writetome51

writetome51/sort-by-property

Sorts array of objects by the value of a particular property

TypeScript
0
0
MIT License

This tiny utility lets you reorder an array of objects by specifying a property name (including dot‑notation for nested fields); it automatically detects whether the values are numbers, strings, or booleans and sorts them numerically, alphabetically, or treats booleans as strings. Its API (`sortByProperty(property, objects)`) is lightweight and safe for data that consistently uses one of those primitive types, making it a handy helper for developers who need simple client‑ or server‑side sorting of object collections in JavaScript/TypeScript projects.

Total donated
Undistributed
Share with your subscribers:

Recipients

How the donated funds are distributed

Support the dependencies of writetome51/sort-by-property

Account's avatar
Orders an array alphabetically. Optional callback allows you to choose what value in each element to sort by
Account's avatar
Function takes an array of numbers and returns new array with numbers in numeric order
Account's avatar
Allows you to retrieve value of object property using dot-notation in a string
Account's avatar
Function triggers error if argument has length === 0
Account's avatar
Takes 2 arrays as arguments, and if they match, returns true
Account's avatar
Returns array of values of a property found in array of objects

Support the repos that depend on writetome51/sort-by-property

Top contributors

writetome51-2's profile
writetome51-2
14 contributions

Recent events

Kivach works on the Obyte network, and therefore you can track all donations.

No events yet