@unikue/ts-lang-utils 1.2.3 → 1.2.4
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/cjs/util/ArrayUtils/index.d.ts +1 -0
- package/dist/cjs/util/ArrayUtils/index.js +3 -0
- package/dist/cjs/util/ArrayUtils/normalize.d.ts +1 -0
- package/dist/cjs/util/ArrayUtils/normalize.js +34 -0
- package/dist/esm/util/ArrayUtils/index.d.ts +1 -0
- package/dist/esm/util/ArrayUtils/index.js +1 -0
- package/dist/esm/util/ArrayUtils/normalize.d.ts +1 -0
- package/dist/esm/util/ArrayUtils/normalize.js +6 -0
- package/package.json +5 -5
|
@@ -22,6 +22,7 @@ export { isNotEmpty } from './isNotEmpty';
|
|
|
22
22
|
export { isTypeof } from './isTypeof';
|
|
23
23
|
export { maxLength } from './maxLength';
|
|
24
24
|
export { minLength } from './minLength';
|
|
25
|
+
export { normalize } from './normalize';
|
|
25
26
|
export { readonly } from './readonly';
|
|
26
27
|
export { remove } from './remove';
|
|
27
28
|
export { removeAll } from './removeAll';
|
|
@@ -43,6 +43,7 @@ __export(ArrayUtils_exports, {
|
|
|
43
43
|
isTypeof: () => import_isTypeof.isTypeof,
|
|
44
44
|
maxLength: () => import_maxLength.maxLength,
|
|
45
45
|
minLength: () => import_minLength.minLength,
|
|
46
|
+
normalize: () => import_normalize.normalize,
|
|
46
47
|
readonly: () => import_readonly.readonly,
|
|
47
48
|
remove: () => import_remove.remove,
|
|
48
49
|
removeAll: () => import_removeAll.removeAll,
|
|
@@ -74,6 +75,7 @@ var import_isNotEmpty = require("./isNotEmpty");
|
|
|
74
75
|
var import_isTypeof = require("./isTypeof");
|
|
75
76
|
var import_maxLength = require("./maxLength");
|
|
76
77
|
var import_minLength = require("./minLength");
|
|
78
|
+
var import_normalize = require("./normalize");
|
|
77
79
|
var import_readonly = require("./readonly");
|
|
78
80
|
var import_remove = require("./remove");
|
|
79
81
|
var import_removeAll = require("./removeAll");
|
|
@@ -105,6 +107,7 @@ var import_singleton = require("./singleton");
|
|
|
105
107
|
isTypeof,
|
|
106
108
|
maxLength,
|
|
107
109
|
minLength,
|
|
110
|
+
normalize,
|
|
108
111
|
readonly,
|
|
109
112
|
remove,
|
|
110
113
|
removeAll,
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function normalize<E>(element?: E | E[] | null): E[];
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
+
var __export = (target, all) => {
|
|
6
|
+
for (var name in all)
|
|
7
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
8
|
+
};
|
|
9
|
+
var __copyProps = (to, from, except, desc) => {
|
|
10
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
11
|
+
for (let key of __getOwnPropNames(from))
|
|
12
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
13
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
14
|
+
}
|
|
15
|
+
return to;
|
|
16
|
+
};
|
|
17
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
18
|
+
|
|
19
|
+
// src/util/ArrayUtils/normalize.ts
|
|
20
|
+
var normalize_exports = {};
|
|
21
|
+
__export(normalize_exports, {
|
|
22
|
+
normalize: () => normalize
|
|
23
|
+
});
|
|
24
|
+
module.exports = __toCommonJS(normalize_exports);
|
|
25
|
+
function normalize(element) {
|
|
26
|
+
if (!element) {
|
|
27
|
+
return [];
|
|
28
|
+
}
|
|
29
|
+
return Array.isArray(element) ? element : [element];
|
|
30
|
+
}
|
|
31
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
32
|
+
0 && (module.exports = {
|
|
33
|
+
normalize
|
|
34
|
+
});
|
|
@@ -22,6 +22,7 @@ export { isNotEmpty } from './isNotEmpty';
|
|
|
22
22
|
export { isTypeof } from './isTypeof';
|
|
23
23
|
export { maxLength } from './maxLength';
|
|
24
24
|
export { minLength } from './minLength';
|
|
25
|
+
export { normalize } from './normalize';
|
|
25
26
|
export { readonly } from './readonly';
|
|
26
27
|
export { remove } from './remove';
|
|
27
28
|
export { removeAll } from './removeAll';
|
|
@@ -22,6 +22,7 @@ export { isNotEmpty } from "./isNotEmpty";
|
|
|
22
22
|
export { isTypeof } from "./isTypeof";
|
|
23
23
|
export { maxLength } from "./maxLength";
|
|
24
24
|
export { minLength } from "./minLength";
|
|
25
|
+
export { normalize } from "./normalize";
|
|
25
26
|
export { readonly } from "./readonly";
|
|
26
27
|
export { remove } from "./remove";
|
|
27
28
|
export { removeAll } from "./removeAll";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function normalize<E>(element?: E | E[] | null): E[];
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@unikue/ts-lang-utils",
|
|
3
|
-
"version": "1.2.
|
|
3
|
+
"version": "1.2.4",
|
|
4
4
|
"title": "TsLangUtils",
|
|
5
5
|
"description": "Common lang utilities for typescript",
|
|
6
6
|
"homepage": "https://unikueltd.github.io/ts-lang-utils",
|
|
@@ -51,7 +51,7 @@
|
|
|
51
51
|
"test:coverage": "del-cli ./coverage && jest --coverage --coverageDirectory ./coverage"
|
|
52
52
|
},
|
|
53
53
|
"dependencies": {
|
|
54
|
-
"@babel/runtime": "^7.29.
|
|
54
|
+
"@babel/runtime": "^7.29.7",
|
|
55
55
|
"@imranbarbhuiya/duration": "^5.1.8",
|
|
56
56
|
"lodash": "^4.18.1",
|
|
57
57
|
"nanoid": "^3.3.12",
|
|
@@ -66,12 +66,12 @@
|
|
|
66
66
|
"@unikue/typedoc-plugin-raw-content": "^1.1.0",
|
|
67
67
|
"@unikue/typedoc-theme-dumi": "^1.1.1",
|
|
68
68
|
"del-cli": "^7.0.0",
|
|
69
|
-
"eslint": "^10.
|
|
69
|
+
"eslint": "^10.4.1",
|
|
70
70
|
"eslint-plugin-jest": "^29.15.2",
|
|
71
|
-
"father": "^4.6.
|
|
71
|
+
"father": "^4.6.22",
|
|
72
72
|
"gh-pages": "^6.3.0",
|
|
73
73
|
"globals": "^17.6.0",
|
|
74
|
-
"ts-jest": "^29.4.
|
|
74
|
+
"ts-jest": "^29.4.11",
|
|
75
75
|
"typedoc": "~0.28.19",
|
|
76
76
|
"typescript": "^6.0.3",
|
|
77
77
|
"typescript-eslint": "^8.59.1"
|