Skip to content

Commit 3ef6a9d

Browse files
committed
Replace Object.assign with spread
1 parent 1669dcb commit 3ef6a9d

File tree

1 file changed

+13
-8
lines changed

1 file changed

+13
-8
lines changed

root/static/scripts/guess-case/modes.js

+13-8
Original file line numberDiff line numberDiff line change
@@ -284,7 +284,8 @@ const DefaultMode = {
284284
},
285285
};
286286

287-
export const English = Object.assign({}, DefaultMode, {
287+
export const English = {
288+
...DefaultMode,
288289
description: ReactDOMServer.renderToStaticMarkup(exp.l(
289290
`This mode capitalises almost all words, with some words (mainly articles
290291
and short prepositions) lowercased. Some words may need to be manually
@@ -322,9 +323,10 @@ export const English = Object.assign({}, DefaultMode, {
322323
is = this.fixEnglishKeyNames(is);
323324
return is;
324325
},
325-
});
326+
};
326327

327-
export const French = Object.assign({}, DefaultMode, {
328+
export const French = {
329+
...DefaultMode,
328330
description: ReactDOMServer.renderToStaticMarkup(exp.l(
329331
`This mode capitalises titles as sentence mode, but also inserts spaces
330332
before semicolons, colons, exclamation marks and question marks,
@@ -345,9 +347,10 @@ export const French = Object.assign({}, DefaultMode, {
345347
.replace(/^(Le\s|La\s|Les\s|L['])(\S+)$/gi,
346348
(_, m1, m2) => m1.replace('\'', '’') + capitalize(m2));
347349
},
348-
});
350+
};
349351

350-
export const Sentence = Object.assign({}, DefaultMode, {
352+
export const Sentence = {
353+
...DefaultMode,
351354
description: ReactDOMServer.renderToStaticMarkup(exp.l(
352355
`This mode capitalises the first word of a sentence, most other words
353356
are lowercased. Some words, often proper nouns, may need to be manually
@@ -359,8 +362,10 @@ export const Sentence = Object.assign({}, DefaultMode, {
359362
)),
360363

361364
name: 'Sentence',
362-
});
363-
export const Turkish = Object.assign({}, DefaultMode, {
365+
};
366+
367+
export const Turkish = {
368+
...DefaultMode,
364369
description: ReactDOMServer.renderToStaticMarkup(exp.l(
365370
`This mode handles the Turkish capitalisation of 'i' ('İ') and 'ı' ('I').
366371
Some words may need to be manually corrected according to
@@ -386,4 +391,4 @@ export const Turkish = Object.assign({}, DefaultMode, {
386391
toLowerCase: turkishLowerCase,
387392

388393
toUpperCase: turkishUpperCase,
389-
});
394+
};

0 commit comments

Comments
 (0)