@fangzhongya/utils 0.0.34 → 0.0.35
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/basic/array/asyncMergeArray.d.cts +9 -0
- package/dist/basic/array/asyncMergeArray.d.ts +9 -0
- package/dist/basic/array/compareArray.cjs +7 -1
- package/dist/basic/array/compareArray.d.cts +11 -0
- package/dist/basic/array/compareArray.d.ts +11 -0
- package/dist/basic/array/compareArray.js +7 -1
- package/dist/basic/array/deleteArray.d.cts +6 -0
- package/dist/basic/array/deleteArray.d.ts +6 -0
- package/dist/basic/array/duplicateRemoval.d.cts +9 -0
- package/dist/basic/array/duplicateRemoval.d.ts +9 -0
- package/dist/basic/array/index.cjs +6 -3
- package/dist/basic/array/index.d.cts +8 -0
- package/dist/basic/array/index.d.ts +8 -0
- package/dist/basic/array/index.js +5 -2
- package/dist/basic/array/isArray.d.cts +8 -0
- package/dist/basic/array/isArray.d.ts +8 -0
- package/dist/basic/array/replaceAfter.d.cts +11 -0
- package/dist/basic/array/replaceAfter.d.ts +11 -0
- package/dist/basic/array/sortObj.d.cts +10 -0
- package/dist/basic/array/sortObj.d.ts +10 -0
- package/dist/basic/array/toggleArray.d.cts +10 -0
- package/dist/basic/array/toggleArray.d.ts +10 -0
- package/dist/basic/index.cjs +4 -4
- package/dist/basic/index.d.cts +38 -0
- package/dist/basic/index.d.ts +38 -0
- package/dist/basic/index.js +3 -3
- package/dist/basic/object/attrValueSort.d.cts +12 -0
- package/dist/basic/object/attrValueSort.d.ts +12 -0
- package/dist/basic/object/deepCopy.d.cts +8 -0
- package/dist/basic/object/deepCopy.d.ts +8 -0
- package/dist/basic/object/filterObject.d.cts +14 -0
- package/dist/basic/object/filterObject.d.ts +14 -0
- package/dist/basic/object/getSort.d.cts +10 -0
- package/dist/basic/object/getSort.d.ts +10 -0
- package/dist/basic/object/hasOwn.d.cts +9 -0
- package/dist/basic/object/hasOwn.d.ts +9 -0
- package/dist/basic/object/index.d.cts +12 -0
- package/dist/basic/object/index.d.ts +12 -0
- package/dist/basic/object/isObject.d.cts +8 -0
- package/dist/basic/object/isObject.d.ts +8 -0
- package/dist/basic/object/isObjectArray.d.cts +8 -0
- package/dist/basic/object/isObjectArray.d.ts +8 -0
- package/dist/basic/object/mergeObject.d.cts +11 -0
- package/dist/basic/object/mergeObject.d.ts +11 -0
- package/dist/basic/object/objValue.d.cts +7 -0
- package/dist/basic/object/objValue.d.ts +7 -0
- package/dist/basic/object/reverseObj.d.cts +9 -0
- package/dist/basic/object/reverseObj.d.ts +9 -0
- package/dist/basic/object/setSort.d.cts +7 -0
- package/dist/basic/object/setSort.d.ts +7 -0
- package/dist/basic/object/unmergeObject.d.cts +11 -0
- package/dist/basic/object/unmergeObject.d.ts +11 -0
- package/dist/basic/string/appearNum.d.cts +9 -0
- package/dist/basic/string/appearNum.d.ts +9 -0
- package/dist/basic/string/appearNumSeat.d.cts +10 -0
- package/dist/basic/string/appearNumSeat.d.ts +10 -0
- package/dist/basic/string/deComment.d.cts +7 -0
- package/dist/basic/string/deComment.d.ts +7 -0
- package/dist/basic/string/firstLower.d.cts +8 -0
- package/dist/basic/string/firstLower.d.ts +8 -0
- package/dist/basic/string/firstUpper.d.cts +8 -0
- package/dist/basic/string/firstUpper.d.ts +8 -0
- package/dist/basic/string/getImports.d.cts +22 -0
- package/dist/basic/string/getImports.d.ts +22 -0
- package/dist/basic/string/getStartSame.d.cts +9 -0
- package/dist/basic/string/getStartSame.d.ts +9 -0
- package/dist/basic/string/getStartSames.d.cts +9 -0
- package/dist/basic/string/getStartSames.d.ts +9 -0
- package/dist/basic/string/getStrNunPosit.d.cts +10 -0
- package/dist/basic/string/getStrNunPosit.d.ts +10 -0
- package/dist/basic/string/index.d.cts +15 -0
- package/dist/basic/string/index.d.ts +15 -0
- package/dist/basic/string/splitUpper.d.cts +8 -0
- package/dist/basic/string/splitUpper.d.ts +8 -0
- package/dist/basic/string/startsNum.d.cts +9 -0
- package/dist/basic/string/startsNum.d.ts +9 -0
- package/dist/basic/string/toFunction.d.cts +19 -0
- package/dist/basic/string/toFunction.d.ts +19 -0
- package/dist/basic/string/toJson.d.cts +4 -0
- package/dist/basic/string/toJson.d.ts +4 -0
- package/dist/basic/string/toJsons.d.cts +60 -0
- package/dist/basic/string/toJsons.d.ts +60 -0
- package/dist/basic/string/toStringParse.d.cts +6 -0
- package/dist/basic/string/toStringParse.d.ts +6 -0
- package/dist/{chunk-7UVIWZ2J.js → chunk-ATRR4ELS.js} +4 -0
- package/dist/{chunk-QBGA4H7C.js → chunk-AXX6AFYC.js} +1 -1
- package/dist/chunk-NDKOWDDX.cjs +17 -0
- package/dist/{chunk-F4IWIVCD.cjs → chunk-SR4YVP26.cjs} +4 -0
- package/dist/{chunk-4SFMC3WS.cjs → chunk-VT3YWR6G.cjs} +2 -2
- package/dist/chunk-WQ2PUZ2S.js +17 -0
- package/dist/css/fetchUnitValue.d.cts +10 -0
- package/dist/css/fetchUnitValue.d.ts +10 -0
- package/dist/css/getAttrObj.d.cts +11 -0
- package/dist/css/getAttrObj.d.ts +11 -0
- package/dist/css/getCss.d.cts +9 -0
- package/dist/css/getCss.d.ts +9 -0
- package/dist/css/getPositionRelative.d.cts +7 -0
- package/dist/css/getPositionRelative.d.ts +7 -0
- package/dist/css/getPrentClass.d.cts +7 -0
- package/dist/css/getPrentClass.d.ts +7 -0
- package/dist/css/getPrentCorres.d.cts +7 -0
- package/dist/css/getPrentCorres.d.ts +7 -0
- package/dist/css/getSVG.d.cts +14 -0
- package/dist/css/getSVG.d.ts +14 -0
- package/dist/css/getScssImports.d.cts +8 -0
- package/dist/css/getScssImports.d.ts +8 -0
- package/dist/css/index.d.cts +11 -0
- package/dist/css/index.d.ts +11 -0
- package/dist/css/setClassName.d.cts +6 -0
- package/dist/css/setClassName.d.ts +6 -0
- package/dist/css/setCss.d.cts +11 -0
- package/dist/css/setCss.d.ts +11 -0
- package/dist/css/setObjStyle.d.cts +12 -0
- package/dist/css/setObjStyle.d.ts +12 -0
- package/dist/date/format.d.cts +3 -0
- package/dist/date/format.d.ts +3 -0
- package/dist/date/index.d.cts +1 -0
- package/dist/date/index.d.ts +1 -0
- package/dist/dom/getLocus.d.cts +14 -0
- package/dist/dom/getLocus.d.ts +14 -0
- package/dist/dom/getShiftEvent.d.cts +25 -0
- package/dist/dom/getShiftEvent.d.ts +25 -0
- package/dist/dom/index.d.cts +2 -0
- package/dist/dom/index.d.ts +2 -0
- package/dist/html/analysisHtml.d.cts +13 -0
- package/dist/html/analysisHtml.d.ts +13 -0
- package/dist/html/generateHtml.d.cts +5 -0
- package/dist/html/generateHtml.d.ts +5 -0
- package/dist/html/getVueText.d.cts +16 -0
- package/dist/html/getVueText.d.ts +16 -0
- package/dist/html/htmlEscape.d.cts +8 -0
- package/dist/html/htmlEscape.d.ts +8 -0
- package/dist/html/index.d.cts +4 -0
- package/dist/html/index.d.ts +4 -0
- package/dist/index--yFTfMpc.d.cts +29 -0
- package/dist/index-B7gdHwF9.d.cts +40 -0
- package/dist/index-BU0xla6v.d.cts +31 -0
- package/dist/index-BYfEDFkm.d.ts +22 -0
- package/dist/index-BbrWO_KD.d.cts +16 -0
- package/dist/index-BiHaQlE9.d.cts +14 -0
- package/dist/index-Bo-c8HaW.d.cts +9 -0
- package/dist/index-BocAlCa8.d.ts +8 -0
- package/dist/index-Bq6WKjlK.d.ts +29 -0
- package/dist/index-BqhKBGyX.d.ts +14 -0
- package/dist/index-Bta_eezz.d.ts +12 -0
- package/dist/index-C0q7yBX5.d.cts +29 -0
- package/dist/index-C1rfQdS-.d.ts +8 -0
- package/dist/index-CK2c-6vv.d.cts +8 -0
- package/dist/index-CLnASTZ5.d.ts +29 -0
- package/dist/index-CPO1AFVg.d.ts +14 -0
- package/dist/index-CS54GrWo.d.ts +16 -0
- package/dist/index-CdRz4xJD.d.ts +15 -0
- package/dist/index-CmiMKPSL.d.ts +43 -0
- package/dist/index-CnrmwHvE.d.cts +15 -0
- package/dist/index-Cqj4dm5n.d.ts +8 -0
- package/dist/index-CsYVH5m1.d.cts +8 -0
- package/dist/index-D1xTdh0f.d.cts +8 -0
- package/dist/index-D8_Udh46.d.cts +22 -0
- package/dist/index-DAi9PP0w.d.cts +13 -0
- package/dist/index-DE6mtDGJ.d.ts +9 -0
- package/dist/index-DOq59RNr.d.ts +31 -0
- package/dist/index-DPrdy8Ms.d.ts +40 -0
- package/dist/index-DaryquSt.d.cts +43 -0
- package/dist/index-Dvp25i1P.d.cts +10 -0
- package/dist/index-cuR7l2XV.d.cts +14 -0
- package/dist/index-syb18q2f.d.ts +10 -0
- package/dist/index-v-06_rNI.d.cts +12 -0
- package/dist/index-vCPDFXBq.d.ts +13 -0
- package/dist/index.cjs +7 -7
- package/dist/index.d.cts +99 -0
- package/dist/index.d.ts +99 -0
- package/dist/index.js +8 -8
- package/dist/iss/index.d.cts +3 -0
- package/dist/iss/index.d.ts +3 -0
- package/dist/judge/index.d.cts +5 -0
- package/dist/judge/index.d.ts +5 -0
- package/dist/judge/judge.d.cts +155 -0
- package/dist/judge/judge.d.ts +155 -0
- package/dist/judge/matchs.d.cts +10 -0
- package/dist/judge/matchs.d.ts +10 -0
- package/dist/judge/matchsEnd.d.cts +9 -0
- package/dist/judge/matchsEnd.d.ts +9 -0
- package/dist/judge/matchsStart.d.cts +9 -0
- package/dist/judge/matchsStart.d.ts +9 -0
- package/dist/judge/matchsWhole.d.cts +9 -0
- package/dist/judge/matchsWhole.d.ts +9 -0
- package/dist/load/getSynch.d.cts +8 -0
- package/dist/load/getSynch.d.ts +8 -0
- package/dist/load/index.d.cts +2 -0
- package/dist/load/index.d.ts +2 -0
- package/dist/load/loadScript.d.cts +3 -0
- package/dist/load/loadScript.d.ts +3 -0
- package/dist/log/index.d.cts +1 -0
- package/dist/log/index.d.ts +1 -0
- package/dist/log/styleLog.d.cts +68 -0
- package/dist/log/styleLog.d.ts +68 -0
- package/dist/name/getComponentNames.d.cts +8 -0
- package/dist/name/getComponentNames.d.ts +8 -0
- package/dist/name/getNames.d.cts +8 -0
- package/dist/name/getNames.d.ts +8 -0
- package/dist/name/humpToLine.d.cts +8 -0
- package/dist/name/humpToLine.d.ts +8 -0
- package/dist/name/index.d.cts +5 -0
- package/dist/name/index.d.ts +5 -0
- package/dist/name/lineToLargeHump.d.cts +8 -0
- package/dist/name/lineToLargeHump.d.ts +8 -0
- package/dist/name/lineToSmallHump.d.cts +8 -0
- package/dist/name/lineToSmallHump.d.ts +8 -0
- package/dist/node/getPort.d.cts +13 -0
- package/dist/node/getPort.d.ts +13 -0
- package/dist/node/index.d.cts +1 -0
- package/dist/node/index.d.ts +1 -0
- package/dist/tree/getTreeObj.d.cts +26 -0
- package/dist/tree/getTreeObj.d.ts +26 -0
- package/dist/tree/index.d.cts +2 -0
- package/dist/tree/index.d.ts +2 -0
- package/dist/tree/splitGroup.d.cts +15 -0
- package/dist/tree/splitGroup.d.ts +15 -0
- package/dist/urls/getImportUrl.d.cts +9 -0
- package/dist/urls/getImportUrl.d.ts +9 -0
- package/dist/urls/getImportUrlSuffix.d.cts +9 -0
- package/dist/urls/getImportUrlSuffix.d.ts +9 -0
- package/dist/urls/getNewFileName.d.cts +8 -0
- package/dist/urls/getNewFileName.d.ts +8 -0
- package/dist/urls/getReplaceCompleteUrl.d.cts +9 -0
- package/dist/urls/getReplaceCompleteUrl.d.ts +9 -0
- package/dist/urls/getReplaceImportUrl.d.cts +9 -0
- package/dist/urls/getReplaceImportUrl.d.ts +9 -0
- package/dist/urls/getReplaceUrl.d.cts +9 -0
- package/dist/urls/getReplaceUrl.d.ts +9 -0
- package/dist/urls/getReplaceUrls.d.cts +9 -0
- package/dist/urls/getReplaceUrls.d.ts +9 -0
- package/dist/urls/getSuffix.d.cts +8 -0
- package/dist/urls/getSuffix.d.ts +8 -0
- package/dist/urls/getUrlCatalogue.d.cts +8 -0
- package/dist/urls/getUrlCatalogue.d.ts +8 -0
- package/dist/urls/getUrlCatalogueLast.d.cts +8 -0
- package/dist/urls/getUrlCatalogueLast.d.ts +8 -0
- package/dist/urls/getUrlCatalogueObj.d.cts +17 -0
- package/dist/urls/getUrlCatalogueObj.d.ts +17 -0
- package/dist/urls/index.d.cts +11 -0
- package/dist/urls/index.d.ts +11 -0
- package/dist/window/copy.d.cts +3 -0
- package/dist/window/copy.d.ts +3 -0
- package/dist/window/getParam.d.cts +9 -0
- package/dist/window/getParam.d.ts +9 -0
- package/dist/window/index.d.cts +2 -0
- package/dist/window/index.d.ts +2 -0
- package/package.json +1 -1
- package/dist/chunk-M53E7HJ2.js +0 -0
- package/dist/chunk-UC2AI4QC.cjs +0 -1
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 合并两个对象不改原对象的值
|
|
3
|
+
* @param {T} a 合并对象
|
|
4
|
+
* @param {T} b 合并对象
|
|
5
|
+
* @param {number} j 合并级别
|
|
6
|
+
* @param {boolean} i 是否合并数组
|
|
7
|
+
* @returns {T} 合并的对象
|
|
8
|
+
*/
|
|
9
|
+
declare function unmergeObject<T>(a: T, b: T, j?: number, i?: boolean): T;
|
|
10
|
+
|
|
11
|
+
export { unmergeObject };
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 合并两个对象不改原对象的值
|
|
3
|
+
* @param {T} a 合并对象
|
|
4
|
+
* @param {T} b 合并对象
|
|
5
|
+
* @param {number} j 合并级别
|
|
6
|
+
* @param {boolean} i 是否合并数组
|
|
7
|
+
* @returns {T} 合并的对象
|
|
8
|
+
*/
|
|
9
|
+
declare function unmergeObject<T>(a: T, b: T, j?: number, i?: boolean): T;
|
|
10
|
+
|
|
11
|
+
export { unmergeObject };
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 查询字符串出现第n次数的位置
|
|
3
|
+
* @param {string} str 被查询的字符串
|
|
4
|
+
* @param {string | RegExp} t 查询的字符串 或者 正则表达式
|
|
5
|
+
* @param {number} n 第几次出现
|
|
6
|
+
* @returns {number} 第n次出现时在字符串的位置 -1 表示没有查询到
|
|
7
|
+
*/
|
|
8
|
+
declare function appearNumSeat(str: string, t: string | RegExp, n: number): number;
|
|
9
|
+
|
|
10
|
+
export { appearNumSeat };
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 查询字符串出现第n次数的位置
|
|
3
|
+
* @param {string} str 被查询的字符串
|
|
4
|
+
* @param {string | RegExp} t 查询的字符串 或者 正则表达式
|
|
5
|
+
* @param {number} n 第几次出现
|
|
6
|
+
* @returns {number} 第n次出现时在字符串的位置 -1 表示没有查询到
|
|
7
|
+
*/
|
|
8
|
+
declare function appearNumSeat(str: string, t: string | RegExp, n: number): number;
|
|
9
|
+
|
|
10
|
+
export { appearNumSeat };
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 获取代码中的所有导入/导出路径
|
|
3
|
+
* 支持以下语法:
|
|
4
|
+
* 1. 静态导入:
|
|
5
|
+
* - import 'module'
|
|
6
|
+
* - import x from 'module'
|
|
7
|
+
* - import { x } from 'module'
|
|
8
|
+
* - import * as x from 'module'
|
|
9
|
+
* - import type ... from 'module'
|
|
10
|
+
* 2. 动态导入:
|
|
11
|
+
* - import('module')
|
|
12
|
+
* 3. 导出:
|
|
13
|
+
* - export 'module' (无效语法,忽略)
|
|
14
|
+
* - export ... from 'module'
|
|
15
|
+
* - export * from 'module'
|
|
16
|
+
* - export * as x from 'module'
|
|
17
|
+
* - export type ... from 'module'
|
|
18
|
+
*/
|
|
19
|
+
declare function getImportss(code: string): string[];
|
|
20
|
+
declare function getImports(code: string, includeType?: boolean): string[];
|
|
21
|
+
|
|
22
|
+
export { getImports, getImportss };
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 获取代码中的所有导入/导出路径
|
|
3
|
+
* 支持以下语法:
|
|
4
|
+
* 1. 静态导入:
|
|
5
|
+
* - import 'module'
|
|
6
|
+
* - import x from 'module'
|
|
7
|
+
* - import { x } from 'module'
|
|
8
|
+
* - import * as x from 'module'
|
|
9
|
+
* - import type ... from 'module'
|
|
10
|
+
* 2. 动态导入:
|
|
11
|
+
* - import('module')
|
|
12
|
+
* 3. 导出:
|
|
13
|
+
* - export 'module' (无效语法,忽略)
|
|
14
|
+
* - export ... from 'module'
|
|
15
|
+
* - export * from 'module'
|
|
16
|
+
* - export * as x from 'module'
|
|
17
|
+
* - export type ... from 'module'
|
|
18
|
+
*/
|
|
19
|
+
declare function getImportss(code: string): string[];
|
|
20
|
+
declare function getImports(code: string, includeType?: boolean): string[];
|
|
21
|
+
|
|
22
|
+
export { getImports, getImportss };
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
export { appearNum } from './appearNum.cjs';
|
|
2
|
+
export { appearNumSeat } from './appearNumSeat.cjs';
|
|
3
|
+
export { deComment } from './deComment.cjs';
|
|
4
|
+
export { firstLower } from './firstLower.cjs';
|
|
5
|
+
export { firstUpper } from './firstUpper.cjs';
|
|
6
|
+
export { getImports, getImportss } from './getImports.cjs';
|
|
7
|
+
export { getStartSame } from './getStartSame.cjs';
|
|
8
|
+
export { getStartSames } from './getStartSames.cjs';
|
|
9
|
+
export { getStrNunPosit } from './getStrNunPosit.cjs';
|
|
10
|
+
export { splitUpper } from './splitUpper.cjs';
|
|
11
|
+
export { startsNum } from './startsNum.cjs';
|
|
12
|
+
export { getFunctionFormat, toFunction } from './toFunction.cjs';
|
|
13
|
+
export { toJSONParse, toJSONStringify } from './toJson.cjs';
|
|
14
|
+
export { CodeBlock, serializeCodeBlock, serializeFunctionRef, toJSONSParse, toJSONSStringify } from './toJsons.cjs';
|
|
15
|
+
export { toStringParse } from './toStringParse.cjs';
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
export { appearNum } from './appearNum.js';
|
|
2
|
+
export { appearNumSeat } from './appearNumSeat.js';
|
|
3
|
+
export { deComment } from './deComment.js';
|
|
4
|
+
export { firstLower } from './firstLower.js';
|
|
5
|
+
export { firstUpper } from './firstUpper.js';
|
|
6
|
+
export { getImports, getImportss } from './getImports.js';
|
|
7
|
+
export { getStartSame } from './getStartSame.js';
|
|
8
|
+
export { getStartSames } from './getStartSames.js';
|
|
9
|
+
export { getStrNunPosit } from './getStrNunPosit.js';
|
|
10
|
+
export { splitUpper } from './splitUpper.js';
|
|
11
|
+
export { startsNum } from './startsNum.js';
|
|
12
|
+
export { getFunctionFormat, toFunction } from './toFunction.js';
|
|
13
|
+
export { toJSONParse, toJSONStringify } from './toJson.js';
|
|
14
|
+
export { CodeBlock, serializeCodeBlock, serializeFunctionRef, toJSONSParse, toJSONSStringify } from './toJsons.js';
|
|
15
|
+
export { toStringParse } from './toStringParse.js';
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
interface FunctionFormat {
|
|
2
|
+
isAsync: boolean;
|
|
3
|
+
isGenerator: boolean;
|
|
4
|
+
name?: string;
|
|
5
|
+
param: string;
|
|
6
|
+
body: string;
|
|
7
|
+
}
|
|
8
|
+
/**
|
|
9
|
+
* 将函数字符串转换为可执行函数(支持异步函数)
|
|
10
|
+
*/
|
|
11
|
+
declare function toFunction(str: string, key?: string): Function | undefined;
|
|
12
|
+
/**
|
|
13
|
+
* 解析函数字符串格式(合并正则表达式优化性能)
|
|
14
|
+
* @param v - 输入的函数或字符串
|
|
15
|
+
* @returns 解析后的函数结构对象,失败返回null
|
|
16
|
+
*/
|
|
17
|
+
declare function getFunctionFormat(v: Function | string): FunctionFormat | undefined;
|
|
18
|
+
|
|
19
|
+
export { getFunctionFormat, toFunction };
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
interface FunctionFormat {
|
|
2
|
+
isAsync: boolean;
|
|
3
|
+
isGenerator: boolean;
|
|
4
|
+
name?: string;
|
|
5
|
+
param: string;
|
|
6
|
+
body: string;
|
|
7
|
+
}
|
|
8
|
+
/**
|
|
9
|
+
* 将函数字符串转换为可执行函数(支持异步函数)
|
|
10
|
+
*/
|
|
11
|
+
declare function toFunction(str: string, key?: string): Function | undefined;
|
|
12
|
+
/**
|
|
13
|
+
* 解析函数字符串格式(合并正则表达式优化性能)
|
|
14
|
+
* @param v - 输入的函数或字符串
|
|
15
|
+
* @returns 解析后的函数结构对象,失败返回null
|
|
16
|
+
*/
|
|
17
|
+
declare function getFunctionFormat(v: Function | string): FunctionFormat | undefined;
|
|
18
|
+
|
|
19
|
+
export { getFunctionFormat, toFunction };
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
type ObjAny<T = any> = Record<string | number | symbol, T>;
|
|
2
|
+
declare const TYPE_MARKERS: {
|
|
3
|
+
FUNCTION_REF: string;
|
|
4
|
+
CODE_BLOCK: string;
|
|
5
|
+
/**内置对象*/
|
|
6
|
+
SYMBOL: string;
|
|
7
|
+
FUNCTION: string;
|
|
8
|
+
UNDEFINED: string;
|
|
9
|
+
DATE: string;
|
|
10
|
+
REGEXP: string;
|
|
11
|
+
NAN: string;
|
|
12
|
+
BIGINT: string;
|
|
13
|
+
MAP: string;
|
|
14
|
+
SET: string;
|
|
15
|
+
ARRAY_BUFFER: string;
|
|
16
|
+
TYPED_ARRAY: string;
|
|
17
|
+
DATA_VIEW: string;
|
|
18
|
+
ERROR: string;
|
|
19
|
+
URL: string;
|
|
20
|
+
INFINITY: string;
|
|
21
|
+
NEGATIVE_INFINITY: string;
|
|
22
|
+
INT8_ARRAY: string;
|
|
23
|
+
UINT8_ARRAY: string;
|
|
24
|
+
UINT8_CLAMPED_ARRAY: string;
|
|
25
|
+
INT16_ARRAY: string;
|
|
26
|
+
UINT16_ARRAY: string;
|
|
27
|
+
INT32_ARRAY: string;
|
|
28
|
+
UINT32_ARRAY: string;
|
|
29
|
+
FLOAT32_ARRAY: string;
|
|
30
|
+
FLOAT64_ARRAY: string;
|
|
31
|
+
BIGINT64_ARRAY: string;
|
|
32
|
+
BIGUINT64_ARRAY: string;
|
|
33
|
+
};
|
|
34
|
+
/**
|
|
35
|
+
* 安全序列化函数(支持更多内置对象)
|
|
36
|
+
*/
|
|
37
|
+
declare function toJSONSStringify(obj: any, space?: number | string): string;
|
|
38
|
+
/**
|
|
39
|
+
* 安全反序列化函数(完整支持更多内置对象)
|
|
40
|
+
*/
|
|
41
|
+
declare function toJSONSParse<T = any>(str: string, context?: ObjAny): T;
|
|
42
|
+
type CodeBlock = {
|
|
43
|
+
params: string[];
|
|
44
|
+
body: string;
|
|
45
|
+
name?: string;
|
|
46
|
+
};
|
|
47
|
+
/**
|
|
48
|
+
* 序列化函数引用
|
|
49
|
+
*/
|
|
50
|
+
declare function serializeFunctionRef(key: string): {
|
|
51
|
+
[TYPE_MARKERS.FUNCTION_REF]: string;
|
|
52
|
+
};
|
|
53
|
+
/**
|
|
54
|
+
* 序列化代码块
|
|
55
|
+
*/
|
|
56
|
+
declare function serializeCodeBlock(value: CodeBlock): {
|
|
57
|
+
[TYPE_MARKERS.CODE_BLOCK]: CodeBlock;
|
|
58
|
+
};
|
|
59
|
+
|
|
60
|
+
export { type CodeBlock, serializeCodeBlock, serializeFunctionRef, toJSONSParse, toJSONSStringify };
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
type ObjAny<T = any> = Record<string | number | symbol, T>;
|
|
2
|
+
declare const TYPE_MARKERS: {
|
|
3
|
+
FUNCTION_REF: string;
|
|
4
|
+
CODE_BLOCK: string;
|
|
5
|
+
/**内置对象*/
|
|
6
|
+
SYMBOL: string;
|
|
7
|
+
FUNCTION: string;
|
|
8
|
+
UNDEFINED: string;
|
|
9
|
+
DATE: string;
|
|
10
|
+
REGEXP: string;
|
|
11
|
+
NAN: string;
|
|
12
|
+
BIGINT: string;
|
|
13
|
+
MAP: string;
|
|
14
|
+
SET: string;
|
|
15
|
+
ARRAY_BUFFER: string;
|
|
16
|
+
TYPED_ARRAY: string;
|
|
17
|
+
DATA_VIEW: string;
|
|
18
|
+
ERROR: string;
|
|
19
|
+
URL: string;
|
|
20
|
+
INFINITY: string;
|
|
21
|
+
NEGATIVE_INFINITY: string;
|
|
22
|
+
INT8_ARRAY: string;
|
|
23
|
+
UINT8_ARRAY: string;
|
|
24
|
+
UINT8_CLAMPED_ARRAY: string;
|
|
25
|
+
INT16_ARRAY: string;
|
|
26
|
+
UINT16_ARRAY: string;
|
|
27
|
+
INT32_ARRAY: string;
|
|
28
|
+
UINT32_ARRAY: string;
|
|
29
|
+
FLOAT32_ARRAY: string;
|
|
30
|
+
FLOAT64_ARRAY: string;
|
|
31
|
+
BIGINT64_ARRAY: string;
|
|
32
|
+
BIGUINT64_ARRAY: string;
|
|
33
|
+
};
|
|
34
|
+
/**
|
|
35
|
+
* 安全序列化函数(支持更多内置对象)
|
|
36
|
+
*/
|
|
37
|
+
declare function toJSONSStringify(obj: any, space?: number | string): string;
|
|
38
|
+
/**
|
|
39
|
+
* 安全反序列化函数(完整支持更多内置对象)
|
|
40
|
+
*/
|
|
41
|
+
declare function toJSONSParse<T = any>(str: string, context?: ObjAny): T;
|
|
42
|
+
type CodeBlock = {
|
|
43
|
+
params: string[];
|
|
44
|
+
body: string;
|
|
45
|
+
name?: string;
|
|
46
|
+
};
|
|
47
|
+
/**
|
|
48
|
+
* 序列化函数引用
|
|
49
|
+
*/
|
|
50
|
+
declare function serializeFunctionRef(key: string): {
|
|
51
|
+
[TYPE_MARKERS.FUNCTION_REF]: string;
|
|
52
|
+
};
|
|
53
|
+
/**
|
|
54
|
+
* 序列化代码块
|
|
55
|
+
*/
|
|
56
|
+
declare function serializeCodeBlock(value: CodeBlock): {
|
|
57
|
+
[TYPE_MARKERS.CODE_BLOCK]: CodeBlock;
|
|
58
|
+
};
|
|
59
|
+
|
|
60
|
+
export { type CodeBlock, serializeCodeBlock, serializeFunctionRef, toJSONSParse, toJSONSStringify };
|
|
@@ -13,6 +13,9 @@ import {
|
|
|
13
13
|
import {
|
|
14
14
|
asyncMergeArray
|
|
15
15
|
} from "./chunk-Q6FMBSK4.js";
|
|
16
|
+
import {
|
|
17
|
+
compareArray
|
|
18
|
+
} from "./chunk-WQ2PUZ2S.js";
|
|
16
19
|
import {
|
|
17
20
|
sortObj
|
|
18
21
|
} from "./chunk-O34QAOO7.js";
|
|
@@ -27,6 +30,7 @@ import {
|
|
|
27
30
|
var array_exports = {};
|
|
28
31
|
__export(array_exports, {
|
|
29
32
|
asyncMergeArray: () => asyncMergeArray,
|
|
33
|
+
compareArray: () => compareArray,
|
|
30
34
|
deleteArray: () => deleteArray,
|
|
31
35
|
duplicateRemoval: () => duplicateRemoval,
|
|
32
36
|
isArray: () => isArray,
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true});// packages/basic/array/compareArray.ts
|
|
2
|
+
function compareArray(arr1, arr2, compareFn = (a, b) => a === b) {
|
|
3
|
+
const front = arr1.filter(
|
|
4
|
+
(item1) => !arr2.some((item2) => compareFn(item1, item2))
|
|
5
|
+
);
|
|
6
|
+
const after = arr2.filter(
|
|
7
|
+
(item2) => !arr1.some((item1) => compareFn(item1, item2))
|
|
8
|
+
);
|
|
9
|
+
const same = arr1.filter(
|
|
10
|
+
(item1) => arr2.some((item2) => compareFn(item1, item2))
|
|
11
|
+
);
|
|
12
|
+
return { front, after, same, value: [...front, ...after] };
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
exports.compareArray = compareArray;
|
|
@@ -15,6 +15,9 @@ var _chunkSOAKYJIGcjs = require('./chunk-SOAKYJIG.cjs');
|
|
|
15
15
|
var _chunkTCMJPIRMcjs = require('./chunk-TCMJPIRM.cjs');
|
|
16
16
|
|
|
17
17
|
|
|
18
|
+
var _chunkNDKOWDDXcjs = require('./chunk-NDKOWDDX.cjs');
|
|
19
|
+
|
|
20
|
+
|
|
18
21
|
var _chunkXW3XIK3Dcjs = require('./chunk-XW3XIK3D.cjs');
|
|
19
22
|
|
|
20
23
|
|
|
@@ -27,6 +30,7 @@ var _chunk75ZPJI57cjs = require('./chunk-75ZPJI57.cjs');
|
|
|
27
30
|
var array_exports = {};
|
|
28
31
|
_chunk75ZPJI57cjs.__export.call(void 0, array_exports, {
|
|
29
32
|
asyncMergeArray: () => _chunkTCMJPIRMcjs.asyncMergeArray,
|
|
33
|
+
compareArray: () => _chunkNDKOWDDXcjs.compareArray,
|
|
30
34
|
deleteArray: () => _chunkXSQOJWXLcjs.deleteArray,
|
|
31
35
|
duplicateRemoval: () => _chunkGD3OA7GUcjs.duplicateRemoval,
|
|
32
36
|
isArray: () => _chunkISHLY7WMcjs.isArray,
|
|
@@ -6,7 +6,7 @@ var _chunk3SJOLMSIcjs = require('./chunk-3SJOLMSI.cjs');
|
|
|
6
6
|
var _chunk4E4OWBN7cjs = require('./chunk-4E4OWBN7.cjs');
|
|
7
7
|
|
|
8
8
|
|
|
9
|
-
var
|
|
9
|
+
var _chunkSR4YVP26cjs = require('./chunk-SR4YVP26.cjs');
|
|
10
10
|
|
|
11
11
|
|
|
12
12
|
var _chunk75ZPJI57cjs = require('./chunk-75ZPJI57.cjs');
|
|
@@ -14,7 +14,7 @@ var _chunk75ZPJI57cjs = require('./chunk-75ZPJI57.cjs');
|
|
|
14
14
|
// packages/basic/index.ts
|
|
15
15
|
var basic_exports = {};
|
|
16
16
|
_chunk75ZPJI57cjs.__export.call(void 0, basic_exports, {
|
|
17
|
-
array: () =>
|
|
17
|
+
array: () => _chunkSR4YVP26cjs.array_exports,
|
|
18
18
|
object: () => _chunk4E4OWBN7cjs.object_exports,
|
|
19
19
|
string: () => _chunk3SJOLMSIcjs.string_exports
|
|
20
20
|
});
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
// packages/basic/array/compareArray.ts
|
|
2
|
+
function compareArray(arr1, arr2, compareFn = (a, b) => a === b) {
|
|
3
|
+
const front = arr1.filter(
|
|
4
|
+
(item1) => !arr2.some((item2) => compareFn(item1, item2))
|
|
5
|
+
);
|
|
6
|
+
const after = arr2.filter(
|
|
7
|
+
(item2) => !arr1.some((item1) => compareFn(item1, item2))
|
|
8
|
+
);
|
|
9
|
+
const same = arr1.filter(
|
|
10
|
+
(item1) => arr2.some((item2) => compareFn(item1, item2))
|
|
11
|
+
);
|
|
12
|
+
return { front, after, same, value: [...front, ...after] };
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
export {
|
|
16
|
+
compareArray
|
|
17
|
+
};
|