@holoscript/std 2.1.0

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.
@@ -0,0 +1,208 @@
1
+ /**
2
+ * @holoscript/std - String Module
3
+ *
4
+ * String manipulation utilities for HoloScript Plus programs.
5
+ */
6
+ /**
7
+ * Check if a string is empty or only whitespace
8
+ */
9
+ export declare function isBlank(s: string): boolean;
10
+ /**
11
+ * Check if a string is not empty and not only whitespace
12
+ */
13
+ export declare function isNotBlank(s: string): boolean;
14
+ /**
15
+ * Capitalize the first letter of a string
16
+ */
17
+ export declare function capitalize(s: string): string;
18
+ /**
19
+ * Capitalize the first letter of each word
20
+ */
21
+ export declare function titleCase(s: string): string;
22
+ /**
23
+ * Convert to camelCase
24
+ */
25
+ export declare function camelCase(s: string): string;
26
+ /**
27
+ * Convert to PascalCase
28
+ */
29
+ export declare function pascalCase(s: string): string;
30
+ /**
31
+ * Convert to snake_case
32
+ */
33
+ export declare function snakeCase(s: string): string;
34
+ /**
35
+ * Convert to kebab-case
36
+ */
37
+ export declare function kebabCase(s: string): string;
38
+ /**
39
+ * Convert to SCREAMING_SNAKE_CASE
40
+ */
41
+ export declare function constantCase(s: string): string;
42
+ /**
43
+ * Pad a string on the left to reach target length
44
+ */
45
+ export declare function padLeft(s: string, length: number, char?: string): string;
46
+ /**
47
+ * Pad a string on the right to reach target length
48
+ */
49
+ export declare function padRight(s: string, length: number, char?: string): string;
50
+ /**
51
+ * Pad a string on both sides to center it
52
+ */
53
+ export declare function center(s: string, length: number, char?: string): string;
54
+ /**
55
+ * Truncate a string to max length, adding ellipsis if needed
56
+ */
57
+ export declare function truncate(s: string, maxLength: number, ellipsis?: string): string;
58
+ /**
59
+ * Truncate a string in the middle
60
+ */
61
+ export declare function truncateMiddle(s: string, maxLength: number, ellipsis?: string): string;
62
+ /**
63
+ * Repeat a string n times
64
+ */
65
+ export declare function repeat(s: string, count: number): string;
66
+ /**
67
+ * Reverse a string
68
+ */
69
+ export declare function reverse(s: string): string;
70
+ /**
71
+ * Count occurrences of a substring
72
+ */
73
+ export declare function count(s: string, substring: string): number;
74
+ /**
75
+ * Check if string contains a substring (case-insensitive)
76
+ */
77
+ export declare function containsIgnoreCase(s: string, substring: string): boolean;
78
+ /**
79
+ * Check if string starts with prefix (case-insensitive)
80
+ */
81
+ export declare function startsWithIgnoreCase(s: string, prefix: string): boolean;
82
+ /**
83
+ * Check if string ends with suffix (case-insensitive)
84
+ */
85
+ export declare function endsWithIgnoreCase(s: string, suffix: string): boolean;
86
+ /**
87
+ * Remove all whitespace from a string
88
+ */
89
+ export declare function removeWhitespace(s: string): string;
90
+ /**
91
+ * Collapse multiple spaces into single space
92
+ */
93
+ export declare function collapseWhitespace(s: string): string;
94
+ /**
95
+ * Remove a prefix if present
96
+ */
97
+ export declare function removePrefix(s: string, prefix: string): string;
98
+ /**
99
+ * Remove a suffix if present
100
+ */
101
+ export declare function removeSuffix(s: string, suffix: string): string;
102
+ /**
103
+ * Wrap a string with prefix and suffix
104
+ */
105
+ export declare function wrap(s: string, wrapper: string): string;
106
+ export declare function wrap(s: string, prefix: string, suffix: string): string;
107
+ /**
108
+ * Unwrap a string by removing matching prefix and suffix
109
+ */
110
+ export declare function unwrap(s: string, wrapper: string): string;
111
+ export declare function unwrap(s: string, prefix: string, suffix: string): string;
112
+ /**
113
+ * Split a string into lines
114
+ */
115
+ export declare function lines(s: string): string[];
116
+ /**
117
+ * Split a string into words
118
+ */
119
+ export declare function words(s: string): string[];
120
+ /**
121
+ * Split a string into characters
122
+ */
123
+ export declare function chars(s: string): string[];
124
+ /**
125
+ * Join strings with a separator
126
+ */
127
+ export declare function join(strings: string[], separator?: string): string;
128
+ /**
129
+ * Format a template string with values
130
+ */
131
+ export declare function format(template: string, values: Record<string, unknown>): string;
132
+ /**
133
+ * Format a number as a string with grouping
134
+ */
135
+ export declare function formatNumber(n: number, options?: Intl.NumberFormatOptions): string;
136
+ /**
137
+ * Format a number with commas
138
+ */
139
+ export declare function numberWithCommas(n: number): string;
140
+ /**
141
+ * Format bytes as human-readable string
142
+ */
143
+ export declare function formatBytes(bytes: number, decimals?: number): string;
144
+ /**
145
+ * Format duration in milliseconds as human-readable string
146
+ */
147
+ export declare function formatDuration(ms: number): string;
148
+ /**
149
+ * Escape HTML special characters
150
+ */
151
+ export declare function escapeHtml(s: string): string;
152
+ /**
153
+ * Unescape HTML entities
154
+ */
155
+ export declare function unescapeHtml(s: string): string;
156
+ /**
157
+ * Escape regex special characters
158
+ */
159
+ export declare function escapeRegex(s: string): string;
160
+ /**
161
+ * Generate a slug from a string
162
+ */
163
+ export declare function slugify(s: string): string;
164
+ /**
165
+ * Check if string is a valid identifier
166
+ */
167
+ export declare function isValidIdentifier(s: string): boolean;
168
+ /**
169
+ * Check if string is numeric
170
+ */
171
+ export declare function isNumeric(s: string): boolean;
172
+ /**
173
+ * Check if string is alphanumeric
174
+ */
175
+ export declare function isAlphanumeric(s: string): boolean;
176
+ /**
177
+ * Check if string is alphabetic
178
+ */
179
+ export declare function isAlpha(s: string): boolean;
180
+ /**
181
+ * Generate a random string
182
+ */
183
+ export declare function randomString(length: number, charset?: string): string;
184
+ /**
185
+ * Generate a UUID v4
186
+ */
187
+ export declare function uuid(): string;
188
+ /**
189
+ * Indent each line of a string
190
+ */
191
+ export declare function indent(s: string, spaces: number, char?: string): string;
192
+ /**
193
+ * Dedent a string (remove common leading whitespace)
194
+ */
195
+ export declare function dedent(s: string): string;
196
+ /**
197
+ * Word wrap text to a maximum width
198
+ */
199
+ export declare function wordWrap(s: string, maxWidth: number): string;
200
+ /**
201
+ * Levenshtein distance between two strings
202
+ */
203
+ export declare function levenshtein(a: string, b: string): number;
204
+ /**
205
+ * Check similarity between two strings (0-1)
206
+ */
207
+ export declare function similarity(a: string, b: string): number;
208
+ //# sourceMappingURL=string.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"string.d.ts","sourceRoot":"","sources":["../src/string.ts"],"names":[],"mappings":"AAAA;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AO,CAAC,CAAC,EAAE,MAAM,GAAG,MAAM,CAOzC;AAED;;GAEG;AACH,wBAAgB,iBAAiB,CAAC,CAAC,EAAE,MAAM,GAAG,OAAO,CAEpD;AAED;;GAEG;AACH,wBAAgB,SAAS,CAAC,CAAC,EAAE,MAAM,GAAG,OAAO,CAE5C;AAED;;GAEG;AACH,wBAAgB,cAAc,CAAC,CAAC,EAAE,MAAM,GAAG,OAAO,CAEjD;AAED;;GAEG;AACH,wBAAgB,OAAO,CAAC,CAAC,EAAE,MAAM,GAAG,OAAO,CAE1C;AAED;;GAEG;AACH,wBAAgB,YAAY,CAAC,MAAM,EAAE,MAAM,EAAE,OAAO,SAAmE,GAAG,MAAM,CAM/H;AAED;;GAEG;AACH,wBAAgB,IAAI,IAAI,MAAM,CAM7B;AAED;;GAEG;AACH,wBAAgB,MAAM,CAAC,CAAC,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,IAAI,SAAM,GAAG,MAAM,CAMpE;AAED;;GAEG;AACH,wBAAgB,MAAM,CAAC,CAAC,EAAE,MAAM,GAAG,MAAM,CAaxC;AAED;;GAEG;AACH,wBAAgB,QAAQ,CAAC,CAAC,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,GAAG,MAAM,CAqB5D;AAED;;GAEG;AACH,wBAAgB,WAAW,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,GAAG,MAAM,CA4BxD;AAED;;GAEG;AACH,wBAAgB,UAAU,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,GAAG,MAAM,CAIvD"}
package/dist/string.js ADDED
@@ -0,0 +1,443 @@
1
+ /**
2
+ * @holoscript/std - String Module
3
+ *
4
+ * String manipulation utilities for HoloScript Plus programs.
5
+ */
6
+ /**
7
+ * Check if a string is empty or only whitespace
8
+ */
9
+ export function isBlank(s) {
10
+ return s.trim().length === 0;
11
+ }
12
+ /**
13
+ * Check if a string is not empty and not only whitespace
14
+ */
15
+ export function isNotBlank(s) {
16
+ return s.trim().length > 0;
17
+ }
18
+ /**
19
+ * Capitalize the first letter of a string
20
+ */
21
+ export function capitalize(s) {
22
+ if (s.length === 0)
23
+ return s;
24
+ return s[0].toUpperCase() + s.slice(1);
25
+ }
26
+ /**
27
+ * Capitalize the first letter of each word
28
+ */
29
+ export function titleCase(s) {
30
+ return s.split(/\s+/).map(capitalize).join(' ');
31
+ }
32
+ /**
33
+ * Convert to camelCase
34
+ */
35
+ export function camelCase(s) {
36
+ return s
37
+ .replace(/[-_\s]+(.)?/g, (_, c) => (c ? c.toUpperCase() : ''))
38
+ .replace(/^[A-Z]/, (c) => c.toLowerCase());
39
+ }
40
+ /**
41
+ * Convert to PascalCase
42
+ */
43
+ export function pascalCase(s) {
44
+ const camel = camelCase(s);
45
+ return camel.length > 0 ? camel[0].toUpperCase() + camel.slice(1) : camel;
46
+ }
47
+ /**
48
+ * Convert to snake_case
49
+ */
50
+ export function snakeCase(s) {
51
+ return s
52
+ .replace(/([a-z])([A-Z])/g, '$1_$2')
53
+ .replace(/[-\s]+/g, '_')
54
+ .toLowerCase();
55
+ }
56
+ /**
57
+ * Convert to kebab-case
58
+ */
59
+ export function kebabCase(s) {
60
+ return s
61
+ .replace(/([a-z])([A-Z])/g, '$1-$2')
62
+ .replace(/[_\s]+/g, '-')
63
+ .toLowerCase();
64
+ }
65
+ /**
66
+ * Convert to SCREAMING_SNAKE_CASE
67
+ */
68
+ export function constantCase(s) {
69
+ return snakeCase(s).toUpperCase();
70
+ }
71
+ /**
72
+ * Pad a string on the left to reach target length
73
+ */
74
+ export function padLeft(s, length, char = ' ') {
75
+ return s.padStart(length, char);
76
+ }
77
+ /**
78
+ * Pad a string on the right to reach target length
79
+ */
80
+ export function padRight(s, length, char = ' ') {
81
+ return s.padEnd(length, char);
82
+ }
83
+ /**
84
+ * Pad a string on both sides to center it
85
+ */
86
+ export function center(s, length, char = ' ') {
87
+ if (s.length >= length)
88
+ return s;
89
+ const totalPadding = length - s.length;
90
+ const leftPadding = Math.floor(totalPadding / 2);
91
+ const rightPadding = totalPadding - leftPadding;
92
+ return char.repeat(leftPadding) + s + char.repeat(rightPadding);
93
+ }
94
+ /**
95
+ * Truncate a string to max length, adding ellipsis if needed
96
+ */
97
+ export function truncate(s, maxLength, ellipsis = '...') {
98
+ if (s.length <= maxLength)
99
+ return s;
100
+ return s.slice(0, maxLength - ellipsis.length) + ellipsis;
101
+ }
102
+ /**
103
+ * Truncate a string in the middle
104
+ */
105
+ export function truncateMiddle(s, maxLength, ellipsis = '...') {
106
+ if (s.length <= maxLength)
107
+ return s;
108
+ const availableLength = maxLength - ellipsis.length;
109
+ const leftLength = Math.ceil(availableLength / 2);
110
+ const rightLength = Math.floor(availableLength / 2);
111
+ return s.slice(0, leftLength) + ellipsis + s.slice(-rightLength);
112
+ }
113
+ /**
114
+ * Repeat a string n times
115
+ */
116
+ export function repeat(s, count) {
117
+ return s.repeat(count);
118
+ }
119
+ /**
120
+ * Reverse a string
121
+ */
122
+ export function reverse(s) {
123
+ return [...s].reverse().join('');
124
+ }
125
+ /**
126
+ * Count occurrences of a substring
127
+ */
128
+ export function count(s, substring) {
129
+ if (substring.length === 0)
130
+ return 0;
131
+ let count = 0;
132
+ let pos = 0;
133
+ while ((pos = s.indexOf(substring, pos)) !== -1) {
134
+ count++;
135
+ pos += substring.length;
136
+ }
137
+ return count;
138
+ }
139
+ /**
140
+ * Check if string contains a substring (case-insensitive)
141
+ */
142
+ export function containsIgnoreCase(s, substring) {
143
+ return s.toLowerCase().includes(substring.toLowerCase());
144
+ }
145
+ /**
146
+ * Check if string starts with prefix (case-insensitive)
147
+ */
148
+ export function startsWithIgnoreCase(s, prefix) {
149
+ return s.toLowerCase().startsWith(prefix.toLowerCase());
150
+ }
151
+ /**
152
+ * Check if string ends with suffix (case-insensitive)
153
+ */
154
+ export function endsWithIgnoreCase(s, suffix) {
155
+ return s.toLowerCase().endsWith(suffix.toLowerCase());
156
+ }
157
+ /**
158
+ * Remove all whitespace from a string
159
+ */
160
+ export function removeWhitespace(s) {
161
+ return s.replace(/\s+/g, '');
162
+ }
163
+ /**
164
+ * Collapse multiple spaces into single space
165
+ */
166
+ export function collapseWhitespace(s) {
167
+ return s.replace(/\s+/g, ' ').trim();
168
+ }
169
+ /**
170
+ * Remove a prefix if present
171
+ */
172
+ export function removePrefix(s, prefix) {
173
+ return s.startsWith(prefix) ? s.slice(prefix.length) : s;
174
+ }
175
+ /**
176
+ * Remove a suffix if present
177
+ */
178
+ export function removeSuffix(s, suffix) {
179
+ return s.endsWith(suffix) ? s.slice(0, -suffix.length) : s;
180
+ }
181
+ export function wrap(s, prefixOrWrapper, suffix) {
182
+ if (suffix === undefined) {
183
+ return prefixOrWrapper + s + prefixOrWrapper;
184
+ }
185
+ return prefixOrWrapper + s + suffix;
186
+ }
187
+ export function unwrap(s, prefixOrWrapper, suffix) {
188
+ const prefix = prefixOrWrapper;
189
+ const actualSuffix = suffix ?? prefixOrWrapper;
190
+ if (s.startsWith(prefix) && s.endsWith(actualSuffix)) {
191
+ return s.slice(prefix.length, -actualSuffix.length || undefined);
192
+ }
193
+ return s;
194
+ }
195
+ /**
196
+ * Split a string into lines
197
+ */
198
+ export function lines(s) {
199
+ return s.split(/\r?\n/);
200
+ }
201
+ /**
202
+ * Split a string into words
203
+ */
204
+ export function words(s) {
205
+ return s.split(/\s+/).filter((w) => w.length > 0);
206
+ }
207
+ /**
208
+ * Split a string into characters
209
+ */
210
+ export function chars(s) {
211
+ return [...s];
212
+ }
213
+ /**
214
+ * Join strings with a separator
215
+ */
216
+ export function join(strings, separator = '') {
217
+ return strings.join(separator);
218
+ }
219
+ /**
220
+ * Format a template string with values
221
+ */
222
+ export function format(template, values) {
223
+ return template.replace(/\{(\w+)\}/g, (match, key) => {
224
+ return key in values ? String(values[key]) : match;
225
+ });
226
+ }
227
+ /**
228
+ * Format a number as a string with grouping
229
+ */
230
+ export function formatNumber(n, options = {}) {
231
+ return n.toLocaleString('en-US', options);
232
+ }
233
+ /**
234
+ * Format a number with commas
235
+ */
236
+ export function numberWithCommas(n) {
237
+ return n.toLocaleString('en-US');
238
+ }
239
+ /**
240
+ * Format bytes as human-readable string
241
+ */
242
+ export function formatBytes(bytes, decimals = 2) {
243
+ if (bytes === 0)
244
+ return '0 B';
245
+ const k = 1024;
246
+ const sizes = ['B', 'KB', 'MB', 'GB', 'TB', 'PB'];
247
+ const i = Math.floor(Math.log(bytes) / Math.log(k));
248
+ return parseFloat((bytes / Math.pow(k, i)).toFixed(decimals)) + ' ' + sizes[i];
249
+ }
250
+ /**
251
+ * Format duration in milliseconds as human-readable string
252
+ */
253
+ export function formatDuration(ms) {
254
+ if (ms < 1000)
255
+ return `${ms}ms`;
256
+ if (ms < 60000)
257
+ return `${(ms / 1000).toFixed(1)}s`;
258
+ if (ms < 3600000) {
259
+ const mins = Math.floor(ms / 60000);
260
+ const secs = Math.floor((ms % 60000) / 1000);
261
+ return `${mins}m ${secs}s`;
262
+ }
263
+ const hours = Math.floor(ms / 3600000);
264
+ const mins = Math.floor((ms % 3600000) / 60000);
265
+ return `${hours}h ${mins}m`;
266
+ }
267
+ /**
268
+ * Escape HTML special characters
269
+ */
270
+ export function escapeHtml(s) {
271
+ const htmlEntities = {
272
+ '&': '&amp;',
273
+ '<': '&lt;',
274
+ '>': '&gt;',
275
+ '"': '&quot;',
276
+ "'": '&#39;',
277
+ };
278
+ return s.replace(/[&<>"']/g, (c) => htmlEntities[c]);
279
+ }
280
+ /**
281
+ * Unescape HTML entities
282
+ */
283
+ export function unescapeHtml(s) {
284
+ const htmlEntities = {
285
+ '&amp;': '&',
286
+ '&lt;': '<',
287
+ '&gt;': '>',
288
+ '&quot;': '"',
289
+ '&#39;': "'",
290
+ '&#x27;': "'",
291
+ '&#x2F;': '/',
292
+ };
293
+ return s.replace(/&(?:amp|lt|gt|quot|#39|#x27|#x2F);/g, (entity) => htmlEntities[entity] || entity);
294
+ }
295
+ /**
296
+ * Escape regex special characters
297
+ */
298
+ export function escapeRegex(s) {
299
+ return s.replace(/[.*+?^${}()|[\]\\]/g, '\\$&');
300
+ }
301
+ /**
302
+ * Generate a slug from a string
303
+ */
304
+ export function slugify(s) {
305
+ return s
306
+ .toLowerCase()
307
+ .normalize('NFD')
308
+ .replace(/[\u0300-\u036f]/g, '') // Remove diacritics
309
+ .replace(/[^a-z0-9]+/g, '-')
310
+ .replace(/^-+|-+$/g, '');
311
+ }
312
+ /**
313
+ * Check if string is a valid identifier
314
+ */
315
+ export function isValidIdentifier(s) {
316
+ return /^[a-zA-Z_$][a-zA-Z0-9_$]*$/.test(s);
317
+ }
318
+ /**
319
+ * Check if string is numeric
320
+ */
321
+ export function isNumeric(s) {
322
+ return !isNaN(parseFloat(s)) && isFinite(Number(s));
323
+ }
324
+ /**
325
+ * Check if string is alphanumeric
326
+ */
327
+ export function isAlphanumeric(s) {
328
+ return /^[a-zA-Z0-9]+$/.test(s);
329
+ }
330
+ /**
331
+ * Check if string is alphabetic
332
+ */
333
+ export function isAlpha(s) {
334
+ return /^[a-zA-Z]+$/.test(s);
335
+ }
336
+ /**
337
+ * Generate a random string
338
+ */
339
+ export function randomString(length, charset = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789') {
340
+ let result = '';
341
+ for (let i = 0; i < length; i++) {
342
+ result += charset[Math.floor(Math.random() * charset.length)];
343
+ }
344
+ return result;
345
+ }
346
+ /**
347
+ * Generate a UUID v4
348
+ */
349
+ export function uuid() {
350
+ return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, (c) => {
351
+ const r = (Math.random() * 16) | 0;
352
+ const v = c === 'x' ? r : (r & 0x3) | 0x8;
353
+ return v.toString(16);
354
+ });
355
+ }
356
+ /**
357
+ * Indent each line of a string
358
+ */
359
+ export function indent(s, spaces, char = ' ') {
360
+ const prefix = char.repeat(spaces);
361
+ return s
362
+ .split('\n')
363
+ .map((line) => prefix + line)
364
+ .join('\n');
365
+ }
366
+ /**
367
+ * Dedent a string (remove common leading whitespace)
368
+ */
369
+ export function dedent(s) {
370
+ const linesList = lines(s);
371
+ const nonEmptyLines = linesList.filter((l) => l.trim().length > 0);
372
+ if (nonEmptyLines.length === 0)
373
+ return s;
374
+ const minIndent = Math.min(...nonEmptyLines.map((line) => {
375
+ const match = line.match(/^(\s*)/);
376
+ return match ? match[1].length : 0;
377
+ }));
378
+ return linesList.map((line) => line.slice(minIndent)).join('\n');
379
+ }
380
+ /**
381
+ * Word wrap text to a maximum width
382
+ */
383
+ export function wordWrap(s, maxWidth) {
384
+ const wordsList = words(s);
385
+ const linesList = [];
386
+ let currentLine = '';
387
+ for (const word of wordsList) {
388
+ if (currentLine.length === 0) {
389
+ currentLine = word;
390
+ }
391
+ else if (currentLine.length + 1 + word.length <= maxWidth) {
392
+ currentLine += ' ' + word;
393
+ }
394
+ else {
395
+ linesList.push(currentLine);
396
+ currentLine = word;
397
+ }
398
+ }
399
+ if (currentLine.length > 0) {
400
+ linesList.push(currentLine);
401
+ }
402
+ return linesList.join('\n');
403
+ }
404
+ /**
405
+ * Levenshtein distance between two strings
406
+ */
407
+ export function levenshtein(a, b) {
408
+ if (a.length === 0)
409
+ return b.length;
410
+ if (b.length === 0)
411
+ return a.length;
412
+ const matrix = [];
413
+ for (let i = 0; i <= b.length; i++) {
414
+ matrix[i] = [i];
415
+ }
416
+ for (let j = 0; j <= a.length; j++) {
417
+ matrix[0][j] = j;
418
+ }
419
+ for (let i = 1; i <= b.length; i++) {
420
+ for (let j = 1; j <= a.length; j++) {
421
+ if (b[i - 1] === a[j - 1]) {
422
+ matrix[i][j] = matrix[i - 1][j - 1];
423
+ }
424
+ else {
425
+ matrix[i][j] = Math.min(matrix[i - 1][j - 1] + 1, // substitution
426
+ matrix[i][j - 1] + 1, // insertion
427
+ matrix[i - 1][j] + 1 // deletion
428
+ );
429
+ }
430
+ }
431
+ }
432
+ return matrix[b.length][a.length];
433
+ }
434
+ /**
435
+ * Check similarity between two strings (0-1)
436
+ */
437
+ export function similarity(a, b) {
438
+ const maxLen = Math.max(a.length, b.length);
439
+ if (maxLen === 0)
440
+ return 1;
441
+ return 1 - levenshtein(a, b) / maxLen;
442
+ }
443
+ //# sourceMappingURL=string.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"string.js","sourceRoot":"","sources":["../src/string.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH;;GAEG;AACH,MAAM,UAAU,OAAO,CAAC,CAAS;IAC/B,OAAO,CAAC,CAAC,IAAI,EAAE,CAAC,MAAM,KAAK,CAAC,CAAC;AAC/B,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,UAAU,CAAC,CAAS;IAClC,OAAO,CAAC,CAAC,IAAI,EAAE,CAAC,MAAM,GAAG,CAAC,CAAC;AAC7B,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,UAAU,CAAC,CAAS;IAClC,IAAI,CAAC,CAAC,MAAM,KAAK,CAAC;QAAE,OAAO,CAAC,CAAC;IAC7B,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC,WAAW,EAAE,GAAG,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;AACzC,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,SAAS,CAAC,CAAS;IACjC,OAAO,CAAC,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,GAAG,CAAC,UAAU,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;AAClD,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,SAAS,CAAC,CAAS;IACjC,OAAO,CAAC;SACL,OAAO,CAAC,cAAc,EAAE,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,WAAW,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC;SAC7D,OAAO,CAAC,QAAQ,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,WAAW,EAAE,CAAC,CAAC;AAC/C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