Comparing version 0.0.8 to 0.0.9
@@ -5,3 +5,3 @@ //----------------------------------------------------- | ||
// Site: 666.io | ||
// Version: 0.00.008 | ||
// Version: 0.00.009 | ||
// | ||
@@ -142,2 +142,5 @@ //----------------------------------------------------- | ||
case "wordchar": | ||
return typeof(input) === "string" && !!input.match(/^[\w]+$/); | ||
case "alphanumeric": | ||
@@ -401,2 +404,4 @@ return typeof(input) === "string" && !!input.match(/^[a-zA-Z0-9]+$/); | ||
else if(options.onlyAlphanumeric) | ||
input = input.replace(/[\W_]/g, ""); | ||
else if(options.onlyWordchar) | ||
input = input.replace(/\W/g, ""); | ||
@@ -403,0 +408,0 @@ |
{ | ||
"name": "aigis", | ||
"version": "0.0.8", | ||
"version": "0.0.9", | ||
"description": "Simple and Powerful module for strict validation", | ||
@@ -38,4 +38,4 @@ | ||
"_id": "aigis@0.0.8", | ||
"_id": "aigis@0.0.9", | ||
"_from": "aigis@" | ||
} |
@@ -22,5 +22,8 @@ `npm install aigis -g` | ||
`?name` - Check an input only when the input exists (not undefined). | ||
`type` -> `use` <- `rule` | ||
#### ~ | ||
* `?name` - Check an input only when the input exists (not undefined). | ||
* `type` -> `use` <- `rule` | ||
#### Module | ||
@@ -47,3 +50,3 @@ | ||
| boolean | true: "true", "on", "yes", "1" | - | | ||
| string | - | default, max, trim, escape, lowercase, uppercase, onlyDigits, onlyAlphanumeric | | ||
| string | - | default, max, trim, escape, lowercase, uppercase, onlyDigits, onlyAlphanumeric, onlyWordchar | | ||
| integer | - | default, min, max, enum, abs | | ||
@@ -98,2 +101,3 @@ | float | - | default, min, max, enum, abs | | ||
| | - || | ||
| wordchar | Alphanumeric characters including the underscore | - | | ||
| alphanumeric | If string is only letters and numbers | - | | ||
@@ -100,0 +104,0 @@ | alpha | If string is only letters | - | |
@@ -288,2 +288,9 @@ //----------------------------------------------------- | ||
testV(false, "wordchar", 10); | ||
testV(false, "wordchar", "0d@root.pop"); | ||
testV(false, "wordchar", "10@"); | ||
testV(false, "wordchar", "1 0"); | ||
testV(true, "wordchar", "10_"); | ||
testV(true, "wordchar", "10"); | ||
testV(false, "alphanumeric", 10); | ||
@@ -290,0 +297,0 @@ testV(true, "alphanumeric", "0drootpop"); |
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
47277
868
226