Skip to content

Commit 0b1e9d8

Browse files
authored
Merge pull request webpack#6982 from mohsen1/json-and-date-api-fixes
JSON and Date API usage fixes
2 parents 5be4026 + 37ff424 commit 0b1e9d8

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

lib/Stats.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -749,7 +749,7 @@ class Stats {
749749
const builtAtDate = new Date(obj.builtAt);
750750
colors.normal("Built at: ");
751751
colors.normal(
752-
builtAtDate.toLocaleDateString({
752+
builtAtDate.toLocaleDateString(undefined, {
753753
day: "2-digit",
754754
month: "2-digit",
755755
year: "numeric"

lib/WebpackOptionsValidationError.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,7 @@ class WebpackOptionsValidationError extends WebpackError {
141141
if (schema.anyOf) return schema.anyOf.map(formatInnerSchema).join(" | ");
142142
if (schema.enum)
143143
return schema.enum.map(item => JSON.stringify(item)).join(" | ");
144-
return JSON.stringify(schema, 0, 2);
144+
return JSON.stringify(schema, null, 2);
145145
}
146146

147147
static formatValidationError(err) {
@@ -306,7 +306,7 @@ class WebpackOptionsValidationError extends WebpackError {
306306
// eslint-disable-line no-fallthrough
307307
return `${dataPath} ${err.message} (${JSON.stringify(
308308
err,
309-
0,
309+
null,
310310
2
311311
)}).\n${getSchemaPartText(err.parentSchema)}`;
312312
}

0 commit comments

Comments
 (0)