schemaglobin
Advanced tools
Comparing version 5.5.0 to 5.5.1
/** Just get important part of a URL, e.g. `http://shax.com/test?uid=129483` → `shax.com/test` */ | ||
export declare const formatUrl: (url: string) => string; | ||
export declare const formatUrl: (url: string | URL) => string; |
@@ -6,4 +6,4 @@ "use strict"; | ||
exports.formatUrl = (url) => { | ||
const u = new URL(url); | ||
const u = url instanceof URL ? url : new URL(url); | ||
return `${u.host}${u.pathname.length > 1 ? u.pathname : ""}`; | ||
}; |
@@ -18,4 +18,4 @@ "use strict"; | ||
// Regular expressions. | ||
const R_CONTROL_CHARS = /[\x00-\x1F\x7F-\x9F]/g; // Select all control characters. | ||
const R_CONTROL_CHARS_MULTILINE = /[\x00-\x08\x0B-\x1F\x7F-\x9F]/g; // Select all control characters except `\x09` tab and `\x1A` line feed | ||
const R_CONTROL_CHARS = /[\x00-\x1F\x7F-\x9F]/g; // Match all control characters (00-1F, 7F-9F). | ||
const R_CONTROL_CHARS_MULTILINE = /[\x00-\x08\x0B-\x1F\x7F-\x9F]/g; // Match all control characters (00-1F, 7F-9F) except `\x09` horizontal tab and `\x0A` line feed | ||
/** | ||
@@ -22,0 +22,0 @@ * Schema that defines a valid string. |
{ | ||
"name": "schemaglobin", | ||
"description": "Validate user-entered data.", | ||
"version": "5.5.0", | ||
"version": "5.5.1", | ||
"repository": "https://github.com/dhoulb/schemaglobin", | ||
@@ -30,6 +30,6 @@ "author": "Dave Houlbrooke <dave@shax.com>", | ||
"devDependencies": { | ||
"@types/jest": "^26.0.10", | ||
"@typescript-eslint/eslint-plugin": "^3.9.1", | ||
"@typescript-eslint/parser": "^3.9.1", | ||
"eslint": "^7.7.0", | ||
"@types/jest": "^26.0.13", | ||
"@typescript-eslint/eslint-plugin": "^4.1.0", | ||
"@typescript-eslint/parser": "^4.1.0", | ||
"eslint": "^7.8.1", | ||
"eslint-config-prettier": "^6.11.0", | ||
@@ -39,6 +39,6 @@ "eslint-plugin-import": "^2.22.0", | ||
"jest": "^26.4.2", | ||
"prettier": "^2.0.5", | ||
"ts-jest": "^26.2.0", | ||
"prettier": "^2.1.1", | ||
"ts-jest": "^26.3.0", | ||
"typescript": "^4.0.2" | ||
} | ||
} |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
154543