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

iso-datestring-validator

Package Overview
Dependencies
Maintainers
1
Versions
17
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

iso-datestring-validator - npm Package Compare versions

Comparing version 2.1.1 to 2.1.2

2

dist/get-string-separator/get-string-separator.function.js

@@ -1,1 +0,1 @@

export function getStringSeparator(r){var e=/\D/.exec(r);return e?e[0]:""}
"use strict";function e(e){var r=/\D/.exec(e);return r?r[0]:""}Object.defineProperty(exports,"__esModule",{value:!0}),exports.getStringSeparator=e;

@@ -1,1 +0,1 @@

export*from"./is-valid-date/is-valid-date.function";export*from"./is-valid-iso-datestring/is-valid-iso-datestring.function";export*from"./is-valid-time/is-valid-time.function";export*from"./is-valid-year-month/is-valid-year-month.function";
"use strict";function i(i){for(var e in i)exports.hasOwnProperty(e)||(exports[e]=i[e])}Object.defineProperty(exports,"__esModule",{value:!0}),i(require("./is-valid-date/is-valid-date.function")),i(require("./is-valid-iso-datestring/is-valid-iso-datestring.function")),i(require("./is-valid-time/is-valid-time.function")),i(require("./is-valid-year-month/is-valid-year-month.function"));

@@ -1,1 +0,1 @@

export function isValidDate(e,t){return void 0===t&&(t="-"),new RegExp("^(?!0{4}"+t+"0{2}"+t+"0{2})((?=[0-9]{4}"+t+"(((0[^2])|1[0-2])|02(?="+t+"(([0-1][0-9])|2[0-8])))"+t+"[0-9]{2})|(?=((([13579][26])|([2468][048])|(0[48]))0{2})|([0-9]{2}((((0|[2468])[48])|[2468][048])|([13579][26])))"+t+"02"+t+"29))([0-9]{4})"+t+"(?!((0[469])|11)"+t+"31)((0[1,3-9]|1[0-2])|(02(?!"+t+"3)))"+t+"([0-2][0-9]|3[0-1])$").test(e)}
"use strict";function e(e,t){return void 0===t&&(t="-"),new RegExp("^(?!0{4}"+t+"0{2}"+t+"0{2})((?=[0-9]{4}"+t+"(((0[^2])|1[0-2])|02(?="+t+"(([0-1][0-9])|2[0-8])))"+t+"[0-9]{2})|(?=((([13579][26])|([2468][048])|(0[48]))0{2})|([0-9]{2}((((0|[2468])[48])|[2468][048])|([13579][26])))"+t+"02"+t+"29))([0-9]{4})"+t+"(?!((0[469])|11)"+t+"31)((0[1,3-9]|1[0-2])|(02(?!"+t+"3)))"+t+"([0-2][0-9]|3[0-1])$").test(e)}Object.defineProperty(exports,"__esModule",{value:!0}),exports.isValidDate=e;

@@ -1,1 +0,1 @@

import{getStringSeparator as i}from"../get-string-separator/get-string-separator.function";import{isValidDate as t}from"../is-valid-date/is-valid-date.function";import{isValidTime as r}from"../is-valid-time/is-valid-time.function";export function isValidISODateString(n){var o=n.split("T"),e=o[0],s=o[1],m=i(e);return t(e,m)&&r(s,a(s),!0)}function a(i){var t=i.match(/[^Z+\-\d]/);return Array.isArray(t)?t[0]:""}
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var i=require("../get-string-separator/get-string-separator.function"),r=require("../is-valid-date/is-valid-date.function"),e=require("../is-valid-time/is-valid-time.function");function t(t){var s=t.split("T"),n=s[0],u=s[1],d=i.getStringSeparator(n);return r.isValidDate(n,d)&&e.isValidTime(u,a(u),!0)}function a(i){var r=i.match(/[^Z+\-\d]/);return Array.isArray(r)?r[0]:""}exports.isValidISODateString=t;

@@ -1,1 +0,1 @@

import{getStringSeparator as t}from"../get-string-separator/get-string-separator.function";import{isValidZoneOffset as e}from"../is-valid-timezone-offset/is-valid-timezone-offset.function";export function isValidTime(i,r,o){void 0===r&&(r=":"),void 0===o&&(o=!1);var s=new RegExp("^([0-1]|2(?=([0-3])|4"+r+"00))[0-9]"+r+"[0-5][0-9]("+r+"([0-5]|6(?=0))[0-9])?(.[0-9]{1,9})?$");if(!o||!/[Z+\-]/.test(i))return s.test(i);if(/Z$/.test(i))return s.test(i.replace("Z",""));var n=i.includes("+"),f=i.split(/[+-]/),a=f[0],p=f[1];return s.test(a)&&e(p,n,t(p))}
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("../get-string-separator/get-string-separator.function"),t=require("../is-valid-timezone-offset/is-valid-timezone-offset.function");function r(r,i,s){void 0===i&&(i=":"),void 0===s&&(s=!1);var n=new RegExp("^([0-1]|2(?=([0-3])|4"+i+"00))[0-9]"+i+"[0-5][0-9]("+i+"([0-5]|6(?=0))[0-9])?(.[0-9]{1,9})?$");if(!s||!/[Z+\-]/.test(r))return n.test(r);if(/Z$/.test(r))return n.test(r.replace("Z",""));var o=r.includes("+"),a=r.split(/[+-]/),f=a[0],u=a[1];return n.test(f)&&t.isValidZoneOffset(u,o,e.getStringSeparator(u))}exports.isValidTime=r;

@@ -1,1 +0,1 @@

export function isValidZoneOffset(e,t,n){return void 0===n&&(n=":"),new RegExp(t?"^(0(?!(2"+n+"4)|0"+n+"3)|1(?=([0-1]|2(?="+n+"[04])|[34](?="+n+"0))))([03469](?="+n+"[03])|[17](?="+n+"0)|2(?="+n+"[04])|5(?="+n+"[034])|8(?="+n+"[04]))"+n+"([03](?=0)|4(?=5))[05]$":"^(0(?=[^0])|1(?=[0-2]))([39](?="+n+"[03])|[0-24-8](?="+n+"00))"+n+"[03]0$").test(e)}
"use strict";function e(e,t,s){return void 0===s&&(s=":"),new RegExp(t?"^(0(?!(2"+s+"4)|0"+s+"3)|1(?=([0-1]|2(?="+s+"[04])|[34](?="+s+"0))))([03469](?="+s+"[03])|[17](?="+s+"0)|2(?="+s+"[04])|5(?="+s+"[034])|8(?="+s+"[04]))"+s+"([03](?=0)|4(?=5))[05]$":"^(0(?=[^0])|1(?=[0-2]))([39](?="+s+"[03])|[0-24-8](?="+s+"00))"+s+"[03]0$").test(e)}Object.defineProperty(exports,"__esModule",{value:!0}),exports.isValidZoneOffset=e;

@@ -1,1 +0,1 @@

export function isValidYearMonth(e,t){return void 0===t&&(t="-"),new RegExp("^[0-9]{4}"+t+"(0(?=[^0])|1(?=[0-2]))[0-9]$").test(e)}
"use strict";function e(e,t){return void 0===t&&(t="-"),new RegExp("^[0-9]{4}"+t+"(0(?=[^0])|1(?=[0-2]))[0-9]$").test(e)}Object.defineProperty(exports,"__esModule",{value:!0}),exports.isValidYearMonth=e;

@@ -31,3 +31,3 @@ {

"license": "MIT",
"version": "2.1.1",
"version": "2.1.2",
"keywords": [

@@ -34,0 +34,0 @@ "date",

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