@futdevpro/fsm-dynamo 1.11.31 → 1.11.33
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/.github/workflows/main.yml +20 -21
- package/build/_collections/utils/json-error-helper.util.d.ts +8 -0
- package/build/_collections/utils/json-error-helper.util.d.ts.map +1 -1
- package/build/_collections/utils/json-error-helper.util.js +118 -39
- package/build/_collections/utils/json-error-helper.util.js.map +1 -1
- package/build/_collections/utils/object.util.d.ts +6 -0
- package/build/_collections/utils/object.util.d.ts.map +1 -1
- package/build/_collections/utils/object.util.js +37 -1
- package/build/_collections/utils/object.util.js.map +1 -1
- package/build/_collections/utils/object.util.spec.js +393 -0
- package/build/_collections/utils/object.util.spec.js.map +1 -1
- package/build/_collections/utils/string.util.d.ts +130 -0
- package/build/_collections/utils/string.util.d.ts.map +1 -1
- package/build/_collections/utils/string.util.js +354 -0
- package/build/_collections/utils/string.util.js.map +1 -1
- package/build/_collections/utils/string.util.spec.js +694 -0
- package/build/_collections/utils/string.util.spec.js.map +1 -1
- package/build/_modules/crypto/_collections/crypto-2-non-stable.util.d.ts.map +1 -1
- package/build/_modules/crypto/_collections/crypto-2-non-stable.util.js +3 -2
- package/build/_modules/crypto/_collections/crypto-2-non-stable.util.js.map +1 -1
- package/build/_modules/crypto/_collections/crypto.util.d.ts.map +1 -1
- package/build/_modules/crypto/_collections/crypto.util.js +22 -9
- package/build/_modules/crypto/_collections/crypto.util.js.map +1 -1
- package/build/_modules/crypto/_collections/crypto.util.spec.js +3 -3
- package/build/_modules/crypto/_collections/crypto.util.spec.js.map +1 -1
- package/build/_modules/crypto/index.js +7 -6
- package/build/_modules/crypto/index.js.map +1 -1
- package/build/_modules/open-ai/index.js +7 -6
- package/build/_modules/open-ai/index.js.map +1 -1
- package/futdevpro-fsm-dynamo-01.11.33.tgz +0 -0
- package/package.json +1 -1
- package/src/_collections/utils/json-error-helper.util.ts +135 -45
- package/src/_collections/utils/object.util.spec.ts +503 -0
- package/src/_collections/utils/object.util.ts +40 -10
- package/src/_collections/utils/string.util.spec.ts +773 -1
- package/src/_collections/utils/string.util.ts +426 -0
- package/src/_modules/crypto/_collections/crypto-2-non-stable.util.ts +3 -2
- package/src/_modules/crypto/_collections/crypto.util.spec.ts +3 -3
- package/src/_modules/crypto/_collections/crypto.util.ts +20 -8
- package/src/_modules/crypto/index.ts +2 -2
- package/src/_modules/open-ai/index.ts +2 -2
- package/futdevpro-fsm-dynamo-01.11.31.tgz +0 -0
|
@@ -32,5 +32,699 @@ describe('| DyFM_String', () => {
|
|
|
32
32
|
expect(result).toBe('');
|
|
33
33
|
});
|
|
34
34
|
});
|
|
35
|
+
describe('| nestedBracketSplit', () => {
|
|
36
|
+
it('| should handle simple bracket extraction with replacement', () => {
|
|
37
|
+
const input = 'hello (world) test';
|
|
38
|
+
const result = string_util_1.DyFM_String.nestedBracketSplit(input, '(', ')', 10, '...');
|
|
39
|
+
expect(result).toEqual(['hello ... test', 'world']);
|
|
40
|
+
});
|
|
41
|
+
it('| should handle multiple brackets at the same level', () => {
|
|
42
|
+
const input = 'start (first) middle (second) end';
|
|
43
|
+
const result = string_util_1.DyFM_String.nestedBracketSplit(input, '(', ')', 10, '...');
|
|
44
|
+
expect(result).toEqual(['start ... middle ... end', 'first', 'second']);
|
|
45
|
+
});
|
|
46
|
+
it('| should handle nested brackets according to the example', () => {
|
|
47
|
+
const input = 'asdasd (and other things) around (and layered things (and more layers) around) around';
|
|
48
|
+
const result = string_util_1.DyFM_String.nestedBracketSplit(input, '(', ')', 2, '...');
|
|
49
|
+
expect(result).toEqual([
|
|
50
|
+
'asdasd ... around ... around',
|
|
51
|
+
'and other things',
|
|
52
|
+
'and layered things ... around',
|
|
53
|
+
'and more layers'
|
|
54
|
+
]);
|
|
55
|
+
});
|
|
56
|
+
it('| should respect maxDepth parameter', () => {
|
|
57
|
+
const input = 'text (level1 (level2 (level3) level2) level1) text';
|
|
58
|
+
const result = string_util_1.DyFM_String.nestedBracketSplit(input, '(', ')', 1, '...');
|
|
59
|
+
expect(result).toEqual([
|
|
60
|
+
'text ... text',
|
|
61
|
+
'level1 (level2 (level3) level2) level1'
|
|
62
|
+
]);
|
|
63
|
+
});
|
|
64
|
+
it('| should handle empty replacement string', () => {
|
|
65
|
+
const input = 'hello (world) test';
|
|
66
|
+
const result = string_util_1.DyFM_String.nestedBracketSplit(input, '(', ')', 10, '');
|
|
67
|
+
expect(result).toEqual(['hello test', 'world']);
|
|
68
|
+
});
|
|
69
|
+
it('| should handle string with no brackets', () => {
|
|
70
|
+
const input = 'hello world test';
|
|
71
|
+
const result = string_util_1.DyFM_String.nestedBracketSplit(input, '(', ')', 10, '...');
|
|
72
|
+
expect(result).toEqual(['hello world test']);
|
|
73
|
+
});
|
|
74
|
+
it('| should handle empty string', () => {
|
|
75
|
+
const input = '';
|
|
76
|
+
const result = string_util_1.DyFM_String.nestedBracketSplit(input, '(', ')', 10, '...');
|
|
77
|
+
expect(result).toEqual(['']);
|
|
78
|
+
});
|
|
79
|
+
it('| should handle unmatched opening bracket', () => {
|
|
80
|
+
const input = 'hello (world test';
|
|
81
|
+
const result = string_util_1.DyFM_String.nestedBracketSplit(input, '(', ')', 10, '...');
|
|
82
|
+
expect(result).toEqual(['hello (world test']);
|
|
83
|
+
});
|
|
84
|
+
it('| should handle unmatched closing bracket', () => {
|
|
85
|
+
const input = 'hello world) test';
|
|
86
|
+
const result = string_util_1.DyFM_String.nestedBracketSplit(input, '(', ')', 10, '...');
|
|
87
|
+
expect(result).toEqual(['hello world) test']);
|
|
88
|
+
});
|
|
89
|
+
it('| should handle custom bracket characters', () => {
|
|
90
|
+
const input = 'start [first] middle [second] end';
|
|
91
|
+
const result = string_util_1.DyFM_String.nestedBracketSplit(input, '[', ']', 10, '...');
|
|
92
|
+
expect(result).toEqual(['start ... middle ... end', 'first', 'second']);
|
|
93
|
+
});
|
|
94
|
+
it('| should handle multi-character brackets', () => {
|
|
95
|
+
const input = 'start {{first}} middle {{second}} end';
|
|
96
|
+
const result = string_util_1.DyFM_String.nestedBracketSplit(input, '{{', '}}', 10, '...');
|
|
97
|
+
expect(result).toEqual(['start ... middle ... end', 'first', 'second']);
|
|
98
|
+
});
|
|
99
|
+
it('| should handle deeply nested brackets with maxDepth', () => {
|
|
100
|
+
const input = 'text (a (b (c (d) c) b) a) text';
|
|
101
|
+
const result = string_util_1.DyFM_String.nestedBracketSplit(input, '(', ')', 3, '...');
|
|
102
|
+
expect(result).toEqual([
|
|
103
|
+
'text ... text',
|
|
104
|
+
'a ... a',
|
|
105
|
+
'b ... b',
|
|
106
|
+
'c (d) c'
|
|
107
|
+
]);
|
|
108
|
+
});
|
|
109
|
+
it('| should handle same character for opening and closing bracket', () => {
|
|
110
|
+
const input = "start 'first quote' middle 'second quote' end";
|
|
111
|
+
const result = string_util_1.DyFM_String.nestedBracketSplit(input, "'", "'", 10, '...');
|
|
112
|
+
expect(result).toEqual(["start ... middle ... end", 'first quote', 'second quote']);
|
|
113
|
+
});
|
|
114
|
+
it('| should handle nested same character brackets', () => {
|
|
115
|
+
const input = "text 'outer 'inner' outer' text";
|
|
116
|
+
const result = string_util_1.DyFM_String.nestedBracketSplit(input, "'", "'", 2, '...');
|
|
117
|
+
expect(result).toEqual([
|
|
118
|
+
'text ... text',
|
|
119
|
+
'outer ... outer',
|
|
120
|
+
'inner'
|
|
121
|
+
]);
|
|
122
|
+
});
|
|
123
|
+
it('| should handle multiple levels of same character brackets', () => {
|
|
124
|
+
const input = "start 'level1 'level2 'level3' level2' level1' end";
|
|
125
|
+
const result = string_util_1.DyFM_String.nestedBracketSplit(input, "'", "'", 3, '...');
|
|
126
|
+
expect(result).toEqual([
|
|
127
|
+
'start ... end',
|
|
128
|
+
'level1 ... level1',
|
|
129
|
+
'level2 ... level2',
|
|
130
|
+
'level3'
|
|
131
|
+
]);
|
|
132
|
+
});
|
|
133
|
+
it('| should handle empty content between same character brackets', () => {
|
|
134
|
+
const input = "text '' more text";
|
|
135
|
+
const result = string_util_1.DyFM_String.nestedBracketSplit(input, "'", "'", 10, '...');
|
|
136
|
+
expect(result).toEqual(['text ... more text', '']);
|
|
137
|
+
});
|
|
138
|
+
it('| should handle single same character bracket (unmatched)', () => {
|
|
139
|
+
const input = "text 'unmatched quote";
|
|
140
|
+
const result = string_util_1.DyFM_String.nestedBracketSplit(input, "'", "'", 10, '...');
|
|
141
|
+
expect(result).toEqual(["text 'unmatched quote"]);
|
|
142
|
+
});
|
|
143
|
+
it('| should handle alternating same character brackets', () => {
|
|
144
|
+
const input = "text 'first' normal 'second' normal 'third' text";
|
|
145
|
+
const result = string_util_1.DyFM_String.nestedBracketSplit(input, "'", "'", 10, '...');
|
|
146
|
+
expect(result).toEqual(['text ... normal ... normal ... text', 'first', 'second', 'third']);
|
|
147
|
+
});
|
|
148
|
+
it('| should respect maxDepth with same character brackets', () => {
|
|
149
|
+
const input = "text 'a 'b 'c' b' a' text";
|
|
150
|
+
const result = string_util_1.DyFM_String.nestedBracketSplit(input, "'", "'", 1, '...');
|
|
151
|
+
expect(result).toEqual([
|
|
152
|
+
'text ... text',
|
|
153
|
+
"a 'b 'c' b' a"
|
|
154
|
+
]);
|
|
155
|
+
});
|
|
156
|
+
});
|
|
157
|
+
describe('| nestedBracketSplit - replaceContents variations', () => {
|
|
158
|
+
it('| should handle empty replaceContents (no replacement)', () => {
|
|
159
|
+
const input = 'hello (world) test';
|
|
160
|
+
const result = string_util_1.DyFM_String.nestedBracketSplit(input, '(', ')', 10, '');
|
|
161
|
+
expect(result).toEqual(['hello test', 'world']);
|
|
162
|
+
});
|
|
163
|
+
it('| should handle undefined replaceContents (no replacement)', () => {
|
|
164
|
+
const input = 'hello (world) test';
|
|
165
|
+
const result = string_util_1.DyFM_String.nestedBracketSplit(input, '(', ')', 10);
|
|
166
|
+
expect(result).toEqual(['hello (world) test', 'world']);
|
|
167
|
+
});
|
|
168
|
+
it('| should handle multiple brackets with empty replaceContents', () => {
|
|
169
|
+
const input = 'start (first) middle (second) end';
|
|
170
|
+
const result = string_util_1.DyFM_String.nestedBracketSplit(input, '(', ')', 10, '');
|
|
171
|
+
expect(result).toEqual(['start middle end', 'first', 'second']);
|
|
172
|
+
});
|
|
173
|
+
it('| should handle nested brackets with empty replaceContents', () => {
|
|
174
|
+
const input = 'text (outer (inner) outer) text';
|
|
175
|
+
const result = string_util_1.DyFM_String.nestedBracketSplit(input, '(', ')', 2, '');
|
|
176
|
+
expect(result).toEqual(['text text', 'outer outer', 'inner']);
|
|
177
|
+
});
|
|
178
|
+
});
|
|
179
|
+
describe('| nestedBracketSplitDetailed', () => {
|
|
180
|
+
it('| should return detailed information for simple nested brackets', () => {
|
|
181
|
+
const input = 'hello (world) test';
|
|
182
|
+
const result = string_util_1.DyFM_String.nestedBracketSplitDetailed(input, '(', ')', 10, '...');
|
|
183
|
+
expect(result).toEqual([
|
|
184
|
+
{ content: 'hello ... test', level: 0, brackets: null },
|
|
185
|
+
{ content: 'world', level: 1, brackets: { opening: '(', closing: ')' } }
|
|
186
|
+
]);
|
|
187
|
+
});
|
|
188
|
+
it('| should handle nested brackets with detailed level information', () => {
|
|
189
|
+
const input = 'asdasd (and other things) around (and layered things (and more layers) around) around';
|
|
190
|
+
const result = string_util_1.DyFM_String.nestedBracketSplitDetailed(input, '(', ')', 2, '...');
|
|
191
|
+
expect(result).toEqual([
|
|
192
|
+
{ content: 'asdasd ... around ... around', level: 0, brackets: null },
|
|
193
|
+
{ content: 'and other things', level: 1, brackets: { opening: '(', closing: ')' } },
|
|
194
|
+
{ content: 'and layered things ... around', level: 1, brackets: { opening: '(', closing: ')' } },
|
|
195
|
+
{ content: 'and more layers', level: 2, brackets: { opening: '(', closing: ')' } }
|
|
196
|
+
]);
|
|
197
|
+
});
|
|
198
|
+
it('| should handle same character brackets with detailed info', () => {
|
|
199
|
+
const input = "text 'quoted content' end";
|
|
200
|
+
const result = string_util_1.DyFM_String.nestedBracketSplitDetailed(input, "'", "'", 10, '...');
|
|
201
|
+
expect(result).toEqual([
|
|
202
|
+
{ content: 'text ... end', level: 0, brackets: null },
|
|
203
|
+
{ content: 'quoted content', level: 1, brackets: { opening: "'", closing: "'" } }
|
|
204
|
+
]);
|
|
205
|
+
});
|
|
206
|
+
it('| should respect maxDepth with detailed levels', () => {
|
|
207
|
+
const input = 'text (a (b (c) b) a) text';
|
|
208
|
+
const result = string_util_1.DyFM_String.nestedBracketSplitDetailed(input, '(', ')', 2, '...');
|
|
209
|
+
expect(result).toEqual([
|
|
210
|
+
{ content: 'text ... text', level: 0, brackets: null },
|
|
211
|
+
{ content: 'a ... a', level: 1, brackets: { opening: '(', closing: ')' } },
|
|
212
|
+
{ content: 'b (c) b', level: 2, brackets: { opening: '(', closing: ')' } }
|
|
213
|
+
]);
|
|
214
|
+
});
|
|
215
|
+
it('| should handle no brackets case', () => {
|
|
216
|
+
const input = 'plain text with no brackets';
|
|
217
|
+
const result = string_util_1.DyFM_String.nestedBracketSplitDetailed(input, '(', ')', 10, '...');
|
|
218
|
+
expect(result).toEqual([
|
|
219
|
+
{ content: 'plain text with no brackets', level: 0, brackets: null }
|
|
220
|
+
]);
|
|
221
|
+
});
|
|
222
|
+
it('| should handle empty replaceContents (no replacement)', () => {
|
|
223
|
+
const input = 'hello (world) test';
|
|
224
|
+
const result = string_util_1.DyFM_String.nestedBracketSplitDetailed(input, '(', ')', 10, '');
|
|
225
|
+
expect(result).toEqual([
|
|
226
|
+
{ content: 'hello test', level: 0, brackets: null },
|
|
227
|
+
{ content: 'world', level: 1, brackets: { opening: '(', closing: ')' } }
|
|
228
|
+
]);
|
|
229
|
+
});
|
|
230
|
+
it('| should handle undefined replaceContents (no replacement)', () => {
|
|
231
|
+
const input = 'hello (world) test';
|
|
232
|
+
const result = string_util_1.DyFM_String.nestedBracketSplitDetailed(input, '(', ')', 10);
|
|
233
|
+
expect(result).toEqual([
|
|
234
|
+
{ content: 'hello (world) test', level: 0, brackets: null },
|
|
235
|
+
{ content: 'world', level: 1, brackets: { opening: '(', closing: ')' } }
|
|
236
|
+
]);
|
|
237
|
+
});
|
|
238
|
+
it('| should handle nested brackets with empty replaceContents', () => {
|
|
239
|
+
const input = 'text (outer (inner) outer) text';
|
|
240
|
+
const result = string_util_1.DyFM_String.nestedBracketSplitDetailed(input, '(', ')', 2, '');
|
|
241
|
+
expect(result).toEqual([
|
|
242
|
+
{ content: 'text text', level: 0, brackets: null },
|
|
243
|
+
{ content: 'outer outer', level: 1, brackets: { opening: '(', closing: ')' } },
|
|
244
|
+
{ content: 'inner', level: 2, brackets: { opening: '(', closing: ')' } }
|
|
245
|
+
]);
|
|
246
|
+
});
|
|
247
|
+
});
|
|
248
|
+
describe('| multiBracketSplit', () => {
|
|
249
|
+
const standardBrackets = [
|
|
250
|
+
{ opening: '(', closing: ')' },
|
|
251
|
+
{ opening: '[', closing: ']' },
|
|
252
|
+
{ opening: '{', closing: '}' }
|
|
253
|
+
];
|
|
254
|
+
it('| should handle multiple bracket types at the same level', () => {
|
|
255
|
+
const input = 'text (round) and [square] with {curly} brackets';
|
|
256
|
+
const result = string_util_1.DyFM_String.multiBracketSplit(input, standardBrackets, 10, '...');
|
|
257
|
+
expect(result).toEqual([
|
|
258
|
+
'text ... and ... with ... brackets',
|
|
259
|
+
'round',
|
|
260
|
+
'square',
|
|
261
|
+
'curly'
|
|
262
|
+
]);
|
|
263
|
+
});
|
|
264
|
+
it('| should handle mixed nested brackets according to the example', () => {
|
|
265
|
+
const input = 'text (round) and [square] with {curly (nested)} brackets';
|
|
266
|
+
const result = string_util_1.DyFM_String.multiBracketSplit(input, standardBrackets, 2, '...');
|
|
267
|
+
expect(result).toEqual([
|
|
268
|
+
'text ... and ... with ... brackets',
|
|
269
|
+
'round',
|
|
270
|
+
'square',
|
|
271
|
+
'curly ...',
|
|
272
|
+
'nested'
|
|
273
|
+
]);
|
|
274
|
+
});
|
|
275
|
+
it('| should handle deeply nested mixed brackets', () => {
|
|
276
|
+
const input = 'start {outer [middle (inner) middle] outer} end';
|
|
277
|
+
const result = string_util_1.DyFM_String.multiBracketSplit(input, standardBrackets, 3, '...');
|
|
278
|
+
expect(result).toEqual([
|
|
279
|
+
'start ... end',
|
|
280
|
+
'outer ... outer',
|
|
281
|
+
'middle ... middle',
|
|
282
|
+
'inner'
|
|
283
|
+
]);
|
|
284
|
+
});
|
|
285
|
+
it('| should respect maxDepth with mixed brackets', () => {
|
|
286
|
+
const input = 'text {a [b (c) b] a} text';
|
|
287
|
+
const result = string_util_1.DyFM_String.multiBracketSplit(input, standardBrackets, 1, '...');
|
|
288
|
+
expect(result).toEqual([
|
|
289
|
+
'text ... text',
|
|
290
|
+
'a [b (c) b] a'
|
|
291
|
+
]);
|
|
292
|
+
});
|
|
293
|
+
it('| should handle empty bracket contents', () => {
|
|
294
|
+
const input = 'text () and [] with {} brackets';
|
|
295
|
+
const result = string_util_1.DyFM_String.multiBracketSplit(input, standardBrackets, 10, '...');
|
|
296
|
+
expect(result).toEqual([
|
|
297
|
+
'text ... and ... with ... brackets',
|
|
298
|
+
'',
|
|
299
|
+
'',
|
|
300
|
+
''
|
|
301
|
+
]);
|
|
302
|
+
});
|
|
303
|
+
it('| should handle unmatched brackets gracefully', () => {
|
|
304
|
+
const input = 'text (unmatched and [incomplete';
|
|
305
|
+
const result = string_util_1.DyFM_String.multiBracketSplit(input, standardBrackets, 10, '...');
|
|
306
|
+
expect(result).toEqual(['text (unmatched and [incomplete']);
|
|
307
|
+
});
|
|
308
|
+
it('| should handle same character brackets in the array', () => {
|
|
309
|
+
const quoteBrackets = [
|
|
310
|
+
{ opening: "'", closing: "'" },
|
|
311
|
+
{ opening: '"', closing: '"' }
|
|
312
|
+
];
|
|
313
|
+
const input = "text 'single quoted' and \"double quoted\" content";
|
|
314
|
+
const result = string_util_1.DyFM_String.multiBracketSplit(input, quoteBrackets, 10, '...');
|
|
315
|
+
expect(result).toEqual([
|
|
316
|
+
'text ... and ... content',
|
|
317
|
+
'single quoted',
|
|
318
|
+
'double quoted'
|
|
319
|
+
]);
|
|
320
|
+
});
|
|
321
|
+
it('| should handle multi-character brackets', () => {
|
|
322
|
+
const customBrackets = [
|
|
323
|
+
{ opening: '{{', closing: '}}' },
|
|
324
|
+
{ opening: '[[', closing: ']]' },
|
|
325
|
+
{ opening: '()', closing: ')(' }
|
|
326
|
+
];
|
|
327
|
+
const input = 'text {{double curly}} and [[double square]] with ()reversed)( brackets';
|
|
328
|
+
const result = string_util_1.DyFM_String.multiBracketSplit(input, customBrackets, 10, '...');
|
|
329
|
+
expect(result).toEqual([
|
|
330
|
+
'text ... and ... with ... brackets',
|
|
331
|
+
'double curly',
|
|
332
|
+
'double square',
|
|
333
|
+
'reversed'
|
|
334
|
+
]);
|
|
335
|
+
});
|
|
336
|
+
it('| should handle complex nesting with different bracket types', () => {
|
|
337
|
+
const input = 'start (round [square {curly [inner]} square] round) end';
|
|
338
|
+
const result = string_util_1.DyFM_String.multiBracketSplit(input, standardBrackets, 4, '...');
|
|
339
|
+
expect(result).toEqual([
|
|
340
|
+
'start ... end',
|
|
341
|
+
'round ... round',
|
|
342
|
+
'square ... square',
|
|
343
|
+
'curly ...',
|
|
344
|
+
'inner'
|
|
345
|
+
]);
|
|
346
|
+
});
|
|
347
|
+
it('| should handle no brackets', () => {
|
|
348
|
+
const input = 'plain text with no brackets';
|
|
349
|
+
const result = string_util_1.DyFM_String.multiBracketSplit(input, standardBrackets, 10, '...');
|
|
350
|
+
expect(result).toEqual(['plain text with no brackets']);
|
|
351
|
+
});
|
|
352
|
+
it('| should handle empty string', () => {
|
|
353
|
+
const input = '';
|
|
354
|
+
const result = string_util_1.DyFM_String.multiBracketSplit(input, standardBrackets, 10, '...');
|
|
355
|
+
expect(result).toEqual(['']);
|
|
356
|
+
});
|
|
357
|
+
it('| should handle empty brackets array', () => {
|
|
358
|
+
const input = 'text (with) brackets [but] no {bracket} definitions';
|
|
359
|
+
const result = string_util_1.DyFM_String.multiBracketSplit(input, [], 10, '...');
|
|
360
|
+
expect(result).toEqual(['text (with) brackets [but] no {bracket} definitions']);
|
|
361
|
+
});
|
|
362
|
+
it('| should handle overlapping bracket patterns', () => {
|
|
363
|
+
const overlappingBrackets = [
|
|
364
|
+
{ opening: '(', closing: ')' },
|
|
365
|
+
{ opening: '((', closing: '))' }
|
|
366
|
+
];
|
|
367
|
+
const input = 'text ((double)) and (single) brackets';
|
|
368
|
+
const result = string_util_1.DyFM_String.multiBracketSplit(input, overlappingBrackets, 10, '...');
|
|
369
|
+
expect(result).toEqual([
|
|
370
|
+
'text ... and ... brackets',
|
|
371
|
+
'double',
|
|
372
|
+
'single'
|
|
373
|
+
]);
|
|
374
|
+
});
|
|
375
|
+
it('| should handle brackets with same opening but different closing', () => {
|
|
376
|
+
const mixedBrackets = [
|
|
377
|
+
{ opening: '<', closing: '>' },
|
|
378
|
+
{ opening: '<', closing: '/>' }
|
|
379
|
+
];
|
|
380
|
+
const input = 'text <tag/> and <content> here';
|
|
381
|
+
const result = string_util_1.DyFM_String.multiBracketSplit(input, mixedBrackets, 10, '...');
|
|
382
|
+
expect(result).toEqual([
|
|
383
|
+
'text ... and ... here',
|
|
384
|
+
'tag',
|
|
385
|
+
'content'
|
|
386
|
+
]);
|
|
387
|
+
});
|
|
388
|
+
it('| should maintain proper bracket matching with mixed types', () => {
|
|
389
|
+
const input = 'text (round [square) wrong] correct';
|
|
390
|
+
const result = string_util_1.DyFM_String.multiBracketSplit(input, standardBrackets, 10, '...');
|
|
391
|
+
expect(result).toEqual([
|
|
392
|
+
'text ... wrong] correct',
|
|
393
|
+
'round [square'
|
|
394
|
+
]);
|
|
395
|
+
});
|
|
396
|
+
});
|
|
397
|
+
describe('| multiBracketSplit - replaceContents variations', () => {
|
|
398
|
+
const standardBrackets = [
|
|
399
|
+
{ opening: '(', closing: ')' },
|
|
400
|
+
{ opening: '[', closing: ']' },
|
|
401
|
+
{ opening: '{', closing: '}' }
|
|
402
|
+
];
|
|
403
|
+
it('| should handle empty replaceContents (no replacement)', () => {
|
|
404
|
+
const input = 'text (round) and [square] with {curly} brackets';
|
|
405
|
+
const result = string_util_1.DyFM_String.multiBracketSplit(input, standardBrackets, 10, '');
|
|
406
|
+
expect(result).toEqual([
|
|
407
|
+
'text and with brackets',
|
|
408
|
+
'round',
|
|
409
|
+
'square',
|
|
410
|
+
'curly'
|
|
411
|
+
]);
|
|
412
|
+
});
|
|
413
|
+
it('| should handle undefined replaceContents (no replacement)', () => {
|
|
414
|
+
const input = 'text (round) and [square] with {curly} brackets';
|
|
415
|
+
const result = string_util_1.DyFM_String.multiBracketSplit(input, standardBrackets, 10);
|
|
416
|
+
expect(result).toEqual([
|
|
417
|
+
'text (round) and [square] with {curly} brackets',
|
|
418
|
+
'round',
|
|
419
|
+
'square',
|
|
420
|
+
'curly'
|
|
421
|
+
]);
|
|
422
|
+
});
|
|
423
|
+
it('| should handle nested brackets with empty replaceContents', () => {
|
|
424
|
+
const input = 'text (round) and [square] with {curly (nested)} brackets';
|
|
425
|
+
const result = string_util_1.DyFM_String.multiBracketSplit(input, standardBrackets, 2, '');
|
|
426
|
+
expect(result).toEqual([
|
|
427
|
+
'text and with brackets',
|
|
428
|
+
'round',
|
|
429
|
+
'square',
|
|
430
|
+
'curly ',
|
|
431
|
+
'nested'
|
|
432
|
+
]);
|
|
433
|
+
});
|
|
434
|
+
});
|
|
435
|
+
describe('| multiBracketSplitDetailed', () => {
|
|
436
|
+
const standardBrackets = [
|
|
437
|
+
{ opening: '(', closing: ')' },
|
|
438
|
+
{ opening: '[', closing: ']' },
|
|
439
|
+
{ opening: '{', closing: '}' }
|
|
440
|
+
];
|
|
441
|
+
it('| should return detailed information for simple bracket extraction', () => {
|
|
442
|
+
const input = 'text (round) end';
|
|
443
|
+
const result = string_util_1.DyFM_String.multiBracketSplitDetailed(input, standardBrackets, 10, '...');
|
|
444
|
+
expect(result).toEqual([
|
|
445
|
+
{ content: 'text ... end', level: 0, brackets: null },
|
|
446
|
+
{ content: 'round', level: 1, brackets: { opening: '(', closing: ')' } }
|
|
447
|
+
]);
|
|
448
|
+
});
|
|
449
|
+
it('| should handle multiple bracket types with detailed info', () => {
|
|
450
|
+
const input = 'text (round) and [square] with {curly} brackets';
|
|
451
|
+
const result = string_util_1.DyFM_String.multiBracketSplitDetailed(input, standardBrackets, 10, '...');
|
|
452
|
+
expect(result).toEqual([
|
|
453
|
+
{ content: 'text ... and ... with ... brackets', level: 0, brackets: null },
|
|
454
|
+
{ content: 'round', level: 1, brackets: { opening: '(', closing: ')' } },
|
|
455
|
+
{ content: 'square', level: 1, brackets: { opening: '[', closing: ']' } },
|
|
456
|
+
{ content: 'curly', level: 1, brackets: { opening: '{', closing: '}' } }
|
|
457
|
+
]);
|
|
458
|
+
});
|
|
459
|
+
it('| should handle nested brackets with detailed level information', () => {
|
|
460
|
+
const input = 'text (round) and [square] with {curly (nested)} brackets';
|
|
461
|
+
const result = string_util_1.DyFM_String.multiBracketSplitDetailed(input, standardBrackets, 2, '...');
|
|
462
|
+
expect(result).toEqual([
|
|
463
|
+
{ content: 'text ... and ... with ... brackets', level: 0, brackets: null },
|
|
464
|
+
{ content: 'round', level: 1, brackets: { opening: '(', closing: ')' } },
|
|
465
|
+
{ content: 'square', level: 1, brackets: { opening: '[', closing: ']' } },
|
|
466
|
+
{ content: 'curly ...', level: 1, brackets: { opening: '{', closing: '}' } },
|
|
467
|
+
{ content: 'nested', level: 2, brackets: { opening: '(', closing: ')' } }
|
|
468
|
+
]);
|
|
469
|
+
});
|
|
470
|
+
it('| should handle deeply nested brackets with correct levels', () => {
|
|
471
|
+
const input = 'start {outer [middle (inner) middle] outer} end';
|
|
472
|
+
const result = string_util_1.DyFM_String.multiBracketSplitDetailed(input, standardBrackets, 3, '...');
|
|
473
|
+
expect(result).toEqual([
|
|
474
|
+
{ content: 'start ... end', level: 0, brackets: null },
|
|
475
|
+
{ content: 'outer ... outer', level: 1, brackets: { opening: '{', closing: '}' } },
|
|
476
|
+
{ content: 'middle ... middle', level: 2, brackets: { opening: '[', closing: ']' } },
|
|
477
|
+
{ content: 'inner', level: 3, brackets: { opening: '(', closing: ')' } }
|
|
478
|
+
]);
|
|
479
|
+
});
|
|
480
|
+
it('| should respect maxDepth and show correct levels', () => {
|
|
481
|
+
const input = 'text {a [b (c) b] a} text';
|
|
482
|
+
const result = string_util_1.DyFM_String.multiBracketSplitDetailed(input, standardBrackets, 2, '...');
|
|
483
|
+
expect(result).toEqual([
|
|
484
|
+
{ content: 'text ... text', level: 0, brackets: null },
|
|
485
|
+
{ content: 'a ... a', level: 1, brackets: { opening: '{', closing: '}' } },
|
|
486
|
+
{ content: 'b (c) b', level: 2, brackets: { opening: '[', closing: ']' } }
|
|
487
|
+
]);
|
|
488
|
+
});
|
|
489
|
+
it('| should handle empty brackets with detailed info', () => {
|
|
490
|
+
const input = 'text () and [] with {} brackets';
|
|
491
|
+
const result = string_util_1.DyFM_String.multiBracketSplitDetailed(input, standardBrackets, 10, '...');
|
|
492
|
+
expect(result).toEqual([
|
|
493
|
+
{ content: 'text ... and ... with ... brackets', level: 0, brackets: null },
|
|
494
|
+
{ content: '', level: 1, brackets: { opening: '(', closing: ')' } },
|
|
495
|
+
{ content: '', level: 1, brackets: { opening: '[', closing: ']' } },
|
|
496
|
+
{ content: '', level: 1, brackets: { opening: '{', closing: '}' } }
|
|
497
|
+
]);
|
|
498
|
+
});
|
|
499
|
+
it('| should handle custom bracket types with detailed info', () => {
|
|
500
|
+
const customBrackets = [
|
|
501
|
+
{ opening: '{{', closing: '}}' },
|
|
502
|
+
{ opening: '[[', closing: ']]' }
|
|
503
|
+
];
|
|
504
|
+
const input = 'text {{double curly}} and [[double square]] content';
|
|
505
|
+
const result = string_util_1.DyFM_String.multiBracketSplitDetailed(input, customBrackets, 10, '...');
|
|
506
|
+
expect(result).toEqual([
|
|
507
|
+
{ content: 'text ... and ... content', level: 0, brackets: null },
|
|
508
|
+
{ content: 'double curly', level: 1, brackets: { opening: '{{', closing: '}}' } },
|
|
509
|
+
{ content: 'double square', level: 1, brackets: { opening: '[[', closing: ']]' } }
|
|
510
|
+
]);
|
|
511
|
+
});
|
|
512
|
+
it('| should handle same character brackets with detailed info', () => {
|
|
513
|
+
const quoteBrackets = [
|
|
514
|
+
{ opening: "'", closing: "'" },
|
|
515
|
+
{ opening: '"', closing: '"' }
|
|
516
|
+
];
|
|
517
|
+
const input = "text 'single quoted' and \"double quoted\" content";
|
|
518
|
+
const result = string_util_1.DyFM_String.multiBracketSplitDetailed(input, quoteBrackets, 10, '...');
|
|
519
|
+
expect(result).toEqual([
|
|
520
|
+
{ content: 'text ... and ... content', level: 0, brackets: null },
|
|
521
|
+
{ content: 'single quoted', level: 1, brackets: { opening: "'", closing: "'" } },
|
|
522
|
+
{ content: 'double quoted', level: 1, brackets: { opening: '"', closing: '"' } }
|
|
523
|
+
]);
|
|
524
|
+
});
|
|
525
|
+
it('| should handle no brackets case', () => {
|
|
526
|
+
const input = 'plain text with no brackets';
|
|
527
|
+
const result = string_util_1.DyFM_String.multiBracketSplitDetailed(input, standardBrackets, 10, '...');
|
|
528
|
+
expect(result).toEqual([
|
|
529
|
+
{ content: 'plain text with no brackets', level: 0, brackets: null }
|
|
530
|
+
]);
|
|
531
|
+
});
|
|
532
|
+
it('| should handle empty brackets array', () => {
|
|
533
|
+
const input = 'text (with) brackets [but] no {bracket} definitions';
|
|
534
|
+
const result = string_util_1.DyFM_String.multiBracketSplitDetailed(input, [], 10, '...');
|
|
535
|
+
expect(result).toEqual([
|
|
536
|
+
{ content: 'text (with) brackets [but] no {bracket} definitions', level: 0, brackets: null }
|
|
537
|
+
]);
|
|
538
|
+
});
|
|
539
|
+
it('| should handle empty string', () => {
|
|
540
|
+
const input = '';
|
|
541
|
+
const result = string_util_1.DyFM_String.multiBracketSplitDetailed(input, standardBrackets, 10, '...');
|
|
542
|
+
expect(result).toEqual([
|
|
543
|
+
{ content: '', level: 0, brackets: null }
|
|
544
|
+
]);
|
|
545
|
+
});
|
|
546
|
+
it('| should show bracket type for each extracted content', () => {
|
|
547
|
+
const mixedBrackets = [
|
|
548
|
+
{ opening: '<', closing: '>' },
|
|
549
|
+
{ opening: '(', closing: ')' },
|
|
550
|
+
{ opening: '[', closing: ']' }
|
|
551
|
+
];
|
|
552
|
+
const input = 'start <tag> middle (paren) end [array] finish';
|
|
553
|
+
const result = string_util_1.DyFM_String.multiBracketSplitDetailed(input, mixedBrackets, 10, '...');
|
|
554
|
+
expect(result).toEqual([
|
|
555
|
+
{ content: 'start ... middle ... end ... finish', level: 0, brackets: null },
|
|
556
|
+
{ content: 'tag', level: 1, brackets: { opening: '<', closing: '>' } },
|
|
557
|
+
{ content: 'paren', level: 1, brackets: { opening: '(', closing: ')' } },
|
|
558
|
+
{ content: 'array', level: 1, brackets: { opening: '[', closing: ']' } }
|
|
559
|
+
]);
|
|
560
|
+
});
|
|
561
|
+
it('| should handle complex nested scenario with multiple bracket types', () => {
|
|
562
|
+
const input = 'text (a [b {c (d) c} b] a) text';
|
|
563
|
+
const result = string_util_1.DyFM_String.multiBracketSplitDetailed(input, standardBrackets, 4, '...');
|
|
564
|
+
expect(result).toEqual([
|
|
565
|
+
{ content: 'text ... text', level: 0, brackets: null },
|
|
566
|
+
{ content: 'a ... a', level: 1, brackets: { opening: '(', closing: ')' } },
|
|
567
|
+
{ content: 'b ... b', level: 2, brackets: { opening: '[', closing: ']' } },
|
|
568
|
+
{ content: 'c ... c', level: 3, brackets: { opening: '{', closing: '}' } },
|
|
569
|
+
{ content: 'd', level: 4, brackets: { opening: '(', closing: ')' } }
|
|
570
|
+
]);
|
|
571
|
+
});
|
|
572
|
+
});
|
|
573
|
+
describe('| multiBracketSplitDetailed - replaceContents variations', () => {
|
|
574
|
+
const standardBrackets = [
|
|
575
|
+
{ opening: '(', closing: ')' },
|
|
576
|
+
{ opening: '[', closing: ']' },
|
|
577
|
+
{ opening: '{', closing: '}' }
|
|
578
|
+
];
|
|
579
|
+
it('| should handle empty replaceContents (no replacement)', () => {
|
|
580
|
+
const input = 'text (round) and [square] brackets';
|
|
581
|
+
const result = string_util_1.DyFM_String.multiBracketSplitDetailed(input, standardBrackets, 10, '');
|
|
582
|
+
expect(result).toEqual([
|
|
583
|
+
{ content: 'text and brackets', level: 0, brackets: null },
|
|
584
|
+
{ content: 'round', level: 1, brackets: { opening: '(', closing: ')' } },
|
|
585
|
+
{ content: 'square', level: 1, brackets: { opening: '[', closing: ']' } }
|
|
586
|
+
]);
|
|
587
|
+
});
|
|
588
|
+
it('| should handle undefined replaceContents (no replacement)', () => {
|
|
589
|
+
const input = 'text (round) and [square] brackets';
|
|
590
|
+
const result = string_util_1.DyFM_String.multiBracketSplitDetailed(input, standardBrackets, 10);
|
|
591
|
+
expect(result).toEqual([
|
|
592
|
+
{ content: 'text (round) and [square] brackets', level: 0, brackets: null },
|
|
593
|
+
{ content: 'round', level: 1, brackets: { opening: '(', closing: ')' } },
|
|
594
|
+
{ content: 'square', level: 1, brackets: { opening: '[', closing: ']' } }
|
|
595
|
+
]);
|
|
596
|
+
});
|
|
597
|
+
it('| should handle nested brackets with empty replaceContents', () => {
|
|
598
|
+
const input = 'text {curly (nested) content} end';
|
|
599
|
+
const result = string_util_1.DyFM_String.multiBracketSplitDetailed(input, standardBrackets, 2, '');
|
|
600
|
+
expect(result).toEqual([
|
|
601
|
+
{ content: 'text end', level: 0, brackets: null },
|
|
602
|
+
{ content: 'curly content', level: 1, brackets: { opening: '{', closing: '}' } },
|
|
603
|
+
{ content: 'nested', level: 2, brackets: { opening: '(', closing: ')' } }
|
|
604
|
+
]);
|
|
605
|
+
});
|
|
606
|
+
});
|
|
607
|
+
// JSON and code fence extraction tests
|
|
608
|
+
describe('| JSON and code fence extraction', () => {
|
|
609
|
+
it('| should extract from plain JSON object with nested object', () => {
|
|
610
|
+
const brackets = [
|
|
611
|
+
{ opening: '{', closing: '}' }
|
|
612
|
+
];
|
|
613
|
+
const input = 'before {"name":"John","age":30,"nested":{"flag":true}} after';
|
|
614
|
+
const result = string_util_1.DyFM_String.multiBracketSplitDetailed(input, brackets, 3, '...');
|
|
615
|
+
expect(result).toEqual([
|
|
616
|
+
{ content: 'before ... after', level: 0, brackets: null },
|
|
617
|
+
{ content: '"name":"John","age":30,"nested":...', level: 1, brackets: { opening: '{', closing: '}' } },
|
|
618
|
+
{ content: '"flag":true', level: 2, brackets: { opening: '{', closing: '}' } }
|
|
619
|
+
]);
|
|
620
|
+
});
|
|
621
|
+
it('| should extract JSON inside code fence json``` ... ```', () => {
|
|
622
|
+
const brackets = [
|
|
623
|
+
{ opening: 'json```', closing: '```' },
|
|
624
|
+
{ opening: '{', closing: '}' }
|
|
625
|
+
];
|
|
626
|
+
const input = 'pre json```{"x":1,"y":{"z":2}}``` post';
|
|
627
|
+
const result = string_util_1.DyFM_String.multiBracketSplitDetailed(input, brackets, 3, '...');
|
|
628
|
+
expect(result).toEqual([
|
|
629
|
+
{ content: 'pre ... post', level: 0, brackets: null },
|
|
630
|
+
{ content: '...', level: 1, brackets: { opening: 'json```', closing: '```' } },
|
|
631
|
+
{ content: '"x":1,"y":...', level: 2, brackets: { opening: '{', closing: '}' } },
|
|
632
|
+
{ content: '"z":2', level: 3, brackets: { opening: '{', closing: '}' } }
|
|
633
|
+
]);
|
|
634
|
+
});
|
|
635
|
+
it('| should handle deeply nested JSON object within a property', () => {
|
|
636
|
+
const brackets = [
|
|
637
|
+
{ opening: '{', closing: '}' }
|
|
638
|
+
];
|
|
639
|
+
const input = 'wrap {"outer":{"mid":{"inner":42}}} done';
|
|
640
|
+
const result = string_util_1.DyFM_String.multiBracketSplitDetailed(input, brackets, 3, '...');
|
|
641
|
+
expect(result).toEqual([
|
|
642
|
+
{ content: 'wrap ... done', level: 0, brackets: null },
|
|
643
|
+
{ content: '"outer":...', level: 1, brackets: { opening: '{', closing: '}' } },
|
|
644
|
+
{ content: '"mid":...', level: 2, brackets: { opening: '{', closing: '}' } },
|
|
645
|
+
{ content: '"inner":42', level: 3, brackets: { opening: '{', closing: '}' } }
|
|
646
|
+
]);
|
|
647
|
+
});
|
|
648
|
+
it('| should process when a JSON string value contains code fence pattern json``` ... ```', () => {
|
|
649
|
+
const brackets = [
|
|
650
|
+
{ opening: 'json```', closing: '```' },
|
|
651
|
+
{ opening: '{', closing: '}' }
|
|
652
|
+
];
|
|
653
|
+
const input = 'before {"note":"see json```X``` inside","data":{"raw":"json```Y```"}} after';
|
|
654
|
+
const result = string_util_1.DyFM_String.multiBracketSplitDetailed(input, brackets, 4, '...');
|
|
655
|
+
expect(result).toEqual([
|
|
656
|
+
{ content: 'before ... after', level: 0, brackets: null },
|
|
657
|
+
{ content: '"note":"see ... inside","data":...', level: 1, brackets: { opening: '{', closing: '}' } },
|
|
658
|
+
{ content: 'X', level: 2, brackets: { opening: 'json```', closing: '```' } },
|
|
659
|
+
{ content: '"raw":"..."', level: 2, brackets: { opening: '{', closing: '}' } },
|
|
660
|
+
{ content: 'Y', level: 3, brackets: { opening: 'json```', closing: '```' } }
|
|
661
|
+
]);
|
|
662
|
+
});
|
|
663
|
+
});
|
|
664
|
+
// Script/method extraction tests
|
|
665
|
+
describe('| script/method extraction', () => {
|
|
666
|
+
it('| should extract simple method arguments with parentheses', () => {
|
|
667
|
+
const input = 'prefix doSomething(arg1, arg2) suffix';
|
|
668
|
+
const result = string_util_1.DyFM_String.nestedBracketSplit(input, '(', ')', 2, '...');
|
|
669
|
+
expect(result).toEqual([
|
|
670
|
+
'prefix doSomething... suffix',
|
|
671
|
+
'arg1, arg2'
|
|
672
|
+
]);
|
|
673
|
+
});
|
|
674
|
+
it('| should handle nested method calls', () => {
|
|
675
|
+
const input = 'call outer(inner(a, b), c)';
|
|
676
|
+
const result = string_util_1.DyFM_String.nestedBracketSplit(input, '(', ')', 3, '...');
|
|
677
|
+
expect(result).toEqual([
|
|
678
|
+
'call outer...',
|
|
679
|
+
'inner..., c',
|
|
680
|
+
'a, b'
|
|
681
|
+
]);
|
|
682
|
+
});
|
|
683
|
+
it('| should extract quoted args inside a method call', () => {
|
|
684
|
+
const brackets = [
|
|
685
|
+
{ opening: '(', closing: ')' },
|
|
686
|
+
{ opening: '"', closing: '"' }
|
|
687
|
+
];
|
|
688
|
+
const input = 'run fn("a, b", 3) end';
|
|
689
|
+
const result = string_util_1.DyFM_String.multiBracketSplitDetailed(input, brackets, 3, '...');
|
|
690
|
+
expect(result).toEqual([
|
|
691
|
+
{ content: 'run fn... end', level: 0, brackets: null },
|
|
692
|
+
{ content: '..., 3', level: 1, brackets: { opening: '(', closing: ')' } },
|
|
693
|
+
{ content: 'a, b', level: 2, brackets: { opening: '"', closing: '"' } }
|
|
694
|
+
]);
|
|
695
|
+
});
|
|
696
|
+
it('| should handle JSON literal and inner helper call as arguments', () => {
|
|
697
|
+
const brackets = [
|
|
698
|
+
{ opening: '(', closing: ')' },
|
|
699
|
+
{ opening: '{', closing: '}' },
|
|
700
|
+
{ opening: '"', closing: '"' }
|
|
701
|
+
];
|
|
702
|
+
const input = 'call api({id:1, meta:{ok:true}}, helper("x")) done';
|
|
703
|
+
const result = string_util_1.DyFM_String.multiBracketSplitDetailed(input, brackets, 4, '...');
|
|
704
|
+
expect(result).toEqual([
|
|
705
|
+
{ content: 'call api... done', level: 0, brackets: null },
|
|
706
|
+
{ content: '..., helper...', level: 1, brackets: { opening: '(', closing: ')' } },
|
|
707
|
+
{ content: 'id:1, meta:...', level: 2, brackets: { opening: '{', closing: '}' } },
|
|
708
|
+
{ content: '...', level: 2, brackets: { opening: '(', closing: ')' } },
|
|
709
|
+
{ content: 'ok:true', level: 3, brackets: { opening: '{', closing: '}' } },
|
|
710
|
+
{ content: 'x', level: 3, brackets: { opening: '"', closing: '"' } }
|
|
711
|
+
]);
|
|
712
|
+
});
|
|
713
|
+
it('| should process code fence marker inside a quoted argument', () => {
|
|
714
|
+
const brackets = [
|
|
715
|
+
{ opening: '(', closing: ')' },
|
|
716
|
+
{ opening: 'json```', closing: '```' },
|
|
717
|
+
{ opening: '"', closing: '"' }
|
|
718
|
+
];
|
|
719
|
+
const input = 'run method("see json```{a:1}``` here", 0)';
|
|
720
|
+
const result = string_util_1.DyFM_String.multiBracketSplitDetailed(input, brackets, 4, '...');
|
|
721
|
+
expect(result).toEqual([
|
|
722
|
+
{ content: 'run method...', level: 0, brackets: null },
|
|
723
|
+
{ content: '..., 0', level: 1, brackets: { opening: '(', closing: ')' } },
|
|
724
|
+
{ content: 'see ... here', level: 2, brackets: { opening: '"', closing: '"' } },
|
|
725
|
+
{ content: '{a:1}', level: 3, brackets: { opening: 'json```', closing: '```' } }
|
|
726
|
+
]);
|
|
727
|
+
});
|
|
728
|
+
});
|
|
35
729
|
});
|
|
36
730
|
//# sourceMappingURL=string.util.spec.js.map
|