@apiverve/phonetic 1.1.13 → 1.1.14
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/index.js +3 -9
- package/package.json +1 -1
package/index.js
CHANGED
|
@@ -13,16 +13,10 @@ class phoneticWrapper {
|
|
|
13
13
|
throw new Error('API key must be provided as a non-empty string. Get your API key at: https://apiverve.com');
|
|
14
14
|
}
|
|
15
15
|
|
|
16
|
-
// Validate API key format (GUID or alphanumeric
|
|
17
|
-
const apiKeyPattern = /^[a-zA-Z0-
|
|
16
|
+
// Validate API key format (GUID, prefixed keys like apv_xxx, or alphanumeric)
|
|
17
|
+
const apiKeyPattern = /^[a-zA-Z0-9_-]+$/;
|
|
18
18
|
if (!apiKeyPattern.test(api_key)) {
|
|
19
|
-
throw new Error('Invalid API key format. API key must be alphanumeric and may contain hyphens. Get your API key at: https://apiverve.com');
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
// Check minimum length (GUIDs are typically 36 chars with hyphens, or 32 without)
|
|
23
|
-
const trimmedKey = api_key.replace(/-/g, '');
|
|
24
|
-
if (trimmedKey.length < 32) {
|
|
25
|
-
throw new Error('Invalid API key. API key appears to be too short. Get your API key at: https://apiverve.com');
|
|
19
|
+
throw new Error('Invalid API key format. API key must be alphanumeric and may contain hyphens and underscores. Get your API key at: https://apiverve.com');
|
|
26
20
|
}
|
|
27
21
|
|
|
28
22
|
if (typeof secure !== 'boolean') {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@apiverve/phonetic",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.14",
|
|
4
4
|
"description": "Phonetic Encoder generates phonetic codes for words using Soundex and Metaphone algorithms. These codes represent how words sound, enabling fuzzy matching of similar-sounding names.",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"types": "index.d.ts",
|