@sohqureshi/tokenwise 1.0.0 → 1.0.3
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/LICENSE +20 -20
- package/README.md +9 -7
- package/dist/cli.cjs +0 -0
- package/dist/cli.js +0 -0
- package/package.json +33 -29
- package/dist/chunk-33GBS5YN.js +0 -288
- package/dist/chunk-33RRCCAT.js +0 -287
- package/dist/chunk-HKCPRPJL.js +0 -294
- package/dist/chunk-JBKETSTK.js +0 -270
- package/dist/chunk-SURFMVNH.js +0 -285
package/LICENSE
CHANGED
|
@@ -1,21 +1,21 @@
|
|
|
1
|
-
MIT License
|
|
2
|
-
|
|
3
|
-
Copyright (c) 2026 tokenwise
|
|
4
|
-
|
|
5
|
-
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
-
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
-
in the Software without restriction, including without limitation the rights
|
|
8
|
-
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
-
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
-
furnished to do so, subject to the following conditions:
|
|
11
|
-
|
|
12
|
-
The above copyright notice and this permission notice shall be included in all
|
|
13
|
-
copies or substantial portions of the Software.
|
|
14
|
-
|
|
15
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
-
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
-
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
-
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
-
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 tokenwise
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
21
|
SOFTWARE.
|
package/README.md
CHANGED
|
@@ -2,6 +2,14 @@
|
|
|
2
2
|
|
|
3
3
|
TokenWise is a lightweight utility for preparing JSON before sending it to AI models. It helps reduce payload noise, shrink token usage, and turn structured data into formats that are easier for LLMs to consume.
|
|
4
4
|
|
|
5
|
+
|
|
6
|
+

|
|
7
|
+

|
|
8
|
+

|
|
9
|
+

