See #17798
path.forEach(key => {
      if (!current[key]) {
        current[key] = {};
      }
      current = current[key];
    });
  }
  function createIsPathWhitelisted(
    key: string | null,
    secondaryCategory: 'hooks' | null,
  ) {
     T
     T
    return function isPathWhitelisted(path: Array<string | number>): boolean {
      switch (secondaryCategory) {
        case 'hooks':
          if (path.length === 1) {
             N
            return true;
          }
          if (
            path[path.length - 1] === 'subHooks' ||
            path[path.length - 2] === 'subHooks'
          ) {
             D
             s
             W
            return true;
          }
          break;