Comparing version 1.0.0-beta.2 to 1.0.0-beta.3
@@ -17,3 +17,4 @@ "use strict"; | ||
joinedAt: _1.validate.date(), | ||
favoriteDishes: _1.validate.array(_1.validate.string()) | ||
favoriteDishes: _1.validate.array(_1.validate.string()), | ||
notifications: _1.validate.enum('immediately', 'daily', 'never') | ||
}); | ||
@@ -26,3 +27,4 @@ const validPerson = { | ||
joinedAt: new Date(), | ||
favoriteDishes: ['Pho Bo', 'Sushi'] | ||
favoriteDishes: ['Pho Bo', 'Sushi'], | ||
notifications: 'daily' | ||
}; | ||
@@ -29,0 +31,0 @@ it('validates a person', () => { |
export { validateArray as array } from './validate-array'; | ||
export { validateBoolean as boolean } from './validate-boolean'; | ||
export { validateDate as date } from './validate-date'; | ||
export { validateEnum as enum } from './validate-enum'; | ||
export { validateNumber as number } from './validate-number'; | ||
@@ -5,0 +6,0 @@ export { validateObject as object } from './validate-object'; |
@@ -9,2 +9,4 @@ "use strict"; | ||
exports.date = validate_date_1.validateDate; | ||
var validate_enum_1 = require("./validate-enum"); | ||
exports.enum = validate_enum_1.validateEnum; | ||
var validate_number_1 = require("./validate-number"); | ||
@@ -11,0 +13,0 @@ exports.number = validate_number_1.validateNumber; |
{ | ||
"name": "fefe", | ||
"version": "1.0.0-beta.2", | ||
"version": "1.0.0-beta.3", | ||
"description": "Validate, sanitize and transform values with proper types.", | ||
@@ -40,15 +40,15 @@ "main": "dist/index.js", | ||
"devDependencies": { | ||
"@types/chai": "^4.1.6", | ||
"@types/chai": "^4.1.7", | ||
"@types/mocha": "^5.2.5", | ||
"@types/ramda": "^0.25.39", | ||
"@types/ramda": "^0.25.42", | ||
"chai": "^4.2.0", | ||
"codecov": "^3.1.0", | ||
"mocha": "^5.2.0", | ||
"nyc": "^13.0.1", | ||
"ramda": "^0.25.0", | ||
"nyc": "^13.1.0", | ||
"ramda": "^0.26.1", | ||
"ts-node": "^7.0.1", | ||
"tslint": "^5.11.0", | ||
"tslint-config-standard": "^8.0.1", | ||
"typescript": "^3.1.2" | ||
"typescript": "^3.1.6" | ||
} | ||
} |
@@ -7,3 +7,3 @@ # fefe | ||
Validate, sanitize and transform values with proper types. | ||
Validate, sanitize and transform values with proper types and with zero dependencies. | ||
@@ -128,2 +128,6 @@ **🔎 Validation:** checks a value (example: check if value is string)<br/> | ||
### `validate.enum(value1, value2, ...)` | ||
Returns a function `(value: unknown) => value1 | value2 | ...` that checks whether value equals one of the strings `value1`, `value2`, .... | ||
### `validate.number(options?)` | ||
@@ -130,0 +134,0 @@ |
@@ -17,3 +17,4 @@ import { expect } from 'chai' | ||
joinedAt: validate.date(), | ||
favoriteDishes: validate.array(validate.string()) | ||
favoriteDishes: validate.array(validate.string()), | ||
notifications: validate.enum('immediately', 'daily', 'never') | ||
}) | ||
@@ -29,3 +30,4 @@ | ||
joinedAt: new Date(), | ||
favoriteDishes: ['Pho Bo', 'Sushi'] | ||
favoriteDishes: ['Pho Bo', 'Sushi'], | ||
notifications: 'daily' | ||
} | ||
@@ -32,0 +34,0 @@ |
export { validateArray as array } from './validate-array' | ||
export { validateBoolean as boolean } from './validate-boolean' | ||
export { validateDate as date } from './validate-date' | ||
export { validateEnum as enum } from './validate-enum' | ||
export { validateNumber as number } from './validate-number' | ||
@@ -5,0 +6,0 @@ export { validateObject as object } from './validate-object' |
Sorry, the diff of this file is not supported yet
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
90873
116
1314
179