sortByPath
See original GitHub issueIs your feature request related to a problem? Please describe.
Sorts the list according to the supplied path
Describe the solution you’d like
const sortByFirstItem = R.sortByPath([[0]]);
const pairs = [[-1, 1], [-2, 2], [-3, 3]];
sortByFirstItem(pairs); //=> [[-3, 3], [-2, 2], [-1, 1]]
const sortByAddress = R.sortByPath([['address', 'street'], ['address', 'streetNo']]);
const alice = {
name: 'ALICE',
age: 101,
address: {
street: "Czech street",
street: 31,
},
};
const bob = {
name: 'Bob',
age: -10,
address: {
street: "Slovak street",
street: 32,
},
};
const clara = {
name: 'clara',
age: 314.159,
address: {
street: "Polish street",
street: 33,
},
};
const people = [clara, bob, alice];
sortByAddress(people); //=> [alice, clara, bob]
Describe alternatives you’ve considered
Additional context
Original issue: https://github.com/char0n/ramda-adjunct/issues/945
Issue Analytics
- State:
- Created 4 years ago
- Comments:6 (6 by maintainers)
Top Results From Across the Web
sortbypath - Gun Dog Supply
ON SALE NOW! Garmin SPORT PRO · ORANGE Sylmar Body Guard Vest · 1-800-251-6133. GUN DOG SUPPLY 17645 U.S. Highway 82
Read more >sortByProp and sortByPath and orderByProp and orderByPath
I'm inclined to wonder, would you be interested in a set of functions (similar to lodash's sortBy and orderBy) which could sort an...
Read more >com.sun.xml.ws.transport.http.client.CookieManager.sortByPath java ...
Uses a one-way hash function to turn an arbitrary number of bytes into a fixed-length byte sequence. Date (java.sql). A class which can...
Read more >module package - github.com/hpapaxen/glicense/module - Go ...
String returns a human readable string format. type SortByPath ¶. type SortByPath []Module. SortByPath implements sort.Interface to sort a slice of Module ...
Read more >ContentMappingInfo (IBM WebSphere Portal Version 8.5.0.0 ...
String scope, boolean sortByPath) Returns the individual content mappings assigned to this resource for a given content mapping scope.
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
@Mxchaeltrxn good point. I’ve modified the issue description to reflect your comment.
@Mxchaeltrxn I’ve assigned it to you. But first let’s focus on https://github.com/char0n/ramda-adjunct/pull/1323. There is still lot of work to be done there. After we’re finished there, you’ll already know how submit another PR. Thanks.