arkanalyzer 1.0.90 → 1.0.91
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/config/arkanalyzer.json +0 -1
- package/lib/Config.d.ts +3 -0
- package/lib/Config.d.ts.map +1 -1
- package/lib/Scene.d.ts +99 -0
- package/lib/Scene.d.ts.map +1 -1
- package/lib/Scene.js +229 -13
- package/lib/callgraph/common/Statistics.js +2 -2
- package/lib/callgraph/model/CallGraph.d.ts +2 -2
- package/lib/callgraph/model/CallGraph.d.ts.map +1 -1
- package/lib/callgraph/model/CallGraph.js +6 -6
- package/lib/callgraph/model/CallSite.d.ts +1 -1
- package/lib/callgraph/model/CallSite.d.ts.map +1 -1
- package/lib/callgraph/model/CallSite.js +2 -2
- package/lib/core/base/Ref.d.ts.map +1 -1
- package/lib/core/base/Ref.js +6 -1
- package/lib/core/common/ArkIRTransformer.d.ts.map +1 -1
- package/lib/core/common/ArkIRTransformer.js +5 -0
- package/lib/core/common/ArkValueTransformer.d.ts.map +1 -1
- package/lib/core/common/ArkValueTransformer.js +2 -1
- package/lib/core/common/Const.d.ts +3 -0
- package/lib/core/common/Const.d.ts.map +1 -1
- package/lib/core/common/Const.js +5 -1
- package/lib/core/common/DummyMainCreater.d.ts +25 -12
- package/lib/core/common/DummyMainCreater.d.ts.map +1 -1
- package/lib/core/common/DummyMainCreater.js +90 -76
- package/lib/core/common/EtsConst.d.ts +2 -0
- package/lib/core/common/EtsConst.d.ts.map +1 -1
- package/lib/core/common/EtsConst.js +133 -125
- package/lib/core/common/SdkUtils.d.ts +1 -0
- package/lib/core/common/SdkUtils.d.ts.map +1 -1
- package/lib/core/common/SdkUtils.js +29 -0
- package/lib/core/graph/BaseExplicitGraph.d.ts +2 -0
- package/lib/core/graph/BaseExplicitGraph.d.ts.map +1 -1
- package/lib/core/graph/BaseExplicitGraph.js +12 -1
- package/lib/core/graph/BaseImplicitGraph.d.ts +16 -0
- package/lib/core/graph/BaseImplicitGraph.d.ts.map +1 -1
- package/lib/core/graph/BaseImplicitGraph.js +21 -0
- package/lib/core/graph/FileDepGraph.d.ts +75 -0
- package/lib/core/graph/FileDepGraph.d.ts.map +1 -0
- package/lib/core/graph/FileDepGraph.js +170 -0
- package/lib/core/graph/GraphTraits.d.ts +2 -0
- package/lib/core/graph/GraphTraits.d.ts.map +1 -1
- package/lib/core/graph/GraphTraits.js +1 -1
- package/lib/core/graph/ModuleDepGraph.d.ts +175 -0
- package/lib/core/graph/ModuleDepGraph.d.ts.map +1 -0
- package/lib/core/graph/ModuleDepGraph.js +421 -0
- package/lib/core/graph/Scc.d.ts +1 -3
- package/lib/core/graph/Scc.d.ts.map +1 -1
- package/lib/core/graph/Scc.js +6 -19
- package/lib/core/graph/builder/CfgBuilder.d.ts.map +1 -1
- package/lib/core/graph/builder/CfgBuilder.js +7 -1
- package/lib/core/graph/builder/TrapBuilder.d.ts +1 -0
- package/lib/core/graph/builder/TrapBuilder.d.ts.map +1 -1
- package/lib/core/graph/builder/TrapBuilder.js +27 -7
- package/lib/core/model/ArkBody.d.ts +1 -0
- package/lib/core/model/ArkBody.d.ts.map +1 -1
- package/lib/core/model/ArkBody.js +7 -0
- package/lib/core/model/ArkClass.d.ts +1 -0
- package/lib/core/model/ArkClass.d.ts.map +1 -1
- package/lib/core/model/ArkClass.js +37 -0
- package/lib/core/model/ArkExport.d.ts +1 -0
- package/lib/core/model/ArkExport.d.ts.map +1 -1
- package/lib/core/model/ArkExport.js +6 -0
- package/lib/core/model/ArkField.d.ts +1 -0
- package/lib/core/model/ArkField.d.ts.map +1 -1
- package/lib/core/model/ArkField.js +5 -0
- package/lib/core/model/ArkFile.d.ts +5 -0
- package/lib/core/model/ArkFile.d.ts.map +1 -1
- package/lib/core/model/ArkFile.js +30 -0
- package/lib/core/model/ArkImport.d.ts +1 -0
- package/lib/core/model/ArkImport.d.ts.map +1 -1
- package/lib/core/model/ArkImport.js +5 -0
- package/lib/core/model/ArkMethod.d.ts +8 -0
- package/lib/core/model/ArkMethod.d.ts.map +1 -1
- package/lib/core/model/ArkMethod.js +22 -0
- package/lib/core/model/ArkModule.d.ts +136 -0
- package/lib/core/model/ArkModule.d.ts.map +1 -0
- package/lib/core/model/ArkModule.js +250 -0
- package/lib/core/model/ArkNamespace.d.ts +1 -0
- package/lib/core/model/ArkNamespace.d.ts.map +1 -1
- package/lib/core/model/ArkNamespace.js +18 -0
- package/lib/core/model/builder/ArkFileBuilder.d.ts +19 -0
- package/lib/core/model/builder/ArkFileBuilder.d.ts.map +1 -1
- package/lib/core/model/builder/ArkFileBuilder.js +155 -51
- package/lib/frontend/FrontendBuilder.d.ts +116 -0
- package/lib/frontend/FrontendBuilder.d.ts.map +1 -1
- package/lib/frontend/FrontendBuilder.js +256 -0
- package/lib/frontend/arktsFrontend/ArktsFrontend.d.ts +11 -0
- package/lib/frontend/arktsFrontend/ArktsFrontend.d.ts.map +1 -1
- package/lib/frontend/arktsFrontend/ArktsFrontend.js +15 -0
- package/lib/frontend/common/MemoryMonitor.d.ts +62 -0
- package/lib/frontend/common/MemoryMonitor.d.ts.map +1 -0
- package/lib/frontend/common/MemoryMonitor.js +108 -0
- package/lib/frontend/common/ModuleAnalysisConfig.d.ts +92 -0
- package/lib/frontend/common/ModuleAnalysisConfig.d.ts.map +1 -0
- package/lib/frontend/common/ModuleAnalysisConfig.js +144 -0
- package/lib/frontend/common/ModuleBuilder.d.ts +497 -0
- package/lib/frontend/common/ModuleBuilder.d.ts.map +1 -0
- package/lib/frontend/common/ModuleBuilder.js +1458 -0
- package/lib/frontend/common/ModuleCache.d.ts +119 -0
- package/lib/frontend/common/ModuleCache.d.ts.map +1 -0
- package/lib/frontend/common/ModuleCache.js +197 -0
- package/lib/frontend/common/ModuleDepth.d.ts +28 -0
- package/lib/frontend/common/ModuleDepth.d.ts.map +1 -0
- package/lib/frontend/common/ModuleDepth.js +45 -0
- package/lib/frontend/cppFrontend/CppFrontend.d.ts +5 -0
- package/lib/frontend/cppFrontend/CppFrontend.d.ts.map +1 -1
- package/lib/frontend/cppFrontend/CppFrontend.js +11 -1
- package/lib/frontend/cppFrontend/model/builder/ArkFileBuilder.d.ts +8 -0
- package/lib/frontend/cppFrontend/model/builder/ArkFileBuilder.d.ts.map +1 -1
- package/lib/frontend/cppFrontend/model/builder/ArkFileBuilder.js +105 -2
- package/lib/index.d.ts +9 -1
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +22 -3
- package/lib/utils/Canonicalizer.d.ts +105 -0
- package/lib/utils/Canonicalizer.d.ts.map +1 -0
- package/lib/utils/Canonicalizer.js +520 -0
- package/lib/utils/ModuleUtils.js +4 -2
- package/lib/utils/entryMethodUtils.d.ts +23 -0
- package/lib/utils/entryMethodUtils.d.ts.map +1 -1
- package/lib/utils/entryMethodUtils.js +53 -1
- package/package.json +1 -1
package/lib/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAgBA,OAAO,EAAE,gBAAgB,EAAE,MAAM,wCAAwC,CAAC;AAC1E,OAAO,EAAE,sBAAsB,EAAE,MAAM,8CAA8C,CAAC;AACtF,OAAO,EAAE,iBAAiB,EAAE,MAAM,yCAAyC,CAAC;AAG5E,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,+BAA+B,CAAC;AAGzE,cAAc,6BAA6B,CAAC;AAC5C,OAAO,EAAE,gBAAgB,EAAE,MAAM,4CAA4C,CAAC;AAG9E,OAAO,EAAE,gBAAgB,EAAE,MAAM,8CAA8C,CAAC;AAChF,cAAc,iCAAiC,CAAC;AAChD,OAAO,EAAE,QAAQ,EAAE,UAAU,EAAE,MAAM,wCAAwC,CAAC;AAC9E,OAAO,EAAE,eAAe,EAAE,MAAM,6CAA6C,CAAC;AAC9E,OAAO,EAAE,qBAAqB,EAAE,MAAM,mDAAmD,CAAC;AAC1F,OAAO,EAAE,MAAM,EAAE,UAA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B,CAAC;AACpC,cAAc,sBAAsB,CAAC;AACrC,cAAc,sBAAsB,CAAC;AACrC,OAAO,EAAE,SAAS,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAC;AAC5D,OAAO,EAAE,OAAO,IAAI,MAAM,EAAE,MAAM,gBAAgB,CAAC;AACnD,OAAO,EAAE,MAAM,EAAE,MAAM,gBAAgB,CAAC;AACxC,OAAO,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAClD,OAAO,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAC;AAC1D,OAAO,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAC;AAGtD,OAAO,EAAE,MAAM,iBAAiB,CAAC;AACjC,OAAO,EAAE,EAAE,EAAE,CAAC"}
|
package/lib/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
/*
|
|
3
|
-
* Copyright (c) 2024-
|
|
3
|
+
* Copyright (c) 2024-2026 Huawei Device Co., Ltd.
|
|
4
4
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
5
|
* you may not use this file except in compliance with the License.
|
|
6
6
|
* You may obtain a copy of the License at
|
|
@@ -31,8 +31,8 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
31
31
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
32
32
|
};
|
|
33
33
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
34
|
-
exports.
|
|
35
|
-
exports.ts = exports.PackedSparseMap = exports.IntWorkList = exports.IntMap = exports.Logger = exports.LOG_MODULE_TYPE = exports.LOG_LEVEL = exports.ViewTreePrinter = exports.GraphPrinter = exports.JsonPrinter = exports.SourceFilePrinter = exports.SourceNamespacePrinter = exports.SourceClassPrinter = exports.SourceMethodPrinter = exports.DotFilePrinter = exports.DotNamespacePrinter = exports.DotClassPrinter = exports.DotMethodPrinter = exports.PrinterBuilder = exports.Printer = exports.getCxxSourceFileExtensions = exports.getCxxSourceFileExtensionSet = exports.getCxxImplementationFileExtensions = exports.getCxxImplementationFileExtensionSet = exports.CppFrontend = exports.ArktsFrontend = exports.FrontendBuilder = exports.Scene = exports.buildSceneConfigFromProject = exports.SceneConfig = exports.ArkBody = exports.ImportInfo = void 0;
|
|
34
|
+
exports.ArkModule = exports.ArkFile = exports.FileDepGraph = exports.DependencyType = exports.ModuleDepGraph = exports.SCCDetection = exports.BaseImplicitGraph = exports.BaseExplicitGraph = exports.BaseNode = exports.BaseEdge = exports.DominanceTree = exports.DominanceFinder = exports.Cfg = exports.BasicBlock = exports.MFPDataFlowSolver = exports.Solution = exports.ReachingDefTransferFunction = exports.ReachingDefProblem = exports.Scope = exports.VisibleValue = exports.ValueUtil = exports.TypeInference = exports.StmtUseReplacer = exports.RefUseReplacer = exports.IRUtils = exports.ExprUseReplacer = exports.DummyMainCreater = exports.ModelUtils = exports.FullPosition = exports.LineColPosition = exports.Local = exports.DefUseChain = exports.Decorator = exports.Constant = exports.DVFGBuilder = exports.DVFG = exports.DiffPTData = exports.PtsSet = exports.PointerAnalysisConfig = exports.PointerAnalysis = exports.PagBuilder = exports.CSFuncID = exports.DummyCallCreator = exports.CallGraphBuilder = exports.CGStat = exports.PAGStat = exports.PTAStat = exports.RapidTypeAnalysis = exports.ClassHierarchyAnalysis = exports.AbstractAnalysis = void 0;
|
|
35
|
+
exports.ts = exports.Canonicalizer = exports.PackedSparseMap = exports.IntWorkList = exports.IntMap = exports.Logger = exports.LOG_MODULE_TYPE = exports.LOG_LEVEL = exports.ViewTreePrinter = exports.GraphPrinter = exports.JsonPrinter = exports.SourceFilePrinter = exports.SourceNamespacePrinter = exports.SourceClassPrinter = exports.SourceMethodPrinter = exports.DotFilePrinter = exports.DotNamespacePrinter = exports.DotClassPrinter = exports.DotMethodPrinter = exports.PrinterBuilder = exports.Printer = exports.getCxxSourceFileExtensions = exports.getCxxSourceFileExtensionSet = exports.getCxxImplementationFileExtensions = exports.getCxxImplementationFileExtensionSet = exports.CppFrontend = exports.ArktsFrontend = exports.FrontendBuilder = exports.Scene = exports.buildSceneConfigFromProject = exports.SceneConfig = exports.ArkBody = exports.ImportInfo = exports.ExportInfo = exports.ArkField = exports.ArkMethod = exports.ArkClass = exports.ArkNamespace = exports.ModuleBuilder = exports.ModuleAnalysisConfig = exports.ModuleDepthLevel = exports.ModuleType = exports.ModuleLoadState = void 0;
|
|
36
36
|
// callgraph/algorithm
|
|
37
37
|
var AbstractAnalysis_1 = require("./callgraph/algorithm/AbstractAnalysis");
|
|
38
38
|
Object.defineProperty(exports, "AbstractAnalysis", { enumerable: true, get: function () { return AbstractAnalysis_1.AbstractAnalysis; } });
|
|
@@ -126,11 +126,28 @@ var BaseExplicitGraph_1 = require("./core/graph/BaseExplicitGraph");
|
|
|
126
126
|
Object.defineProperty(exports, "BaseEdge", { enumerable: true, get: function () { return BaseExplicitGraph_1.BaseEdge; } });
|
|
127
127
|
Object.defineProperty(exports, "BaseNode", { enumerable: true, get: function () { return BaseExplicitGraph_1.BaseNode; } });
|
|
128
128
|
Object.defineProperty(exports, "BaseExplicitGraph", { enumerable: true, get: function () { return BaseExplicitGraph_1.BaseExplicitGraph; } });
|
|
129
|
+
var BaseImplicitGraph_1 = require("./core/graph/BaseImplicitGraph");
|
|
130
|
+
Object.defineProperty(exports, "BaseImplicitGraph", { enumerable: true, get: function () { return BaseImplicitGraph_1.BaseImplicitGraph; } });
|
|
129
131
|
var Scc_1 = require("./core/graph/Scc");
|
|
130
132
|
Object.defineProperty(exports, "SCCDetection", { enumerable: true, get: function () { return Scc_1.SCCDetection; } });
|
|
133
|
+
var ModuleDepGraph_1 = require("./core/graph/ModuleDepGraph");
|
|
134
|
+
Object.defineProperty(exports, "ModuleDepGraph", { enumerable: true, get: function () { return ModuleDepGraph_1.ModuleDepGraph; } });
|
|
135
|
+
Object.defineProperty(exports, "DependencyType", { enumerable: true, get: function () { return ModuleDepGraph_1.DependencyType; } });
|
|
136
|
+
var FileDepGraph_1 = require("./core/graph/FileDepGraph");
|
|
137
|
+
Object.defineProperty(exports, "FileDepGraph", { enumerable: true, get: function () { return FileDepGraph_1.FileDepGraph; } });
|
|
131
138
|
// core/model
|
|
132
139
|
var ArkFile_1 = require("./core/model/ArkFile");
|
|
133
140
|
Object.defineProperty(exports, "ArkFile", { enumerable: true, get: function () { return ArkFile_1.ArkFile; } });
|
|
141
|
+
var ArkModule_1 = require("./core/model/ArkModule");
|
|
142
|
+
Object.defineProperty(exports, "ArkModule", { enumerable: true, get: function () { return ArkModule_1.ArkModule; } });
|
|
143
|
+
Object.defineProperty(exports, "ModuleLoadState", { enumerable: true, get: function () { return ArkModule_1.ModuleLoadState; } });
|
|
144
|
+
Object.defineProperty(exports, "ModuleType", { enumerable: true, get: function () { return ArkModule_1.ModuleType; } });
|
|
145
|
+
var ModuleDepth_1 = require("./frontend/common/ModuleDepth");
|
|
146
|
+
Object.defineProperty(exports, "ModuleDepthLevel", { enumerable: true, get: function () { return ModuleDepth_1.ModuleDepthLevel; } });
|
|
147
|
+
var ModuleAnalysisConfig_1 = require("./frontend/common/ModuleAnalysisConfig");
|
|
148
|
+
Object.defineProperty(exports, "ModuleAnalysisConfig", { enumerable: true, get: function () { return ModuleAnalysisConfig_1.ModuleAnalysisConfig; } });
|
|
149
|
+
var ModuleBuilder_1 = require("./frontend/common/ModuleBuilder");
|
|
150
|
+
Object.defineProperty(exports, "ModuleBuilder", { enumerable: true, get: function () { return ModuleBuilder_1.ModuleBuilder; } });
|
|
134
151
|
var ArkNamespace_1 = require("./core/model/ArkNamespace");
|
|
135
152
|
Object.defineProperty(exports, "ArkNamespace", { enumerable: true, get: function () { return ArkNamespace_1.ArkNamespace; } });
|
|
136
153
|
var ArkClass_1 = require("./core/model/ArkClass");
|
|
@@ -210,6 +227,8 @@ var IntWorkList_1 = require("./utils/IntWorkList");
|
|
|
210
227
|
Object.defineProperty(exports, "IntWorkList", { enumerable: true, get: function () { return IntWorkList_1.IntWorkList; } });
|
|
211
228
|
var PackedSparseMap_1 = require("./utils/PackedSparseMap");
|
|
212
229
|
Object.defineProperty(exports, "PackedSparseMap", { enumerable: true, get: function () { return PackedSparseMap_1.PackedSparseMap; } });
|
|
230
|
+
var Canonicalizer_1 = require("./utils/Canonicalizer");
|
|
231
|
+
Object.defineProperty(exports, "Canonicalizer", { enumerable: true, get: function () { return Canonicalizer_1.Canonicalizer; } });
|
|
213
232
|
//ohos-typescript
|
|
214
233
|
const ohos_typescript_1 = __importDefault(require("ohos-typescript"));
|
|
215
234
|
exports.ts = ohos_typescript_1.default;
|
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
type CanonicalizerStrategy = 'uninitialized' | 'objectIdentity' | 'numberWithEquality' | 'stringIdentity';
|
|
2
|
+
interface CanonicalizerStats {
|
|
3
|
+
strategy: CanonicalizerStrategy;
|
|
4
|
+
size: number;
|
|
5
|
+
bucketCount: number;
|
|
6
|
+
collisionCount: number;
|
|
7
|
+
maxChainLength: number;
|
|
8
|
+
unsupportedKeyFailures: number;
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
* Utility class to map objects to dense integer IDs.
|
|
12
|
+
* Used for performance optimization to replace object-based maps/sets with array-based structures.
|
|
13
|
+
*
|
|
14
|
+
* @template T - The type of items to canonicalize
|
|
15
|
+
*/
|
|
16
|
+
export declare class Canonicalizer<T> {
|
|
17
|
+
private list;
|
|
18
|
+
private keyExtractor;
|
|
19
|
+
private equalityComparer?;
|
|
20
|
+
private readonly usesDefaultKeyExtractor;
|
|
21
|
+
private strategy;
|
|
22
|
+
private objectIdSymbol;
|
|
23
|
+
private numberKeys;
|
|
24
|
+
private numberHeads;
|
|
25
|
+
private numberOccupied;
|
|
26
|
+
private stringHashes;
|
|
27
|
+
private stringHeads;
|
|
28
|
+
private stringOccupied;
|
|
29
|
+
private nextById;
|
|
30
|
+
private bucketCount;
|
|
31
|
+
private threshold;
|
|
32
|
+
private mask;
|
|
33
|
+
private collisionCount;
|
|
34
|
+
private maxChainLength;
|
|
35
|
+
private unsupportedKeyFailures;
|
|
36
|
+
private scratchFoundStored;
|
|
37
|
+
/**
|
|
38
|
+
* @param keyExtractor - Function to extract a unique key from an item.
|
|
39
|
+
* Defaults to identity (using the item itself as key).
|
|
40
|
+
*/
|
|
41
|
+
constructor(keyExtractor?: (item: T) => unknown, equalityComparer?: (a: T, b: T) => boolean);
|
|
42
|
+
/**
|
|
43
|
+
* Get the unique integer ID for an item.
|
|
44
|
+
* If the item (or its key) has been seen before, returns the existing ID.
|
|
45
|
+
* Otherwise, assigns a new ID.
|
|
46
|
+
*/
|
|
47
|
+
getId(item: T): number;
|
|
48
|
+
private hasDuplicateKeyResolver;
|
|
49
|
+
private maybeUpdateRepresentative;
|
|
50
|
+
/**
|
|
51
|
+
* Get the integer ID of an item if it already exists.
|
|
52
|
+
* Returns -1 if the item has not been canonicalized.
|
|
53
|
+
*/
|
|
54
|
+
getExistingId(item: T): number;
|
|
55
|
+
/**
|
|
56
|
+
* Get the item associated with an integer ID.
|
|
57
|
+
*/
|
|
58
|
+
get(id: number): T | undefined;
|
|
59
|
+
/**
|
|
60
|
+
* Get the total number of unique items seen so far.
|
|
61
|
+
*/
|
|
62
|
+
size(): number;
|
|
63
|
+
getStats(): CanonicalizerStats;
|
|
64
|
+
/**
|
|
65
|
+
* Clear all mappings.
|
|
66
|
+
*/
|
|
67
|
+
clear(): void;
|
|
68
|
+
private ensureStrategy;
|
|
69
|
+
private getObjectIdentityId;
|
|
70
|
+
private getExistingObjectIdentityId;
|
|
71
|
+
private getNumberKeyId;
|
|
72
|
+
private getExistingNumberKeyId;
|
|
73
|
+
private getStringKeyId;
|
|
74
|
+
private getExistingStringKeyId;
|
|
75
|
+
private findStringIdOrAppend;
|
|
76
|
+
private appendNumberBucket;
|
|
77
|
+
private appendNumberId;
|
|
78
|
+
private appendStringBucket;
|
|
79
|
+
private appendStringId;
|
|
80
|
+
private initializeNumberTable;
|
|
81
|
+
private initializeStringTable;
|
|
82
|
+
private ensureBucketCapacityForInsert;
|
|
83
|
+
private ensureNextCapacity;
|
|
84
|
+
private findNumberSlot;
|
|
85
|
+
private findExistingNumberSlot;
|
|
86
|
+
private findStringSlot;
|
|
87
|
+
private findExistingStringSlot;
|
|
88
|
+
private stringBucketContainsKey;
|
|
89
|
+
private rehashNumberTable;
|
|
90
|
+
private rehashStringTable;
|
|
91
|
+
private initializeNumberTableWithCapacity;
|
|
92
|
+
private initializeStringTableWithCapacity;
|
|
93
|
+
private updateMaxChainLength;
|
|
94
|
+
private isObjectLike;
|
|
95
|
+
private failUnsupportedKey;
|
|
96
|
+
/**
|
|
97
|
+
* Returns the stored item that was found during the last successful
|
|
98
|
+
* {@link getNumberKeyId} lookup, or `undefined` if no such lookup has
|
|
99
|
+
* occurred. This is a scratch field carried over from the homeflow
|
|
100
|
+
* implementation.
|
|
101
|
+
*/
|
|
102
|
+
getScratchFoundStored(): T | undefined;
|
|
103
|
+
}
|
|
104
|
+
export {};
|
|
105
|
+
//# sourceMappingURL=Canonicalizer.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Canonicalizer.d.ts","sourceRoot":"","sources":["../../src/utils/Canonicalizer.ts"],"names":[],"mappings":"AAmBA,KAAK,qBAAqB,GAAG,eAAe,GAAG,gBAAgB,GAAG,oBAAoB,GAAG,gBAAgB,CAAC;AAE1G,UAAU,kBAAkB;IACxB,QAAQ,EAAE,qBAAqB,CAAC;IAChC,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,MAAM,CAAC;IACpB,cAAc,EAAE,MAAM,CAAC;IACvB,cAAc,EAAE,MAAM,CAAC;IACvB,sBAAsB,EAAE,MAAM,CAAC;CAClC;AA+BD;;;;;GAKG;AACH,qBAAa,aAAa,CAAC,CAAC;IAExB,OAAO,CAAC,IAAI,CAAW;IAEvB,OAAO,CAAC,YAAY,CAAuB;IAC3C,OAAO,CAAC,gBAAgB,CAAC,CAA0B;IACnD,OAAO,CAAC,QAAQ,CAAC,uBAAuB,CAAU;IAElD,OAAO,CA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