grofc_utils 1.0.0 → 1.1.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/eslint.config.js +12 -0
- package/index.js +1 -0
- package/package.json +8 -1
- package/src/guard.js +112 -12
- package/src/object.js +13 -0
- package/src/random.js +2 -2
- package/tsconfig.json +8 -2
- package/types/index.d.ts +1 -0
- package/types/src/guard.d.ts +47 -4
- package/types/src/object.d.ts +1 -0
- package/readme.md +0 -4
package/eslint.config.js
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import js from "@eslint/js";
|
|
2
|
+
import globals from "globals";
|
|
3
|
+
import { defineConfig } from "eslint/config";
|
|
4
|
+
|
|
5
|
+
export default defineConfig([
|
|
6
|
+
{
|
|
7
|
+
files: ["**/*.{js,mjs,cjs}"],
|
|
8
|
+
plugins: { js },
|
|
9
|
+
extends: ["js/recommended"],
|
|
10
|
+
languageOptions: { globals: globals.browser }
|
|
11
|
+
},
|
|
12
|
+
]);
|
package/index.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "grofc_utils",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.1.0",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"scripts": {
|
|
@@ -26,6 +26,10 @@
|
|
|
26
26
|
"import": "./src/missingData.js",
|
|
27
27
|
"types": "./types/src/missingData.d.ts"
|
|
28
28
|
},
|
|
29
|
+
"./object": {
|
|
30
|
+
"import": "./src/object.js",
|
|
31
|
+
"types": "./types/src/object.d.ts"
|
|
32
|
+
},
|
|
29
33
|
"./random": {
|
|
30
34
|
"import": "./src/random.js",
|
|
31
35
|
"types": "./types/src/random.d.ts"
|
|
@@ -40,6 +44,9 @@
|
|
|
40
44
|
"license": "ISC",
|
|
41
45
|
"type": "module",
|
|
42
46
|
"devDependencies": {
|
|
47
|
+
"@eslint/js": "^9.39.1",
|
|
48
|
+
"eslint": "^9.39.1",
|
|
49
|
+
"globals": "^16.5.0",
|
|
43
50
|
"vitest": "^4.0.6"
|
|
44
51
|
}
|
|
45
52
|
}
|
package/src/guard.js
CHANGED
|
@@ -204,6 +204,30 @@ export function throwIfIsNotNonNegativeInteger(variable, name = "variable") {
|
|
|
204
204
|
throwRangeErrorGiveValue(variable, name, "a non-negative integer");
|
|
205
205
|
}
|
|
206
206
|
}
|
|
207
|
+
//
|
|
208
|
+
// 字符串类型守卫函数
|
|
209
|
+
//
|
|
210
|
+
export function throwIfIsNotString(variable, name = "variable") {
|
|
211
|
+
if (typeof variable !== "string") {
|
|
212
|
+
throwTypeErrorGiveType(variable, name, "string")
|
|
213
|
+
}
|
|
214
|
+
}
|
|
215
|
+
//
|
|
216
|
+
// symbol类型守卫函数
|
|
217
|
+
//
|
|
218
|
+
export function throwIfIsNotSymbol(variable, name = "variable") {
|
|
219
|
+
if (typeof variable !== "symbol") {
|
|
220
|
+
throwTypeErrorGiveType(variable, name, "symbol")
|
|
221
|
+
}
|
|
222
|
+
}
|
|
223
|
+
//
|
|
224
|
+
// bigint类型守卫函数
|
|
225
|
+
//
|
|
226
|
+
export function throwIfIsNotBigInt(variable, name = "variable") {
|
|
227
|
+
if (typeof variable !== "bigint") {
|
|
228
|
+
throwTypeErrorGiveType(variable, name, "bigint")
|
|
229
|
+
}
|
|
230
|
+
}
|
|
207
231
|
// ------------------------------------------------
|
|
208
232
|
// 对象类型守卫函数
|
|
209
233
|
// ------------------------------------------------
|
|
@@ -218,10 +242,25 @@ export function throwIfIsNotPlainObject(variable, name = "variable") {
|
|
|
218
242
|
throwTypeErrorGiveType(variable, name, "a plain object");
|
|
219
243
|
}
|
|
220
244
|
}
|
|
245
|
+
/**
|
|
246
|
+
* 检查对象是否包含指定的键
|
|
247
|
+
* @param {*} variable - 要检查的对象
|
|
248
|
+
* @param {string} key - 要检查的键名
|
|
249
|
+
* @param {string} name - 变量名称(用于错误消息)
|
|
250
|
+
* @throws {TypeError} 当variable不是普通对象或key不是字符串时抛出类型错误
|
|
251
|
+
* @throws {Error} 当对象中找不到指定键时抛出错误
|
|
252
|
+
*/
|
|
253
|
+
export function throwIfKeyMissing(variable, key, name = "variable") {
|
|
254
|
+
throwIfIsNotPlainObject(variable);
|
|
255
|
+
throwIfIsNotString(key);
|
|
256
|
+
if (!(key in variable)) {
|
|
257
|
+
throw new Error(`Expected ${name} to have key : "${key}", but cannot find.`)
|
|
258
|
+
}
|
|
259
|
+
}
|
|
221
260
|
/**
|
|
222
261
|
* 检查对象是否缺少所有指定的键
|
|
223
262
|
* @param {*} variable - 要检查的对象
|
|
224
|
-
* @param {string
|
|
263
|
+
* @param {string[]} keys - 要检查的键名数组
|
|
225
264
|
* @param {string} name - 变量名称(用于错误消息)
|
|
226
265
|
* @throws {TypeError} 当 variable 不是普通对象时抛出类型错误
|
|
227
266
|
* @throws {GuardError} 当 keys 不是字符串或字符串数组时抛出守卫错误
|
|
@@ -229,18 +268,15 @@ export function throwIfIsNotPlainObject(variable, name = "variable") {
|
|
|
229
268
|
*/
|
|
230
269
|
export function throwIfAllKeysMissing(variable, keys, name = "variable") {
|
|
231
270
|
throwIfIsNotPlainObject(variable);
|
|
232
|
-
|
|
233
|
-
if (typeof keys === "string") keys = [keys];
|
|
234
|
-
else safeGuardExecute(throwTypeErrorGiveType, keys, name, "string", "an array of string");
|
|
235
|
-
}
|
|
271
|
+
safeGuardExecute(throwIfIsNotStringArray, keys, name, "an array of string");
|
|
236
272
|
if (keys.every(key => !(key in variable))) {
|
|
237
|
-
throw new Error(`Expected ${name} to have at least one
|
|
273
|
+
throw new Error(`Expected ${name} to have at least one keys of [${keys.map(k => `'${k}'`).join(" ,")}], but cannot find.`)
|
|
238
274
|
}
|
|
239
275
|
}
|
|
240
276
|
/**
|
|
241
277
|
* 检查对象是否缺少任意指定的键
|
|
242
278
|
* @param {*} variable - 要检查的对象
|
|
243
|
-
* @param {string
|
|
279
|
+
* @param {string[]} keys - 要检查的键名数组
|
|
244
280
|
* @param {string} name - 变量名称(用于错误消息)
|
|
245
281
|
* @throws {TypeError} 当 variable 不是普通对象时抛出类型错误
|
|
246
282
|
* @throws {GuardError} 当 keys 不是字符串或字符串数组时抛出守卫错误
|
|
@@ -248,13 +284,58 @@ export function throwIfAllKeysMissing(variable, keys, name = "variable") {
|
|
|
248
284
|
*/
|
|
249
285
|
export function throwIfSomeKeysMissing(variable, keys, name = "variable") {
|
|
250
286
|
throwIfIsNotPlainObject(variable);
|
|
251
|
-
|
|
252
|
-
if (typeof keys === "string") keys = [keys];
|
|
253
|
-
else safeGuardExecute(throwTypeErrorGiveType, keys, name, "string", "an array of string");
|
|
254
|
-
}
|
|
287
|
+
safeGuardExecute(throwIfIsNotStringArray, keys, name, "an array of string");
|
|
255
288
|
const l = keys.filter(key => !(key in variable))
|
|
256
289
|
if (l.length) {
|
|
257
|
-
throw new Error(`Expected ${name} to have at all
|
|
290
|
+
throw new Error(`Expected ${name} to have at all keys of [${keys.map(k => `'${k}'`).join(" ,")}], but missing [${l.map(k => `'${k}'`).join(" ,")}].`)
|
|
291
|
+
}
|
|
292
|
+
}
|
|
293
|
+
/**
|
|
294
|
+
* 检查对象是否包含指定的键
|
|
295
|
+
* @param {*} variable - 要检查的对象
|
|
296
|
+
* @param {string} property - 要检查的键名
|
|
297
|
+
* @param {string} name - 变量名称(用于错误消息)
|
|
298
|
+
* @throws {TypeError} 当variable不是普通对象或property不是字符串时抛出类型错误
|
|
299
|
+
* @throws {Error} 当对象中找不到指定键时抛出错误
|
|
300
|
+
*/
|
|
301
|
+
export function throwIfOwnPropertyMissing(variable, property, name = "variable") {
|
|
302
|
+
throwIfIsNotPlainObject(variable);
|
|
303
|
+
throwIfIsNotString(property);
|
|
304
|
+
if (Object.hasOwn(variable, property)) {
|
|
305
|
+
throw new Error(`Expected ${name} to have own property : "${property}", but cannot find.`)
|
|
306
|
+
}
|
|
307
|
+
}
|
|
308
|
+
/**
|
|
309
|
+
* 检查对象是否缺少所有指定的键
|
|
310
|
+
* @param {*} variable - 要检查的对象
|
|
311
|
+
* @param {string[]}properties- 要检查的键名数组
|
|
312
|
+
* @param {string} name - 变量名称(用于错误消息)
|
|
313
|
+
* @throws {TypeError} 当 variable 不是普通对象时抛出类型错误
|
|
314
|
+
* @throws {GuardError} 当properties不是字符串或字符串数组时抛出守卫错误
|
|
315
|
+
* @throws {Error} 当对象缺少所有指定键时抛出错误
|
|
316
|
+
*/
|
|
317
|
+
export function throwIfAllOwnPropertiesMissing(variable, properties, name = "variable") {
|
|
318
|
+
throwIfIsNotPlainObject(variable);
|
|
319
|
+
safeGuardExecute(throwIfIsNotStringArray, properties, name, "an array of string");
|
|
320
|
+
if (properties.every(p => !Object.hasOwn(variable, p))) {
|
|
321
|
+
throw new Error(`Expected ${name} to have at least one own property of [${properties.map(k => `'${k}'`).join(" ,")}], but cannot find.`)
|
|
322
|
+
}
|
|
323
|
+
}
|
|
324
|
+
/**
|
|
325
|
+
* 检查对象是否缺少任意指定的键
|
|
326
|
+
* @param {*} variable - 要检查的对象
|
|
327
|
+
* @param {string[]} properties - 要检查的键名数组
|
|
328
|
+
* @param {string} name - 变量名称(用于错误消息)
|
|
329
|
+
* @throws {TypeError} 当 variable 不是普通对象时抛出类型错误
|
|
330
|
+
* @throws {GuardError} 当 properties 不是字符串或字符串数组时抛出守卫错误
|
|
331
|
+
* @throws {Error} 当对象缺少任何一个指定键时抛出错误
|
|
332
|
+
*/
|
|
333
|
+
export function throwIfSomeOwnPropertiesMissing(variable, properties, name = "variable") {
|
|
334
|
+
throwIfIsNotPlainObject(variable);
|
|
335
|
+
safeGuardExecute(throwIfIsNotStringArray, properties, name, "an array of string");
|
|
336
|
+
const l = properties.filter(p => !Object.hasOwn(variable, p))
|
|
337
|
+
if (l.length) {
|
|
338
|
+
throw new Error(`Expected ${name} to have at all own properties of [${properties.map(k => `'${k}'`).join(" ,")}], but missing [${l.map(k => `'${k}'`).join(" ,")}].`)
|
|
258
339
|
}
|
|
259
340
|
}
|
|
260
341
|
// ------------------------------------------------
|
|
@@ -311,6 +392,25 @@ export function throwIfIsNotNonEmptyArray(variable, name = "variable") {
|
|
|
311
392
|
throwRangeErrorGiveValue(variable, name, "a non-empty array");
|
|
312
393
|
}
|
|
313
394
|
}
|
|
395
|
+
|
|
396
|
+
export function throwIfIsNotStringArray(variable, name = "variable", generalTerm = `all elements of ${name || "array"}`) {
|
|
397
|
+
throwIfIsNotArray(variable, name);
|
|
398
|
+
const acceptType = "strings";
|
|
399
|
+
for (const e of variable) {
|
|
400
|
+
if (typeof e !== "string") {
|
|
401
|
+
throwTypeErrorForArray(generalTerm, acceptType, `a non-string value of type ${getType(e)}`)
|
|
402
|
+
}
|
|
403
|
+
}
|
|
404
|
+
}
|
|
405
|
+
export function throwIfIsNotNumberArray(variable, name = "variable", generalTerm = `all elements of ${name || "array"}`) {
|
|
406
|
+
throwIfIsNotArray(variable, name);
|
|
407
|
+
const acceptType = "numbers";
|
|
408
|
+
for (const e of variable) {
|
|
409
|
+
if (typeof e !== "number") {
|
|
410
|
+
throwTypeErrorForArray(generalTerm, acceptType, `a non-number value of type ${getType(e)}`)
|
|
411
|
+
}
|
|
412
|
+
}
|
|
413
|
+
}
|
|
314
414
|
/**
|
|
315
415
|
* 检查变量是否为仅包含非NaN数字的数组,如果不是则抛出类型错误
|
|
316
416
|
*
|
package/src/object.js
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { throwIfIsNotPlainObject, throwIfKeyMissing } from "./guard";
|
|
2
|
+
|
|
3
|
+
export function setReadOnlyProperty(obj, name) {
|
|
4
|
+
throwIfIsNotPlainObject(obj);
|
|
5
|
+
throwIfKeyMissing(obj, name, "obj");
|
|
6
|
+
const descriptor = Object.getOwnPropertyDescriptor(obj, name);
|
|
7
|
+
Object.defineProperty(obj, name, {
|
|
8
|
+
value: descriptor.value,
|
|
9
|
+
writable: false,
|
|
10
|
+
configurable: false,
|
|
11
|
+
enumerable: descriptor.enumerable ?? true
|
|
12
|
+
})
|
|
13
|
+
}
|
package/src/random.js
CHANGED
|
@@ -151,7 +151,7 @@ export function randomVectors(len, dim = 2, mod = 1, generator = randomGaussian)
|
|
|
151
151
|
* @param {(r: number, c: number) => number} generator 用于生成矩阵元素的函数,接收行列索引作为参数,默认生成0-10的随机整数
|
|
152
152
|
* @returns {number[][]} 二维数组表示的矩阵,大小为rows×cols
|
|
153
153
|
*/
|
|
154
|
-
export function randomMatrix(rows = 2, cols = rows, generator = (
|
|
154
|
+
export function randomMatrix(rows = 2, cols = rows, generator = () => randomInt(0, 10)) {
|
|
155
155
|
throwIfIsNotNonNegativeInteger(rows, "rows");
|
|
156
156
|
throwIfIsNotNonNegativeInteger(cols, "cols");
|
|
157
157
|
throwIfIsNotFunction(generator, "generator");
|
|
@@ -166,7 +166,7 @@ export function randomMatrix(rows = 2, cols = rows, generator = (_r, _c) => rand
|
|
|
166
166
|
* @param {(r: number, c: number) => number} generator 用于生成矩阵元素的函数,接收行列索引作为参数,默认生成0-10的随机整数
|
|
167
167
|
* @returns {number[][][]} 包含len个矩阵的数组,每个矩阵都是二维数组
|
|
168
168
|
*/
|
|
169
|
-
export function randomMatrices(len, rows = 2, cols = rows, generator = (
|
|
169
|
+
export function randomMatrices(len, rows = 2, cols = rows, generator = () => randomInt(0, 10)) {
|
|
170
170
|
throwIfIsNotNonNegativeInteger(len, "len");
|
|
171
171
|
return Array.from({ length: len }, () => randomMatrix(rows, cols, generator))
|
|
172
172
|
}
|
package/tsconfig.json
CHANGED
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
// "disableReferencedProjectLoad": true, /* Reduce the number of projects loaded automatically by TypeScript. */
|
|
12
12
|
|
|
13
13
|
/* Language and Environment */
|
|
14
|
-
"target": "
|
|
14
|
+
"target": "es2022", /* Set the JavaScript language version for emitted JavaScript and include compatible library declarations. */
|
|
15
15
|
// "lib": [], /* Specify a set of bundled library declaration files that describe the target runtime environment. */
|
|
16
16
|
// "jsx": "preserve", /* Specify what JSX code is generated. */
|
|
17
17
|
// "experimentalDecorators": true, /* Enable experimental support for legacy experimental decorators. */
|
|
@@ -108,5 +108,11 @@
|
|
|
108
108
|
// "skipDefaultLibCheck": true, /* Skip type checking .d.ts files that are included with TypeScript. */
|
|
109
109
|
"skipLibCheck": true /* Skip type checking all .d.ts files. */
|
|
110
110
|
},
|
|
111
|
-
"exclude": [
|
|
111
|
+
"exclude": [
|
|
112
|
+
"./src",
|
|
113
|
+
"types",
|
|
114
|
+
"test",
|
|
115
|
+
"eslint.config.js",
|
|
116
|
+
"./generate.exports.js"
|
|
117
|
+
]
|
|
112
118
|
}
|
package/types/index.d.ts
CHANGED
package/types/src/guard.d.ts
CHANGED
|
@@ -82,6 +82,9 @@ export function throwIfIsNotNegativeInteger(variable: any, name?: string): void;
|
|
|
82
82
|
* @throws {RangeError} 当变量不是非负整数时抛出范围错误
|
|
83
83
|
*/
|
|
84
84
|
export function throwIfIsNotNonNegativeInteger(variable: any, name?: string): void;
|
|
85
|
+
export function throwIfIsNotString(variable: any, name?: string): void;
|
|
86
|
+
export function throwIfIsNotSymbol(variable: any, name?: string): void;
|
|
87
|
+
export function throwIfIsNotBigInt(variable: any, name?: string): void;
|
|
85
88
|
/**
|
|
86
89
|
* 检查变量是否为普通对象(非 null,非数组)
|
|
87
90
|
* @param {*} variable - 要检查的变量
|
|
@@ -89,26 +92,64 @@ export function throwIfIsNotNonNegativeInteger(variable: any, name?: string): vo
|
|
|
89
92
|
* @throws {TypeError} 当变量不是普通对象时抛出类型错误
|
|
90
93
|
*/
|
|
91
94
|
export function throwIfIsNotPlainObject(variable: any, name?: string): void;
|
|
95
|
+
/**
|
|
96
|
+
* 检查对象是否包含指定的键
|
|
97
|
+
* @param {*} variable - 要检查的对象
|
|
98
|
+
* @param {string} key - 要检查的键名
|
|
99
|
+
* @param {string} name - 变量名称(用于错误消息)
|
|
100
|
+
* @throws {TypeError} 当variable不是普通对象或key不是字符串时抛出类型错误
|
|
101
|
+
* @throws {Error} 当对象中找不到指定键时抛出错误
|
|
102
|
+
*/
|
|
103
|
+
export function throwIfKeyMissing(variable: any, key: string, name?: string): void;
|
|
92
104
|
/**
|
|
93
105
|
* 检查对象是否缺少所有指定的键
|
|
94
106
|
* @param {*} variable - 要检查的对象
|
|
95
|
-
* @param {string
|
|
107
|
+
* @param {string[]} keys - 要检查的键名数组
|
|
96
108
|
* @param {string} name - 变量名称(用于错误消息)
|
|
97
109
|
* @throws {TypeError} 当 variable 不是普通对象时抛出类型错误
|
|
98
110
|
* @throws {GuardError} 当 keys 不是字符串或字符串数组时抛出守卫错误
|
|
99
111
|
* @throws {Error} 当对象缺少所有指定键时抛出错误
|
|
100
112
|
*/
|
|
101
|
-
export function throwIfAllKeysMissing(variable: any, keys: string
|
|
113
|
+
export function throwIfAllKeysMissing(variable: any, keys: string[], name?: string): void;
|
|
102
114
|
/**
|
|
103
115
|
* 检查对象是否缺少任意指定的键
|
|
104
116
|
* @param {*} variable - 要检查的对象
|
|
105
|
-
* @param {string
|
|
117
|
+
* @param {string[]} keys - 要检查的键名数组
|
|
106
118
|
* @param {string} name - 变量名称(用于错误消息)
|
|
107
119
|
* @throws {TypeError} 当 variable 不是普通对象时抛出类型错误
|
|
108
120
|
* @throws {GuardError} 当 keys 不是字符串或字符串数组时抛出守卫错误
|
|
109
121
|
* @throws {Error} 当对象缺少任何一个指定键时抛出错误
|
|
110
122
|
*/
|
|
111
|
-
export function throwIfSomeKeysMissing(variable: any, keys: string
|
|
123
|
+
export function throwIfSomeKeysMissing(variable: any, keys: string[], name?: string): void;
|
|
124
|
+
/**
|
|
125
|
+
* 检查对象是否包含指定的键
|
|
126
|
+
* @param {*} variable - 要检查的对象
|
|
127
|
+
* @param {string} property - 要检查的键名
|
|
128
|
+
* @param {string} name - 变量名称(用于错误消息)
|
|
129
|
+
* @throws {TypeError} 当variable不是普通对象或property不是字符串时抛出类型错误
|
|
130
|
+
* @throws {Error} 当对象中找不到指定键时抛出错误
|
|
131
|
+
*/
|
|
132
|
+
export function throwIfOwnPropertyMissing(variable: any, property: string, name?: string): void;
|
|
133
|
+
/**
|
|
134
|
+
* 检查对象是否缺少所有指定的键
|
|
135
|
+
* @param {*} variable - 要检查的对象
|
|
136
|
+
* @param {string[]}properties- 要检查的键名数组
|
|
137
|
+
* @param {string} name - 变量名称(用于错误消息)
|
|
138
|
+
* @throws {TypeError} 当 variable 不是普通对象时抛出类型错误
|
|
139
|
+
* @throws {GuardError} 当properties不是字符串或字符串数组时抛出守卫错误
|
|
140
|
+
* @throws {Error} 当对象缺少所有指定键时抛出错误
|
|
141
|
+
*/
|
|
142
|
+
export function throwIfAllOwnPropertiesMissing(variable: any, properties: any, name?: string): void;
|
|
143
|
+
/**
|
|
144
|
+
* 检查对象是否缺少任意指定的键
|
|
145
|
+
* @param {*} variable - 要检查的对象
|
|
146
|
+
* @param {string[]} properties - 要检查的键名数组
|
|
147
|
+
* @param {string} name - 变量名称(用于错误消息)
|
|
148
|
+
* @throws {TypeError} 当 variable 不是普通对象时抛出类型错误
|
|
149
|
+
* @throws {GuardError} 当 properties 不是字符串或字符串数组时抛出守卫错误
|
|
150
|
+
* @throws {Error} 当对象缺少任何一个指定键时抛出错误
|
|
151
|
+
*/
|
|
152
|
+
export function throwIfSomeOwnPropertiesMissing(variable: any, properties: string[], name?: string): void;
|
|
112
153
|
/**
|
|
113
154
|
* 检查变量是否为函数类型,如果不是则抛出类型错误
|
|
114
155
|
* @param {*} variable - 要检查的变量
|
|
@@ -132,6 +173,8 @@ export function throwIfIsNotIterable(variable: any, name?: string): void;
|
|
|
132
173
|
export function throwIfIsNotIterableObject(variable: any, name?: string): void;
|
|
133
174
|
export function throwIfIsNotArray(variable: any, name?: string): void;
|
|
134
175
|
export function throwIfIsNotNonEmptyArray(variable: any, name?: string): void;
|
|
176
|
+
export function throwIfIsNotStringArray(variable: any, name?: string, generalTerm?: string): void;
|
|
177
|
+
export function throwIfIsNotNumberArray(variable: any, name?: string, generalTerm?: string): void;
|
|
135
178
|
/**
|
|
136
179
|
* 检查变量是否为仅包含非NaN数字的数组,如果不是则抛出类型错误
|
|
137
180
|
*
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export function setReadOnlyProperty(obj: any, name: any): void;
|
package/readme.md
DELETED