Comparing version 1.13.0 to 1.14.0
{ | ||
"name": "paramo", | ||
"version": "1.13.0", | ||
"version": "1.14.0", | ||
"description": "🌵Swiss-army knife of stringifying, parsing and manipulating URL parameters by applying types to the parameters.", | ||
@@ -28,17 +28,17 @@ "main": "dist/paramo.cjs.js", | ||
"devDependencies": { | ||
"@babel/plugin-proposal-export-namespace-from": "^7.7.4", | ||
"@babel/plugin-proposal-nullish-coalescing-operator": "^7.7.4", | ||
"@babel/plugin-proposal-private-methods": "^7.7.4", | ||
"@babel/plugin-syntax-bigint": "^7.7.4", | ||
"@babel/polyfill": "^7.7.0", | ||
"@babel/preset-env": "^7.7.7", | ||
"@babel/register": "^7.7.7", | ||
"ava": "^2.4.0", | ||
"@babel/plugin-proposal-export-namespace-from": "^7.8.3", | ||
"@babel/plugin-proposal-nullish-coalescing-operator": "^7.8.3", | ||
"@babel/plugin-proposal-private-methods": "^7.8.3", | ||
"@babel/plugin-syntax-bigint": "^7.8.3", | ||
"@babel/polyfill": "^7.8.3", | ||
"@babel/preset-env": "^7.8.4", | ||
"@babel/register": "^7.8.3", | ||
"ava": "^3.3.0", | ||
"babel-eslint": "^10.0.3", | ||
"coveralls": "^3.0.9", | ||
"eslint": "^6.8.0", | ||
"eslint-config-prettier": "^6.9.0", | ||
"eslint-config-prettier": "^6.10.0", | ||
"eslint-config-standard": "^14.1.0", | ||
"eslint-plugin-ava": "^9.0.0", | ||
"eslint-plugin-import": "^2.19.1", | ||
"eslint-plugin-ava": "^10.2.0", | ||
"eslint-plugin-import": "^2.20.1", | ||
"eslint-plugin-node": "^11.0.0", | ||
@@ -50,7 +50,7 @@ "eslint-plugin-promise": "^4.2.1", | ||
"prettier": "^1.19.1", | ||
"rollup": "^1.28.0", | ||
"rollup": "^1.31.1", | ||
"rollup-plugin-babel": "^4.3.3", | ||
"rollup-plugin-commonjs": "^10.1.0", | ||
"rollup-plugin-node-resolve": "^5.2.0", | ||
"rollup-plugin-terser": "^5.1.3" | ||
"rollup-plugin-terser": "^5.2.0" | ||
}, | ||
@@ -60,5 +60,5 @@ "dependencies": { | ||
"moment": "^2.24.0", | ||
"query-string": "^6.9.0", | ||
"ramda": "^0.26.1" | ||
"query-string": "^6.11.0", | ||
"ramda": "^0.27.0" | ||
} | ||
} |
@@ -26,3 +26,8 @@ import humps from 'humps'; | ||
return { toType, toString, defaultValue, isSame }; | ||
return { | ||
toType, | ||
toString, | ||
defaultValue: typeof defaultValue === 'function' ? defaultValue() : defaultValue, | ||
isSame, | ||
}; | ||
} | ||
@@ -29,0 +34,0 @@ |
@@ -24,3 +24,4 @@ import test from 'ava'; | ||
const instance = create(types); | ||
t.throws(() => instance.parse('name=Adam'), 'typer.toType is not a function'); | ||
const error = t.throws(() => instance.parse('name=Adam'), { instanceOf: Error }); | ||
t.is(error.message, 'typer.toType is not a function'); | ||
}); | ||
@@ -27,0 +28,0 @@ |
@@ -55,1 +55,12 @@ import test from 'ava'; | ||
}); | ||
test('It should be able to handle dates with a default value defined as a function;', t => { | ||
const instance = create( | ||
{ ...types, birthDate: [type.Date, () => moment('2020-10-10').toDate()] }, | ||
{ dateFormat: 'YYYY-MM-DD', includeDefaults: true }, | ||
); | ||
const parsed = instance.parse('name=Adam'); | ||
t.deepEqual(parsed, { name: 'Adam', birthDate: moment('2020-10-10').toDate() }); | ||
const stringified = instance.stringify(parsed); | ||
t.is(stringified, '?name=Adam&birthDate=2020-10-10'); | ||
}); |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
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
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
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
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
1952460
112
5128
+ Addedramda@0.27.2(transitive)
- Removedramda@0.26.1(transitive)
Updatedquery-string@^6.11.0
Updatedramda@^0.27.0