@finnair/v-validation-core
Advanced tools
Comparing version 0.3.0 to 0.4.0
@@ -6,2 +6,13 @@ # Change Log | ||
# [0.4.0](https://github.com/finnair/v-validation/compare/v0.3.0...v0.4.0) (2020-04-21) | ||
### Features | ||
* Property order ([8aea400](https://github.com/finnair/v-validation/commit/8aea400440aede0b4602aa7d00bd93827f0acec8)), closes [#26](https://github.com/finnair/v-validation/issues/26) | ||
# [0.3.0](https://github.com/finnair/v-validation/compare/v0.2.0...v0.3.0) (2020-04-16) | ||
@@ -8,0 +19,0 @@ |
@@ -23,5 +23,5 @@ export declare type PathComponent = number | string; | ||
static of(...path: PathComponent[]): Path; | ||
private static validateComponent; | ||
private static validateIndex; | ||
private static validateProperty; | ||
static validateComponent(component: any): void; | ||
static validateIndex(index: any): void; | ||
static validateProperty(property: any): void; | ||
} | ||
@@ -28,0 +28,0 @@ /** |
@@ -108,3 +108,4 @@ "use strict"; | ||
static validateComponent(component) { | ||
if (typeof component === 'number') { | ||
const type = typeof component; | ||
if (type === 'number') { | ||
if (component < 0 || !Number.isInteger(component)) { | ||
@@ -114,4 +115,4 @@ throw new Error('Expected component to be an integer >= 0'); | ||
} | ||
else if (typeof component !== 'string') { | ||
throw new Error(`Expected component to be a string or integer, got ${component}`); | ||
else if (type !== 'string') { | ||
throw new Error(`Expected component to be a string or an integer, got ${type}: ${component}`); | ||
} | ||
@@ -118,0 +119,0 @@ } |
@@ -385,2 +385,4 @@ "use strict"; | ||
} | ||
// Assign for property order | ||
convertedObject[key] = undefined; | ||
return validator.validatePath(currentValue, path.property(key), ctx).then(result => { | ||
@@ -392,4 +394,8 @@ if (result.isSuccess()) { | ||
} | ||
else { | ||
delete convertedObject[key]; | ||
} | ||
} | ||
else { | ||
delete convertedObject[key]; | ||
violations = violations.concat(result.getViolations()); | ||
@@ -396,0 +402,0 @@ } |
{ | ||
"name": "@finnair/v-validation-core", | ||
"version": "0.3.0", | ||
"version": "0.4.0", | ||
"description": "V-validation core package", | ||
@@ -31,3 +31,3 @@ "main": "dist/index.js", | ||
}, | ||
"gitHead": "9336821f893cf4584b99fc57edc411ccfd67cd6c" | ||
"gitHead": "f3ef8c67d63dbe704a3c857d219ef6bfd56a6375" | ||
} |
# v-validation-core | ||
[![npm version](https://badge.fury.io/js/%40finnair%2Fv-validation-core.svg)](https://badge.fury.io/js/%40finnair%2Fv-validation-core) | ||
V stands for Validation. | ||
@@ -4,0 +6,0 @@ |
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
88460
2188
25