fix: make attrValues' order consistent
This commit is contained in:
@@ -8,7 +8,18 @@ import { createThunk } from "../thunk";
|
||||
|
||||
export const attrNames = (set: NixValue): string[] => Object.keys(forceAttrs(set)).sort();
|
||||
|
||||
export const attrValues = (set: NixValue): NixValue[] => Object.values(forceAttrs(set));
|
||||
export const attrValues = (set: NixValue): NixValue[] =>
|
||||
Object.entries(forceAttrs(set))
|
||||
.sort(([a], [b]) => {
|
||||
if (a < b) {
|
||||
return -1;
|
||||
} else if (a === b) {
|
||||
return 0;
|
||||
} else {
|
||||
return 1;
|
||||
}
|
||||
})
|
||||
.map(([_, val]) => val);
|
||||
|
||||
export const getAttr =
|
||||
(s: NixValue) =>
|
||||
|
||||
Reference in New Issue
Block a user