@ts-type/is-array 1.0.6 → 1.0.7

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/CHANGELOG.md CHANGED
@@ -3,6 +3,26 @@
3
3
  All notable changes to this project will be documented in this file.
4
4
  See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
5
 
6
+ ## [1.0.7](https://github.com/bluelovers/ws-ts-type/compare/@ts-type/is-array@1.0.6...@ts-type/is-array@1.0.7) (2026-03-07)
7
+
8
+
9
+
10
+ ### 📚 Documentation
11
+
12
+ * enhance documentation and JSDoc comments across multiple packages ([88ee99b](https://github.com/bluelovers/ws-ts-type/commit/88ee99b3a489645ca53093357cc3523dbe7996e0))
13
+
14
+
15
+ ### 🛠 Build System
16
+
17
+ * 更新多個套件的 test 指令為 jest ([61ea53b](https://github.com/bluelovers/ws-ts-type/commit/61ea53bf15fc3ed0e216793200604ae5a52079c9))
18
+
19
+
20
+ ### ♻️ Chores
21
+
22
+ * migrate from yarn to pnpm and enhance test infrastructure ([8a5daa2](https://github.com/bluelovers/ws-ts-type/commit/8a5daa2f2022eaf025c3349d4fe5dc8971f8c077))
23
+
24
+
25
+
6
26
  ## [1.0.6](https://github.com/bluelovers/ws-ts-type/compare/@ts-type/is-array@1.0.5...@ts-type/is-array@1.0.6) (2022-10-10)
7
27
 
8
28
 
package/README.md CHANGED
@@ -1,8 +1,19 @@
1
- # README.md
1
+ # @ts-type/is-array
2
2
 
3
-
3
+ 增強的陣列類型斷言與驗證工具
4
4
 
5
- ## install
5
+ Enhanced array type predicates and validation utilities
6
+
7
+ ## 功能特點 / Features
8
+
9
+ - 擴展 Array.isArray 類型斷言
10
+ - Extend Array.isArray type predicate
11
+ - 支援唯讀陣列與可變陣列類型轉換
12
+ - Support readonly array and writable array type conversion
13
+ - 運行時陣列驗證與斷言
14
+ - Runtime array validation and assertion
15
+
16
+ ## 安裝 / Install
6
17
 
7
18
  ```bash
8
19
  yarn add @ts-type/is-array
@@ -10,3 +21,23 @@ yarn-tool add @ts-type/is-array
10
21
  yt add @ts-type/is-array
11
22
  ```
12
23
 
24
+ ## 使用範例 / Usage Example
25
+
26
+ ```typescript
27
+ import { isArray, isArrayPredicates, typePredicatesAsWriteableArray, typePredicatesAsReadonlyArray } from '@ts-type/is-array';
28
+
29
+ // 使用類型斷言
30
+ function processValue(value: string | string[]) {
31
+ if (isArray(value)) {
32
+ // TypeScript 知道 value 是 string[]
33
+ console.log(value.join(', '));
34
+ }
35
+ }
36
+
37
+ // 使用斷言函式(會拋出錯誤)
38
+ function assertArray(arr: unknown) {
39
+ isArrayPredicates(arr);
40
+ // 如果通過,arr 被斷言為陣列
41
+ }
42
+ ```
43
+
package/dist/index.cjs CHANGED
@@ -1,8 +1,8 @@
1
1
 
2
2
  'use strict'
3
3
 
4
- if (typeof process !== 'undefined' && process.env.NODE_ENV === 'production') {
5
- module.exports = require('./index.cjs.production.min.cjs')
6
- } else {
4
+ if (typeof process !== 'undefined' && process.env.NODE_ENV !== 'production') {
7
5
  module.exports = require('./index.cjs.development.cjs')
6
+ } else {
7
+ module.exports = require('./index.cjs.production.min.cjs')
8
8
  }
@@ -4,14 +4,44 @@ Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
5
  var assert = require('assert');
6
6
 
7
+ /**
8
+ * 檢查值是否為陣列(類型斷言版本)
9
+ * Check if value is an array (type predicate version)
10
+ *
11
+ * @param arg - 要檢查的值 / Value to check
12
+ * @returns 是否為輸入類型的類型斷言 / Type predicate of input type
13
+ */
7
14
  function isArray(arg) {
8
15
  return Array.isArray(arg);
9
16
  }
17
+ /**
18
+ * 斷言值為可變陣列(不包含 readonly 屬性)
19
+ * Assert value as writable array (without readonly attribute)
20
+ *
21
+ * @param value - 要斷言的值 / Value to assert
22
+ * @throws 當值不是陣列時拋出錯誤 / Throws error when value is not an array
23
+ */
24
+ // @ts-ignore
10
25
  function typePredicatesAsWriteableArray(value) {}
26
+ /**
27
+ * 斷言值為唯讀陣列
28
+ * Assert value as readonly array
29
+ *
30
+ * @param value - 要斷言的值 / Value to assert
31
+ * @throws 當值不是陣列時拋出錯誤 / Throws error when value is not an array
32
+ */
33
+ // @ts-ignore
11
34
  function typePredicatesAsReadonlyArray(value) {}
35
+ /**
36
+ * 斷言並驗證值為陣列,否則拋出錯誤
37
+ * Assert and validate that value is an array, otherwise throw error
38
+ *
39
+ * @param actual - 要驗證的值 / Value to validate
40
+ * @param message - 自訂錯誤訊息(可選)/ Custom error message (optional)
41
+ * @throws 當值不是陣列時拋出 AssertionError / Throws AssertionError when value is not an array
42
+ */
12
43
  function isArrayPredicates(actual, message) {
13
44
  const expression = Array.isArray(actual);
14
-
15
45
  if (!expression) {
16
46
  throw new assert.AssertionError({
17
47
  message: message !== null && message !== void 0 ? message : `actual ${actual} not as expected`,
@@ -22,7 +52,7 @@ function isArrayPredicates(actual, message) {
22
52
  }
23
53
  }
24
54
 
25
- exports["default"] = isArray;
55
+ exports.default = isArray;
26
56
  exports.isArray = isArray;
27
57
  exports.isArrayNarrowed = isArray;
28
58
  exports.isArrayPredicates = isArrayPredicates;
@@ -1 +1 @@
1
- {"version":3,"file":"index.cjs.development.cjs","sources":["../src/index.ts"],"sourcesContent":["import { ITSArrayListMaybeReadonly } from 'ts-type/lib/type/base';\nimport { AssertionError } from 'assert';\nimport { ITSToReadonlyArray, ITSToWriteableArray } from 'ts-type/lib/helper/array/readonly';\n\ndeclare global\n{\n\tinterface ArrayConstructor\n\t{\n\t\tisArray<T extends ITSArrayListMaybeReadonly<any>>(arg: T | unknown): arg is T\n\t}\n}\n\nexport function isArray<T extends ITSArrayListMaybeReadonly<any>>(arg: T | unknown): arg is T\n{\n\treturn Array.isArray(arg)\n}\n\n// @ts-ignore\nexport function typePredicatesAsWriteableArray<T extends ITSArrayListMaybeReadonly<any>>(value: T): asserts value is ITSToWriteableArray<T>\n{\n\n}\n\n// @ts-ignore\nexport function typePredicatesAsReadonlyArray<T extends ITSArrayListMaybeReadonly<any>>(value: T): asserts value is ITSToReadonlyArray<T>\n{\n\n}\n\nexport function isArrayPredicates<T extends ITSArrayListMaybeReadonly<any>>(actual: T | unknown, message?: string): asserts actual is T\n{\n\tconst expression = Array.isArray(actual);\n\tif (!expression)\n\t{\n\t\tthrow new AssertionError({\n\t\t\tmessage: message ?? `actual ${actual} not as expected`,\n\t\t\tactual,\n\t\t\texpected: expression,\n\t\t\toperator: 'fail',\n\t\t})\n\t}\n}\n\nexport { isArray as isArrayNarrowed }\n\nexport default isArray\n"],"names":["typePredicatesAsWriteableArray","value","expression","message"],"mappings":";;;;;;;;AAYA,CAAA;AAuBYA,SAAAA,8BAAT,CAAsDC,KAAtD,EAAsD,EAAA;AAGtD,SAHA,6BAAA,CAAA,KAAA,EAAA,EAAA;;AAKD,EAAA,MAAA,UAAA,GAAA,KAAA,CAAA,OAAA,CAAA,MAAA,CAAA,CAAA;;AACF,EAAA,IAAA,CAACC,UAAD,EAAC;;MAADC;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"index.cjs.development.cjs","sources":["../src/index.ts"],"sourcesContent":["import { ITSArrayListMaybeReadonly } from 'ts-type/lib/type/base';\nimport { AssertionError } from 'assert';\nimport { ITSToReadonlyArray, ITSToWriteableArray } from 'ts-type/lib/helper/array/readonly';\n\n/**\n * 擴展 ArrayConstructor.isArray 方法,支援更精確的類型斷言\n * Extend ArrayConstructor.isArray method for more precise type predicate\n *\n * 允許在運行時檢查值是否為陣列,並在編譯時保留原始陣列類型\n */\ndeclare global\n{\n\tinterface ArrayConstructor\n\t{\n\t\t/**\n\t\t * 檢查值是否為陣列,並返回類型斷言\n\t\t * Check if value is an array and return type predicate\n\t\t *\n\t\t * @param arg - 要檢查的值 / Value to check\n\t\t * @returns 是否為陣列的類型斷言 / Type predicate indicating if it's an array\n\t\t */\n\t\tisArray<T extends ITSArrayListMaybeReadonly<any>>(arg: T | unknown): arg is T\n\t}\n}\n\n/**\n * 檢查值是否為陣列(類型斷言版本)\n * Check if value is an array (type predicate version)\n *\n * @param arg - 要檢查的值 / Value to check\n * @returns 是否為輸入類型的類型斷言 / Type predicate of input type\n */\nexport function isArray<T extends ITSArrayListMaybeReadonly<any>>(arg: T | unknown): arg is T\n{\n\treturn Array.isArray(arg)\n}\n\n/**\n * 斷言值為可變陣列(不包含 readonly 屬性)\n * Assert value as writable array (without readonly attribute)\n *\n * @param value - 要斷言的值 / Value to assert\n * @throws 當值不是陣列時拋出錯誤 / Throws error when value is not an array\n */\n// @ts-ignore\nexport function typePredicatesAsWriteableArray<T extends ITSArrayListMaybeReadonly<any>>(value: T): asserts value is ITSToWriteableArray<T>\n{\n\n}\n\n/**\n * 斷言值為唯讀陣列\n * Assert value as readonly array\n *\n * @param value - 要斷言的值 / Value to assert\n * @throws 當值不是陣列時拋出錯誤 / Throws error when value is not an array\n */\n// @ts-ignore\nexport function typePredicatesAsReadonlyArray<T extends ITSArrayListMaybeReadonly<any>>(value: T): asserts value is ITSToReadonlyArray<T>\n{\n\n}\n\n/**\n * 斷言並驗證值為陣列,否則拋出錯誤\n * Assert and validate that value is an array, otherwise throw error\n *\n * @param actual - 要驗證的值 / Value to validate\n * @param message - 自訂錯誤訊息(可選)/ Custom error message (optional)\n * @throws 當值不是陣列時拋出 AssertionError / Throws AssertionError when value is not an array\n */\nexport function isArrayPredicates<T extends ITSArrayListMaybeReadonly<any>>(actual: T | unknown, message?: string): asserts actual is T\n{\n\tconst expression = Array.isArray(actual);\n\tif (!expression)\n\t{\n\t\tthrow new AssertionError({\n\t\t\tmessage: message ?? `actual ${actual} not as expected`,\n\t\t\tactual,\n\t\t\texpected: expression,\n\t\t\toperator: 'fail',\n\t\t})\n\t}\n}\n\nexport { isArray as isArrayNarrowed }\n\nexport default isArray\n"],"names":[],"mappings":";;;;;;;;;AA+EG;;;AAtDH;;;;;;;;;;;;;;;;;;AAsDG;;AAMH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
@@ -1,2 +1,24 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var r=require("assert");function isArray(r){return Array.isArray(r)}exports.default=isArray,exports.isArray=isArray,exports.isArrayNarrowed=isArray,exports.isArrayPredicates=function isArrayPredicates(e,a){const t=Array.isArray(e);if(!t)throw new r.AssertionError({message:null!=a?a:`actual ${e} not as expected`,actual:e,expected:t,operator:"fail"})},exports.typePredicatesAsReadonlyArray=function typePredicatesAsReadonlyArray(r){},exports.typePredicatesAsWriteableArray=function typePredicatesAsWriteableArray(r){};
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: !0
5
+ });
6
+
7
+ var r = require("assert");
8
+
9
+ function isArray(r) {
10
+ return Array.isArray(r);
11
+ }
12
+
13
+ exports.default = isArray, exports.isArray = isArray, exports.isArrayNarrowed = isArray,
14
+ exports.isArrayPredicates = function isArrayPredicates(e, a) {
15
+ const t = Array.isArray(e);
16
+ if (!t) throw new r.AssertionError({
17
+ message: null != a ? a : `actual ${e} not as expected`,
18
+ actual: e,
19
+ expected: t,
20
+ operator: "fail"
21
+ });
22
+ }, exports.typePredicatesAsReadonlyArray = function typePredicatesAsReadonlyArray(r) {},
23
+ exports.typePredicatesAsWriteableArray = function typePredicatesAsWriteableArray(r) {};
2
24
  //# sourceMappingURL=index.cjs.production.min.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.cjs.production.min.cjs","sources":["../src/index.ts"],"sourcesContent":["import { ITSArrayListMaybeReadonly } from 'ts-type/lib/type/base';\nimport { AssertionError } from 'assert';\nimport { ITSToReadonlyArray, ITSToWriteableArray } from 'ts-type/lib/helper/array/readonly';\n\ndeclare global\n{\n\tinterface ArrayConstructor\n\t{\n\t\tisArray<T extends ITSArrayListMaybeReadonly<any>>(arg: T | unknown): arg is T\n\t}\n}\n\nexport function isArray<T extends ITSArrayListMaybeReadonly<any>>(arg: T | unknown): arg is T\n{\n\treturn Array.isArray(arg)\n}\n\n// @ts-ignore\nexport function typePredicatesAsWriteableArray<T extends ITSArrayListMaybeReadonly<any>>(value: T): asserts value is ITSToWriteableArray<T>\n{\n\n}\n\n// @ts-ignore\nexport function typePredicatesAsReadonlyArray<T extends ITSArrayListMaybeReadonly<any>>(value: T): asserts value is ITSToReadonlyArray<T>\n{\n\n}\n\nexport function isArrayPredicates<T extends ITSArrayListMaybeReadonly<any>>(actual: T | unknown, message?: string): asserts actual is T\n{\n\tconst expression = Array.isArray(actual);\n\tif (!expression)\n\t{\n\t\tthrow new AssertionError({\n\t\t\tmessage: message ?? `actual ${actual} not as expected`,\n\t\t\tactual,\n\t\t\texpected: expression,\n\t\t\toperator: 'fail',\n\t\t})\n\t}\n}\n\nexport { isArray as isArrayNarrowed }\n\nexport default isArray\n"],"names":["expression","Array","isArray","actual","message","typePredicatesAsReadonlyArray","value","typePredicatesAsWriteableArray"],"mappings":"uIAYA,2IA4BE,MAAAA,EAAAC,MAAAC,QAAAC,GACF,IAACH,8BAADI,6HAHG,SAHAC,8BAAAC,GAAA,yCAASC,SAAAA,+BAA6CD,GAAA"}
1
+ {"version":3,"file":"index.cjs.production.min.cjs","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;"}
package/dist/index.d.ts CHANGED
@@ -1,13 +1,55 @@
1
1
  import { ITSArrayListMaybeReadonly } from 'ts-type/lib/type/base';
2
2
  import { ITSToReadonlyArray, ITSToWriteableArray } from 'ts-type/lib/helper/array/readonly';
3
+ /**
4
+ * 擴展 ArrayConstructor.isArray 方法,支援更精確的類型斷言
5
+ * Extend ArrayConstructor.isArray method for more precise type predicate
6
+ *
7
+ * 允許在運行時檢查值是否為陣列,並在編譯時保留原始陣列類型
8
+ */
3
9
  declare global {
4
10
  interface ArrayConstructor {
11
+ /**
12
+ * 檢查值是否為陣列,並返回類型斷言
13
+ * Check if value is an array and return type predicate
14
+ *
15
+ * @param arg - 要檢查的值 / Value to check
16
+ * @returns 是否為陣列的類型斷言 / Type predicate indicating if it's an array
17
+ */
5
18
  isArray<T extends ITSArrayListMaybeReadonly<any>>(arg: T | unknown): arg is T;
6
19
  }
7
20
  }
21
+ /**
22
+ * 檢查值是否為陣列(類型斷言版本)
23
+ * Check if value is an array (type predicate version)
24
+ *
25
+ * @param arg - 要檢查的值 / Value to check
26
+ * @returns 是否為輸入類型的類型斷言 / Type predicate of input type
27
+ */
8
28
  export declare function isArray<T extends ITSArrayListMaybeReadonly<any>>(arg: T | unknown): arg is T;
29
+ /**
30
+ * 斷言值為可變陣列(不包含 readonly 屬性)
31
+ * Assert value as writable array (without readonly attribute)
32
+ *
33
+ * @param value - 要斷言的值 / Value to assert
34
+ * @throws 當值不是陣列時拋出錯誤 / Throws error when value is not an array
35
+ */
9
36
  export declare function typePredicatesAsWriteableArray<T extends ITSArrayListMaybeReadonly<any>>(value: T): asserts value is ITSToWriteableArray<T>;
37
+ /**
38
+ * 斷言值為唯讀陣列
39
+ * Assert value as readonly array
40
+ *
41
+ * @param value - 要斷言的值 / Value to assert
42
+ * @throws 當值不是陣列時拋出錯誤 / Throws error when value is not an array
43
+ */
10
44
  export declare function typePredicatesAsReadonlyArray<T extends ITSArrayListMaybeReadonly<any>>(value: T): asserts value is ITSToReadonlyArray<T>;
45
+ /**
46
+ * 斷言並驗證值為陣列,否則拋出錯誤
47
+ * Assert and validate that value is an array, otherwise throw error
48
+ *
49
+ * @param actual - 要驗證的值 / Value to validate
50
+ * @param message - 自訂錯誤訊息(可選)/ Custom error message (optional)
51
+ * @throws 當值不是陣列時拋出 AssertionError / Throws AssertionError when value is not an array
52
+ */
11
53
  export declare function isArrayPredicates<T extends ITSArrayListMaybeReadonly<any>>(actual: T | unknown, message?: string): asserts actual is T;
12
54
  export { isArray as isArrayNarrowed };
13
55
  export default isArray;
@@ -1 +1 @@
1
- {"version":3,"file":"index.esm.mjs","sources":["../src/index.ts"],"sourcesContent":["import { ITSArrayListMaybeReadonly } from 'ts-type/lib/type/base';\nimport { AssertionError } from 'assert';\nimport { ITSToReadonlyArray, ITSToWriteableArray } from 'ts-type/lib/helper/array/readonly';\n\ndeclare global\n{\n\tinterface ArrayConstructor\n\t{\n\t\tisArray<T extends ITSArrayListMaybeReadonly<any>>(arg: T | unknown): arg is T\n\t}\n}\n\nexport function isArray<T extends ITSArrayListMaybeReadonly<any>>(arg: T | unknown): arg is T\n{\n\treturn Array.isArray(arg)\n}\n\n// @ts-ignore\nexport function typePredicatesAsWriteableArray<T extends ITSArrayListMaybeReadonly<any>>(value: T): asserts value is ITSToWriteableArray<T>\n{\n\n}\n\n// @ts-ignore\nexport function typePredicatesAsReadonlyArray<T extends ITSArrayListMaybeReadonly<any>>(value: T): asserts value is ITSToReadonlyArray<T>\n{\n\n}\n\nexport function isArrayPredicates<T extends ITSArrayListMaybeReadonly<any>>(actual: T | unknown, message?: string): asserts actual is T\n{\n\tconst expression = Array.isArray(actual);\n\tif (!expression)\n\t{\n\t\tthrow new AssertionError({\n\t\t\tmessage: message ?? `actual ${actual} not as expected`,\n\t\t\tactual,\n\t\t\texpected: expression,\n\t\t\toperator: 'fail',\n\t\t})\n\t}\n}\n\nexport { isArray as isArrayNarrowed }\n\nexport default isArray\n"],"names":["typePredicatesAsWriteableArray","value","typePredicatesAsReadonlyArray","expression","Array","isArray","actual","message"],"mappings":";;;;AAYA;;AAuBYA,SAAAA,+BAA6CC,IAAA;;AAGtD,SAHAC,8BAAAD,IAAA;;;EAKD,MAAAE,IAAAC,MAAAC,QAAAC;EACF,KAACH;IAADI;;;;;;;"}
1
+ {"version":3,"file":"index.esm.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;"}
@@ -4,14 +4,44 @@
4
4
  (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.TsTypeIsArray = {}, global.assert));
5
5
  })(this, (function (exports, assert) { 'use strict';
6
6
 
7
+ /**
8
+ * 檢查值是否為陣列(類型斷言版本)
9
+ * Check if value is an array (type predicate version)
10
+ *
11
+ * @param arg - 要檢查的值 / Value to check
12
+ * @returns 是否為輸入類型的類型斷言 / Type predicate of input type
13
+ */
7
14
  function isArray(arg) {
8
15
  return Array.isArray(arg);
9
16
  }
17
+ /**
18
+ * 斷言值為可變陣列(不包含 readonly 屬性)
19
+ * Assert value as writable array (without readonly attribute)
20
+ *
21
+ * @param value - 要斷言的值 / Value to assert
22
+ * @throws 當值不是陣列時拋出錯誤 / Throws error when value is not an array
23
+ */
24
+ // @ts-ignore
10
25
  function typePredicatesAsWriteableArray(value) {}
26
+ /**
27
+ * 斷言值為唯讀陣列
28
+ * Assert value as readonly array
29
+ *
30
+ * @param value - 要斷言的值 / Value to assert
31
+ * @throws 當值不是陣列時拋出錯誤 / Throws error when value is not an array
32
+ */
33
+ // @ts-ignore
11
34
  function typePredicatesAsReadonlyArray(value) {}
35
+ /**
36
+ * 斷言並驗證值為陣列,否則拋出錯誤
37
+ * Assert and validate that value is an array, otherwise throw error
38
+ *
39
+ * @param actual - 要驗證的值 / Value to validate
40
+ * @param message - 自訂錯誤訊息(可選)/ Custom error message (optional)
41
+ * @throws 當值不是陣列時拋出 AssertionError / Throws AssertionError when value is not an array
42
+ */
12
43
  function isArrayPredicates(actual, message) {
13
44
  const expression = Array.isArray(actual);
14
-
15
45
  if (!expression) {
16
46
  throw new assert.AssertionError({
17
47
  message: message !== null && message !== void 0 ? message : `actual ${actual} not as expected`,
@@ -22,7 +52,7 @@
22
52
  }
23
53
  }
24
54
 
25
- exports["default"] = isArray;
55
+ exports.default = isArray;
26
56
  exports.isArray = isArray;
27
57
  exports.isArrayNarrowed = isArray;
28
58
  exports.isArrayPredicates = isArrayPredicates;
@@ -1 +1 @@
1
- {"version":3,"file":"index.umd.development.cjs","sources":["../src/index.ts"],"sourcesContent":["import { ITSArrayListMaybeReadonly } from 'ts-type/lib/type/base';\nimport { AssertionError } from 'assert';\nimport { ITSToReadonlyArray, ITSToWriteableArray } from 'ts-type/lib/helper/array/readonly';\n\ndeclare global\n{\n\tinterface ArrayConstructor\n\t{\n\t\tisArray<T extends ITSArrayListMaybeReadonly<any>>(arg: T | unknown): arg is T\n\t}\n}\n\nexport function isArray<T extends ITSArrayListMaybeReadonly<any>>(arg: T | unknown): arg is T\n{\n\treturn Array.isArray(arg)\n}\n\n// @ts-ignore\nexport function typePredicatesAsWriteableArray<T extends ITSArrayListMaybeReadonly<any>>(value: T): asserts value is ITSToWriteableArray<T>\n{\n\n}\n\n// @ts-ignore\nexport function typePredicatesAsReadonlyArray<T extends ITSArrayListMaybeReadonly<any>>(value: T): asserts value is ITSToReadonlyArray<T>\n{\n\n}\n\nexport function isArrayPredicates<T extends ITSArrayListMaybeReadonly<any>>(actual: T | unknown, message?: string): asserts actual is T\n{\n\tconst expression = Array.isArray(actual);\n\tif (!expression)\n\t{\n\t\tthrow new AssertionError({\n\t\t\tmessage: message ?? `actual ${actual} not as expected`,\n\t\t\tactual,\n\t\t\texpected: expression,\n\t\t\toperator: 'fail',\n\t\t})\n\t}\n}\n\nexport { isArray as isArrayNarrowed }\n\nexport default isArray\n"],"names":["typePredicatesAsWriteableArray","value","expression","message"],"mappings":";;;;;;;;CAYA,CAAA;CAuBYA,SAAAA,8BAAT,CAAsDC,KAAtD,EAAsD,EAAA;CAGtD,SAHA,6BAAA,CAAA,KAAA,EAAA,EAAA;;CAKD,EAAA,MAAA,UAAA,GAAA,KAAA,CAAA,OAAA,CAAA,MAAA,CAAA,CAAA;;CACF,EAAA,IAAA,CAACC,UAAD,EAAC;;OAADC;;;;;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"index.umd.development.cjs","sources":["../src/index.ts"],"sourcesContent":["import { ITSArrayListMaybeReadonly } from 'ts-type/lib/type/base';\nimport { AssertionError } from 'assert';\nimport { ITSToReadonlyArray, ITSToWriteableArray } from 'ts-type/lib/helper/array/readonly';\n\n/**\n * 擴展 ArrayConstructor.isArray 方法,支援更精確的類型斷言\n * Extend ArrayConstructor.isArray method for more precise type predicate\n *\n * 允許在運行時檢查值是否為陣列,並在編譯時保留原始陣列類型\n */\ndeclare global\n{\n\tinterface ArrayConstructor\n\t{\n\t\t/**\n\t\t * 檢查值是否為陣列,並返回類型斷言\n\t\t * Check if value is an array and return type predicate\n\t\t *\n\t\t * @param arg - 要檢查的值 / Value to check\n\t\t * @returns 是否為陣列的類型斷言 / Type predicate indicating if it's an array\n\t\t */\n\t\tisArray<T extends ITSArrayListMaybeReadonly<any>>(arg: T | unknown): arg is T\n\t}\n}\n\n/**\n * 檢查值是否為陣列(類型斷言版本)\n * Check if value is an array (type predicate version)\n *\n * @param arg - 要檢查的值 / Value to check\n * @returns 是否為輸入類型的類型斷言 / Type predicate of input type\n */\nexport function isArray<T extends ITSArrayListMaybeReadonly<any>>(arg: T | unknown): arg is T\n{\n\treturn Array.isArray(arg)\n}\n\n/**\n * 斷言值為可變陣列(不包含 readonly 屬性)\n * Assert value as writable array (without readonly attribute)\n *\n * @param value - 要斷言的值 / Value to assert\n * @throws 當值不是陣列時拋出錯誤 / Throws error when value is not an array\n */\n// @ts-ignore\nexport function typePredicatesAsWriteableArray<T extends ITSArrayListMaybeReadonly<any>>(value: T): asserts value is ITSToWriteableArray<T>\n{\n\n}\n\n/**\n * 斷言值為唯讀陣列\n * Assert value as readonly array\n *\n * @param value - 要斷言的值 / Value to assert\n * @throws 當值不是陣列時拋出錯誤 / Throws error when value is not an array\n */\n// @ts-ignore\nexport function typePredicatesAsReadonlyArray<T extends ITSArrayListMaybeReadonly<any>>(value: T): asserts value is ITSToReadonlyArray<T>\n{\n\n}\n\n/**\n * 斷言並驗證值為陣列,否則拋出錯誤\n * Assert and validate that value is an array, otherwise throw error\n *\n * @param actual - 要驗證的值 / Value to validate\n * @param message - 自訂錯誤訊息(可選)/ Custom error message (optional)\n * @throws 當值不是陣列時拋出 AssertionError / Throws AssertionError when value is not an array\n */\nexport function isArrayPredicates<T extends ITSArrayListMaybeReadonly<any>>(actual: T | unknown, message?: string): asserts actual is T\n{\n\tconst expression = Array.isArray(actual);\n\tif (!expression)\n\t{\n\t\tthrow new AssertionError({\n\t\t\tmessage: message ?? `actual ${actual} not as expected`,\n\t\t\tactual,\n\t\t\texpected: expression,\n\t\t\toperator: 'fail',\n\t\t})\n\t}\n}\n\nexport { isArray as isArrayNarrowed }\n\nexport default isArray\n"],"names":[],"mappings":";;;;;;;;;CA+EG;;;CAtDH;;;;;;;;;;;;;;;;;;CAsDG;;CAMH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
@@ -1,2 +1,22 @@
1
- !function(e,r){"object"==typeof exports&&"undefined"!=typeof module?r(exports,require("assert")):"function"==typeof define&&define.amd?define(["exports","assert"],r):r((e="undefined"!=typeof globalThis?globalThis:e||self).TsTypeIsArray={},e.assert)}(this,(function(e,r){"use strict";function isArray(e){return Array.isArray(e)}e.default=isArray,e.isArray=isArray,e.isArrayNarrowed=isArray,e.isArrayPredicates=function isArrayPredicates(e,t){const a=Array.isArray(e);if(!a)throw new r.AssertionError({message:null!=t?t:`actual ${e} not as expected`,actual:e,expected:a,operator:"fail"})},e.typePredicatesAsReadonlyArray=function typePredicatesAsReadonlyArray(e){},e.typePredicatesAsWriteableArray=function typePredicatesAsWriteableArray(e){},Object.defineProperty(e,"__esModule",{value:!0})}));
1
+ !function(e, r) {
2
+ "object" == typeof exports && "undefined" != typeof module ? r(exports, require("assert")) : "function" == typeof define && define.amd ? define([ "exports", "assert" ], r) : r((e = "undefined" != typeof globalThis ? globalThis : e || self).TsTypeIsArray = {}, e.assert);
3
+ }(this, function(e, r) {
4
+ "use strict";
5
+ function isArray(e) {
6
+ return Array.isArray(e);
7
+ }
8
+ e.default = isArray, e.isArray = isArray, e.isArrayNarrowed = isArray, e.isArrayPredicates = function isArrayPredicates(e, t) {
9
+ const a = Array.isArray(e);
10
+ if (!a) throw new r.AssertionError({
11
+ message: null != t ? t : `actual ${e} not as expected`,
12
+ actual: e,
13
+ expected: a,
14
+ operator: "fail"
15
+ });
16
+ }, e.typePredicatesAsReadonlyArray = function typePredicatesAsReadonlyArray(e) {},
17
+ e.typePredicatesAsWriteableArray = function typePredicatesAsWriteableArray(e) {},
18
+ Object.defineProperty(e, "__esModule", {
19
+ value: !0
20
+ });
21
+ });
2
22
  //# sourceMappingURL=index.umd.production.min.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.umd.production.min.cjs","sources":["../src/index.ts"],"sourcesContent":["import { ITSArrayListMaybeReadonly } from 'ts-type/lib/type/base';\nimport { AssertionError } from 'assert';\nimport { ITSToReadonlyArray, ITSToWriteableArray } from 'ts-type/lib/helper/array/readonly';\n\ndeclare global\n{\n\tinterface ArrayConstructor\n\t{\n\t\tisArray<T extends ITSArrayListMaybeReadonly<any>>(arg: T | unknown): arg is T\n\t}\n}\n\nexport function isArray<T extends ITSArrayListMaybeReadonly<any>>(arg: T | unknown): arg is T\n{\n\treturn Array.isArray(arg)\n}\n\n// @ts-ignore\nexport function typePredicatesAsWriteableArray<T extends ITSArrayListMaybeReadonly<any>>(value: T): asserts value is ITSToWriteableArray<T>\n{\n\n}\n\n// @ts-ignore\nexport function typePredicatesAsReadonlyArray<T extends ITSArrayListMaybeReadonly<any>>(value: T): asserts value is ITSToReadonlyArray<T>\n{\n\n}\n\nexport function isArrayPredicates<T extends ITSArrayListMaybeReadonly<any>>(actual: T | unknown, message?: string): asserts actual is T\n{\n\tconst expression = Array.isArray(actual);\n\tif (!expression)\n\t{\n\t\tthrow new AssertionError({\n\t\t\tmessage: message ?? `actual ${actual} not as expected`,\n\t\t\tactual,\n\t\t\texpected: expression,\n\t\t\toperator: 'fail',\n\t\t})\n\t}\n}\n\nexport { isArray as isArrayNarrowed }\n\nexport default isArray\n"],"names":["expression","Array","isArray","actual","message","typePredicatesAsReadonlyArray","value","typePredicatesAsWriteableArray"],"mappings":"sUAYA,mHA4BE,MAAAA,EAAAC,MAAAC,QAAAC,GACF,IAACH,8BAADI,uHAHG,SAHAC,8BAAAC,GAAA,mCAASC,SAAAA,+BAA6CD,GAAA"}
1
+ {"version":3,"file":"index.umd.production.min.cjs","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;"}
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@ts-type/is-array",
3
- "version": "1.0.6",
4
- "description": "better typescript type for Array.isArray",
3
+ "version": "1.0.7",
4
+ "description": "增強的陣列類型斷言與驗證工具 | Enhanced array type predicates and validation utilities",
5
5
  "keywords": [
6
6
  ".d.ts",
7
7
  "@types",
@@ -43,8 +43,8 @@
43
43
  "exports": {
44
44
  ".": {
45
45
  "types": "./dist/index.d.ts",
46
- "import": "./dist/index.esm.mjs",
47
- "require": "./dist/index.cjs"
46
+ "require": "./dist/index.cjs",
47
+ "import": "./dist/index.esm.mjs"
48
48
  },
49
49
  "./package.json": "./package.json"
50
50
  },
@@ -61,13 +61,14 @@
61
61
  "lint": "yarn run lint:eslint",
62
62
  "lint:eslint": "ynpx eslint --ext .ts,.tsx,.mts,.cts ./",
63
63
  "pretest": "echo pretest",
64
- "test": "ts-node ./test/spec/issues-17002.spec.ts",
64
+ "test": "tsx ./test/spec/issues-17002.spec.ts",
65
65
  "test:jest": "jest --passWithNoTests",
66
+ "test:jest:coverage": "node --run test:jest -- --coverage",
66
67
  "test:jest:snapshot": "yarn run test:jest -- -u",
67
68
  "test:mocha": "ynpx --quiet -p ts-node -p mocha mocha -- --require ts-node/register \"!(node_modules)/**/*.{test,spec}.{ts,tsx}\"",
68
69
  "test:snapshot": "yarn run test -- -u",
69
70
  "test:tsd": "ynpx tsd",
70
- "test:tsdx": "ynpx @bluelovers/tsdx test --passWithNoTests",
71
+ "test:tsdx": "tsdx test --passWithNoTests",
71
72
  "posttest": "yarn run build",
72
73
  "build": "yarn run build:tsdx && yarn run build:dts:tsc",
73
74
  "build:dts:bundle": "ynpx dts-bundle-generator -o ./dist/index.d.ts ./src/index.ts --no-banner --inline-declare-global --inline-declare-externals & echo build:dts",
@@ -75,7 +76,7 @@
75
76
  "build:dts:tsc": "yarn run build:dts:tsc:emit && yarn run build:dts:copy",
76
77
  "build:dts:tsc:emit": "tsc --emitDeclarationOnly --declaration --noEmit false",
77
78
  "build:microbundle": "ynpx microbundle --target node",
78
- "build:tsdx": "ynpx @bluelovers/tsdx build --target node --name index",
79
+ "build:tsdx": "tsdx build --target node --name index",
79
80
  "ci:install": "echo ci:install",
80
81
  "ci:build": "echo ci:build",
81
82
  "preversion": "echo preversion && yarn run test",
@@ -96,11 +97,10 @@
96
97
  "tsc:showConfig": "ynpx get-current-tsconfig -p"
97
98
  },
98
99
  "dependencies": {
99
- "ts-type": "^3.0.1"
100
+ "ts-type": "^3.0.2"
100
101
  },
101
- "packageManager": "yarn@^1.22.11",
102
102
  "publishConfig": {
103
103
  "access": "public"
104
104
  },
105
- "gitHead": "fa34eea119b9bcbb363061ddffcfe9d78c2d0ddd"
105
+ "gitHead": "57f82cba146cfef0d0f3f138e5ec736cd17f040d"
106
106
  }
package/src/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["index.ts"],"names":[],"mappings":";;;AACA,mCAAwC;AAWxC,SAAgB,OAAO,CAA2C,GAAgB;IAEjF,OAAO,KAAK,CAAC,OAAO,CAAC,GAAG,CAAC,CAAA;AAC1B,CAAC;AAHD,0BAGC;AA4BmB,kCAAe;AA1BnC,aAAa;AACb,SAAgB,8BAA8B,CAA2C,KAAQ;AAGjG,CAAC;AAHD,wEAGC;AAED,aAAa;AACb,SAAgB,6BAA6B,CAA2C,KAAQ;AAGhG,CAAC;AAHD,sEAGC;AAED,SAAgB,iBAAiB,CAA2C,MAAmB,EAAE,OAAgB;IAEhH,MAAM,UAAU,GAAG,KAAK,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC;IACzC,IAAI,CAAC,UAAU,EACf;QACC,MAAM,IAAI,uBAAc,CAAC;YACxB,OAAO,EAAE,OAAO,aAAP,OAAO,cAAP,OAAO,GAAI,UAAU,MAAM,kBAAkB;YACtD,MAAM;YACN,QAAQ,EAAE,UAAU;YACpB,QAAQ,EAAE,MAAM;SAChB,CAAC,CAAA;KACF;AACF,CAAC;AAZD,8CAYC;AAID,kBAAe,OAAO,CAAA","sourcesContent":["import { ITSArrayListMaybeReadonly } from 'ts-type/lib/type/base';\nimport { AssertionError } from 'assert';\nimport { ITSToReadonlyArray, ITSToWriteableArray } from 'ts-type/lib/helper/array/readonly';\n\ndeclare global\n{\n\tinterface ArrayConstructor\n\t{\n\t\tisArray<T extends ITSArrayListMaybeReadonly<any>>(arg: T | unknown): arg is T\n\t}\n}\n\nexport function isArray<T extends ITSArrayListMaybeReadonly<any>>(arg: T | unknown): arg is T\n{\n\treturn Array.isArray(arg)\n}\n\n// @ts-ignore\nexport function typePredicatesAsWriteableArray<T extends ITSArrayListMaybeReadonly<any>>(value: T): asserts value is ITSToWriteableArray<T>\n{\n\n}\n\n// @ts-ignore\nexport function typePredicatesAsReadonlyArray<T extends ITSArrayListMaybeReadonly<any>>(value: T): asserts value is ITSToReadonlyArray<T>\n{\n\n}\n\nexport function isArrayPredicates<T extends ITSArrayListMaybeReadonly<any>>(actual: T | unknown, message?: string): asserts actual is T\n{\n\tconst expression = Array.isArray(actual);\n\tif (!expression)\n\t{\n\t\tthrow new AssertionError({\n\t\t\tmessage: message ?? `actual ${actual} not as expected`,\n\t\t\tactual,\n\t\t\texpected: expression,\n\t\t\toperator: 'fail',\n\t\t})\n\t}\n}\n\nexport { isArray as isArrayNarrowed }\n\nexport default isArray\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["index.ts"],"names":[],"mappings":";;AAgCA,0BAGC;AAkDmB,kCAAe;AAxCnC,wEAGC;AAUD,sEAGC;AAUD,8CAYC;AAlFD,mCAAwC;AAwBxC;;;;;;GAMG;AACH,SAAgB,OAAO,CAA2C,GAAgB;IAEjF,OAAO,KAAK,CAAC,OAAO,CAAC,GAAG,CAAC,CAAA;AAC1B,CAAC;AAED;;;;;;GAMG;AACH,aAAa;AACb,SAAgB,8BAA8B,CAA2C,KAAQ;AAGjG,CAAC;AAED;;;;;;GAMG;AACH,aAAa;AACb,SAAgB,6BAA6B,CAA2C,KAAQ;AAGhG,CAAC;AAED;;;;;;;GAOG;AACH,SAAgB,iBAAiB,CAA2C,MAAmB,EAAE,OAAgB;IAEhH,MAAM,UAAU,GAAG,KAAK,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC;IACzC,IAAI,CAAC,UAAU,EACf,CAAC;QACA,MAAM,IAAI,uBAAc,CAAC;YACxB,OAAO,EAAE,OAAO,aAAP,OAAO,cAAP,OAAO,GAAI,UAAU,MAAM,kBAAkB;YACtD,MAAM;YACN,QAAQ,EAAE,UAAU;YACpB,QAAQ,EAAE,MAAM;SAChB,CAAC,CAAA;IACH,CAAC;AACF,CAAC;AAID,kBAAe,OAAO,CAAA","sourcesContent":["import { ITSArrayListMaybeReadonly } from 'ts-type/lib/type/base';\nimport { AssertionError } from 'assert';\nimport { ITSToReadonlyArray, ITSToWriteableArray } from 'ts-type/lib/helper/array/readonly';\n\n/**\n * 擴展 ArrayConstructor.isArray 方法,支援更精確的類型斷言\n * Extend ArrayConstructor.isArray method for more precise type predicate\n *\n * 允許在運行時檢查值是否為陣列,並在編譯時保留原始陣列類型\n */\ndeclare global\n{\n\tinterface ArrayConstructor\n\t{\n\t\t/**\n\t\t * 檢查值是否為陣列,並返回類型斷言\n\t\t * Check if value is an array and return type predicate\n\t\t *\n\t\t * @param arg - 要檢查的值 / Value to check\n\t\t * @returns 是否為陣列的類型斷言 / Type predicate indicating if it's an array\n\t\t */\n\t\tisArray<T extends ITSArrayListMaybeReadonly<any>>(arg: T | unknown): arg is T\n\t}\n}\n\n/**\n * 檢查值是否為陣列(類型斷言版本)\n * Check if value is an array (type predicate version)\n *\n * @param arg - 要檢查的值 / Value to check\n * @returns 是否為輸入類型的類型斷言 / Type predicate of input type\n */\nexport function isArray<T extends ITSArrayListMaybeReadonly<any>>(arg: T | unknown): arg is T\n{\n\treturn Array.isArray(arg)\n}\n\n/**\n * 斷言值為可變陣列(不包含 readonly 屬性)\n * Assert value as writable array (without readonly attribute)\n *\n * @param value - 要斷言的值 / Value to assert\n * @throws 當值不是陣列時拋出錯誤 / Throws error when value is not an array\n */\n// @ts-ignore\nexport function typePredicatesAsWriteableArray<T extends ITSArrayListMaybeReadonly<any>>(value: T): asserts value is ITSToWriteableArray<T>\n{\n\n}\n\n/**\n * 斷言值為唯讀陣列\n * Assert value as readonly array\n *\n * @param value - 要斷言的值 / Value to assert\n * @throws 當值不是陣列時拋出錯誤 / Throws error when value is not an array\n */\n// @ts-ignore\nexport function typePredicatesAsReadonlyArray<T extends ITSArrayListMaybeReadonly<any>>(value: T): asserts value is ITSToReadonlyArray<T>\n{\n\n}\n\n/**\n * 斷言並驗證值為陣列,否則拋出錯誤\n * Assert and validate that value is an array, otherwise throw error\n *\n * @param actual - 要驗證的值 / Value to validate\n * @param message - 自訂錯誤訊息(可選)/ Custom error message (optional)\n * @throws 當值不是陣列時拋出 AssertionError / Throws AssertionError when value is not an array\n */\nexport function isArrayPredicates<T extends ITSArrayListMaybeReadonly<any>>(actual: T | unknown, message?: string): asserts actual is T\n{\n\tconst expression = Array.isArray(actual);\n\tif (!expression)\n\t{\n\t\tthrow new AssertionError({\n\t\t\tmessage: message ?? `actual ${actual} not as expected`,\n\t\t\tactual,\n\t\t\texpected: expression,\n\t\t\toperator: 'fail',\n\t\t})\n\t}\n}\n\nexport { isArray as isArrayNarrowed }\n\nexport default isArray\n"]}
package/src/index.ts CHANGED
@@ -2,31 +2,73 @@ import { ITSArrayListMaybeReadonly } from 'ts-type/lib/type/base';
2
2
  import { AssertionError } from 'assert';
3
3
  import { ITSToReadonlyArray, ITSToWriteableArray } from 'ts-type/lib/helper/array/readonly';
4
4
 
5
+ /**
6
+ * 擴展 ArrayConstructor.isArray 方法,支援更精確的類型斷言
7
+ * Extend ArrayConstructor.isArray method for more precise type predicate
8
+ *
9
+ * 允許在運行時檢查值是否為陣列,並在編譯時保留原始陣列類型
10
+ */
5
11
  declare global
6
12
  {
7
13
  interface ArrayConstructor
8
14
  {
15
+ /**
16
+ * 檢查值是否為陣列,並返回類型斷言
17
+ * Check if value is an array and return type predicate
18
+ *
19
+ * @param arg - 要檢查的值 / Value to check
20
+ * @returns 是否為陣列的類型斷言 / Type predicate indicating if it's an array
21
+ */
9
22
  isArray<T extends ITSArrayListMaybeReadonly<any>>(arg: T | unknown): arg is T
10
23
  }
11
24
  }
12
25
 
26
+ /**
27
+ * 檢查值是否為陣列(類型斷言版本)
28
+ * Check if value is an array (type predicate version)
29
+ *
30
+ * @param arg - 要檢查的值 / Value to check
31
+ * @returns 是否為輸入類型的類型斷言 / Type predicate of input type
32
+ */
13
33
  export function isArray<T extends ITSArrayListMaybeReadonly<any>>(arg: T | unknown): arg is T
14
34
  {
15
35
  return Array.isArray(arg)
16
36
  }
17
37
 
38
+ /**
39
+ * 斷言值為可變陣列(不包含 readonly 屬性)
40
+ * Assert value as writable array (without readonly attribute)
41
+ *
42
+ * @param value - 要斷言的值 / Value to assert
43
+ * @throws 當值不是陣列時拋出錯誤 / Throws error when value is not an array
44
+ */
18
45
  // @ts-ignore
19
46
  export function typePredicatesAsWriteableArray<T extends ITSArrayListMaybeReadonly<any>>(value: T): asserts value is ITSToWriteableArray<T>
20
47
  {
21
48
 
22
49
  }
23
50
 
51
+ /**
52
+ * 斷言值為唯讀陣列
53
+ * Assert value as readonly array
54
+ *
55
+ * @param value - 要斷言的值 / Value to assert
56
+ * @throws 當值不是陣列時拋出錯誤 / Throws error when value is not an array
57
+ */
24
58
  // @ts-ignore
25
59
  export function typePredicatesAsReadonlyArray<T extends ITSArrayListMaybeReadonly<any>>(value: T): asserts value is ITSToReadonlyArray<T>
26
60
  {
27
61
 
28
62
  }
29
63
 
64
+ /**
65
+ * 斷言並驗證值為陣列,否則拋出錯誤
66
+ * Assert and validate that value is an array, otherwise throw error
67
+ *
68
+ * @param actual - 要驗證的值 / Value to validate
69
+ * @param message - 自訂錯誤訊息(可選)/ Custom error message (optional)
70
+ * @throws 當值不是陣列時拋出 AssertionError / Throws AssertionError when value is not an array
71
+ */
30
72
  export function isArrayPredicates<T extends ITSArrayListMaybeReadonly<any>>(actual: T | unknown, message?: string): asserts actual is T
31
73
  {
32
74
  const expression = Array.isArray(actual);