recurse = (slice, _type) => {
    let type = _type; // keep track of type through the stack
    const keys = Object.keys(slice);
    if (!keys.includes('$type') && type && keys.includes('$value')) {
      slice.$type = type;
    }

    if (slice.$type) {
      type = /** @type {string} */ (slice.$type);
      // remove group level $type
      if (slice.$value === undefined) {
        delete slice.$type;
      }
    }

    Object.values(slice).forEach((val) => {
      if (isPlainObject(val)) {
        recurse(val, type);
      }
    });
  }
@param {DesignTokens | DesignToken} slice
@param {string} [_type]