summaryrefslogtreecommitdiff
path: root/deps/npm/node_modules/@npmcli/config/lib/parse-field.js
diff options
context:
space:
mode:
Diffstat (limited to 'deps/npm/node_modules/@npmcli/config/lib/parse-field.js')
-rw-r--r--deps/npm/node_modules/@npmcli/config/lib/parse-field.js5
1 files changed, 5 insertions, 0 deletions
diff --git a/deps/npm/node_modules/@npmcli/config/lib/parse-field.js b/deps/npm/node_modules/@npmcli/config/lib/parse-field.js
index 0c905bf23c..099b0b4eaf 100644
--- a/deps/npm/node_modules/@npmcli/config/lib/parse-field.js
+++ b/deps/npm/node_modules/@npmcli/config/lib/parse-field.js
@@ -20,6 +20,7 @@ const parseField = (f, key, opts, listElement = false) => {
const isUmask = typeList.has(typeDefs.Umask.type)
const isNumber = typeList.has(typeDefs.Number.type)
const isList = !listElement && typeList.has(Array)
+ const isDate = typeList.has(typeDefs.Date.type)
if (Array.isArray(f)) {
return !isList ? f : f.map(field => parseField(field, key, opts, true))
@@ -53,6 +54,10 @@ const parseField = (f, key, opts, listElement = false) => {
f = envReplace(f, env)
+ if (isDate) {
+ return new Date(f)
+ }
+
if (isPath) {
const homePattern = platform === 'win32' ? /^~(\/|\\)/ : /^~\//
if (homePattern.test(f) && home) {