@vope/utils 1.4.28 → 1.4.30
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/cjs/index.js +8 -2
- package/lib/memory/basic.js +1 -1
- package/lib/memory/simple.js +1 -1
- package/lib/neo4j-anchors.js +6 -0
- package/package.json +11 -7
- package/types/desens.d.ts +7 -7
- package/types/index.d.ts +1 -1
- package/types/memory/basic.d.ts +1 -1
- package/types/memory/simple.d.ts +1 -1
- package/types/neo4j-anchors.d.ts +5 -0
package/cjs/index.js
CHANGED
|
@@ -5531,7 +5531,7 @@ var MemoryBasic = class {
|
|
|
5531
5531
|
return this.list.reduce(callback, initialValue);
|
|
5532
5532
|
}
|
|
5533
5533
|
/**
|
|
5534
|
-
*
|
|
5534
|
+
* 判断存储是否包含指定类型
|
|
5535
5535
|
*/
|
|
5536
5536
|
includes(type) {
|
|
5537
5537
|
return this.memorys.has(type);
|
|
@@ -5722,7 +5722,7 @@ var MemorySimple = class {
|
|
|
5722
5722
|
return this.#memory.reduce(callback, initialValue);
|
|
5723
5723
|
}
|
|
5724
5724
|
/**
|
|
5725
|
-
*
|
|
5725
|
+
* 判断是否包含指定类型
|
|
5726
5726
|
*/
|
|
5727
5727
|
includes(type) {
|
|
5728
5728
|
return this.#memory.includes(type);
|
|
@@ -5774,6 +5774,12 @@ var Neo4jAhchors = class {
|
|
|
5774
5774
|
[neo4j.targetField]: end
|
|
5775
5775
|
});
|
|
5776
5776
|
}
|
|
5777
|
+
/**
|
|
5778
|
+
* 设置多边间隔弧长
|
|
5779
|
+
*/
|
|
5780
|
+
setRaidx(value) {
|
|
5781
|
+
this.config.radOffsetRaidx = value;
|
|
5782
|
+
}
|
|
5777
5783
|
/**
|
|
5778
5784
|
* 当图数据准备好后调用
|
|
5779
5785
|
*/
|
package/lib/memory/basic.js
CHANGED
package/lib/memory/simple.js
CHANGED
package/lib/neo4j-anchors.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vope/utils",
|
|
3
|
-
"version": "1.4.
|
|
3
|
+
"version": "1.4.30",
|
|
4
4
|
"description": "",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"publishConfig": {
|
|
@@ -19,7 +19,7 @@
|
|
|
19
19
|
"mocha": "mocha __tests/**/*.js",
|
|
20
20
|
"test": "npm run mocha",
|
|
21
21
|
"prepublishOnly": "npm run build & npm run test",
|
|
22
|
-
"debug": "npm run
|
|
22
|
+
"debug": "npm run start & npm run premocha"
|
|
23
23
|
},
|
|
24
24
|
"exports": {
|
|
25
25
|
".": {
|
|
@@ -29,21 +29,25 @@
|
|
|
29
29
|
},
|
|
30
30
|
"author": "vope",
|
|
31
31
|
"license": "ISC",
|
|
32
|
+
"sideEffects": [
|
|
33
|
+
"lib/storage/offline.js",
|
|
34
|
+
"src/storage/offline.ts"
|
|
35
|
+
],
|
|
32
36
|
"files": [
|
|
33
37
|
"cjs",
|
|
34
38
|
"lib",
|
|
35
39
|
"types"
|
|
36
40
|
],
|
|
37
41
|
"devDependencies": {
|
|
38
|
-
"@babel/parser": "^7.
|
|
39
|
-
"@babel/traverse": "^7.
|
|
40
|
-
"@babel/types": "^7.
|
|
42
|
+
"@babel/parser": "^7.26.5",
|
|
43
|
+
"@babel/traverse": "^7.26.5",
|
|
44
|
+
"@babel/types": "^7.26.5",
|
|
41
45
|
"@rollup/plugin-alias": "^5.1.1",
|
|
42
46
|
"@rollup/plugin-commonjs": "^28.0.0",
|
|
43
47
|
"@rollup/plugin-json": "^6.1.0",
|
|
44
48
|
"@rollup/plugin-node-resolve": "^15.3.0",
|
|
45
49
|
"@rollup/plugin-typescript": "^12.1.0",
|
|
46
|
-
"@types/babel__traverse": "^7.20.
|
|
50
|
+
"@types/babel__traverse": "^7.20.6",
|
|
47
51
|
"@types/mocha": "^10.0.6",
|
|
48
52
|
"@types/node": "^20.4.5",
|
|
49
53
|
"@types/sm-crypto": "^0.3.4",
|
|
@@ -53,7 +57,7 @@
|
|
|
53
57
|
"mocha": "^10.2.0",
|
|
54
58
|
"puppeteer": "^23.4.1",
|
|
55
59
|
"rimraf": "^5.0.5",
|
|
56
|
-
"rollup": "^4.
|
|
60
|
+
"rollup": "^4.34.6",
|
|
57
61
|
"tslib": "^2.6.1",
|
|
58
62
|
"typescript": "^5.3.3"
|
|
59
63
|
},
|
package/types/desens.d.ts
CHANGED
|
@@ -2,11 +2,11 @@ interface Rule {
|
|
|
2
2
|
/** 加密的开始(包含)和结束(包含)位置(位置信息基于明文) */
|
|
3
3
|
range: [number, number];
|
|
4
4
|
}
|
|
5
|
-
interface
|
|
5
|
+
export interface DesensDecrypt extends Rule {
|
|
6
6
|
/** 密文长度 */
|
|
7
7
|
modify: number;
|
|
8
8
|
}
|
|
9
|
-
interface
|
|
9
|
+
export interface DesensEncrypt extends Rule {
|
|
10
10
|
/** 密文 */
|
|
11
11
|
ciphertext: string;
|
|
12
12
|
}
|
|
@@ -16,17 +16,17 @@ interface EncryptRule extends Rule {
|
|
|
16
16
|
* @param encrypt 加密方法
|
|
17
17
|
* @returns 解密要素
|
|
18
18
|
*/
|
|
19
|
-
export declare const desensEncrypt: (plaintext: string, encrypt: (plaintext: string) =>
|
|
19
|
+
export declare const desensEncrypt: (plaintext: string, encrypt: (plaintext: string) => DesensEncrypt[]) => {
|
|
20
20
|
ciphertext: string;
|
|
21
|
-
rules:
|
|
21
|
+
rules: DesensDecrypt[];
|
|
22
22
|
};
|
|
23
23
|
/**
|
|
24
24
|
* 脱敏解密(对密文进行多个片段解密)
|
|
25
|
-
* @param
|
|
25
|
+
* @param ciphertext 密文
|
|
26
26
|
* @param rules 解密要素
|
|
27
27
|
* @param decrypt 解密方法
|
|
28
28
|
*/
|
|
29
|
-
export declare const desensDecrypt: (ciphertext: string, rules:
|
|
29
|
+
export declare const desensDecrypt: (ciphertext: string, rules: DesensDecrypt | DesensDecrypt[], decrypt: (ciphertext: string) => string) => string;
|
|
30
30
|
type Replacer = string | {
|
|
31
31
|
[Symbol.replace](text: string, size: number): string;
|
|
32
32
|
};
|
|
@@ -36,5 +36,5 @@ type Replacer = string | {
|
|
|
36
36
|
* @param rules 解密要素
|
|
37
37
|
* @param replacer 替换者
|
|
38
38
|
*/
|
|
39
|
-
export declare const desensReplace: (ciphertext: string, rules:
|
|
39
|
+
export declare const desensReplace: (ciphertext: string, rules: DesensDecrypt | DesensDecrypt[], replacer?: Replacer) => string;
|
|
40
40
|
export {};
|
package/types/index.d.ts
CHANGED
|
@@ -5,7 +5,7 @@ export { deepWeakEqual } from './compare/weak-equal';
|
|
|
5
5
|
export { hash8json } from './convert/json';
|
|
6
6
|
export { hash8object } from './convert/object';
|
|
7
7
|
export { hash8strings } from './convert/strings';
|
|
8
|
-
export { desensEncrypt, desensDecrypt, desensReplace } from './desens';
|
|
8
|
+
export { type DesensDecrypt, type DesensEncrypt, desensEncrypt, desensDecrypt, desensReplace } from './desens';
|
|
9
9
|
export { getEncoding } from './encoding';
|
|
10
10
|
export { inputRegex } from './input-regex';
|
|
11
11
|
export { isClass } from './is/class';
|
package/types/memory/basic.d.ts
CHANGED
|
@@ -56,7 +56,7 @@ export declare class MemoryBasic<T, Reactor, Type extends Memory.Type> {
|
|
|
56
56
|
*/
|
|
57
57
|
reduce<V>(callback: (previousValue: V, currentValue: T, currentIndex: number) => V, initialValue: V): V;
|
|
58
58
|
/**
|
|
59
|
-
*
|
|
59
|
+
* 判断存储是否包含指定类型
|
|
60
60
|
*/
|
|
61
61
|
includes(type: Type): boolean;
|
|
62
62
|
/**
|
package/types/memory/simple.d.ts
CHANGED
|
@@ -41,7 +41,7 @@ export declare class MemorySimple<T, Type extends Memory.Type> implements Basic<
|
|
|
41
41
|
*/
|
|
42
42
|
reduce<V>(callback: (previousValue: V, currentValue: T, currentIndex: number) => V, initialValue: V): V;
|
|
43
43
|
/**
|
|
44
|
-
*
|
|
44
|
+
* 判断是否包含指定类型
|
|
45
45
|
*/
|
|
46
46
|
includes(type: Type): boolean;
|
|
47
47
|
/**
|
package/types/neo4j-anchors.d.ts
CHANGED
|
@@ -4,6 +4,7 @@ interface IBox {
|
|
|
4
4
|
centerY: number;
|
|
5
5
|
}
|
|
6
6
|
interface Config {
|
|
7
|
+
/** 多边之间的间隔弧长 */
|
|
7
8
|
radOffsetRaidx?: number;
|
|
8
9
|
getBox(id: string): IBox;
|
|
9
10
|
}
|
|
@@ -16,6 +17,10 @@ export default class Neo4jAhchors<INode extends object, IEdge extends object> {
|
|
|
16
17
|
protected config: Config;
|
|
17
18
|
constructor(neo4j: Neo4j<INode, IEdge>, config: Config);
|
|
18
19
|
protected getDir(start: string, end: string): string;
|
|
20
|
+
/**
|
|
21
|
+
* 设置多边间隔弧长
|
|
22
|
+
*/
|
|
23
|
+
setRaidx(value: number): void;
|
|
19
24
|
/**
|
|
20
25
|
* 当图数据准备好后调用
|
|
21
26
|
*/
|