@sapphire/shapeshift
Advanced tools
Comparing version 2.0.0 to 2.0.1-next.2905614.0
@@ -1601,6 +1601,7 @@ var SapphireShapeshift = (() => { | ||
const typeOfValue = typeof value; | ||
if (typeOfValue === "number" && !this.hasNumericElements) { | ||
return Result.err(new ValidationError("s.nativeEnum(T)", "Expected the value to be a string", value)); | ||
} | ||
if (typeOfValue !== "string" && typeOfValue !== "number") { | ||
if (typeOfValue === "number") { | ||
if (!this.hasNumericElements) { | ||
return Result.err(new ValidationError("s.nativeEnum(T)", "Expected the value to be a string", value)); | ||
} | ||
} else if (typeOfValue !== "string") { | ||
return Result.err(new ValidationError("s.nativeEnum(T)", "Expected the value to be a string or number", value)); | ||
@@ -1607,0 +1608,0 @@ } |
@@ -1594,6 +1594,7 @@ "use strict"; | ||
const typeOfValue = typeof value; | ||
if (typeOfValue === "number" && !this.hasNumericElements) { | ||
return Result.err(new ValidationError("s.nativeEnum(T)", "Expected the value to be a string", value)); | ||
} | ||
if (typeOfValue !== "string" && typeOfValue !== "number") { | ||
if (typeOfValue === "number") { | ||
if (!this.hasNumericElements) { | ||
return Result.err(new ValidationError("s.nativeEnum(T)", "Expected the value to be a string", value)); | ||
} | ||
} else if (typeOfValue !== "string") { | ||
return Result.err(new ValidationError("s.nativeEnum(T)", "Expected the value to be a string or number", value)); | ||
@@ -1600,0 +1601,0 @@ } |
{ | ||
"name": "@sapphire/shapeshift", | ||
"version": "2.0.0", | ||
"version": "2.0.1-next.2905614.0", | ||
"description": "Blazing fast input validation and transformation ⚡", | ||
@@ -34,15 +34,15 @@ "author": "@sapphire", | ||
"devDependencies": { | ||
"@commitlint/cli": "^16.2.1", | ||
"@commitlint/cli": "^16.2.3", | ||
"@commitlint/config-conventional": "^16.2.1", | ||
"@favware/npm-deprecate": "^1.0.4", | ||
"@favware/rollup-type-bundler": "^1.0.7", | ||
"@sapphire/eslint-config": "^4.3.0", | ||
"@sapphire/prettier-config": "^1.4.0", | ||
"@sapphire/ts-config": "^3.3.2", | ||
"@sapphire/eslint-config": "^4.3.3", | ||
"@sapphire/prettier-config": "^1.4.2", | ||
"@sapphire/ts-config": "^3.3.4", | ||
"@types/jest": "^27.4.1", | ||
"@types/node": "^17.0.21", | ||
"@typescript-eslint/eslint-plugin": "^5.14.0", | ||
"@typescript-eslint/parser": "^5.14.0", | ||
"@typescript-eslint/eslint-plugin": "^5.16.0", | ||
"@typescript-eslint/parser": "^5.16.0", | ||
"cz-conventional-changelog": "^3.3.0", | ||
"eslint": "^8.11.0", | ||
"eslint": "^8.12.0", | ||
"eslint-config-prettier": "^8.5.0", | ||
@@ -53,11 +53,11 @@ "eslint-plugin-prettier": "^4.0.0", | ||
"jest-circus": "^27.5.1", | ||
"lint-staged": "^12.3.5", | ||
"prettier": "^2.5.1", | ||
"lint-staged": "^12.3.7", | ||
"prettier": "^2.6.1", | ||
"pretty-quick": "^3.1.3", | ||
"standard-version": "^9.3.2", | ||
"ts-jest": "^27.1.3", | ||
"ts-jest": "^27.1.4", | ||
"tsup": "^5.12.1", | ||
"typedoc": "^0.22.13", | ||
"typedoc-plugin-mdn-links": "^1.0.5", | ||
"typescript": "^4.6.2" | ||
"typescript": "^4.6.3" | ||
}, | ||
@@ -64,0 +64,0 @@ "repository": { |
@@ -290,3 +290,3 @@ <div align="center"> | ||
}) | ||
.partial(); | ||
.partial; | ||
``` | ||
@@ -404,2 +404,6 @@ | ||
--- | ||
_**Function validation is not yet implemented and will be made available starting v2.1.0**_ | ||
#### Functions // TODO | ||
@@ -422,2 +426,4 @@ | ||
--- | ||
### BaseValidator: methods and properties | ||
@@ -440,2 +446,6 @@ | ||
--- | ||
_**Reshape is not yet implemented and will be made available starting v2.1.0**_ | ||
> :warning: `.transform`'s functions **must not throw**. If a validation error is desired to be thrown, `.reshape` instead. | ||
@@ -454,2 +464,4 @@ | ||
--- | ||
`.default(value: T | (() => T))`: transform `undefined` into the given value or the callback's returned value: | ||
@@ -456,0 +468,0 @@ |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Deprecated
MaintenanceThe maintainer of the package marked it as deprecated. This could indicate that a single version should not be used, or that the package is no longer maintained and any new vulnerabilities will not be fixed.
Found 1 instance in 1 package
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
598819
5353
554
6
10
3
97
229775
1
1