@odinlin/utils 0.0.2 → 1.0.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/README.md +16 -20
- package/dist/browser/_virtual/rolldown_runtime.cjs +29 -0
- package/dist/browser/array/arrayCast.cjs +29 -0
- package/dist/browser/array/arrayCast.d.ts +27 -0
- package/dist/browser/array/arrayCast.d.ts.map +1 -0
- package/dist/browser/array/arrayCast.js +30 -0
- package/dist/browser/array/arrayCast.js.map +1 -0
- package/dist/browser/array/index.cjs +3 -0
- package/dist/browser/array/index.d.ts +2 -0
- package/dist/browser/array/index.js +3 -0
- package/dist/browser/browser.cjs +196 -0
- package/dist/browser/browser.d.ts +37 -0
- package/dist/browser/browser.js +30 -0
- package/dist/browser/constants/index.cjs +19 -0
- package/dist/browser/constants/index.d.ts +16 -0
- package/dist/browser/constants/index.d.ts.map +1 -0
- package/dist/browser/constants/index.js +17 -0
- package/dist/browser/constants/index.js.map +1 -0
- package/dist/browser/date/index.cjs +8 -0
- package/dist/browser/date/index.d.ts +3 -0
- package/dist/browser/date/index.js +4 -0
- package/dist/browser/date/prettyMs.cjs +9 -0
- package/dist/browser/date/prettyMs.d.ts +8 -0
- package/dist/browser/date/prettyMs.d.ts.map +1 -0
- package/dist/browser/date/prettyMs.js +8 -0
- package/dist/browser/date/prettyMs.js.map +1 -0
- package/dist/browser/date/timeAgo.cjs +14 -0
- package/dist/browser/date/timeAgo.d.ts +15 -0
- package/dist/browser/date/timeAgo.d.ts.map +1 -0
- package/dist/browser/date/timeAgo.js +11 -0
- package/dist/browser/date/timeAgo.js.map +1 -0
- package/dist/browser/file/browser.cjs +25 -0
- package/dist/browser/file/browser.d.ts +7 -0
- package/dist/browser/file/browser.js +7 -0
- package/dist/browser/file/fileBuffer.browser.cjs +115 -0
- package/dist/browser/file/fileBuffer.browser.d.ts +88 -0
- package/dist/browser/file/fileBuffer.browser.d.ts.map +1 -0
- package/dist/browser/file/fileBuffer.browser.js +115 -0
- package/dist/browser/file/fileBuffer.browser.js.map +1 -0
- package/dist/browser/file/fileBytes.cjs +9 -0
- package/dist/browser/file/fileBytes.d.ts +8 -0
- package/dist/browser/file/fileBytes.d.ts.map +1 -0
- package/dist/browser/file/fileBytes.js +8 -0
- package/dist/browser/file/fileBytes.js.map +1 -0
- package/dist/browser/file/fileType.browser.cjs +22 -0
- package/dist/browser/file/fileType.browser.d.ts +19 -0
- package/dist/browser/file/fileType.browser.d.ts.map +1 -0
- package/dist/browser/file/fileType.browser.js +15 -0
- package/dist/browser/file/fileType.browser.js.map +1 -0
- package/dist/browser/file/fileXml.browser.cjs +8 -0
- package/dist/browser/file/fileXml.browser.d.ts +12 -0
- package/dist/browser/file/fileXml.browser.d.ts.map +1 -0
- package/dist/browser/file/fileXml.browser.js +7 -0
- package/dist/browser/file/fileXml.browser.js.map +1 -0
- package/dist/browser/file/interface.d.ts +26 -0
- package/dist/browser/file/interface.d.ts.map +1 -0
- package/dist/browser/function/index.cjs +10 -0
- package/dist/browser/function/index.d.ts +8 -0
- package/dist/browser/function/index.d.ts.map +1 -0
- package/dist/browser/function/index.js +9 -0
- package/dist/browser/function/index.js.map +1 -0
- package/dist/browser/is/index.cjs +42 -0
- package/dist/browser/is/index.d.ts +7 -0
- package/dist/browser/is/index.js +8 -0
- package/dist/browser/is/isJSON.cjs +44 -0
- package/dist/browser/is/isJSON.d.ts +30 -0
- package/dist/browser/is/isJSON.d.ts.map +1 -0
- package/dist/browser/is/isJSON.js +41 -0
- package/dist/browser/is/isJSON.js.map +1 -0
- package/dist/browser/is/isPlatform.cjs +20 -0
- package/dist/browser/is/isPlatform.d.ts +16 -0
- package/dist/browser/is/isPlatform.d.ts.map +1 -0
- package/dist/browser/is/isPlatform.js +19 -0
- package/dist/browser/is/isPlatform.js.map +1 -0
- package/dist/browser/is/isPrimitive.cjs +91 -0
- package/dist/browser/is/isPrimitive.d.ts +79 -0
- package/dist/browser/is/isPrimitive.d.ts.map +1 -0
- package/dist/browser/is/isPrimitive.js +79 -0
- package/dist/browser/is/isPrimitive.js.map +1 -0
- package/dist/browser/is/isPrimitiveWithout.cjs +86 -0
- package/dist/browser/is/isPrimitiveWithout.d.ts +72 -0
- package/dist/browser/is/isPrimitiveWithout.d.ts.map +1 -0
- package/dist/browser/is/isPrimitiveWithout.js +74 -0
- package/dist/browser/is/isPrimitiveWithout.js.map +1 -0
- package/dist/browser/is/isTagOf.cjs +21 -0
- package/dist/browser/is/isTagOf.d.ts +12 -0
- package/dist/browser/is/isTagOf.d.ts.map +1 -0
- package/dist/browser/is/isTagOf.js +21 -0
- package/dist/browser/is/isTagOf.js.map +1 -0
- package/dist/browser/is/isTypeOf.cjs +29 -0
- package/dist/browser/is/isTypeOf.d.ts +16 -0
- package/dist/browser/is/isTypeOf.d.ts.map +1 -0
- package/dist/browser/is/isTypeOf.js +28 -0
- package/dist/browser/is/isTypeOf.js.map +1 -0
- package/dist/browser/object/index.cjs +3 -0
- package/dist/browser/object/index.d.ts +2 -0
- package/dist/browser/object/index.js +3 -0
- package/dist/browser/object/objectClone.cjs +22 -0
- package/dist/browser/object/objectClone.d.ts +8 -0
- package/dist/browser/object/objectClone.d.ts.map +1 -0
- package/dist/browser/object/objectClone.js +22 -0
- package/dist/browser/object/objectClone.js.map +1 -0
- package/dist/browser/promise/awaitTo.cjs +8 -0
- package/dist/browser/promise/awaitTo.d.ts +7 -0
- package/dist/browser/promise/awaitTo.d.ts.map +1 -0
- package/dist/browser/promise/awaitTo.js +8 -0
- package/dist/browser/promise/awaitTo.js.map +1 -0
- package/dist/browser/promise/index.cjs +6 -0
- package/dist/browser/promise/index.d.ts +3 -0
- package/dist/browser/promise/index.js +4 -0
- package/dist/browser/promise/pLimit.cjs +11 -0
- package/dist/browser/promise/pLimit.d.ts +10 -0
- package/dist/browser/promise/pLimit.d.ts.map +1 -0
- package/dist/browser/promise/pLimit.js +9 -0
- package/dist/browser/promise/pLimit.js.map +1 -0
- package/dist/browser/regexp/OTHERS.cjs +16 -0
- package/dist/browser/regexp/OTHERS.d.ts +14 -0
- package/dist/browser/regexp/OTHERS.d.ts.map +1 -0
- package/dist/browser/regexp/OTHERS.js +15 -0
- package/dist/browser/regexp/OTHERS.js.map +1 -0
- package/dist/browser/regexp/RULES.cjs +698 -0
- package/dist/browser/regexp/RULES.d.ts +434 -0
- package/dist/browser/regexp/RULES.d.ts.map +1 -0
- package/dist/browser/regexp/RULES.js +615 -0
- package/dist/browser/regexp/RULES.js.map +1 -0
- package/dist/browser/regexp/index.cjs +89 -0
- package/dist/browser/regexp/index.d.ts +13 -0
- package/dist/browser/regexp/index.d.ts.map +1 -0
- package/dist/browser/regexp/index.js +4 -0
- package/dist/browser/request/browser.cjs +8 -0
- package/dist/browser/request/browser.d.ts +4 -0
- package/dist/browser/request/browser.js +4 -0
- package/dist/browser/request/instance.cjs +135 -0
- package/dist/browser/request/instance.d.ts +45 -0
- package/dist/browser/request/instance.d.ts.map +1 -0
- package/dist/browser/request/instance.js +134 -0
- package/dist/browser/request/instance.js.map +1 -0
- package/dist/browser/request/interceptors.browser.cjs +66 -0
- package/dist/browser/request/interceptors.browser.d.ts +25 -0
- package/dist/browser/request/interceptors.browser.d.ts.map +1 -0
- package/dist/browser/request/interceptors.browser.js +63 -0
- package/dist/browser/request/interceptors.browser.js.map +1 -0
- package/dist/browser/request/interface.d.ts +54 -0
- package/dist/browser/request/interface.d.ts.map +1 -0
- package/dist/browser/string/className.cjs +13 -0
- package/dist/browser/string/className.d.ts +11 -0
- package/dist/browser/string/className.d.ts.map +1 -0
- package/dist/browser/string/className.js +10 -0
- package/dist/browser/string/className.js.map +1 -0
- package/dist/browser/string/index.cjs +7 -0
- package/dist/browser/string/index.d.ts +3 -0
- package/dist/browser/string/index.js +4 -0
- package/dist/browser/string/proto.cjs +37 -0
- package/dist/browser/string/proto.d.ts +19 -0
- package/dist/browser/string/proto.d.ts.map +1 -0
- package/dist/browser/string/proto.js +36 -0
- package/dist/browser/string/proto.js.map +1 -0
- package/dist/browser/tree/index.cjs +7 -0
- package/dist/browser/tree/index.d.ts +5 -0
- package/dist/browser/tree/index.js +5 -0
- package/dist/browser/tree/interface.d.ts +40 -0
- package/dist/browser/tree/interface.d.ts.map +1 -0
- package/dist/browser/tree/treeFilter.cjs +58 -0
- package/dist/browser/tree/treeFilter.d.ts +14 -0
- package/dist/browser/tree/treeFilter.d.ts.map +1 -0
- package/dist/browser/tree/treeFilter.js +59 -0
- package/dist/browser/tree/treeFilter.js.map +1 -0
- package/dist/browser/tree/treeFlatten.cjs +23 -0
- package/dist/browser/tree/treeFlatten.d.ts +15 -0
- package/dist/browser/tree/treeFlatten.d.ts.map +1 -0
- package/dist/browser/tree/treeFlatten.js +24 -0
- package/dist/browser/tree/treeFlatten.js.map +1 -0
- package/dist/browser/tree/treeGenerate.cjs +37 -0
- package/dist/browser/tree/treeGenerate.d.ts +16 -0
- package/dist/browser/tree/treeGenerate.d.ts.map +1 -0
- package/dist/browser/tree/treeGenerate.js +37 -0
- package/dist/browser/tree/treeGenerate.js.map +1 -0
- package/dist/noExternal/browser.esm.html +94 -0
- package/dist/noExternal/browser.esm.js +10734 -0
- package/dist/noExternal/browser.esm.min.js +16 -0
- package/dist/noExternal/browser.esm.min.js.map +1 -0
- package/dist/noExternal/browser.umd.html +28 -0
- package/dist/noExternal/browser.umd.js +10905 -0
- package/dist/noExternal/browser.umd.min.js +16 -0
- package/dist/noExternal/browser.umd.min.js.map +1 -0
- package/dist/noExternal/node.cjs.js +18282 -0
- package/dist/noExternal/node.cjs.min.js +0 -0
- package/dist/noExternal/node.cjs.min.js.map +1 -0
- package/dist/noExternal/node.esm.js +21727 -0
- package/dist/noExternal/node.esm.min.js +36 -0
- package/dist/noExternal/node.esm.min.js.map +1 -0
- package/dist/node/_virtual/rolldown_runtime.cjs +29 -0
- package/dist/node/array/arrayCast.cjs +29 -0
- package/dist/node/array/arrayCast.d.ts +27 -0
- package/dist/node/array/arrayCast.d.ts.map +1 -0
- package/dist/node/array/arrayCast.js +30 -0
- package/dist/node/array/arrayCast.js.map +1 -0
- package/dist/node/array/index.cjs +3 -0
- package/dist/node/array/index.d.ts +2 -0
- package/dist/node/array/index.js +3 -0
- package/dist/node/constants/index.cjs +19 -0
- package/dist/node/constants/index.d.ts +16 -0
- package/dist/node/constants/index.d.ts.map +1 -0
- package/dist/node/constants/index.js +17 -0
- package/dist/node/constants/index.js.map +1 -0
- package/dist/node/date/index.cjs +8 -0
- package/dist/node/date/index.d.ts +3 -0
- package/dist/node/date/index.js +4 -0
- package/dist/node/date/prettyMs.cjs +9 -0
- package/dist/node/date/prettyMs.d.ts +8 -0
- package/dist/node/date/prettyMs.d.ts.map +1 -0
- package/dist/node/date/prettyMs.js +8 -0
- package/dist/node/date/prettyMs.js.map +1 -0
- package/dist/node/date/timeAgo.cjs +14 -0
- package/dist/node/date/timeAgo.d.ts +15 -0
- package/dist/node/date/timeAgo.d.ts.map +1 -0
- package/dist/node/date/timeAgo.js +11 -0
- package/dist/node/date/timeAgo.js.map +1 -0
- package/dist/node/file/fileBuffer.node.cjs +115 -0
- package/dist/node/file/fileBuffer.node.d.ts +88 -0
- package/dist/node/file/fileBuffer.node.d.ts.map +1 -0
- package/dist/node/file/fileBuffer.node.js +115 -0
- package/dist/node/file/fileBuffer.node.js.map +1 -0
- package/dist/node/file/fileBytes.cjs +9 -0
- package/dist/node/file/fileBytes.d.ts +8 -0
- package/dist/node/file/fileBytes.d.ts.map +1 -0
- package/dist/node/file/fileBytes.js +8 -0
- package/dist/node/file/fileBytes.js.map +1 -0
- package/dist/node/file/fileType.node.cjs +22 -0
- package/dist/node/file/fileType.node.d.ts +19 -0
- package/dist/node/file/fileType.node.d.ts.map +1 -0
- package/dist/node/file/fileType.node.js +15 -0
- package/dist/node/file/fileType.node.js.map +1 -0
- package/dist/node/file/fileXml.node.cjs +10 -0
- package/dist/node/file/fileXml.node.d.ts +8 -0
- package/dist/node/file/fileXml.node.d.ts.map +1 -0
- package/dist/node/file/fileXml.node.js +9 -0
- package/dist/node/file/fileXml.node.js.map +1 -0
- package/dist/node/file/interface.d.ts +26 -0
- package/dist/node/file/interface.d.ts.map +1 -0
- package/dist/node/file/node.cjs +25 -0
- package/dist/node/file/node.d.ts +7 -0
- package/dist/node/file/node.js +7 -0
- package/dist/node/function/index.cjs +10 -0
- package/dist/node/function/index.d.ts +8 -0
- package/dist/node/function/index.d.ts.map +1 -0
- package/dist/node/function/index.js +9 -0
- package/dist/node/function/index.js.map +1 -0
- package/dist/node/is/index.cjs +42 -0
- package/dist/node/is/index.d.ts +7 -0
- package/dist/node/is/index.js +8 -0
- package/dist/node/is/isJSON.cjs +44 -0
- package/dist/node/is/isJSON.d.ts +30 -0
- package/dist/node/is/isJSON.d.ts.map +1 -0
- package/dist/node/is/isJSON.js +41 -0
- package/dist/node/is/isJSON.js.map +1 -0
- package/dist/node/is/isPlatform.cjs +20 -0
- package/dist/node/is/isPlatform.d.ts +16 -0
- package/dist/node/is/isPlatform.d.ts.map +1 -0
- package/dist/node/is/isPlatform.js +19 -0
- package/dist/node/is/isPlatform.js.map +1 -0
- package/dist/node/is/isPrimitive.cjs +91 -0
- package/dist/node/is/isPrimitive.d.ts +79 -0
- package/dist/node/is/isPrimitive.d.ts.map +1 -0
- package/dist/node/is/isPrimitive.js +79 -0
- package/dist/node/is/isPrimitive.js.map +1 -0
- package/dist/node/is/isPrimitiveWithout.cjs +86 -0
- package/dist/node/is/isPrimitiveWithout.d.ts +72 -0
- package/dist/node/is/isPrimitiveWithout.d.ts.map +1 -0
- package/dist/node/is/isPrimitiveWithout.js +74 -0
- package/dist/node/is/isPrimitiveWithout.js.map +1 -0
- package/dist/node/is/isTagOf.cjs +21 -0
- package/dist/node/is/isTagOf.d.ts +12 -0
- package/dist/node/is/isTagOf.d.ts.map +1 -0
- package/dist/node/is/isTagOf.js +21 -0
- package/dist/node/is/isTagOf.js.map +1 -0
- package/dist/node/is/isTypeOf.cjs +29 -0
- package/dist/node/is/isTypeOf.d.ts +16 -0
- package/dist/node/is/isTypeOf.d.ts.map +1 -0
- package/dist/node/is/isTypeOf.js +28 -0
- package/dist/node/is/isTypeOf.js.map +1 -0
- package/dist/node/node.cjs +196 -0
- package/dist/node/node.d.ts +37 -0
- package/dist/node/node.js +30 -0
- package/dist/node/object/index.cjs +3 -0
- package/dist/node/object/index.d.ts +2 -0
- package/dist/node/object/index.js +3 -0
- package/dist/node/object/objectClone.cjs +22 -0
- package/dist/node/object/objectClone.d.ts +8 -0
- package/dist/node/object/objectClone.d.ts.map +1 -0
- package/dist/node/object/objectClone.js +22 -0
- package/dist/node/object/objectClone.js.map +1 -0
- package/dist/node/promise/awaitTo.cjs +8 -0
- package/dist/node/promise/awaitTo.d.ts +7 -0
- package/dist/node/promise/awaitTo.d.ts.map +1 -0
- package/dist/node/promise/awaitTo.js +8 -0
- package/dist/node/promise/awaitTo.js.map +1 -0
- package/dist/node/promise/index.cjs +6 -0
- package/dist/node/promise/index.d.ts +3 -0
- package/dist/node/promise/index.js +4 -0
- package/dist/node/promise/pLimit.cjs +11 -0
- package/dist/node/promise/pLimit.d.ts +10 -0
- package/dist/node/promise/pLimit.d.ts.map +1 -0
- package/dist/node/promise/pLimit.js +9 -0
- package/dist/node/promise/pLimit.js.map +1 -0
- package/dist/node/regexp/OTHERS.cjs +16 -0
- package/dist/node/regexp/OTHERS.d.ts +14 -0
- package/dist/node/regexp/OTHERS.d.ts.map +1 -0
- package/dist/node/regexp/OTHERS.js +15 -0
- package/dist/node/regexp/OTHERS.js.map +1 -0
- package/dist/node/regexp/RULES.cjs +698 -0
- package/dist/node/regexp/RULES.d.ts +434 -0
- package/dist/node/regexp/RULES.d.ts.map +1 -0
- package/dist/node/regexp/RULES.js +615 -0
- package/dist/node/regexp/RULES.js.map +1 -0
- package/dist/node/regexp/index.cjs +89 -0
- package/dist/node/regexp/index.d.ts +13 -0
- package/dist/node/regexp/index.d.ts.map +1 -0
- package/dist/node/regexp/index.js +4 -0
- package/dist/node/request/instance.cjs +135 -0
- package/dist/node/request/instance.d.ts +45 -0
- package/dist/node/request/instance.d.ts.map +1 -0
- package/dist/node/request/instance.js +134 -0
- package/dist/node/request/instance.js.map +1 -0
- package/dist/node/request/interceptors.node.cjs +66 -0
- package/dist/node/request/interceptors.node.d.ts +25 -0
- package/dist/node/request/interceptors.node.d.ts.map +1 -0
- package/dist/node/request/interceptors.node.js +63 -0
- package/dist/node/request/interceptors.node.js.map +1 -0
- package/dist/node/request/interface.d.ts +54 -0
- package/dist/node/request/interface.d.ts.map +1 -0
- package/dist/node/request/node.cjs +8 -0
- package/dist/node/request/node.d.ts +4 -0
- package/dist/node/request/node.js +4 -0
- package/dist/node/string/className.cjs +13 -0
- package/dist/node/string/className.d.ts +11 -0
- package/dist/node/string/className.d.ts.map +1 -0
- package/dist/node/string/className.js +10 -0
- package/dist/node/string/className.js.map +1 -0
- package/dist/node/string/index.cjs +7 -0
- package/dist/node/string/index.d.ts +3 -0
- package/dist/node/string/index.js +4 -0
- package/dist/node/string/proto.cjs +37 -0
- package/dist/node/string/proto.d.ts +19 -0
- package/dist/node/string/proto.d.ts.map +1 -0
- package/dist/node/string/proto.js +36 -0
- package/dist/node/string/proto.js.map +1 -0
- package/dist/node/tree/index.cjs +7 -0
- package/dist/node/tree/index.d.ts +5 -0
- package/dist/node/tree/index.js +5 -0
- package/dist/node/tree/interface.d.ts +40 -0
- package/dist/node/tree/interface.d.ts.map +1 -0
- package/dist/node/tree/treeFilter.cjs +58 -0
- package/dist/node/tree/treeFilter.d.ts +14 -0
- package/dist/node/tree/treeFilter.d.ts.map +1 -0
- package/dist/node/tree/treeFilter.js +59 -0
- package/dist/node/tree/treeFilter.js.map +1 -0
- package/dist/node/tree/treeFlatten.cjs +23 -0
- package/dist/node/tree/treeFlatten.d.ts +15 -0
- package/dist/node/tree/treeFlatten.d.ts.map +1 -0
- package/dist/node/tree/treeFlatten.js +24 -0
- package/dist/node/tree/treeFlatten.js.map +1 -0
- package/dist/node/tree/treeGenerate.cjs +37 -0
- package/dist/node/tree/treeGenerate.d.ts +16 -0
- package/dist/node/tree/treeGenerate.d.ts.map +1 -0
- package/dist/node/tree/treeGenerate.js +37 -0
- package/dist/node/tree/treeGenerate.js.map +1 -0
- package/dist/version.d.ts +5 -0
- package/dist/version.d.ts.map +1 -0
- package/dist/version.js +10 -0
- package/dist/version.js.map +1 -0
- package/package.json +95 -53
- package/LICENSE +0 -21
- package/dist/index.cjs +0 -403
- package/dist/index.d.ts +0 -496
- package/dist/index.mjs +0 -307
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
//#region src/is/isPrimitiveWithout.d.ts
|
|
2
|
+
/** typedArray */
|
|
3
|
+
type TypeTypedArray = Int8Array | Uint8Array | Uint8ClampedArray | Int16Array | Uint16Array | Int32Array | Uint32Array | BigInt64Array | BigUint64Array | Float16Array | Float32Array | Float64Array;
|
|
4
|
+
/**
|
|
5
|
+
* 判断 Array 类型的类型谓词
|
|
6
|
+
* @param {unknown} x 待检测值
|
|
7
|
+
*/
|
|
8
|
+
declare const isArray: <T = unknown>(x: unknown) => x is Array<T>;
|
|
9
|
+
/**
|
|
10
|
+
* 判断 Object 类型的类型谓词
|
|
11
|
+
* @param {unknown} x 待检测值
|
|
12
|
+
*/
|
|
13
|
+
declare const isObject: (x: unknown) => x is object;
|
|
14
|
+
/**
|
|
15
|
+
* 判断 Function 类型的类型谓词
|
|
16
|
+
* @param {unknown} x 待检测值
|
|
17
|
+
*/
|
|
18
|
+
declare const isFunction: (x: unknown) => x is (...args: any[]) => any;
|
|
19
|
+
/**
|
|
20
|
+
* 判断 Set 类型的类型谓词
|
|
21
|
+
* @param {unknown} x 待检测值
|
|
22
|
+
*/
|
|
23
|
+
declare const isSet: <T = unknown>(x: unknown) => x is Set<T>;
|
|
24
|
+
/**
|
|
25
|
+
* 判断 Map 类型的类型谓词
|
|
26
|
+
* @param {unknown} x 待检测值
|
|
27
|
+
*/
|
|
28
|
+
declare const isMap: <T = unknown, K extends PropertyKey = PropertyKey>(x: unknown) => x is Map<K, T>;
|
|
29
|
+
/**
|
|
30
|
+
* 判断 WeakSet 类型的类型谓词
|
|
31
|
+
* @param {unknown} x 待检测值
|
|
32
|
+
*/
|
|
33
|
+
declare const isWeakSet: <T extends WeakKey = WeakKey>(x: unknown) => x is WeakSet<T>;
|
|
34
|
+
/**
|
|
35
|
+
* 判断 WeakMap 类型的类型谓词
|
|
36
|
+
* @param {unknown} x 待检测值
|
|
37
|
+
*/
|
|
38
|
+
declare const isWeakMap: <T = unknown, K extends WeakKey = WeakKey>(x: unknown) => x is WeakMap<K, T>;
|
|
39
|
+
/**
|
|
40
|
+
* 判断 Date 类型的类型谓词
|
|
41
|
+
* @param {unknown} x 待检测值
|
|
42
|
+
*/
|
|
43
|
+
declare const isDate: (x: unknown) => x is Date;
|
|
44
|
+
/**
|
|
45
|
+
* 判断 RegExp 类型的类型谓词
|
|
46
|
+
* @param {unknown} x 待检测值
|
|
47
|
+
*/
|
|
48
|
+
declare const isRegExp: (x: unknown) => x is RegExp;
|
|
49
|
+
/**
|
|
50
|
+
* 判断 Promise 类型的类型谓词
|
|
51
|
+
* @param {unknown} x 待检测值
|
|
52
|
+
*/
|
|
53
|
+
declare const isPromise: <T = unknown>(x: unknown) => x is Promise<T>;
|
|
54
|
+
/**
|
|
55
|
+
* 判断 Error 类型的类型谓词
|
|
56
|
+
* @param {unknown} x 待检测值
|
|
57
|
+
*/
|
|
58
|
+
declare const isError: (x: unknown) => x is Error;
|
|
59
|
+
/**
|
|
60
|
+
* 判断 普通对象 Record<PropertyKey, unknown> 类型的类型谓词
|
|
61
|
+
* @param {unknown} x 待检测值
|
|
62
|
+
*/
|
|
63
|
+
declare const isPlainObject: <T = unknown, K extends PropertyKey = PropertyKey>(x: unknown) => x is Record<K, T>;
|
|
64
|
+
/**
|
|
65
|
+
* 判断 给定值 是否为空
|
|
66
|
+
* 🚫 非类型谓词
|
|
67
|
+
* @returns {boolean} 可以判断字符串、数组、对象、Map、Set 等类型是否为空
|
|
68
|
+
*/
|
|
69
|
+
declare const isEmpty: (x: unknown) => boolean;
|
|
70
|
+
//#endregion
|
|
71
|
+
export { TypeTypedArray, isArray, isDate, isEmpty, isError, isFunction, isMap, isObject, isPlainObject, isPromise, isRegExp, isSet, isWeakMap, isWeakSet };
|
|
72
|
+
//# sourceMappingURL=isPrimitiveWithout.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"isPrimitiveWithout.d.ts","names":[],"sources":["../../../src/is/isPrimitiveWithout.ts"],"sourcesContent":[],"mappings":";;AAgBY,KAAA,cAAA,GAAiB,SAAH,GAAe,UAAf,GAA4B,iBAA5B,GAAgD,UAAhD,GAA6D,WAA7D,GAA2E,UAA3E,GAAwF,WAAxF,GAAsG,aAAtG,GAAsH,cAAtH,GAAuI,YAAvI,GAAsJ,YAAtJ,GAAqK,YAArK;;;;;AAA6D,cAM1E,OAN0E,EAAA,CAAA,IAAA,OAAA,CAAA,CAAA,CAAA,EAAA,OAAA,EAAA,GAAA,CAAA,IAMhC,KANgC,CAM1B,CAN0B,CAAA;;;;;AAA0E,cAWpJ,QAXoJ,EAAA,CAAA,CAAA,EAAA,OAAA,EAAA,GAAA,CAAA,IAAA,MAAA;;;;AAMjK;AAKa,cAKA,UALuD,EAAA,CAAA,CAAA,EAAA,OAAA,EAAA,GAAA,CAAA,IAAA,CAAA,GAAA,IAAA,EAAA,GAAA,EAAA,EAAA,GAAA,GAAA;AAKpE;AAMA;AAKA;;AAA2D,cAL9C,KAK8C,EAAA,CAAA,IAAA,OAAA,CAAA,CAAA,CAAA,EAAA,OAAA,EAAA,GAAA,CAAA,IALN,GAKM,CALF,CAKE,CAAA;;;;;AAK9C,cALA,KAK0F,EAAA,CAAA,IAAA,OAAA,EAAA,UAL1D,WAK0D,GAL5C,WAK4C,CAAA,CAAA,CAAA,EAAA,OAAA,EAAA,GAAA,CAAA,IALb,GAKa,CALT,CAKS,EALN,CAKM,CAAA;;;;;AAAvB,cAAnE,SAAmE,EAAA,CAAA,UAA5C,OAA4C,GAAlC,OAAkC,CAAA,CAAA,CAAA,EAAA,OAAA,EAAA,GAAA,CAAA,IAAP,OAAO,CAAC,CAAD,CAAA;AAKhF;;;;AAAiG,cAApF,SAAoF,EAAA,CAAA,IAAA,OAAA,EAAA,UAAhD,OAAgD,GAAtC,OAAsC,CAAA,CAAA,CAAA,EAAA,OAAA,EAAA,GAAA,CAAA,IAAX,OAAW,CAAH,CAAG,EAAA,CAAA,CAAA;;;AAKjG;AAKA;AAKa,cAVA,MAU0E,EAAA,CAAtB,CAAA,EAAR,OAAA,EAAO,GAAA,CAAA,IAVvB,IAUuB;AAKhE;AAMA;;;AAAyG,cAhB5F,QAgB4F,EAAA,CAAA,CAAA,EAAA,OAAA,EAAA,GAAA,CAAA,IAhB9D,MAgB8D;;;;AAMzG;cAjBa,6CAA4C,QAAQ;;;;;cAKpD,8BAA6B;;;;;cAM7B,uCAAwC,cAAc,iCAA+B,OAAO,GAAG;;;;;;cAM/F"}
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
import { isDate, isError, isFunction, isMap, isPlainObject, isPromise, isRegExp, isSet, isWeakMap, isWeakSet } from "es-toolkit";
|
|
2
|
+
import { isArray, isEmpty, isObject } from "es-toolkit/compat";
|
|
3
|
+
|
|
4
|
+
//#region src/is/isPrimitiveWithout.ts
|
|
5
|
+
/**
|
|
6
|
+
* 判断 Array 类型的类型谓词
|
|
7
|
+
* @param {unknown} x 待检测值
|
|
8
|
+
*/
|
|
9
|
+
const isArray$1 = (x) => isArray(x);
|
|
10
|
+
/**
|
|
11
|
+
* 判断 Object 类型的类型谓词
|
|
12
|
+
* @param {unknown} x 待检测值
|
|
13
|
+
*/
|
|
14
|
+
const isObject$1 = (x) => isObject(x);
|
|
15
|
+
/**
|
|
16
|
+
* 判断 Function 类型的类型谓词
|
|
17
|
+
* @param {unknown} x 待检测值
|
|
18
|
+
*/
|
|
19
|
+
const isFunction$1 = (x) => isFunction(x);
|
|
20
|
+
/**
|
|
21
|
+
* 判断 Set 类型的类型谓词
|
|
22
|
+
* @param {unknown} x 待检测值
|
|
23
|
+
*/
|
|
24
|
+
const isSet$1 = (x) => isSet(x);
|
|
25
|
+
/**
|
|
26
|
+
* 判断 Map 类型的类型谓词
|
|
27
|
+
* @param {unknown} x 待检测值
|
|
28
|
+
*/
|
|
29
|
+
const isMap$1 = (x) => isMap(x);
|
|
30
|
+
/**
|
|
31
|
+
* 判断 WeakSet 类型的类型谓词
|
|
32
|
+
* @param {unknown} x 待检测值
|
|
33
|
+
*/
|
|
34
|
+
const isWeakSet$1 = (x) => isWeakSet(x);
|
|
35
|
+
/**
|
|
36
|
+
* 判断 WeakMap 类型的类型谓词
|
|
37
|
+
* @param {unknown} x 待检测值
|
|
38
|
+
*/
|
|
39
|
+
const isWeakMap$1 = (x) => isWeakMap(x);
|
|
40
|
+
/**
|
|
41
|
+
* 判断 Date 类型的类型谓词
|
|
42
|
+
* @param {unknown} x 待检测值
|
|
43
|
+
*/
|
|
44
|
+
const isDate$1 = (x) => isDate(x);
|
|
45
|
+
/**
|
|
46
|
+
* 判断 RegExp 类型的类型谓词
|
|
47
|
+
* @param {unknown} x 待检测值
|
|
48
|
+
*/
|
|
49
|
+
const isRegExp$1 = (x) => isRegExp(x);
|
|
50
|
+
/**
|
|
51
|
+
* 判断 Promise 类型的类型谓词
|
|
52
|
+
* @param {unknown} x 待检测值
|
|
53
|
+
*/
|
|
54
|
+
const isPromise$1 = (x) => isPromise(x);
|
|
55
|
+
/**
|
|
56
|
+
* 判断 Error 类型的类型谓词
|
|
57
|
+
* @param {unknown} x 待检测值
|
|
58
|
+
*/
|
|
59
|
+
const isError$1 = (x) => isError(x);
|
|
60
|
+
/**
|
|
61
|
+
* 判断 普通对象 Record<PropertyKey, unknown> 类型的类型谓词
|
|
62
|
+
* @param {unknown} x 待检测值
|
|
63
|
+
*/
|
|
64
|
+
const isPlainObject$1 = (x) => isPlainObject(x);
|
|
65
|
+
/**
|
|
66
|
+
* 判断 给定值 是否为空
|
|
67
|
+
* 🚫 非类型谓词
|
|
68
|
+
* @returns {boolean} 可以判断字符串、数组、对象、Map、Set 等类型是否为空
|
|
69
|
+
*/
|
|
70
|
+
const isEmpty$1 = (x) => isEmpty(x);
|
|
71
|
+
|
|
72
|
+
//#endregion
|
|
73
|
+
export { isArray$1 as isArray, isDate$1 as isDate, isEmpty$1 as isEmpty, isError$1 as isError, isFunction$1 as isFunction, isMap$1 as isMap, isObject$1 as isObject, isPlainObject$1 as isPlainObject, isPromise$1 as isPromise, isRegExp$1 as isRegExp, isSet$1 as isSet, isWeakMap$1 as isWeakMap, isWeakSet$1 as isWeakSet };
|
|
74
|
+
//# sourceMappingURL=isPrimitiveWithout.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"isPrimitiveWithout.js","names":["isArray","originArray","isObject","originObject","isFunction","originFunction","isSet","originSet","isMap","originMap","isWeakSet","originWeakSet","isWeakMap","originWeakMap","isDate","originDate","isRegExp","originRegExp","isPromise","originPromise","isError","originError","isPlainObject","originPlainObject","isEmpty","originEmpty"],"sources":["../../../src/is/isPrimitiveWithout.ts"],"sourcesContent":["/* eslint-disable perfectionist/sort-named-imports */\nimport {\n isFunction as originFunction,\n isSet as originSet,\n isMap as originMap,\n isWeakSet as originWeakSet,\n isWeakMap as originWeakMap,\n isDate as originDate,\n isRegExp as originRegExp,\n isPromise as originPromise,\n isError as originError,\n isPlainObject as originPlainObject,\n} from 'es-toolkit'\nimport { isArray as originArray, isObject as originObject, isEmpty as originEmpty } from 'es-toolkit/compat'\n\n/** typedArray */\nexport type TypeTypedArray = Int8Array | Uint8Array | Uint8ClampedArray | Int16Array | Uint16Array | Int32Array | Uint32Array | BigInt64Array | BigUint64Array | Float16Array | Float32Array | Float64Array\n\n/**\n * 判断 Array 类型的类型谓词\n * @param {unknown} x 待检测值\n */\nexport const isArray = <T = unknown>(x: unknown): x is Array<T> => originArray(x)\n/**\n * 判断 Object 类型的类型谓词\n * @param {unknown} x 待检测值\n */\nexport const isObject = (x: unknown): x is object => originObject(x)\n/**\n * 判断 Function 类型的类型谓词\n * @param {unknown} x 待检测值\n */\nexport const isFunction = (x: unknown): x is (...args: any[]) => any => originFunction(x)\n\n/**\n * 判断 Set 类型的类型谓词\n * @param {unknown} x 待检测值\n */\nexport const isSet = <T = unknown>(x: unknown): x is Set<T> => originSet(x)\n/**\n * 判断 Map 类型的类型谓词\n * @param {unknown} x 待检测值\n */\nexport const isMap = <T = unknown, K extends PropertyKey = PropertyKey>(x: unknown): x is Map<K, T> => originMap(x)\n/**\n * 判断 WeakSet 类型的类型谓词\n * @param {unknown} x 待检测值\n */\nexport const isWeakSet = <T extends WeakKey = WeakKey>(x: unknown): x is WeakSet<T> => originWeakSet(x)\n/**\n * 判断 WeakMap 类型的类型谓词\n * @param {unknown} x 待检测值\n */\nexport const isWeakMap = <T = unknown, K extends WeakKey = WeakKey>(x: unknown): x is WeakMap<K, T> => originWeakMap(x)\n/**\n * 判断 Date 类型的类型谓词\n * @param {unknown} x 待检测值\n */\nexport const isDate = (x: unknown): x is Date => originDate(x)\n/**\n * 判断 RegExp 类型的类型谓词\n * @param {unknown} x 待检测值\n */\nexport const isRegExp = (x: unknown): x is RegExp => originRegExp(x)\n/**\n * 判断 Promise 类型的类型谓词\n * @param {unknown} x 待检测值\n */\nexport const isPromise = <T = unknown>(x: unknown): x is Promise<T> => originPromise(x)\n/**\n * 判断 Error 类型的类型谓词\n * @param {unknown} x 待检测值\n */\nexport const isError = (x: unknown): x is Error => originError(x)\n\n/**\n * 判断 普通对象 Record<PropertyKey, unknown> 类型的类型谓词\n * @param {unknown} x 待检测值\n */\nexport const isPlainObject = <T = unknown, K extends PropertyKey = PropertyKey>(x: unknown): x is Record<K, T> => originPlainObject(x)\n/**\n * 判断 给定值 是否为空\n * 🚫 非类型谓词\n * @returns {boolean} 可以判断字符串、数组、对象、Map、Set 等类型是否为空\n */\nexport const isEmpty = (x: unknown): boolean => originEmpty(x)\n"],"mappings":";;;;;;;;AAsBA,MAAaA,aAAwB,MAA8BC,QAAY,EAAE;;;;;AAKjF,MAAaC,cAAY,MAA4BC,SAAa,EAAE;;;;;AAKpE,MAAaC,gBAAc,MAA6CC,WAAe,EAAE;;;;;AAMzF,MAAaC,WAAsB,MAA4BC,MAAU,EAAE;;;;;AAK3E,MAAaC,WAA2D,MAA+BC,MAAU,EAAE;;;;;AAKnH,MAAaC,eAA0C,MAAgCC,UAAc,EAAE;;;;;AAKvG,MAAaC,eAAuD,MAAmCC,UAAc,EAAE;;;;;AAKvH,MAAaC,YAAU,MAA0BC,OAAW,EAAE;;;;;AAK9D,MAAaC,cAAY,MAA4BC,SAAa,EAAE;;;;;AAKpE,MAAaC,eAA0B,MAAgCC,UAAc,EAAE;;;;;AAKvF,MAAaC,aAAW,MAA2BC,QAAY,EAAE;;;;;AAMjE,MAAaC,mBAAmE,MAAkCC,cAAkB,EAAE;;;;;;AAMtI,MAAaC,aAAW,MAAwBC,QAAY,EAAE"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
|
|
2
|
+
//#region src/is/isTagOf.ts
|
|
3
|
+
const toString = Object.prototype.toString;
|
|
4
|
+
const toStringCache = Object.create(null);
|
|
5
|
+
function tagOf(thing) {
|
|
6
|
+
const str = toString.call(thing);
|
|
7
|
+
return toStringCache[str] || (toStringCache[str] = str.slice(8, -1).toLowerCase());
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* 根据 `Object.prototype.toString` 方法判断值的类型
|
|
11
|
+
* @param {unknown} x The value to test.
|
|
12
|
+
* @param {string[]} type The types to check.
|
|
13
|
+
*
|
|
14
|
+
* @reference axios/dist/axios.js
|
|
15
|
+
*/
|
|
16
|
+
function isTagOf(x, type) {
|
|
17
|
+
return type.some((t) => tagOf(x) === t.toLowerCase());
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
//#endregion
|
|
21
|
+
exports.isTagOf = isTagOf;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
//#region src/is/isTagOf.d.ts
|
|
2
|
+
/**
|
|
3
|
+
* 根据 `Object.prototype.toString` 方法判断值的类型
|
|
4
|
+
* @param {unknown} x The value to test.
|
|
5
|
+
* @param {string[]} type The types to check.
|
|
6
|
+
*
|
|
7
|
+
* @reference axios/dist/axios.js
|
|
8
|
+
*/
|
|
9
|
+
declare function isTagOf(x: unknown, type: string[]): boolean;
|
|
10
|
+
//#endregion
|
|
11
|
+
export { isTagOf };
|
|
12
|
+
//# sourceMappingURL=isTagOf.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"isTagOf.d.ts","names":[],"sources":["../../../src/is/isTagOf.ts"],"sourcesContent":[],"mappings":";;AAiBA;;;;;;iBAAgB,OAAA"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
//#region src/is/isTagOf.ts
|
|
2
|
+
const toString = Object.prototype.toString;
|
|
3
|
+
const toStringCache = Object.create(null);
|
|
4
|
+
function tagOf(thing) {
|
|
5
|
+
const str = toString.call(thing);
|
|
6
|
+
return toStringCache[str] || (toStringCache[str] = str.slice(8, -1).toLowerCase());
|
|
7
|
+
}
|
|
8
|
+
/**
|
|
9
|
+
* 根据 `Object.prototype.toString` 方法判断值的类型
|
|
10
|
+
* @param {unknown} x The value to test.
|
|
11
|
+
* @param {string[]} type The types to check.
|
|
12
|
+
*
|
|
13
|
+
* @reference axios/dist/axios.js
|
|
14
|
+
*/
|
|
15
|
+
function isTagOf(x, type) {
|
|
16
|
+
return type.some((t) => tagOf(x) === t.toLowerCase());
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
//#endregion
|
|
20
|
+
export { isTagOf };
|
|
21
|
+
//# sourceMappingURL=isTagOf.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"isTagOf.js","names":["toStringCache: Record<string, string>"],"sources":["../../../src/is/isTagOf.ts"],"sourcesContent":["// eslint-disable-next-line ts/unbound-method\nconst toString = Object.prototype.toString\n\nconst toStringCache: Record<string, string> = Object.create(null)\n\nfunction tagOf(thing: unknown): string {\n const str = toString.call(thing)\n return toStringCache[str] || (toStringCache[str] = str.slice(8, -1).toLowerCase())\n};\n\n/**\n * 根据 `Object.prototype.toString` 方法判断值的类型\n * @param {unknown} x The value to test.\n * @param {string[]} type The types to check.\n *\n * @reference axios/dist/axios.js\n */\nexport function isTagOf(x: unknown, type: string[]): boolean {\n return type.some(t => tagOf(x) === t.toLowerCase())\n}\n"],"mappings":";AACA,MAAM,WAAW,OAAO,UAAU;AAElC,MAAMA,gBAAwC,OAAO,OAAO,KAAK;AAEjE,SAAS,MAAM,OAAwB;CACrC,MAAM,MAAM,SAAS,KAAK,MAAM;AAChC,QAAO,cAAc,SAAS,cAAc,OAAO,IAAI,MAAM,GAAG,GAAG,CAAC,aAAa;;;;;;;;;AAUnF,SAAgB,QAAQ,GAAY,MAAyB;AAC3D,QAAO,KAAK,MAAK,MAAK,MAAM,EAAE,KAAK,EAAE,aAAa,CAAC"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
|
|
2
|
+
//#region src/is/isTypeOf.ts
|
|
3
|
+
/**
|
|
4
|
+
* The result of `typeof` operator.
|
|
5
|
+
*/
|
|
6
|
+
const isTypeOfResult = [
|
|
7
|
+
"bigint",
|
|
8
|
+
"boolean",
|
|
9
|
+
"function",
|
|
10
|
+
"number",
|
|
11
|
+
"object",
|
|
12
|
+
"string",
|
|
13
|
+
"symbol",
|
|
14
|
+
"undefined"
|
|
15
|
+
];
|
|
16
|
+
/**
|
|
17
|
+
* 根据 `typeof` 方法判断值的类型
|
|
18
|
+
* @param {unknown} x The value to test.
|
|
19
|
+
* @param {string[]} type The types to check.
|
|
20
|
+
*
|
|
21
|
+
* @reference axios/dist/axios.js
|
|
22
|
+
*/
|
|
23
|
+
function isTypeOf(x, type) {
|
|
24
|
+
return type.some((t) => typeof x === t.toLowerCase());
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
//#endregion
|
|
28
|
+
exports.isTypeOf = isTypeOf;
|
|
29
|
+
exports.isTypeOfResult = isTypeOfResult;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
//#region src/is/isTypeOf.d.ts
|
|
2
|
+
/**
|
|
3
|
+
* The result of `typeof` operator.
|
|
4
|
+
*/
|
|
5
|
+
declare const isTypeOfResult: readonly ["bigint", "boolean", "function", "number", "object", "string", "symbol", "undefined"];
|
|
6
|
+
/**
|
|
7
|
+
* 根据 `typeof` 方法判断值的类型
|
|
8
|
+
* @param {unknown} x The value to test.
|
|
9
|
+
* @param {string[]} type The types to check.
|
|
10
|
+
*
|
|
11
|
+
* @reference axios/dist/axios.js
|
|
12
|
+
*/
|
|
13
|
+
declare function isTypeOf(x: unknown, type: string[]): boolean;
|
|
14
|
+
//#endregion
|
|
15
|
+
export { isTypeOf, isTypeOfResult };
|
|
16
|
+
//# sourceMappingURL=isTypeOf.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"isTypeOf.d.ts","names":[],"sources":["../../../src/is/isTypeOf.ts"],"sourcesContent":[],"mappings":";;AAGA;AASA;cATa;;;;;;;;iBASG,QAAA"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
//#region src/is/isTypeOf.ts
|
|
2
|
+
/**
|
|
3
|
+
* The result of `typeof` operator.
|
|
4
|
+
*/
|
|
5
|
+
const isTypeOfResult = [
|
|
6
|
+
"bigint",
|
|
7
|
+
"boolean",
|
|
8
|
+
"function",
|
|
9
|
+
"number",
|
|
10
|
+
"object",
|
|
11
|
+
"string",
|
|
12
|
+
"symbol",
|
|
13
|
+
"undefined"
|
|
14
|
+
];
|
|
15
|
+
/**
|
|
16
|
+
* 根据 `typeof` 方法判断值的类型
|
|
17
|
+
* @param {unknown} x The value to test.
|
|
18
|
+
* @param {string[]} type The types to check.
|
|
19
|
+
*
|
|
20
|
+
* @reference axios/dist/axios.js
|
|
21
|
+
*/
|
|
22
|
+
function isTypeOf(x, type) {
|
|
23
|
+
return type.some((t) => typeof x === t.toLowerCase());
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
//#endregion
|
|
27
|
+
export { isTypeOf, isTypeOfResult };
|
|
28
|
+
//# sourceMappingURL=isTypeOf.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"isTypeOf.js","names":[],"sources":["../../../src/is/isTypeOf.ts"],"sourcesContent":["/**\n * The result of `typeof` operator.\n */\nexport const isTypeOfResult = ['bigint', 'boolean', 'function', 'number', 'object', 'string', 'symbol', 'undefined'] as const\n\n/**\n * 根据 `typeof` 方法判断值的类型\n * @param {unknown} x The value to test.\n * @param {string[]} type The types to check.\n *\n * @reference axios/dist/axios.js\n */\nexport function isTypeOf(x: unknown, type: string[]): boolean {\n // eslint-disable-next-line valid-typeof\n return type.some(t => (typeof x) === t.toLowerCase())\n}\n"],"mappings":";;;;AAGA,MAAa,iBAAiB;CAAC;CAAU;CAAW;CAAY;CAAU;CAAU;CAAU;CAAU;CAAY;;;;;;;;AASpH,SAAgB,SAAS,GAAY,MAAyB;AAE5D,QAAO,KAAK,MAAK,MAAM,OAAO,MAAO,EAAE,aAAa,CAAC"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
const require_rolldown_runtime = require('../_virtual/rolldown_runtime.cjs');
|
|
2
|
+
const require_isPrimitiveWithout = require('../is/isPrimitiveWithout.cjs');
|
|
3
|
+
let es_toolkit = require("es-toolkit");
|
|
4
|
+
|
|
5
|
+
//#region src/object/objectClone.ts
|
|
6
|
+
/**
|
|
7
|
+
* 深度克隆给定的对象
|
|
8
|
+
* @template T -对象的类型
|
|
9
|
+
* @param {T} obj -要克隆的对象
|
|
10
|
+
* @param {Function | object | undefined} cloneValue - cloneDeepWith的第二个参数/structuredClone的第二个参数
|
|
11
|
+
* @returns {T} -给定对象的深度克隆
|
|
12
|
+
*
|
|
13
|
+
* @reference https://developer.mozilla.org/zh-CN/docs/Web/API/Window/structuredClone
|
|
14
|
+
* @reference https://es-toolkit.dev/zh_hans/reference/object/cloneDeepWith.html
|
|
15
|
+
*/
|
|
16
|
+
function objectClone(obj, cloneValue) {
|
|
17
|
+
if (structuredClone) return require_isPrimitiveWithout.isPlainObject(cloneValue) ? structuredClone(obj, cloneValue) : structuredClone(obj);
|
|
18
|
+
return require_isPrimitiveWithout.isFunction(cloneValue) ? (0, es_toolkit.cloneDeepWith)(obj, cloneValue) : (0, es_toolkit.cloneDeep)(obj);
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
//#endregion
|
|
22
|
+
exports.objectClone = objectClone;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
//#region src/object/objectClone.d.ts
|
|
2
|
+
declare function objectClone<T>(obj: T, cloneValue?: {
|
|
3
|
+
transfer?: Transferable[];
|
|
4
|
+
}): T;
|
|
5
|
+
declare function objectClone<T>(obj: T, cloneValue?: (value: any, key: PropertyKey | undefined, obj: T, stack: Map<any, any>) => any): T;
|
|
6
|
+
//#endregion
|
|
7
|
+
export { objectClone };
|
|
8
|
+
//# sourceMappingURL=objectClone.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"objectClone.d.ts","names":[],"sources":["../../../src/object/objectClone.ts"],"sourcesContent":[],"mappings":";iBAGgB,oBAAoB,aAAA;EAApB,QAAA,CAAA,EAAiD,YAAtC,EAAA;CAAS,CAAA,EAAgD,CAAhD;AAA6B,iBACjD,WADiD,CAAA,CAAA,CAAA,CAAA,GAAA,EAC7B,CAD6B,EAAA,UAAA,CAAA,EAAA,CAAA,KAAA,EAAA,GAAA,EAAA,GAAA,EACK,WADL,GAAA,SAAA,EAAA,GAAA,EACmC,CADnC,EAAA,KAAA,EAC6C,GAD7C,CAAA,GAAA,EAAA,GAAA,CAAA,EAAA,GAAA,GAAA,CAAA,EACqE,CADrE"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { isFunction as isFunction$1, isPlainObject as isPlainObject$1 } from "../is/isPrimitiveWithout.js";
|
|
2
|
+
import { cloneDeep, cloneDeepWith } from "es-toolkit";
|
|
3
|
+
|
|
4
|
+
//#region src/object/objectClone.ts
|
|
5
|
+
/**
|
|
6
|
+
* 深度克隆给定的对象
|
|
7
|
+
* @template T -对象的类型
|
|
8
|
+
* @param {T} obj -要克隆的对象
|
|
9
|
+
* @param {Function | object | undefined} cloneValue - cloneDeepWith的第二个参数/structuredClone的第二个参数
|
|
10
|
+
* @returns {T} -给定对象的深度克隆
|
|
11
|
+
*
|
|
12
|
+
* @reference https://developer.mozilla.org/zh-CN/docs/Web/API/Window/structuredClone
|
|
13
|
+
* @reference https://es-toolkit.dev/zh_hans/reference/object/cloneDeepWith.html
|
|
14
|
+
*/
|
|
15
|
+
function objectClone(obj, cloneValue) {
|
|
16
|
+
if (structuredClone) return isPlainObject$1(cloneValue) ? structuredClone(obj, cloneValue) : structuredClone(obj);
|
|
17
|
+
return isFunction$1(cloneValue) ? cloneDeepWith(obj, cloneValue) : cloneDeep(obj);
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
//#endregion
|
|
21
|
+
export { objectClone };
|
|
22
|
+
//# sourceMappingURL=objectClone.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"objectClone.js","names":["isPlainObject","isFunction"],"sources":["../../../src/object/objectClone.ts"],"sourcesContent":["import { cloneDeep, cloneDeepWith } from 'es-toolkit'\nimport { isFunction, isPlainObject } from '../is'\n\nexport function objectClone<T>(obj: T, cloneValue?: { transfer?: Transferable[] }): T\nexport function objectClone<T>(obj: T, cloneValue?: (value: any, key: PropertyKey | undefined, obj: T, stack: Map<any, any>) => any): T\n\n/**\n * 深度克隆给定的对象\n * @template T -对象的类型\n * @param {T} obj -要克隆的对象\n * @param {Function | object | undefined} cloneValue - cloneDeepWith的第二个参数/structuredClone的第二个参数\n * @returns {T} -给定对象的深度克隆\n *\n * @reference https://developer.mozilla.org/zh-CN/docs/Web/API/Window/structuredClone\n * @reference https://es-toolkit.dev/zh_hans/reference/object/cloneDeepWith.html\n */\nexport function objectClone<T>(obj: T, cloneValue?: any): T {\n if (structuredClone) {\n return isPlainObject(cloneValue) ? structuredClone(obj, cloneValue) : structuredClone(obj)\n }\n return isFunction(cloneValue) ? cloneDeepWith(obj, cloneValue) : cloneDeep(obj)\n}\n"],"mappings":";;;;;;;;;;;;;;AAgBA,SAAgB,YAAe,KAAQ,YAAqB;AAC1D,KAAI,gBACF,QAAOA,gBAAc,WAAW,GAAG,gBAAgB,KAAK,WAAW,GAAG,gBAAgB,IAAI;AAE5F,QAAOC,aAAW,WAAW,GAAG,cAAc,KAAK,WAAW,GAAG,UAAU,IAAI"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"awaitTo.d.ts","names":[],"sources":["../../../src/promise/awaitTo.ts"],"sourcesContent":[],"mappings":";;;cAEa,uBAAc"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"awaitTo.js","names":[],"sources":["../../../src/promise/awaitTo.ts"],"sourcesContent":["import { to } from 'await-to-js'\n\nexport const promiseAwaitTo = to\n"],"mappings":";;;AAEA,MAAa,iBAAiB"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
const require_awaitTo = require('./awaitTo.cjs');
|
|
2
|
+
const require_pLimit = require('./pLimit.cjs');
|
|
3
|
+
|
|
4
|
+
exports.promiseAwaitTo = require_awaitTo.promiseAwaitTo;
|
|
5
|
+
exports.promiseLimit = require_pLimit.promiseLimit;
|
|
6
|
+
exports.promiseLimitFunction = require_pLimit.promiseLimitFunction;
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import { promiseAwaitTo } from "./awaitTo.js";
|
|
2
|
+
import { PromiseLimitFunction, PromiseLimitFunctionOptions, promiseLimit, promiseLimitFunction } from "./pLimit.js";
|
|
3
|
+
export { PromiseLimitFunction, PromiseLimitFunctionOptions, promiseAwaitTo, promiseLimit, promiseLimitFunction };
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
const require_rolldown_runtime = require('../_virtual/rolldown_runtime.cjs');
|
|
2
|
+
let p_limit = require("p-limit");
|
|
3
|
+
p_limit = require_rolldown_runtime.__toESM(p_limit);
|
|
4
|
+
|
|
5
|
+
//#region src/promise/pLimit.ts
|
|
6
|
+
const promiseLimit = p_limit.default;
|
|
7
|
+
const promiseLimitFunction = p_limit.limitFunction;
|
|
8
|
+
|
|
9
|
+
//#endregion
|
|
10
|
+
exports.promiseLimit = promiseLimit;
|
|
11
|
+
exports.promiseLimitFunction = promiseLimitFunction;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import pLimit, { LimitFunction, Options, limitFunction } from "p-limit";
|
|
2
|
+
|
|
3
|
+
//#region src/promise/pLimit.d.ts
|
|
4
|
+
type PromiseLimitFunctionOptions = Options;
|
|
5
|
+
type PromiseLimitFunction = LimitFunction;
|
|
6
|
+
declare const promiseLimit: typeof pLimit;
|
|
7
|
+
declare const promiseLimitFunction: typeof limitFunction;
|
|
8
|
+
//#endregion
|
|
9
|
+
export { PromiseLimitFunction, PromiseLimitFunctionOptions, promiseLimit, promiseLimitFunction };
|
|
10
|
+
//# sourceMappingURL=pLimit.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pLimit.d.ts","names":[],"sources":["../../../src/promise/pLimit.ts"],"sourcesContent":[],"mappings":";;;KAGY,2BAAA,GAA8B;AAA9B,KACA,oBAAA,GAAuB,aADO;AAC9B,cAEC,YAFmB,EAAA,OAEP,MAFU;AAEtB,cACA,oBADqB,EAAA,OACD,aADC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import pLimit, { limitFunction } from "p-limit";
|
|
2
|
+
|
|
3
|
+
//#region src/promise/pLimit.ts
|
|
4
|
+
const promiseLimit = pLimit;
|
|
5
|
+
const promiseLimitFunction = limitFunction;
|
|
6
|
+
|
|
7
|
+
//#endregion
|
|
8
|
+
export { promiseLimit, promiseLimitFunction };
|
|
9
|
+
//# sourceMappingURL=pLimit.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pLimit.js","names":[],"sources":["../../../src/promise/pLimit.ts"],"sourcesContent":["import type { LimitFunction, Options } from 'p-limit'\nimport pLimit, { limitFunction } from 'p-limit'\n\nexport type PromiseLimitFunctionOptions = Options\nexport type PromiseLimitFunction = LimitFunction\n\nexport const promiseLimit = pLimit\nexport const promiseLimitFunction = limitFunction\n"],"mappings":";;;AAMA,MAAa,eAAe;AAC5B,MAAa,uBAAuB"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
|
|
2
|
+
//#region src/regexp/OTHERS.ts
|
|
3
|
+
const anyRuleWithBracket = {
|
|
4
|
+
title: "匹配中/方括号",
|
|
5
|
+
rule: /\[([^\]]+)\]/g,
|
|
6
|
+
examples: ["h[e]llo"]
|
|
7
|
+
};
|
|
8
|
+
const anyRuleWithBrace = {
|
|
9
|
+
title: "匹配大/花括号",
|
|
10
|
+
rule: /\{([^}]+)\}/g,
|
|
11
|
+
examples: ["h{e}llo"]
|
|
12
|
+
};
|
|
13
|
+
|
|
14
|
+
//#endregion
|
|
15
|
+
exports.anyRuleWithBrace = anyRuleWithBrace;
|
|
16
|
+
exports.anyRuleWithBracket = anyRuleWithBracket;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
//#region src/regexp/OTHERS.d.ts
|
|
2
|
+
declare const anyRuleWithBracket: {
|
|
3
|
+
title: string;
|
|
4
|
+
rule: RegExp;
|
|
5
|
+
examples: string[];
|
|
6
|
+
};
|
|
7
|
+
declare const anyRuleWithBrace: {
|
|
8
|
+
title: string;
|
|
9
|
+
rule: RegExp;
|
|
10
|
+
examples: string[];
|
|
11
|
+
};
|
|
12
|
+
//#endregion
|
|
13
|
+
export { anyRuleWithBrace, anyRuleWithBracket };
|
|
14
|
+
//# sourceMappingURL=OTHERS.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"OTHERS.d.ts","names":[],"sources":["../../../src/regexp/OTHERS.ts"],"sourcesContent":[],"mappings":";cAAa;EAAA,KAAA,EAAA,MAAA;EAOA,IAAA,EADZ,MACY;;;cAAA;;QAIZ"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
//#region src/regexp/OTHERS.ts
|
|
2
|
+
const anyRuleWithBracket = {
|
|
3
|
+
title: "匹配中/方括号",
|
|
4
|
+
rule: /\[([^\]]+)\]/g,
|
|
5
|
+
examples: ["h[e]llo"]
|
|
6
|
+
};
|
|
7
|
+
const anyRuleWithBrace = {
|
|
8
|
+
title: "匹配大/花括号",
|
|
9
|
+
rule: /\{([^}]+)\}/g,
|
|
10
|
+
examples: ["h{e}llo"]
|
|
11
|
+
};
|
|
12
|
+
|
|
13
|
+
//#endregion
|
|
14
|
+
export { anyRuleWithBrace, anyRuleWithBracket };
|
|
15
|
+
//# sourceMappingURL=OTHERS.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"OTHERS.js","names":[],"sources":["../../../src/regexp/OTHERS.ts"],"sourcesContent":["export const anyRuleWithBracket = {\n // 参考:\n // https://www.runoob.com/w3cnote/java-capture-group.html\n title: '匹配中/方括号',\n rule: /\\[([^\\]]+)\\]/g,\n examples: ['h[e]llo'],\n}\nexport const anyRuleWithBrace = {\n title: '匹配大/花括号',\n rule: /\\{([^}]+)\\}/g,\n examples: ['h{e}llo'],\n}\n"],"mappings":";AAAA,MAAa,qBAAqB;CAGhC,OAAO;CACP,MAAM;CACN,UAAU,CAAC,UAAU;CACtB;AACD,MAAa,mBAAmB;CAC9B,OAAO;CACP,MAAM;CACN,UAAU,CAAC,UAAU;CACtB"}
|