decode-formdata
Advanced tools
Comparing version 0.2.0 to 0.3.0
// src/utils/getFieldDate/getFieldDate.ts | ||
function getFieldDate(value) { | ||
if (!value) { | ||
return null; | ||
} | ||
if (/^\d{4}-(0[1-9]|1[0-2])-([12]\d|0[1-9]|3[01])$/.test(value)) { | ||
@@ -4,0 +7,0 @@ return /* @__PURE__ */ new Date(`${value}T00:00:00.000Z`); |
@@ -8,3 +8,3 @@ /** | ||
*/ | ||
declare function getFieldDate(value: string): Date; | ||
declare function getFieldDate(value: string): Date | null; | ||
@@ -31,3 +31,3 @@ /** | ||
*/ | ||
declare function getFieldValue(info: FormDataInfo | undefined, templateName: string, value: FormDataEntryValue): number | boolean | Date | FormDataEntryValue; | ||
declare function getFieldValue(info: FormDataInfo | undefined, templateName: string, value: FormDataEntryValue): number | boolean | Date | FormDataEntryValue | null; | ||
@@ -34,0 +34,0 @@ /** |
// src/utils/getFieldDate/getFieldDate.ts | ||
function getFieldDate(value) { | ||
if (!value) { | ||
return null; | ||
} | ||
if (/^\d{4}-(0[1-9]|1[0-2])-([12]\d|0[1-9]|3[01])$/.test(value)) { | ||
@@ -4,0 +7,0 @@ return /* @__PURE__ */ new Date(`${value}T00:00:00.000Z`); |
{ | ||
"name": "decode-formdata", | ||
"description": "Decodes complex FormData into a JavaScript object", | ||
"version": "0.2.0", | ||
"version": "0.3.0", | ||
"license": "MIT", | ||
@@ -6,0 +6,0 @@ "author": "Fabian Hiller", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
26033
501