Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

anchor-validation

Package Overview
Dependencies
Maintainers
4
Versions
16
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

anchor-validation - npm Package Compare versions

Comparing version 1.2.8 to 1.2.9

6

get-age.js

@@ -5,10 +5,10 @@ 'use strict';

var getAge = function getAge(dateOfBirth) {
if (!moment(dateOfBirth, 'YYYY-MM-DD', true).isValid()) {
var getAge = function getAge(dateOfBirth, format) {
if (!moment(dateOfBirth, format, true).isValid()) {
return 0;
}
return moment().diff(moment(dateOfBirth, 'YYYY-MM-DD', true), 'years');
return moment().diff(moment(dateOfBirth, format, true), 'years');
};
module.exports = getAge;

@@ -48,13 +48,13 @@ 'use strict';

var maxAge = exports.maxAge = function maxAge(max) {
var maxAge = exports.maxAge = function maxAge(max, format) {
return function (value) {
var error = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;
return (0, _getAge2.default)(value) > max ? error : undefined;
return (0, _getAge2.default)(value, format) > max ? error : undefined;
};
};
var minAge = exports.minAge = function minAge(min) {
var minAge = exports.minAge = function minAge(min, format) {
return function (value) {
var error = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;
return (0, _getAge2.default)(value) < min ? error : undefined;
return (0, _getAge2.default)(value, format) < min ? error : undefined;
};

@@ -61,0 +61,0 @@ };

{
"name": "anchor-validation",
"version": "1.2.8",
"version": "1.2.9",
"description": "anchor-validation for anchor-ui kit",

@@ -5,0 +5,0 @@ "main": "index.js",

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc