import { sortKeys } from "https://deno.land/x/ayonli_jsext@v0.9.72/object/index.ts";
Creates an object with sorted keys (in ascending order) of the original object.
NOTE: Symbol keys are not sorted and remain their original order.
NOTE: This function only operates on plain objects and arrays.
Examples
Example 1
Example 1
import { sortKeys } from "@ayonli/jsext/object";
const obj = sortKeys({ foo: "Hello", bar: "World" });
console.log(JSON.stringify(obj)); // { "bar": "World", "foo": "Hello" }
Parameters
obj: T