@zenstackhq/common-helpers 3.0.0-alpha.6
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/LICENSE +21 -0
- package/dist/index.cjs +107 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.cts +13 -0
- package/dist/index.d.ts +13 -0
- package/dist/index.js +77 -0
- package/dist/index.js.map +1 -0
- package/package.json +34 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2025 ZenStack
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/dist/index.cjs
ADDED
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
|
|
7
|
+
var __export = (target, all) => {
|
|
8
|
+
for (var name in all)
|
|
9
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
10
|
+
};
|
|
11
|
+
var __copyProps = (to, from, except, desc) => {
|
|
12
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
13
|
+
for (let key of __getOwnPropNames(from))
|
|
14
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
15
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
16
|
+
}
|
|
17
|
+
return to;
|
|
18
|
+
};
|
|
19
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
20
|
+
|
|
21
|
+
// src/index.ts
|
|
22
|
+
var src_exports = {};
|
|
23
|
+
__export(src_exports, {
|
|
24
|
+
invariant: () => invariant,
|
|
25
|
+
isPlainObject: () => isPlainObject,
|
|
26
|
+
lowerCaseFirst: () => lowerCaseFirst,
|
|
27
|
+
paramCase: () => paramCase,
|
|
28
|
+
sleep: () => sleep,
|
|
29
|
+
upperCaseFirst: () => upperCaseFirst
|
|
30
|
+
});
|
|
31
|
+
module.exports = __toCommonJS(src_exports);
|
|
32
|
+
|
|
33
|
+
// src/is-plain-object.ts
|
|
34
|
+
function isObject(o) {
|
|
35
|
+
return Object.prototype.toString.call(o) === "[object Object]";
|
|
36
|
+
}
|
|
37
|
+
__name(isObject, "isObject");
|
|
38
|
+
function isPlainObject(o) {
|
|
39
|
+
if (isObject(o) === false) return false;
|
|
40
|
+
const ctor = o.constructor;
|
|
41
|
+
if (ctor === void 0) return true;
|
|
42
|
+
const prot = ctor.prototype;
|
|
43
|
+
if (isObject(prot) === false) return false;
|
|
44
|
+
if (Object.prototype.hasOwnProperty.call(prot, "isPrototypeOf") === false) {
|
|
45
|
+
return false;
|
|
46
|
+
}
|
|
47
|
+
return true;
|
|
48
|
+
}
|
|
49
|
+
__name(isPlainObject, "isPlainObject");
|
|
50
|
+
|
|
51
|
+
// src/lower-case-first.ts
|
|
52
|
+
function lowerCaseFirst(input) {
|
|
53
|
+
return input.charAt(0).toLowerCase() + input.slice(1);
|
|
54
|
+
}
|
|
55
|
+
__name(lowerCaseFirst, "lowerCaseFirst");
|
|
56
|
+
|
|
57
|
+
// src/param-case.ts
|
|
58
|
+
var DEFAULT_SPLIT_REGEXP_1 = /([a-z0-9])([A-Z])/g;
|
|
59
|
+
var DEFAULT_SPLIT_REGEXP_2 = /([A-Z])([A-Z][a-z])/g;
|
|
60
|
+
var DEFAULT_STRIP_REGEXP = /[^A-Z0-9]+/gi;
|
|
61
|
+
function paramCase(input) {
|
|
62
|
+
const result = input.replace(DEFAULT_SPLIT_REGEXP_1, "$1\0$2").replace(DEFAULT_SPLIT_REGEXP_2, "$1\0$2").replace(DEFAULT_STRIP_REGEXP, "\0");
|
|
63
|
+
let start = 0;
|
|
64
|
+
let end = result.length;
|
|
65
|
+
while (result.charAt(start) === "\0") start++;
|
|
66
|
+
while (result.charAt(end - 1) === "\0") end--;
|
|
67
|
+
return result.slice(start, end).split("\0").map((str) => str.toLowerCase()).join("-");
|
|
68
|
+
}
|
|
69
|
+
__name(paramCase, "paramCase");
|
|
70
|
+
|
|
71
|
+
// src/sleep.ts
|
|
72
|
+
function sleep(timeout) {
|
|
73
|
+
return new Promise((resolve) => {
|
|
74
|
+
setTimeout(() => resolve(), timeout);
|
|
75
|
+
});
|
|
76
|
+
}
|
|
77
|
+
__name(sleep, "sleep");
|
|
78
|
+
|
|
79
|
+
// src/tiny-invariant.ts
|
|
80
|
+
var isProduction = process.env["NODE_ENV"] === "production";
|
|
81
|
+
var prefix = "Invariant failed";
|
|
82
|
+
function invariant(condition, message) {
|
|
83
|
+
if (condition) {
|
|
84
|
+
return;
|
|
85
|
+
}
|
|
86
|
+
if (isProduction) {
|
|
87
|
+
throw new Error(prefix);
|
|
88
|
+
}
|
|
89
|
+
throw new Error(message ? `${prefix}: ${message}` : prefix);
|
|
90
|
+
}
|
|
91
|
+
__name(invariant, "invariant");
|
|
92
|
+
|
|
93
|
+
// src/upper-case-first.ts
|
|
94
|
+
function upperCaseFirst(input) {
|
|
95
|
+
return input.charAt(0).toUpperCase() + input.slice(1);
|
|
96
|
+
}
|
|
97
|
+
__name(upperCaseFirst, "upperCaseFirst");
|
|
98
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
99
|
+
0 && (module.exports = {
|
|
100
|
+
invariant,
|
|
101
|
+
isPlainObject,
|
|
102
|
+
lowerCaseFirst,
|
|
103
|
+
paramCase,
|
|
104
|
+
sleep,
|
|
105
|
+
upperCaseFirst
|
|
106
|
+
});
|
|
107
|
+
//# sourceMappingURL=index.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/index.ts","../src/is-plain-object.ts","../src/lower-case-first.ts","../src/param-case.ts","../src/sleep.ts","../src/tiny-invariant.ts","../src/upper-case-first.ts"],"sourcesContent":["export * from './is-plain-object';\nexport * from './lower-case-first';\nexport * from './param-case';\nexport * from './sleep';\nexport * from './tiny-invariant';\nexport * from './upper-case-first';\n","function isObject(o: unknown) {\n return Object.prototype.toString.call(o) === '[object Object]';\n}\n\nexport function isPlainObject(o: unknown) {\n if (isObject(o) === false) return false;\n\n // If has modified constructor\n const ctor = (o as { constructor: unknown }).constructor;\n if (ctor === undefined) return true;\n\n // If has modified prototype\n const prot = (ctor as { prototype: unknown }).prototype;\n if (isObject(prot) === false) return false;\n\n // If constructor does not have an Object-specific method\n if (Object.prototype.hasOwnProperty.call(prot, 'isPrototypeOf') === false) {\n return false;\n }\n\n // Most likely a plain Object\n return true;\n}\n","export function lowerCaseFirst(input: string) {\n return input.charAt(0).toLowerCase() + input.slice(1);\n}\n","const DEFAULT_SPLIT_REGEXP_1 = /([a-z0-9])([A-Z])/g;\nconst DEFAULT_SPLIT_REGEXP_2 = /([A-Z])([A-Z][a-z])/g;\nconst DEFAULT_STRIP_REGEXP = /[^A-Z0-9]+/gi;\n\nexport function paramCase(input: string) {\n const result = input\n .replace(DEFAULT_SPLIT_REGEXP_1, \"$1\\0$2\")\n .replace(DEFAULT_SPLIT_REGEXP_2, \"$1\\0$2\")\n .replace(DEFAULT_STRIP_REGEXP, \"\\0\");\n\n let start = 0;\n let end = result.length;\n\n while (result.charAt(start) === \"\\0\") start++;\n while (result.charAt(end - 1) === \"\\0\") end--;\n\n return result.slice(start, end).split(\"\\0\").map((str) => str.toLowerCase()).join(\"-\");\n}\n","export function sleep(timeout: number) {\n return new Promise<void>((resolve) => {\n setTimeout(() => resolve(), timeout);\n });\n}\n","const isProduction = process.env['NODE_ENV'] === 'production';\nconst prefix = 'Invariant failed';\n\nexport function invariant(condition: unknown, message?: string): asserts condition {\n if (condition) {\n return;\n }\n\n if (isProduction) {\n throw new Error(prefix);\n }\n\n throw new Error(message ? `${prefix}: ${message}` : prefix);\n}\n","export function upperCaseFirst(input: string) {\n return input.charAt(0).toUpperCase() + input.slice(1);\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAAA;;;;;;;;;;;;ACAA,SAASA,SAASC,GAAU;AACxB,SAAOC,OAAOC,UAAUC,SAASC,KAAKJ,CAAAA,MAAO;AACjD;AAFSD;AAIF,SAASM,cAAcL,GAAU;AACpC,MAAID,SAASC,CAAAA,MAAO,MAAO,QAAO;AAGlC,QAAMM,OAAQN,EAA+B;AAC7C,MAAIM,SAASC,OAAW,QAAO;AAG/B,QAAMC,OAAQF,KAAgCJ;AAC9C,MAAIH,SAASS,IAAAA,MAAU,MAAO,QAAO;AAGrC,MAAIP,OAAOC,UAAUO,eAAeL,KAAKI,MAAM,eAAA,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ainObject","ctor","undefined","prot","hasOwnProperty","lowerCaseFirst","input","charAt","toLowerCase","slice","DEFAULT_SPLIT_REGEXP_1","DEFAULT_SPLIT_REGEXP_2","DEFAULT_STRIP_REGEXP","paramCase","input","result","replace","start","end","length","charAt","slice","split","map","str","toLowerCase","join","sleep","timeout","Promise","resolve","setTimeout","isProduction","process","env","prefix","invariant","condition","message","Error","upperCaseFirst","input","charAt","toUpperCase","slice"]}
|
package/dist/index.d.cts
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
declare function isPlainObject(o: unknown): boolean;
|
|
2
|
+
|
|
3
|
+
declare function lowerCaseFirst(input: string): string;
|
|
4
|
+
|
|
5
|
+
declare function paramCase(input: string): string;
|
|
6
|
+
|
|
7
|
+
declare function sleep(timeout: number): Promise<void>;
|
|
8
|
+
|
|
9
|
+
declare function invariant(condition: unknown, message?: string): asserts condition;
|
|
10
|
+
|
|
11
|
+
declare function upperCaseFirst(input: string): string;
|
|
12
|
+
|
|
13
|
+
export { invariant, isPlainObject, lowerCaseFirst, paramCase, sleep, upperCaseFirst };
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
declare function isPlainObject(o: unknown): boolean;
|
|
2
|
+
|
|
3
|
+
declare function lowerCaseFirst(input: string): string;
|
|
4
|
+
|
|
5
|
+
declare function paramCase(input: string): string;
|
|
6
|
+
|
|
7
|
+
declare function sleep(timeout: number): Promise<void>;
|
|
8
|
+
|
|
9
|
+
declare function invariant(condition: unknown, message?: string): asserts condition;
|
|
10
|
+
|
|
11
|
+
declare function upperCaseFirst(input: string): string;
|
|
12
|
+
|
|
13
|
+
export { invariant, isPlainObject, lowerCaseFirst, paramCase, sleep, upperCaseFirst };
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
|
|
3
|
+
|
|
4
|
+
// src/is-plain-object.ts
|
|
5
|
+
function isObject(o) {
|
|
6
|
+
return Object.prototype.toString.call(o) === "[object Object]";
|
|
7
|
+
}
|
|
8
|
+
__name(isObject, "isObject");
|
|
9
|
+
function isPlainObject(o) {
|
|
10
|
+
if (isObject(o) === false) return false;
|
|
11
|
+
const ctor = o.constructor;
|
|
12
|
+
if (ctor === void 0) return true;
|
|
13
|
+
const prot = ctor.prototype;
|
|
14
|
+
if (isObject(prot) === false) return false;
|
|
15
|
+
if (Object.prototype.hasOwnProperty.call(prot, "isPrototypeOf") === false) {
|
|
16
|
+
return false;
|
|
17
|
+
}
|
|
18
|
+
return true;
|
|
19
|
+
}
|
|
20
|
+
__name(isPlainObject, "isPlainObject");
|
|
21
|
+
|
|
22
|
+
// src/lower-case-first.ts
|
|
23
|
+
function lowerCaseFirst(input) {
|
|
24
|
+
return input.charAt(0).toLowerCase() + input.slice(1);
|
|
25
|
+
}
|
|
26
|
+
__name(lowerCaseFirst, "lowerCaseFirst");
|
|
27
|
+
|
|
28
|
+
// src/param-case.ts
|
|
29
|
+
var DEFAULT_SPLIT_REGEXP_1 = /([a-z0-9])([A-Z])/g;
|
|
30
|
+
var DEFAULT_SPLIT_REGEXP_2 = /([A-Z])([A-Z][a-z])/g;
|
|
31
|
+
var DEFAULT_STRIP_REGEXP = /[^A-Z0-9]+/gi;
|
|
32
|
+
function paramCase(input) {
|
|
33
|
+
const result = input.replace(DEFAULT_SPLIT_REGEXP_1, "$1\0$2").replace(DEFAULT_SPLIT_REGEXP_2, "$1\0$2").replace(DEFAULT_STRIP_REGEXP, "\0");
|
|
34
|
+
let start = 0;
|
|
35
|
+
let end = result.length;
|
|
36
|
+
while (result.charAt(start) === "\0") start++;
|
|
37
|
+
while (result.charAt(end - 1) === "\0") end--;
|
|
38
|
+
return result.slice(start, end).split("\0").map((str) => str.toLowerCase()).join("-");
|
|
39
|
+
}
|
|
40
|
+
__name(paramCase, "paramCase");
|
|
41
|
+
|
|
42
|
+
// src/sleep.ts
|
|
43
|
+
function sleep(timeout) {
|
|
44
|
+
return new Promise((resolve) => {
|
|
45
|
+
setTimeout(() => resolve(), timeout);
|
|
46
|
+
});
|
|
47
|
+
}
|
|
48
|
+
__name(sleep, "sleep");
|
|
49
|
+
|
|
50
|
+
// src/tiny-invariant.ts
|
|
51
|
+
var isProduction = process.env["NODE_ENV"] === "production";
|
|
52
|
+
var prefix = "Invariant failed";
|
|
53
|
+
function invariant(condition, message) {
|
|
54
|
+
if (condition) {
|
|
55
|
+
return;
|
|
56
|
+
}
|
|
57
|
+
if (isProduction) {
|
|
58
|
+
throw new Error(prefix);
|
|
59
|
+
}
|
|
60
|
+
throw new Error(message ? `${prefix}: ${message}` : prefix);
|
|
61
|
+
}
|
|
62
|
+
__name(invariant, "invariant");
|
|
63
|
+
|
|
64
|
+
// src/upper-case-first.ts
|
|
65
|
+
function upperCaseFirst(input) {
|
|
66
|
+
return input.charAt(0).toUpperCase() + input.slice(1);
|
|
67
|
+
}
|
|
68
|
+
__name(upperCaseFirst, "upperCaseFirst");
|
|
69
|
+
export {
|
|
70
|
+
invariant,
|
|
71
|
+
isPlainObject,
|
|
72
|
+
lowerCaseFirst,
|
|
73
|
+
paramCase,
|
|
74
|
+
sleep,
|
|
75
|
+
upperCaseFirst
|
|
76
|
+
};
|
|
77
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/is-plain-object.ts","../src/lower-case-first.ts","../src/param-case.ts","../src/sleep.ts","../src/tiny-invariant.ts","../src/upper-case-first.ts"],"sourcesContent":["function isObject(o: unknown) {\n return Object.prototype.toString.call(o) === '[object Object]';\n}\n\nexport function isPlainObject(o: unknown) {\n if (isObject(o) === false) return false;\n\n // If has modified constructor\n const ctor = (o as { constructor: unknown }).constructor;\n if (ctor === undefined) return true;\n\n // If has modified prototype\n const prot = (ctor as { prototype: unknown }).prototype;\n if (isObject(prot) === false) return false;\n\n // If constructor does not have an Object-specific method\n if (Object.prototype.hasOwnProperty.call(prot, 'isPrototypeOf') === false) {\n return false;\n }\n\n // Most likely a plain Object\n return true;\n}\n","export function lowerCaseFirst(input: string) {\n return input.charAt(0).toLowerCase() + input.slice(1);\n}\n","const DEFAULT_SPLIT_REGEXP_1 = /([a-z0-9])([A-Z])/g;\nconst DEFAULT_SPLIT_REGEXP_2 = /([A-Z])([A-Z][a-z])/g;\nconst DEFAULT_STRIP_REGEXP = /[^A-Z0-9]+/gi;\n\nexport function paramCase(input: string) {\n const result = input\n .replace(DEFAULT_SPLIT_REGEXP_1, \"$1\\0$2\")\n .replace(DEFAULT_SPLIT_REGEXP_2, \"$1\\0$2\")\n .replace(DEFAULT_STRIP_REGEXP, \"\\0\");\n\n let start = 0;\n let end = result.length;\n\n while (result.charAt(start) === \"\\0\") start++;\n while (result.charAt(end - 1) === \"\\0\") end--;\n\n return result.slice(start, end).split(\"\\0\").map((str) => str.toLowerCase()).join(\"-\");\n}\n","export function sleep(timeout: number) {\n return new Promise<void>((resolve) => {\n setTimeout(() => resolve(), timeout);\n });\n}\n","const isProduction = process.env['NODE_ENV'] === 'production';\nconst prefix = 'Invariant failed';\n\nexport function invariant(condition: unknown, message?: string): asserts condition {\n if (condition) {\n return;\n }\n\n if (isProduction) {\n throw new Error(prefix);\n }\n\n throw new Error(message ? `${prefix}: ${message}` : prefix);\n}\n","export function upperCaseFirst(input: string) {\n return input.charAt(0).toUpperCase() + input.slice(1);\n}\n"],"mappings":";;;;AAAA,SAASA,SAASC,GAAU;AACxB,SAAOC,OAAOC,UAAUC,SAASC,KAAKJ,CAAAA,MAAO;AACjD;AAFSD;AAIF,SAASM,cAAcL,GAAU;AACpC,MAAID,SAASC,CAAAA,MAAO,MAAO,QAAO;AAGlC,QAAMM,OAAQN,EAA+B;AAC7C,MAAIM,SAASC,OAAW,QAAO;AAG/B,QAAMC,OAAQF,KAAgCJ;AAC9C,MAAIH,SAASS,IAAAA,MAAU,MAAO,QAAO;AAGrC,MAAIP,OAAOC,UAAUO,eAAe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","o","Object","prototype","toString","call","isPlainObject","ctor","undefined","prot","hasOwnProperty","lowerCaseFirst","input","charAt","toLowerCase","slice","DEFAULT_SPLIT_REGEXP_1","DEFAULT_SPLIT_REGEXP_2","DEFAULT_STRIP_REGEXP","paramCase","input","result","replace","start","end","length","charAt","slice","split","map","str","toLowerCase","join","sleep","timeout","Promise","resolve","setTimeout","isProduction","process","env","prefix","invariant","condition","message","Error","upperCaseFirst","input","charAt","toUpperCase","slice"]}
|
package/package.json
ADDED
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@zenstackhq/common-helpers",
|
|
3
|
+
"version": "3.0.0-alpha.6",
|
|
4
|
+
"description": "ZenStack Common Helpers",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"keywords": [],
|
|
7
|
+
"author": "ZenStack Team",
|
|
8
|
+
"license": "MIT",
|
|
9
|
+
"files": [
|
|
10
|
+
"dist"
|
|
11
|
+
],
|
|
12
|
+
"exports": {
|
|
13
|
+
".": {
|
|
14
|
+
"import": {
|
|
15
|
+
"types": "./dist/index.d.ts",
|
|
16
|
+
"default": "./dist/index.js"
|
|
17
|
+
},
|
|
18
|
+
"require": {
|
|
19
|
+
"types": "./dist/index.d.cts",
|
|
20
|
+
"default": "./dist/index.cjs"
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
},
|
|
24
|
+
"devDependencies": {
|
|
25
|
+
"@zenstackhq/typescript-config": "3.0.0-alpha.6",
|
|
26
|
+
"@zenstackhq/eslint-config": "3.0.0-alpha.6"
|
|
27
|
+
},
|
|
28
|
+
"scripts": {
|
|
29
|
+
"build": "tsup-node",
|
|
30
|
+
"watch": "tsup-node --watch",
|
|
31
|
+
"lint": "eslint src --ext ts",
|
|
32
|
+
"pack": "pnpm pack"
|
|
33
|
+
}
|
|
34
|
+
}
|