@onivoro/isomorphic-common 24.20.0 → 24.22.0

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@onivoro/isomorphic-common",
3
- "version": "24.20.0",
3
+ "version": "24.22.0",
4
4
  "type": "commonjs",
5
5
  "main": "./src/index.js",
6
6
  "types": "./src/index.d.ts",
package/src/index.d.ts CHANGED
@@ -16,6 +16,8 @@ export * from './lib/functions/map-enum-to-lookup-array.function';
16
16
  export * from './lib/functions/map-enum-to-options.function';
17
17
  export * from './lib/functions/remove-element-at-index.function';
18
18
  export * from './lib/functions/round.function';
19
+ export * from './lib/functions/sort-by-number-factory.function';
20
+ export * from './lib/functions/sort-by-string-factory.function';
19
21
  export * from './lib/functions/sort-by-created-at.function';
20
22
  export * from './lib/functions/sort-by-full-name.function';
21
23
  export * from './lib/functions/sort-by-id.function';
package/src/index.js CHANGED
@@ -19,6 +19,8 @@ tslib_1.__exportStar(require("./lib/functions/map-enum-to-lookup-array.function"
19
19
  tslib_1.__exportStar(require("./lib/functions/map-enum-to-options.function"), exports);
20
20
  tslib_1.__exportStar(require("./lib/functions/remove-element-at-index.function"), exports);
21
21
  tslib_1.__exportStar(require("./lib/functions/round.function"), exports);
22
+ tslib_1.__exportStar(require("./lib/functions/sort-by-number-factory.function"), exports);
23
+ tslib_1.__exportStar(require("./lib/functions/sort-by-string-factory.function"), exports);
22
24
  tslib_1.__exportStar(require("./lib/functions/sort-by-created-at.function"), exports);
23
25
  tslib_1.__exportStar(require("./lib/functions/sort-by-full-name.function"), exports);
24
26
  tslib_1.__exportStar(require("./lib/functions/sort-by-id.function"), exports);
package/src/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../libs/isomorphic/common/src/index.ts"],"names":[],"mappings":";;;AAAA,iFAAuD;AACvD,kFAAwD;AACxD,oFAA0D;AAC1D,2EAAiD;AAEjD,sFAA4D;AAC5D,8EAAoD;AAEpD,yEAA+C;AAC/C,8EAAoD;AACpD,uFAA6D;AAC7D,4FAAkE;AAClE,sFAA4D;AAC5D,iFAAuD;AACvD,2FAAiE;AACjE,+FAAqE;AACrE,4FAAkE;AAClE,uFAA6D;AAC7D,2FAAiE;AACjE,yEAA+C;AAC/C,sFAA4D;AAC5D,qFAA2D;AAC3D,8EAAoD;AACpD,gFAAsD;AACtD,gFAAsD;AACtD,8FAAoE;AACpE,4EAAkD;AAElD,6EAAmD;AACnD,mEAAyC;AACzC,sEAA4C;AAC5C,mEAAyC;AACzC,uEAA6C;AAC7C,oEAA0C;AAE1C,kFAAwD;AACxD,mFAAyD;AACzD,qFAA2D;AAC3D,2EAAiD;AAEjD,8EAAoD;AACpD,8EAAoD;AACpD,6FAAmE;AACnE,8EAAoD;AACpD,uFAA6D;AAC7D,sFAA4D;AAC5D,mFAAyD;AACzD,4FAAkE;AAClE,6EAAmD;AACnD,iFAAuD;AACvD,8EAAoD;AACpD,+FAAqE;AACrE,4FAAkE;AAClE,uFAA6D;AAC7D,yEAA+C;AAC/C,8EAAoD;AACpD,uFAA6D;AAC7D,sFAA4D;AAC5D,2FAAiE;AACjE,yEAA+C;AAC/C,yEAA+C;AAC/C,qFAA2D;AAC3D,8EAAoD;AACpD,mFAAyD;AACzD,qFAA2D;AAC3D,oFAA0D;AAC1D,iFAAuD;AACvD,mFAAyD;AACzD,wFAA8D;AAC9D,mFAAyD;AACzD,4EAAkD;AAClD,kFAAwD;AACxD,8EAAoD;AACpD,+EAAqD;AACrD,yEAA+C;AAE/C,6FAAmE;AACnE,gFAAsD;AACtD,mEAAyC;AACzC,uEAA6C"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../libs/isomorphic/common/src/index.ts"],"names":[],"mappings":";;;AAAA,iFAAuD;AACvD,kFAAwD;AACxD,oFAA0D;AAC1D,2EAAiD;AAEjD,sFAA4D;AAC5D,8EAAoD;AAEpD,yEAA+C;AAC/C,8EAAoD;AACpD,uFAA6D;AAC7D,4FAAkE;AAClE,sFAA4D;AAC5D,iFAAuD;AACvD,2FAAiE;AACjE,+FAAqE;AACrE,4FAAkE;AAClE,uFAA6D;AAC7D,2FAAiE;AACjE,yEAA+C;AAC/C,0FAAgE;AAChE,0FAAgE;AAChE,sFAA4D;AAC5D,qFAA2D;AAC3D,8EAAoD;AACpD,gFAAsD;AACtD,gFAAsD;AACtD,8FAAoE;AACpE,4EAAkD;AAElD,6EAAmD;AACnD,mEAAyC;AACzC,sEAA4C;AAC5C,mEAAyC;AACzC,uEAA6C;AAC7C,oEAA0C;AAE1C,kFAAwD;AACxD,mFAAyD;AACzD,qFAA2D;AAC3D,2EAAiD;AAEjD,8EAAoD;AACpD,8EAAoD;AACpD,6FAAmE;AACnE,8EAAoD;AACpD,uFAA6D;AAC7D,sFAA4D;AAC5D,mFAAyD;AACzD,4FAAkE;AAClE,6EAAmD;AACnD,iFAAuD;AACvD,8EAAoD;AACpD,+FAAqE;AACrE,4FAAkE;AAClE,uFAA6D;AAC7D,yEAA+C;AAC/C,8EAAoD;AACpD,uFAA6D;AAC7D,sFAA4D;AAC5D,2FAAiE;AACjE,yEAA+C;AAC/C,yEAA+C;AAC/C,qFAA2D;AAC3D,8EAAoD;AACpD,mFAAyD;AACzD,qFAA2D;AAC3D,oFAA0D;AAC1D,iFAAuD;AACvD,mFAAyD;AACzD,wFAA8D;AAC9D,mFAAyD;AACzD,4EAAkD;AAClD,kFAAwD;AACxD,8EAAoD;AACpD,+EAAqD;AACrD,yEAA+C;AAE/C,6FAAmE;AACnE,gFAAsD;AACtD,mEAAyC;AACzC,uEAA6C"}
@@ -0,0 +1 @@
1
+ export declare function sortByNumberFactory<TEntity>(propertyName: keyof TEntity): (a: TEntity, b: TEntity) => 0 | 1 | -1;
@@ -0,0 +1,14 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.sortByNumberFactory = sortByNumberFactory;
4
+ function sortByNumberFactory(propertyName) {
5
+ return function (a, b) {
6
+ const resolvedA = a[propertyName] || 0;
7
+ const resolvedB = b[propertyName] || 0;
8
+ if (resolvedA == resolvedB) {
9
+ return 0;
10
+ }
11
+ return resolvedA < resolvedB ? -1 : 1;
12
+ };
13
+ }
14
+ //# sourceMappingURL=sort-by-number-factory.function.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"sort-by-number-factory.function.js","sourceRoot":"","sources":["../../../../../../../libs/isomorphic/common/src/lib/functions/sort-by-number-factory.function.ts"],"names":[],"mappings":";;AAAA,kDAWC;AAXD,SAAgB,mBAAmB,CAAU,YAA2B;IACpE,OAAO,UAAU,CAAU,EAAE,CAAU;QACnC,MAAM,SAAS,GAAG,CAAC,CAAC,YAAY,CAAC,IAAI,CAAC,CAAC;QACvC,MAAM,SAAS,GAAG,CAAC,CAAC,YAAY,CAAC,IAAI,CAAC,CAAC;QAEvC,IAAI,SAAS,IAAI,SAAS,EAAE,CAAC;YACzB,OAAO,CAAC,CAAC;QACb,CAAC;QAED,OAAO,SAAS,GAAG,SAAS,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;IAC1C,CAAC,CAAA;AACL,CAAC"}
@@ -0,0 +1 @@
1
+ export declare function sortByStringFactory<TEntity>(propertyName: keyof TEntity): (a: TEntity, b: TEntity) => number;
@@ -0,0 +1,10 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.sortByStringFactory = sortByStringFactory;
4
+ function sortByStringFactory(propertyName) {
5
+ return function (a, b) {
6
+ var _a, _b, _c, _d;
7
+ return ((_c = (_b = (_a = a[propertyName]) === null || _a === void 0 ? void 0 : _a.toString()) === null || _b === void 0 ? void 0 : _b.localeCompare) === null || _c === void 0 ? void 0 : _c.call(_b, ((_d = b[propertyName]) === null || _d === void 0 ? void 0 : _d.toString()) || '')) || 0;
8
+ };
9
+ }
10
+ //# sourceMappingURL=sort-by-string-factory.function.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"sort-by-string-factory.function.js","sourceRoot":"","sources":["../../../../../../../libs/isomorphic/common/src/lib/functions/sort-by-string-factory.function.ts"],"names":[],"mappings":";;AAAA,kDAIC;AAJD,SAAgB,mBAAmB,CAAU,YAA2B;IACpE,OAAO,UAAU,CAAU,EAAE,CAAU;;QACnC,OAAO,CAAA,MAAA,MAAA,MAAA,CAAC,CAAC,YAAY,CAAC,0CAAE,QAAQ,EAAE,0CAAE,aAAa,mDAAG,CAAA,MAAA,CAAC,CAAC,YAAY,CAAC,0CAAE,QAAQ,EAAE,KAAI,EAAE,CAAC,KAAI,CAAC,CAAC;IAChG,CAAC,CAAA;AACL,CAAC"}