Documentation
    Preparing search index...

    Function createJsonSortingPreferenceNormalizer

    • Creates a function that can receive an optional objectKeyOrder and return it. It will also try to load a file from .config/${filename}.sort.json and treat it as the sorting preference if no custom preference is passed. That's why this function is async, but the normalizer itself is not.

      If the fileName passed is package.json it will also perform some adjustments to any order received to make sure the exports object will be valid.

      For package.json's only, when there's no keyorder is passed and there's no .config/package.sort.json is present, an opinionated order is returned specifically for package.json files.

      Parameters

      • fileName: string
      • OptionalrawOptions: CwdOption

      Returns Promise<(sortingPreference?: ObjectKeyOrder) => ObjectKeyOrder>