From ac2abcd83c907080ca04d87524bc6167d5783cf9 Mon Sep 17 00:00:00 2001 From: Landon Grindheim Date: Tue, 5 Sep 2023 20:41:40 +0000 Subject: [PATCH] Run > dependabot-pull-request-action@1.6.0 build > ncc build src/main.ts ncc: Version 0.36.1 ncc: Compiling file index.js into CJS ncc: Using typescript@5.2.2 (local user-provided) 880kB dist/index.js 880kB [5564ms] - ncc 0.36.1 on dev dependencies --- dist/index.js | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/dist/index.js b/dist/index.js index 0d894d51..2469c26f 100644 --- a/dist/index.js +++ b/dist/index.js @@ -13157,6 +13157,8 @@ function debug(logLevel, ...messages) { } function warn(logLevel, warning) { if (logLevel === 'debug' || logLevel === 'warn') { + // https://github.com/typescript-eslint/typescript-eslint/issues/7478 + // eslint-disable-next-line @typescript-eslint/prefer-optional-chain if (typeof process !== 'undefined' && process.emitWarning) process.emitWarning(warning); else @@ -13938,7 +13940,7 @@ function stringifyKey(key, jsKey, ctx) { return ''; if (typeof jsKey !== 'object') return String(jsKey); - if (identity.isNode(key) && ctx && ctx.doc) { + if (identity.isNode(key) && ctx?.doc) { const strCtx = stringify.createStringifyContext(ctx.doc, {}); strCtx.anchors = new Set(); for (const node of ctx.anchors.keys()) @@ -17317,8 +17319,9 @@ function createPairs(schema, iterable, ctx) { key = keys[0]; value = it[key]; } - else - throw new TypeError(`Expected { key: value } tuple: ${it}`); + else { + throw new TypeError(`Expected tuple with one key, not ${keys.length} keys`); + } } else { key = it; @@ -17993,7 +17996,7 @@ function stringifyFlowCollection({ comment, items }, ctx, { flowChars, itemInden if (iv.commentBefore) reqNewline = true; } - else if (item.value == null && ik && ik.comment) { + else if (item.value == null && ik?.comment) { comment = ik.comment; } } @@ -18619,7 +18622,7 @@ function blockString({ comment, type, value }, ctx, onComment, onChompKeep) { function plainString(item, ctx, onComment, onChompKeep) { const { type, value } = item; const { actualString, implicitKey, indent, indentStep, inFlow } = ctx; - if ((implicitKey && /[\n[\]{},]/.test(value)) || + if ((implicitKey && value.includes('\n')) || (inFlow && /[[\]{},]/.test(value))) { return quotedString(value, ctx); }