|
|
10
|
+
[](https://sohqureshi.github.io/tokenwise/)
|
|
11
|
+
[](https://github.com/sponsors/sohqureshi)
|
|
12
|
+
|
|
5
13
|
---
|
|
6
14
|
|
|
7
15
|
## 🧠 What is tokenwise?
|
|
@@ -25,7 +33,7 @@ Raw JSON is:
|
|
|
25
33
|
## Installation
|
|
26
34
|
|
|
27
35
|
```bash
|
|
28
|
-
npm install tokenwise
|
|
36
|
+
npm install @sohqureshi/tokenwise
|
|
29
37
|
```
|
|
30
38
|
|
|
31
39
|
## Quick Usage
|
|
@@ -247,12 +255,6 @@ If it helps you, consider supporting its development:
|
|
|
247
255
|
[](https://github.com/sponsors/sohqureshi)
|
|
248
256
|
|
|
249
257
|
|
|
250
|
-

|
|
251
|
-

|
|
252
|
-

|
|
253
|
-

|
|
254
|
-
[](https://sohqureshi.github.io/tokenwise/)
|
|
255
|
-
[](https://github.com/sponsors/sohqureshi)
|
|
256
258
|
---
|
|
257
259
|
|
|
258
260
|
## 💡 Vision
|
package/dist/cli.cjs
CHANGED
|
File without changes
|
package/dist/cli.js
CHANGED
|
File without changes
|
package/package.json
CHANGED
|
@@ -1,7 +1,11 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "@sohqureshi/tokenwise",
|
|
3
|
-
"version": "1.0.
|
|
1
|
+
{
|
|
2
|
+
"name": "@sohqureshi/tokenwise",
|
|
3
|
+
"version": "1.0.3",
|
|
4
4
|
"description": "Optimize JSON data for AI by reducing token usage",
|
|
5
|
+
"repository": {
|
|
6
|
+
"type": "git",
|
|
7
|
+
"url": "git+https://github.com/sohqureshi/tokenwise.git"
|
|
8
|
+
},
|
|
5
9
|
"main": "dist/index.js",
|
|
6
10
|
"types": "dist/index.d.ts",
|
|
7
11
|
"type": "module",
|
|
@@ -48,31 +52,31 @@
|
|
|
48
52
|
}
|
|
49
53
|
},
|
|
50
54
|
"bin": {
|
|
51
|
-
"tokenwise": "
|
|
55
|
+
"tokenwise": "dist/cli.js"
|
|
52
56
|
},
|
|
53
|
-
"files": [
|
|
54
|
-
"dist"
|
|
55
|
-
],
|
|
56
|
-
"scripts": {
|
|
57
|
+
"files": [
|
|
58
|
+
"dist"
|
|
59
|
+
],
|
|
60
|
+
"scripts": {
|
|
57
61
|
"build": "tsup src/index.ts src/cli.ts src/core/analyze.ts src/core/compact.ts src/core/flatten.ts src/core/natural.ts src/core/prune.ts src/core/token.ts src/core/toon.ts --format esm,cjs --dts",
|
|
58
|
-
"test": "vitest",
|
|
59
|
-
"prepare": "npm run build"
|
|
60
|
-
},
|
|
61
|
-
"keywords": [
|
|
62
|
-
"ai",
|
|
63
|
-
"llm",
|
|
64
|
-
"token",
|
|
65
|
-
"json",
|
|
66
|
-
"optimization",
|
|
67
|
-
"toon",
|
|
68
|
-
"data-processing"
|
|
69
|
-
],
|
|
70
|
-
"author": "Mohammad Sohail",
|
|
71
|
-
"license": "MIT",
|
|
72
|
-
"devDependencies": {
|
|
73
|
-
"@types/node": "^25.6.0",
|
|
74
|
-
"tsup": "^8.0.0",
|
|
75
|
-
"typescript": "^5.0.0",
|
|
76
|
-
"vitest": "^1.0.0"
|
|
77
|
-
}
|
|
78
|
-
}
|
|
62
|
+
"test": "vitest",
|
|
63
|
+
"prepare": "npm run build"
|
|
64
|
+
},
|
|
65
|
+
"keywords": [
|
|
66
|
+
"ai",
|
|
67
|
+
"llm",
|
|
68
|
+
"token",
|
|
69
|
+
"json",
|
|
70
|
+
"optimization",
|
|
71
|
+
"toon",
|
|
72
|
+
"data-processing"
|
|
73
|
+
],
|
|
74
|
+
"author": "Mohammad Sohail",
|
|
75
|
+
"license": "MIT",
|
|
76
|
+
"devDependencies": {
|
|
77
|
+
"@types/node": "^25.6.0",
|
|
78
|
+
"tsup": "^8.0.0",
|
|
79
|
+
"typescript": "^5.0.0",
|
|
80
|
+
"vitest": "^1.0.0"
|
|
81
|
+
}
|
|
82
|
+
}
|
package/dist/chunk-33GBS5YN.js
DELETED
|
@@ -1,288 +0,0 @@
|
|
|
1
|
-
// src/core/prune.ts
|
|
2
|
-
function prune(obj, options = {}) {
|
|
3
|
-
const normalizedOptions = Array.isArray(options) ? { removeKeys: options } : options;
|
|
4
|
-
const {
|
|
5
|
-
removeKeys = [],
|
|
6
|
-
removeNull = true,
|
|
7
|
-
removeUndefined = true,
|
|
8
|
-
removeEmptyObjects = true,
|
|
9
|
-
removeEmptyArrays = false
|
|
10
|
-
} = normalizedOptions;
|
|
11
|
-
if (obj === null) return removeNull ? void 0 : obj;
|
|
12
|
-
if (obj === void 0) return removeUndefined ? void 0 : obj;
|
|
13
|
-
if (typeof obj !== "object") return obj;
|
|
14
|
-
if (Array.isArray(obj)) {
|
|
15
|
-
const arr = obj.map((item) => prune(item, normalizedOptions)).filter((item) => item !== void 0);
|
|
16
|
-
if (removeEmptyArrays && arr.length === 0) {
|
|
17
|
-
return void 0;
|
|
18
|
-
}
|
|
19
|
-
return arr;
|
|
20
|
-
}
|
|
21
|
-
const result = {};
|
|
22
|
-
for (const key in obj) {
|
|
23
|
-
if (removeKeys.includes(key)) continue;
|
|
24
|
-
const value = prune(obj[key], normalizedOptions);
|
|
25
|
-
if (value === void 0) continue;
|
|
26
|
-
if (removeEmptyObjects && typeof value === "object" && !Array.isArray(value) && Object.keys(value).length === 0) {
|
|
27
|
-
continue;
|
|
28
|
-
}
|
|
29
|
-
result[key] = value;
|
|
30
|
-
}
|
|
31
|
-
return result;
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
// src/core/flatten.ts
|
|
35
|
-
function flatten(obj, prefix = "", res = {}) {
|
|
36
|
-
if (obj === null || obj === void 0) return res;
|
|
37
|
-
if (typeof obj !== "object") {
|
|
38
|
-
res[prefix] = obj;
|
|
39
|
-
return res;
|
|
40
|
-
}
|
|
41
|
-
for (const key in obj) {
|
|
42
|
-
const value = obj[key];
|
|
43
|
-
const newKey = prefix ? `${prefix}.${key}` : key;
|
|
44
|
-
if (typeof value === "object" && value !== null) {
|
|
45
|
-
flatten(value, newKey, res);
|
|
46
|
-
} else {
|
|
47
|
-
res[newKey] = value;
|
|
48
|
-
}
|
|
49
|
-
}
|
|
50
|
-
return res;
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
// src/core/compact.ts
|
|
54
|
-
function compact(obj) {
|
|
55
|
-
const pruned = prune(obj);
|
|
56
|
-
const flat = flatten(pruned);
|
|
57
|
-
return Object.entries(flat).map(([k, v]) => `${k}=${v}`).join("|");
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
// src/core/toon.ts
|
|
61
|
-
function toTOON(data, indent = 0) {
|
|
62
|
-
const space = " ".repeat(indent);
|
|
63
|
-
if (Array.isArray(data)) {
|
|
64
|
-
if (data.length === 0) return "[]";
|
|
65
|
-
if (typeof data[0] === "object") {
|
|
66
|
-
const keys = Object.keys(data[0]);
|
|
67
|
-
let result = `${space}[${data.length}]{${keys.join(",")}}:
|
|
68
|
-
`;
|
|
69
|
-
for (const item of data) {
|
|
70
|
-
result += space + " " + keys.map((k) => formatValue(item[k])).join(",") + "\n";
|
|
71
|
-
}
|
|
72
|
-
return result;
|
|
73
|
-
}
|
|
74
|
-
return `${space}[${data.length}]: ${data.join(",")}`;
|
|
75
|
-
}
|
|
76
|
-
if (typeof data === "object" && data !== null) {
|
|
77
|
-
let result = "";
|
|
78
|
-
for (const key in data) {
|
|
79
|
-
const value = data[key];
|
|
80
|
-
if (typeof value === "object") {
|
|
81
|
-
result += `${space}${key}:
|
|
82
|
-
${toTOON(value, indent + 1)}
|
|
83
|
-
`;
|
|
84
|
-
} else {
|
|
85
|
-
result += `${space}${key}: ${formatValue(value)}
|
|
86
|
-
`;
|
|
87
|
-
}
|
|
88
|
-
}
|
|
89
|
-
return result.trim();
|
|
90
|
-
}
|
|
91
|
-
return formatValue(data);
|
|
92
|
-
}
|
|
93
|
-
function formatValue(val) {
|
|
94
|
-
if (val === null || val === void 0) return "";
|
|
95
|
-
if (typeof val === "string") return val;
|
|
96
|
-
return String(val);
|
|
97
|
-
}
|
|
98
|
-
|
|
99
|
-
// src/core/token.ts
|
|
100
|
-
function estimateTokens(text) {
|
|
101
|
-
if (!text) return 0;
|
|
102
|
-
return Math.ceil(text.length / 4);
|
|
103
|
-
}
|
|
104
|
-
|
|
105
|
-
// src/core/analyze.ts
|
|
106
|
-
function analyze(input, options = {}) {
|
|
107
|
-
if (!input || typeof input === "object" && input !== null && Object.keys(input).length === 0) {
|
|
108
|
-
return {
|
|
109
|
-
originalTokens: 0,
|
|
110
|
-
optimizedTokens: 0,
|
|
111
|
-
savings: 0,
|
|
112
|
-
savingsPercent: 0,
|
|
113
|
-
optimizedData: null,
|
|
114
|
-
reductionRatio: 1
|
|
115
|
-
};
|
|
116
|
-
}
|
|
117
|
-
let originalTokens = estimateTokens(input);
|
|
118
|
-
if (isNaN(originalTokens) || !isFinite(originalTokens)) originalTokens = 0;
|
|
119
|
-
let optimizedData = input;
|
|
120
|
-
if (options.prune && Array.isArray(options.prune)) {
|
|
121
|
-
optimizedData = prune(optimizedData, options.prune);
|
|
122
|
-
}
|
|
123
|
-
if (options.compact) {
|
|
124
|
-
optimizedData = compact(optimizedData);
|
|
125
|
-
}
|
|
126
|
-
if (options.flatten) {
|
|
127
|
-
optimizedData = flatten(optimizedData);
|
|
128
|
-
}
|
|
129
|
-
if (options.toTOON === true || options.toon === true) {
|
|
130
|
-
optimizedData = toTOON(optimizedData);
|
|
131
|
-
}
|
|
132
|
-
let optimizedTokens = estimateTokens(optimizedData);
|
|
133
|
-
if (isNaN(optimizedTokens) || !isFinite(optimizedTokens)) optimizedTokens = 0;
|
|
134
|
-
const savings = Math.max(0, originalTokens - optimizedTokens);
|
|
135
|
-
const savingsPercent = originalTokens > 0 ? Math.round(savings / originalTokens * 100) : 0;
|
|
136
|
-
const reductionRatio = originalTokens > 0 ? optimizedTokens / originalTokens : 1;
|
|
137
|
-
return {
|
|
138
|
-
originalTokens,
|
|
139
|
-
optimizedTokens,
|
|
140
|
-
savings,
|
|
141
|
-
savingsPercent,
|
|
142
|
-
optimizedData,
|
|
143
|
-
reductionRatio
|
|
144
|
-
};
|
|
145
|
-
}
|
|
146
|
-
|
|
147
|
-
// src/core/natural.ts
|
|
148
|
-
function toNatural(data, depth = 0) {
|
|
149
|
-
if (data === null || data === void 0) return "nothing";
|
|
150
|
-
if (typeof data === "string") return data;
|
|
151
|
-
if (typeof data === "number") return String(data);
|
|
152
|
-
if (typeof data === "boolean") return data ? "yes" : "no";
|
|
153
|
-
if (Array.isArray(data)) {
|
|
154
|
-
if (data.length === 0) return "empty list";
|
|
155
|
-
if (data.every(isPlainObject)) {
|
|
156
|
-
return data.map((item, index) => `${index + 1}. ${stripTrailingPeriod(toNatural(item, depth + 1))}.`).join(" ");
|
|
157
|
-
}
|
|
158
|
-
const items = data.map((item) => toNatural(item, depth + 1));
|
|
159
|
-
return joinNaturalList(items);
|
|
160
|
-
}
|
|
161
|
-
if (typeof data === "object") {
|
|
162
|
-
return buildContextualStory(data, depth);
|
|
163
|
-
}
|
|
164
|
-
return String(data);
|
|
165
|
-
}
|
|
166
|
-
function buildContextualStory(obj, depth = 0) {
|
|
167
|
-
let name = obj.name || obj.userName || obj.user;
|
|
168
|
-
if (typeof name === "object" && name !== null && name.name) {
|
|
169
|
-
name = name.name;
|
|
170
|
-
}
|
|
171
|
-
const entries = Object.entries(obj).filter(([key]) => {
|
|
172
|
-
return !["id", "timestamp", "apiKey"].includes(key);
|
|
173
|
-
});
|
|
174
|
-
if (entries.length === 0) return "";
|
|
175
|
-
let story = name && typeof name === "string" ? `User ${name}` : "";
|
|
176
|
-
const clauses = entries.map(([key, value]) => {
|
|
177
|
-
if (key === "user" && name && typeof value === "object" && value !== null && !Array.isArray(value)) {
|
|
178
|
-
const userProps = Object.entries(value).filter(([k]) => !["id", "name", "timestamp", "apiKey"].includes(k)).map(([k, v]) => formatPropertyClause(k, v, depth + 1)).filter((c) => c !== null && c !== "").join(", ");
|
|
179
|
-
return userProps ? `(${userProps})` : null;
|
|
180
|
-
}
|
|
181
|
-
return formatPropertyClause(key, value, depth);
|
|
182
|
-
}).filter((c) => c !== null && c !== "");
|
|
183
|
-
if (clauses.length === 0) return story;
|
|
184
|
-
if (story) {
|
|
185
|
-
story += " " + clauses.join(", ");
|
|
186
|
-
} else {
|
|
187
|
-
story = clauses.join(", ");
|
|
188
|
-
}
|
|
189
|
-
return story + ".";
|
|
190
|
-
}
|
|
191
|
-
function formatPropertyClause(key, value, depth) {
|
|
192
|
-
const naturalKey = camelToWords(key);
|
|
193
|
-
if (typeof value === "object" && value !== null && !Array.isArray(value)) {
|
|
194
|
-
if (["internal", "metadata", "debug"].includes(key)) {
|
|
195
|
-
return null;
|
|
196
|
-
}
|
|
197
|
-
const nested = Object.entries(value).filter(([k]) => !["id", "timestamp", "apiKey", "createdAt", "updatedAt"].includes(k)).map(([k, v]) => {
|
|
198
|
-
if (typeof v === "object" && v !== null) {
|
|
199
|
-
return formatPropertyClause(k, v, depth + 1);
|
|
200
|
-
}
|
|
201
|
-
const propValue = toNatural(v, depth + 1);
|
|
202
|
-
if (propValue === "yes" || propValue === "no") {
|
|
203
|
-
return `${camelToWords(k)} ${propValue === "yes" ? "enabled" : "disabled"}`;
|
|
204
|
-
}
|
|
205
|
-
return `${camelToWords(k)} ${propValue}`;
|
|
206
|
-
}).filter((c) => c && c.trim()).join(", ");
|
|
207
|
-
if (!nested) return null;
|
|
208
|
-
return `${naturalKey}: ${nested}`;
|
|
209
|
-
}
|
|
210
|
-
if (Array.isArray(value)) {
|
|
211
|
-
if (value.length === 0) return null;
|
|
212
|
-
if (["skills", "hobbies", "interests", "tags", "languages", "items"].includes(key)) {
|
|
213
|
-
const items2 = value.map((item) => {
|
|
214
|
-
const str = String(item);
|
|
215
|
-
return str.charAt(0).toUpperCase() + str.slice(1);
|
|
216
|
-
});
|
|
217
|
-
return `Having ${joinNaturalList(items2)}`;
|
|
218
|
-
}
|
|
219
|
-
const items = joinNaturalList(value.map((item) => toNatural(item, depth + 1)));
|
|
220
|
-
return `${naturalKey}: ${items}`;
|
|
221
|
-
}
|
|
222
|
-
const naturalValue = toNatural(value, depth + 1);
|
|
223
|
-
if (naturalValue === "yes") return `${naturalKey} enabled`;
|
|
224
|
-
if (naturalValue === "no") return `${naturalKey} disabled`;
|
|
225
|
-
if (key === "theme") return `prefers the ${naturalValue} ${key}`;
|
|
226
|
-
if (key === "age") return `age: ${naturalValue}`;
|
|
227
|
-
if (key === "email") return `email: ${naturalValue}`;
|
|
228
|
-
if (key === "city") return `address: ${naturalValue}`;
|
|
229
|
-
if (key === "debug" && naturalValue === "yes") return `debug enabled`;
|
|
230
|
-
return `${naturalKey}: ${naturalValue}`;
|
|
231
|
-
}
|
|
232
|
-
function camelToWords(str) {
|
|
233
|
-
return str.replace(/([A-Z])/g, " $1").toLowerCase().trim();
|
|
234
|
-
}
|
|
235
|
-
function isPlainObject(value) {
|
|
236
|
-
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
237
|
-
}
|
|
238
|
-
function joinNaturalList(items) {
|
|
239
|
-
if (items.length === 0) return "";
|
|
240
|
-
if (items.length === 1) return items[0];
|
|
241
|
-
if (items.length === 2) return `${items[0]} and ${items[1]}`;
|
|
242
|
-
const lastItem = items[items.length - 1];
|
|
243
|
-
return `${items.slice(0, -1).join(", ")} and ${lastItem}`;
|
|
244
|
-
}
|
|
245
|
-
function stripTrailingPeriod(value) {
|
|
246
|
-
return value.replace(/\.+$/, "");
|
|
247
|
-
}
|
|
248
|
-
|
|
249
|
-
// src/chain.ts
|
|
250
|
-
var AIChain = class {
|
|
251
|
-
constructor(data) {
|
|
252
|
-
this.data = data;
|
|
253
|
-
}
|
|
254
|
-
prune(options) {
|
|
255
|
-
this.data = prune(this.data, options);
|
|
256
|
-
return this;
|
|
257
|
-
}
|
|
258
|
-
compact() {
|
|
259
|
-
this.data = compact(this.data);
|
|
260
|
-
return this;
|
|
261
|
-
}
|
|
262
|
-
flatten() {
|
|
263
|
-
this.data = flatten(this.data);
|
|
264
|
-
return this;
|
|
265
|
-
}
|
|
266
|
-
toTOON() {
|
|
267
|
-
this.data = toTOON(this.data);
|
|
268
|
-
return this;
|
|
269
|
-
}
|
|
270
|
-
toNatural() {
|
|
271
|
-
return toNatural(this.data);
|
|
272
|
-
}
|
|
273
|
-
analyze() {
|
|
274
|
-
return analyze(this.data);
|
|
275
|
-
}
|
|
276
|
-
value() {
|
|
277
|
-
return this.data;
|
|
278
|
-
}
|
|
279
|
-
};
|
|
280
|
-
|
|
281
|
-
export {
|
|
282
|
-
prune,
|
|
283
|
-
compact,
|
|
284
|
-
toTOON,
|
|
285
|
-
analyze,
|
|
286
|
-
toNatural,
|
|
287
|
-
AIChain
|
|
288
|
-
};
|