@duplojs/utils 1.3.25 → 1.3.26
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/dataParser/parsers/date.cjs +8 -0
- package/dist/dataParser/parsers/date.mjs +8 -0
- package/dist/either/index.cjs +4 -0
- package/dist/either/index.d.ts +1 -0
- package/dist/either/index.mjs +1 -0
- package/dist/either/safeCallback.cjs +21 -0
- package/dist/either/safeCallback.d.ts +9 -0
- package/dist/either/safeCallback.mjs +17 -0
- package/dist/metadata.json +2792 -2774
- package/dist/string/index.cjs +2 -0
- package/dist/string/index.d.ts +1 -0
- package/dist/string/index.mjs +1 -0
- package/dist/string/sortCompare.cjs +18 -0
- package/dist/string/sortCompare.d.ts +2 -0
- package/dist/string/sortCompare.mjs +16 -0
- package/package.json +2 -2
package/dist/string/index.cjs
CHANGED
|
@@ -28,6 +28,7 @@ var test = require('./test.cjs');
|
|
|
28
28
|
var isIn = require('./isIn.cjs');
|
|
29
29
|
var length = require('./length.cjs');
|
|
30
30
|
var sort = require('./sort.cjs');
|
|
31
|
+
var sortCompare = require('./sortCompare.cjs');
|
|
31
32
|
var _default = require('./at/default.cjs');
|
|
32
33
|
var first = require('./at/first.cjs');
|
|
33
34
|
var last = require('./at/last.cjs');
|
|
@@ -65,6 +66,7 @@ exports.test = test.test;
|
|
|
65
66
|
exports.isIn = isIn.isIn;
|
|
66
67
|
exports.length = length.length;
|
|
67
68
|
exports.sort = sort.sort;
|
|
69
|
+
exports.sortCompare = sortCompare.sortCompare;
|
|
68
70
|
exports.at = _default.at;
|
|
69
71
|
exports.first = first.first;
|
|
70
72
|
exports.last = last.last;
|
package/dist/string/index.d.ts
CHANGED
package/dist/string/index.mjs
CHANGED
|
@@ -26,6 +26,7 @@ export { test } from './test.mjs';
|
|
|
26
26
|
export { isIn } from './isIn.mjs';
|
|
27
27
|
export { length } from './length.mjs';
|
|
28
28
|
export { sort } from './sort.mjs';
|
|
29
|
+
export { sortCompare } from './sortCompare.mjs';
|
|
29
30
|
export { at } from './at/default.mjs';
|
|
30
31
|
export { first } from './at/first.mjs';
|
|
31
32
|
export { last } from './at/last.mjs';
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
const collator = new Intl.Collator("en-US-u-kn-true", {
|
|
4
|
+
usage: "sort",
|
|
5
|
+
sensitivity: "variant",
|
|
6
|
+
numeric: false,
|
|
7
|
+
ignorePunctuation: false,
|
|
8
|
+
});
|
|
9
|
+
function sortCompare(...args) {
|
|
10
|
+
if (args.length === 1) {
|
|
11
|
+
const [valueB] = args;
|
|
12
|
+
return (valueA) => sortCompare(valueA, valueB);
|
|
13
|
+
}
|
|
14
|
+
const [valueA, valueB] = args;
|
|
15
|
+
return collator.compare(valueA, valueB);
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
exports.sortCompare = sortCompare;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
const collator = new Intl.Collator("en-US-u-kn-true", {
|
|
2
|
+
usage: "sort",
|
|
3
|
+
sensitivity: "variant",
|
|
4
|
+
numeric: false,
|
|
5
|
+
ignorePunctuation: false,
|
|
6
|
+
});
|
|
7
|
+
function sortCompare(...args) {
|
|
8
|
+
if (args.length === 1) {
|
|
9
|
+
const [valueB] = args;
|
|
10
|
+
return (valueA) => sortCompare(valueA, valueB);
|
|
11
|
+
}
|
|
12
|
+
const [valueA, valueB] = args;
|
|
13
|
+
return collator.compare(valueA, valueB);
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
export { sortCompare };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@duplojs/utils",
|
|
3
|
-
"version": "1.3.
|
|
3
|
+
"version": "1.3.26",
|
|
4
4
|
"author": {
|
|
5
5
|
"name": "mathcovax",
|
|
6
6
|
"url": "https://github.com/mathcovax"
|
|
@@ -112,7 +112,7 @@
|
|
|
112
112
|
"devDependencies": {
|
|
113
113
|
"@commitlint/cli": "19.8.1",
|
|
114
114
|
"@commitlint/config-conventional": "19.8.1",
|
|
115
|
-
"@duplojs/dev-tools": "0.
|
|
115
|
+
"@duplojs/dev-tools": "0.2.0",
|
|
116
116
|
"@duplojs/eslint": "0.5.0",
|
|
117
117
|
"@rollup/plugin-typescript": "12.1.4",
|
|
118
118
|
"@types/node": "24.3.0",
|