@apiverve/textlanguage
Advanced tools
+3
-9
@@ -16,14 +16,8 @@ const axios = require('axios'); | ||
| // Validate API key format (GUID or alphanumeric with hyphens) | ||
| const apiKeyPattern = /^[a-zA-Z0-9-]+$/; | ||
| // Validate API key format (GUID, prefixed keys like apv_xxx, or alphanumeric) | ||
| const apiKeyPattern = /^[a-zA-Z0-9_-]+$/; | ||
| if (!apiKeyPattern.test(api_key)) { | ||
| throw new Error('Invalid API key format. API key must be alphanumeric and may contain hyphens. Get your API key at: https://apiverve.com'); | ||
| 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'); | ||
| } | ||
| // Check minimum length (GUIDs are typically 36 chars with hyphens, or 32 without) | ||
| const trimmedKey = api_key.replace(/-/g, ''); | ||
| if (trimmedKey.length < 32) { | ||
| throw new Error('Invalid API key. API key appears to be too short. Get your API key at: https://apiverve.com'); | ||
| } | ||
| if (typeof secure !== 'boolean') { | ||
@@ -30,0 +24,0 @@ throw new Error('Secure parameter must be a boolean value.'); |
+1
-1
| { | ||
| "name": "@apiverve/textlanguage", | ||
| "version": "1.1.13", | ||
| "version": "1.1.14", | ||
| "description": "Text Language is a simple tool for detecting the language of a text. It returns the language code.", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
0
-100%15946
-1.79%198
-2.46%