cry-search 1.0.1 → 1.0.4
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/CLAUDE.md +110 -4
- package/README.md +86 -2
- package/dist/common/numeric/AugmentedMetadata.d.ts +111 -0
- package/dist/common/numeric/AugmentedMetadata.d.ts.map +1 -0
- package/dist/common/numeric/index.d.ts +3 -0
- package/dist/common/numeric/index.d.ts.map +1 -1
- package/dist/common/numeric/syncSearchArrayMetadata.d.ts +64 -0
- package/dist/common/numeric/syncSearchArrayMetadata.d.ts.map +1 -0
- package/dist/common/numeric/updateSearchLinkedMetadata.d.ts +130 -0
- package/dist/common/numeric/updateSearchLinkedMetadata.d.ts.map +1 -0
- package/dist/common/syncSearchArrayMetadata.d.ts +12 -8
- package/dist/common/syncSearchArrayMetadata.d.ts.map +1 -1
- package/dist/common/updateSearchLinkedMetadata.d.ts +26 -16
- package/dist/common/updateSearchLinkedMetadata.d.ts.map +1 -1
- package/dist/index.cjs +192 -427
- package/dist/index.d.cts +3 -9
- package/dist/index.d.ts +3 -9
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +192 -427
- package/dist/string.cjs +924 -0
- package/dist/string.d.cts +26 -0
- package/dist/string.d.ts +26 -0
- package/dist/string.d.ts.map +1 -0
- package/dist/string.js +892 -0
- package/dist/utils/preprocessString.d.ts +6 -2
- package/dist/utils/preprocessString.d.ts.map +1 -1
- package/package.json +14 -4
|
@@ -2,8 +2,9 @@
|
|
|
2
2
|
* Preprocesses a string for search by normalizing number formats and splitting mixed alphanumeric tokens.
|
|
3
3
|
*
|
|
4
4
|
* Processing steps:
|
|
5
|
-
* 1. Replaces decimal commas with periods (e.g., "12,3" → "12.3")
|
|
6
|
-
* 2.
|
|
5
|
+
* 1. Replaces decimal commas with periods, drops leading zeros (e.g., "12,3" → "12.3", "007" → "7")
|
|
6
|
+
* 2. Strips decimal period from pure standalone numbers (e.g., "11.22" → "1122", ".3" → "3")
|
|
7
|
+
* Does NOT strip from mixed tokens (".5kg") or multi-period tokens ("1.2.3")
|
|
7
8
|
* 3. Removes spaces in digit-dash-digit patterns (e.g., "12 - 25" → "12-25")
|
|
8
9
|
* 4. Inserts spaces at letter-to-digit boundaries (e.g., "SI123" → "SI 123", "123SI" → "123 SI")
|
|
9
10
|
*
|
|
@@ -15,6 +16,9 @@
|
|
|
15
16
|
* preprocessString('SI123 Čokolada 0,5kg')
|
|
16
17
|
* // Returns: 'SI 123 Čokolada .5kg'
|
|
17
18
|
*
|
|
19
|
+
* preprocessString('abc 11.22 def')
|
|
20
|
+
* // Returns: 'abc 1122 def'
|
|
21
|
+
*
|
|
18
22
|
* preprocessString('007')
|
|
19
23
|
* // Returns: '7'
|
|
20
24
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"preprocessString.d.ts","sourceRoot":"","sources":["../../src/utils/preprocessString.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"preprocessString.d.ts","sourceRoot":"","sources":["../../src/utils/preprocessString.ts"],"names":[],"mappings":"AAUA;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AACH,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAyBtD"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "cry-search",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.4",
|
|
4
4
|
"description": "A fast, memory-efficient search library for large datasets with support for tokenized matching, linked collections, and per-field match modes.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -16,6 +16,16 @@
|
|
|
16
16
|
"types": "./dist/index.d.cts",
|
|
17
17
|
"default": "./dist/index.cjs"
|
|
18
18
|
}
|
|
19
|
+
},
|
|
20
|
+
"./string": {
|
|
21
|
+
"import": {
|
|
22
|
+
"types": "./dist/string.d.ts",
|
|
23
|
+
"default": "./dist/string.js"
|
|
24
|
+
},
|
|
25
|
+
"require": {
|
|
26
|
+
"types": "./dist/string.d.cts",
|
|
27
|
+
"default": "./dist/string.cjs"
|
|
28
|
+
}
|
|
19
29
|
}
|
|
20
30
|
},
|
|
21
31
|
"files": [
|
|
@@ -27,10 +37,10 @@
|
|
|
27
37
|
],
|
|
28
38
|
"scripts": {
|
|
29
39
|
"build": "bun run build:js && bun run build:types",
|
|
30
|
-
"build:esm": "bun build ./src/index.ts --outdir ./dist --target browser --format esm",
|
|
31
|
-
"build:cjs": "bun build ./src/index.ts --target browser --format cjs --outfile ./dist/index.cjs",
|
|
40
|
+
"build:esm": "bun build ./src/index.ts --outdir ./dist --target browser --format esm && bun build ./src/string.ts --outdir ./dist --target browser --format esm",
|
|
41
|
+
"build:cjs": "bun build ./src/index.ts --target browser --format cjs --outfile ./dist/index.cjs && bun build ./src/string.ts --target browser --format cjs --outfile ./dist/string.cjs",
|
|
32
42
|
"build:js": "bun run build:esm && bun run build:cjs",
|
|
33
|
-
"build:types": "tsc -p tsconfig.build.json && cp ./dist/index.d.ts ./dist/index.d.cts",
|
|
43
|
+
"build:types": "tsc -p tsconfig.build.json && cp ./dist/index.d.ts ./dist/index.d.cts && cp ./dist/string.d.ts ./dist/string.d.cts",
|
|
34
44
|
"clean": "rm -rf dist",
|
|
35
45
|
"test": "bun test",
|
|
36
46
|
"prepublishOnly": "bun run clean && bun run build"
|