UNPKG

@baseplate-dev/sync

Version:

Library for syncing Baseplate descriptions

25 lines 885 B
import { sortKeysRecursive, sortObjectKeys } from '@baseplate-dev/utils'; import { mapValues } from 'es-toolkit'; export function sortExtractorConfigTemplateKeys(template) { const { name, type, ...rest } = template; return { name, type, ...sortKeysRecursive(rest), }; } /** * Sorts the extractor.json configs in a standardized way. * @param extractorConfig - The extractor.json config to sort * @returns The sorted extractor.json config */ export function sortExtractorConfigKeys({ name, extractors, plugins, templates, ...rest }) { return { name, extractors: sortKeysRecursive(extractors), plugins: sortKeysRecursive(plugins), templates: sortObjectKeys(mapValues(templates, sortExtractorConfigTemplateKeys)), ...sortKeysRecursive(rest), }; } //# sourceMappingURL=sort-extractor-config-keys.js.map