UNPKG

@augment-vir/common

Version:

A collection of augments, helpers types, functions, and classes for any JavaScript environment.

11 lines (10 loc) 375 B
/** * Creates as new sorted object copied from the the original given object. * * @category Object * @category Package : @augment-vir/common * @package [`@augment-vir/common`](https://www.npmjs.com/package/@augment-vir/common) */ export function sortObject(original) { return Object.fromEntries(Object.entries(original).sort((a, b) => a[0].localeCompare(b[0]))); }