@ztimson/utils 0.28.2 → 0.28.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs +2 -0
- package/dist/index.cjs.map +1 -1
- package/dist/index.mjs +2 -0
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -424,6 +424,8 @@ function sortByProp(prop, reverse = false) {
|
|
|
424
424
|
return function(a, b) {
|
|
425
425
|
const aVal = dotNotation(a, prop);
|
|
426
426
|
const bVal = dotNotation(b, prop);
|
|
427
|
+
if (aVal === void 0) return 1;
|
|
428
|
+
if (bVal === void 0) return -1;
|
|
427
429
|
if (typeof aVal == "number" && typeof bVal == "number")
|
|
428
430
|
return (reverse ? -1 : 1) * (aVal - bVal);
|
|
429
431
|
if (aVal > bVal) return reverse ? -1 : 1;
|