@angular-builders/timestamp
Advanced tools
Comparing version 11.0.0-beta.1 to 11.0.0-beta.2
@@ -6,2 +6,10 @@ # Change Log | ||
## 11.0.0-beta.2 (2020-12-14) | ||
**Note:** Version bump only for package @angular-builders/timestamp | ||
## [11.0.0-beta.1](https://github.com/just-jeb/angular-builders/compare/@angular-builders/timestamp@10.0.2-beta.13...@angular-builders/timestamp@11.0.0-beta.1) (2020-11-17) | ||
@@ -8,0 +16,0 @@ |
@@ -23,3 +23,6 @@ "use strict"; | ||
exports.Convert = Convert; | ||
function invalidValue(typ, val) { | ||
function invalidValue(typ, val, key = '') { | ||
if (key) { | ||
throw Error(`Invalid value for key "${key}". Expected type ${JSON.stringify(typ)} but got ${JSON.stringify(val)}`); | ||
} | ||
throw Error(`Invalid value ${JSON.stringify(val)} for type ${JSON.stringify(typ)}`); | ||
@@ -43,7 +46,7 @@ } | ||
} | ||
function transform(val, typ, getProps) { | ||
function transform(val, typ, getProps, key = '') { | ||
function transformPrimitive(typ, val) { | ||
if (typeof typ === typeof val) | ||
return val; | ||
return invalidValue(typ, val); | ||
return invalidValue(typ, val, key); | ||
} | ||
@@ -91,7 +94,7 @@ function transformUnion(typs, val) { | ||
const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; | ||
result[prop.key] = transform(v, prop.typ, getProps); | ||
result[prop.key] = transform(v, prop.typ, getProps, prop.key); | ||
}); | ||
Object.getOwnPropertyNames(val).forEach(key => { | ||
if (!Object.prototype.hasOwnProperty.call(props, key)) { | ||
result[key] = transform(val[key], additional, getProps); | ||
result[key] = transform(val[key], additional, getProps, key); | ||
} | ||
@@ -98,0 +101,0 @@ }); |
{ | ||
"name": "@angular-builders/timestamp", | ||
"version": "11.0.0-beta.1", | ||
"version": "11.0.0-beta.2", | ||
"repository": { | ||
@@ -34,5 +34,5 @@ "type": "git", | ||
"@angular-devkit/core": "^11.0.0", | ||
"dateformat": "^3.0.3" | ||
"dateformat": "^4.3.1" | ||
}, | ||
"gitHead": "a0dca8d09919a8b1de3c5b91271d5d0a99c1643e" | ||
"gitHead": "a14331fcc9d2cb88798cd28378728b23070d2fe0" | ||
} |
Sorry, the diff of this file is not supported yet
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
32732
218
+ Addeddateformat@4.6.3(transitive)
- Removeddateformat@3.0.3(transitive)
Updateddateformat@^4.3.1