anchor-validation
Advanced tools
Comparing version 1.2.9 to 1.3.0
13
index.js
@@ -6,3 +6,3 @@ 'use strict'; | ||
}); | ||
exports.oneOf = exports.isNotEqual = exports.isEqual = exports.isEmail = exports.isAlphanumeric = exports.minAge = exports.maxAge = exports.minLength = exports.maxLength = exports.required = exports.normalizeUsername = exports.normalizeDate = undefined; | ||
exports.oneOf = exports.isNotEqual = exports.isEqual = exports.isEmail = exports.isAlphanumeric = exports.minAge = exports.maxAge = exports.validDate = exports.minLength = exports.maxLength = exports.required = exports.normalizeUsername = exports.normalizeDate = undefined; | ||
@@ -24,2 +24,6 @@ var _normalizers = require('./normalizers'); | ||
var _moment = require('moment'); | ||
var _moment2 = _interopRequireDefault(_moment); | ||
var _getAge = require('./get-age'); | ||
@@ -50,2 +54,9 @@ | ||
var validDate = exports.validDate = function validDate(format) { | ||
return function (value) { | ||
var error = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true; | ||
return !format || !(0, _moment2.default)(value, format, true).isValid() ? error : undefined; | ||
}; | ||
}; | ||
var maxAge = exports.maxAge = function maxAge(max, format) { | ||
@@ -52,0 +63,0 @@ return function (value) { |
{ | ||
"name": "anchor-validation", | ||
"version": "1.2.9", | ||
"version": "1.3.0", | ||
"description": "anchor-validation for anchor-ui kit", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
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
7143
110