UNPKG

prettier-plugin-pkg

Version:

An opinionated package.json formatter plugin for Prettier

16 lines 489 B
import { sortObject, sortStringArray } from '../utils.js'; const process = (props, key) => { const item = props.find(prop => prop.key.value === key); if (item) { if ('elements' in item.value) { ; item.value.elements.sort(sortStringArray); } else if ('properties' in item.value) { item.value.properties.sort(sortObject); } } return props; }; export { process as object }; //# sourceMappingURL=object.js.map