Documentation - v0.0.0
    Preparing search index...
    • Pick a deep subset of an object filtered by key paths of another object.

      Type Parameters

      • T extends object
      • Filter extends object

      Parameters

      • input: T

        Object to pick from.

      • subsetFilter: Filter

        Object to use as filter.

      • Optionaloptions: {
            filterFlatOptions?: FlattenOptions;
            inputFlatOptions?: FlattenOptions;
            unflatOptions?: UnflattenOptions;
        }

        Flatten options.

      Returns Extract<T, Filter>

      // input (values will always come from input)
      const input = {
      randomValue: 'random',
      django: {
      allowedHosts: '*',
      csrfCookieSecure: false,
      },
      sentry: {
      traceExcludeUrls: ['one', 'two', 'three'],
      },
      }
      // filter only django values (only keys are looked at).
      const subsetFilter = {
      django: {
      allowedHosts: true,
      csrfCookieSecure: true,
      },
      }
      const result = pickSubsetDeep(input, subsetFilter)
      console.log(result)
      // {
      // django: {
      // allowedHosts: '*',
      // csrfCookieSecure: false,
      // },
      // }