Order Properties from an Object
This function will order the properties of an object based on the provided keys and return a NEW object with the ordered properties.
import { object } from "@rjweb/utils"object.order({ ok: true, e: 0 }, ['e', 'ok']) // { e: 0, ok: true }object.order({ ok: true, e: 0, aaa: true }, ['ok', 'e']) // { ok: true, e: 0, aaa: true } Copy
import { object } from "@rjweb/utils"object.order({ ok: true, e: 0 }, ['e', 'ok']) // { e: 0, ok: true }object.order({ ok: true, e: 0, aaa: true }, ['ok', 'e']) // { ok: true, e: 0, aaa: true }
1.12.20
nodejs, browser
Order Properties from an Object
This function will order the properties of an object based on the provided keys and return a NEW object with the ordered properties.