@uxf/core 11.45.0 → 11.47.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/cookie/cookie.test.d.ts +1 -0
- package/cookie/cookie.test.js +68 -0
- package/money/currencies.d.ts +503 -0
- package/money/currencies.js +172 -0
- package/money/get-currency-symbol.d.ts +2 -0
- package/money/get-currency-symbol.js +6 -0
- package/money/get-currency-symbol.test.d.ts +1 -0
- package/money/get-currency-symbol.test.js +11 -0
- package/money/index.d.ts +6 -0
- package/money/index.js +2 -0
- package/next/query-param.test.d.ts +1 -0
- package/next/query-param.test.js +35 -0
- package/package.json +1 -1
- package/utils/assert-not-nil.test.d.ts +1 -0
- package/utils/assert-not-nil.test.js +8 -0
- package/utils/copy-to-clipboard.test.d.ts +1 -0
- package/utils/copy-to-clipboard.test.js +30 -0
- package/utils/file.test.d.ts +1 -0
- package/utils/file.test.js +35 -0
- package/utils/filter-nullish.test.d.ts +1 -0
- package/utils/filter-nullish.test.js +15 -0
- package/utils/is-empty.d.ts +3 -1
- package/utils/is-empty.js +3 -0
- package/utils/is-empty.test.js +5 -4
- package/utils/is-nil.test.d.ts +1 -0
- package/utils/is-nil.test.js +7 -0
- package/utils/is-not-empty.d.ts +3 -1
- package/utils/is-not-empty.test.js +5 -4
- package/utils/is-not-nil.test.d.ts +1 -0
- package/utils/is-not-nil.test.js +7 -0
- package/utils/isBrowser.test.d.ts +1 -0
- package/utils/isBrowser.test.js +12 -0
- package/utils/isServer.test.d.ts +1 -0
- package/utils/isServer.test.js +12 -0
- package/utils/noop.test.d.ts +1 -0
- package/utils/noop.test.js +15 -0
- package/utils/resizer.d.ts +2 -2
- package/utils/resizer.js +7 -7
- package/utils/resizer.test.d.ts +1 -0
- package/utils/resizer.test.js +85 -0
- package/utils/slugify.test.js +5 -3
- package/utils/sort-object-keys.test.d.ts +1 -0
- package/utils/sort-object-keys.test.js +65 -0
- package/utils/throw-error.test.d.ts +1 -0
- package/utils/throw-error.test.js +14 -0
- package/utils/trim-trailing-zeros.test.d.ts +1 -0
- package/utils/trim-trailing-zeros.test.js +10 -0
- package/utils/trimTrailingZeros.js +1 -1
package/utils/slugify.test.js
CHANGED
|
@@ -2,7 +2,9 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
const slugify_1 = require("./slugify");
|
|
4
4
|
test("slugify", () => {
|
|
5
|
-
expect((0, slugify_1.slugify)("
|
|
6
|
-
expect((0, slugify_1.slugify)("
|
|
7
|
-
expect((0, slugify_1.slugify)("
|
|
5
|
+
expect((0, slugify_1.slugify)(" Osm hrozných ")).toBe("osm-hroznych");
|
|
6
|
+
expect((0, slugify_1.slugify)("Osm & hrozných")).toBe("osm-and-hroznych");
|
|
7
|
+
expect((0, slugify_1.slugify)("osm---hroznych")).toBe("osm-hroznych");
|
|
8
|
+
expect((0, slugify_1.slugify)("Osm hrozných.")).toBe("osm-hroznych");
|
|
9
|
+
expect((0, slugify_1.slugify)("àáäâãåăæąçćčđďèéěėëêęǵḧìíïîįłḿǹńňñòóöôœøṕŕřßśšșťțùúüûǘůűūųẃẍÿýźžż·/_,:;")).toBe("aaaaaaaaacccddeeeeeeeghiiiiilmnnnnooooooprrssssttuuuuuuuuuwxyyzzz");
|
|
8
10
|
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const sort_object_keys_1 = require("./sort-object-keys");
|
|
4
|
+
describe("sortObjectKeys", () => {
|
|
5
|
+
it("should sort object keys in alphabetical order", () => {
|
|
6
|
+
const input = {
|
|
7
|
+
b: "banana",
|
|
8
|
+
a: "apple",
|
|
9
|
+
d: "date",
|
|
10
|
+
c: "cherry",
|
|
11
|
+
};
|
|
12
|
+
const expectedOutput = {
|
|
13
|
+
a: "apple",
|
|
14
|
+
b: "banana",
|
|
15
|
+
c: "cherry",
|
|
16
|
+
d: "date",
|
|
17
|
+
};
|
|
18
|
+
expect((0, sort_object_keys_1.sortObjectKeys)(input)).toEqual(expectedOutput);
|
|
19
|
+
});
|
|
20
|
+
it("should sort nested object keys", () => {
|
|
21
|
+
const input = {
|
|
22
|
+
b: {
|
|
23
|
+
d: "date",
|
|
24
|
+
c: "cherry",
|
|
25
|
+
},
|
|
26
|
+
a: "apple",
|
|
27
|
+
c: "cat",
|
|
28
|
+
};
|
|
29
|
+
const expectedOutput = {
|
|
30
|
+
a: "apple",
|
|
31
|
+
b: {
|
|
32
|
+
c: "cherry",
|
|
33
|
+
d: "date",
|
|
34
|
+
},
|
|
35
|
+
c: "cat",
|
|
36
|
+
};
|
|
37
|
+
expect((0, sort_object_keys_1.sortObjectKeys)(input)).toEqual(expectedOutput);
|
|
38
|
+
});
|
|
39
|
+
it("should handle empty objects", () => {
|
|
40
|
+
const input = {};
|
|
41
|
+
const expectedOutput = {};
|
|
42
|
+
expect((0, sort_object_keys_1.sortObjectKeys)(input)).toEqual(expectedOutput);
|
|
43
|
+
});
|
|
44
|
+
it("should handle null values and functions gracefully", () => {
|
|
45
|
+
const input = { s: 1, b: [], d: {}, c: "string", g: () => "function" };
|
|
46
|
+
const expectedOutput = {
|
|
47
|
+
b: {},
|
|
48
|
+
c: "string",
|
|
49
|
+
d: {},
|
|
50
|
+
g: {},
|
|
51
|
+
s: {},
|
|
52
|
+
};
|
|
53
|
+
expect((0, sort_object_keys_1.sortObjectKeys)(input)).toEqual(expect.objectContaining(expectedOutput));
|
|
54
|
+
});
|
|
55
|
+
it("should throw an error for object with null and undefined", () => {
|
|
56
|
+
const input = { a: [null], b: null, c: undefined };
|
|
57
|
+
expect(() => (0, sort_object_keys_1.sortObjectKeys)(input)).toThrow();
|
|
58
|
+
});
|
|
59
|
+
it("should throw an error for non-object types", () => {
|
|
60
|
+
const inputs = [null, undefined];
|
|
61
|
+
inputs.forEach((input) => {
|
|
62
|
+
expect(() => (0, sort_object_keys_1.sortObjectKeys)(input)).toThrow();
|
|
63
|
+
});
|
|
64
|
+
});
|
|
65
|
+
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const throw_error_1 = require("./throw-error");
|
|
4
|
+
describe("throwError", () => {
|
|
5
|
+
it("should throw an error with the provided message", () => {
|
|
6
|
+
const message = "This is an error message";
|
|
7
|
+
expect(() => (0, throw_error_1.throwError)(message)).toThrow(Error);
|
|
8
|
+
expect(() => (0, throw_error_1.throwError)(message)).toThrow(message);
|
|
9
|
+
});
|
|
10
|
+
it("should throw an error without a message", () => {
|
|
11
|
+
expect(() => (0, throw_error_1.throwError)()).toThrow(Error);
|
|
12
|
+
expect(() => (0, throw_error_1.throwError)()).toThrow();
|
|
13
|
+
});
|
|
14
|
+
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const trimTrailingZeros_1 = require("./trimTrailingZeros");
|
|
4
|
+
test("trimTrailingZeros", () => {
|
|
5
|
+
expect((0, trimTrailingZeros_1.trimTrailingZeros)("1.0000")).toBe("1");
|
|
6
|
+
expect((0, trimTrailingZeros_1.trimTrailingZeros)("1.")).toBe("1.");
|
|
7
|
+
expect((0, trimTrailingZeros_1.trimTrailingZeros)("0")).toBe("0");
|
|
8
|
+
expect((0, trimTrailingZeros_1.trimTrailingZeros)("100")).toBe("100");
|
|
9
|
+
expect((0, trimTrailingZeros_1.trimTrailingZeros)("test .0")).toBe("test ");
|
|
10
|
+
});
|