Skip to content

Commit

Permalink
chore(deps): upgrade to typescript 3.9 (#275)
Browse files Browse the repository at this point in the history
BREAKING CHANGE: The compile target of the library changed from ES2015 to ES2018.
  • Loading branch information
connium authored Jun 29, 2020
1 parent ad2eca6 commit 8fa816d
Show file tree
Hide file tree
Showing 7 changed files with 16 additions and 18 deletions.
12 changes: 6 additions & 6 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "simple-odf",
"version": "0.10.1",
"version": "1.0.0",
"description": "Open Document Format made easy using pure JavaScript and Node.js",
"keywords": [
"open",
Expand Down Expand Up @@ -55,7 +55,7 @@
"@semantic-release/changelog": "^5.0.1",
"@semantic-release/git": "^9.0.0",
"@types/jest": "^25.1.0",
"@types/node": "^10.17.17",
"@types/node": "^10.17.26",
"@types/xmldom": "^0.1.29",
"@typescript-eslint/eslint-plugin": "^2.25.0",
"@typescript-eslint/parser": "^2.25.0",
Expand All @@ -67,7 +67,7 @@
"prettier": "2.0.5",
"semantic-release": "^17.0.7",
"ts-jest": "^25.0.0",
"typescript": "^3.3.3"
"typescript": "^3.9.5"
},
"engines": {
"node": "^10.x"
Expand Down
4 changes: 2 additions & 2 deletions src/api/office/AutomaticStyles.ts
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ export class AutomaticStyles implements IStyles {
private getHash(style: Style): string {
const hash = createHash('md5');

hash.update(style.getClass() || '');
hash.update(style.getClass() ?? '');
hash.update(style.getFamily());

if (style instanceof ListStyle) {
Expand Down Expand Up @@ -244,7 +244,7 @@ export class AutomaticStyles implements IStyles {
textProperties: ITextProperties
): void {
hash.update('color' + textProperties.getColor());
hash.update(textProperties.getFontName() || '');
hash.update(textProperties.getFontName() ?? '');
hash.update(textProperties.getFontSize().toString());
hash.update(textProperties.getFontVariant());
hash.update(textProperties.getTextTransformation());
Expand Down
4 changes: 1 addition & 3 deletions src/api/office/CommonStyles.ts
Original file line number Diff line number Diff line change
Expand Up @@ -93,9 +93,7 @@ export class CommonStyles implements IStyles {
* @since 0.9.0
*/
public getName(displayName: string): string | undefined {
const style = this.styles.get(displayName);

return style !== undefined ? style.getName() : undefined;
return this.styles.get(displayName)?.getName();
}

/** @inheritdoc */
Expand Down
2 changes: 1 addition & 1 deletion src/api/text/List.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ export class List extends OdfElement {
* @since 0.2.0
*/
public addItem(item?: ListItem): ListItem {
const listItem = item || new ListItem();
const listItem = item ?? new ListItem();
this.append(listItem);

return listItem;
Expand Down
4 changes: 2 additions & 2 deletions src/api/text/Paragraph.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ export class Paragraph extends OdfElement {
public constructor(text?: string) {
super();

this.addText(text || '');
this.addText(text ?? '');
}

/**
Expand Down Expand Up @@ -97,7 +97,7 @@ export class Paragraph extends OdfElement {
*/
public setText(text: string): Paragraph {
this.removeText();
this.addText(text || '');
this.addText(text ?? '');

return this;
}
Expand Down
2 changes: 1 addition & 1 deletion tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"compilerOptions": {
/* Basic Options */
"target": "ES2015", /* Specify ECMAScript target version: 'ES3' (default), 'ES5', 'ES2015', 'ES2016', 'ES2017','ES2018' or 'ESNEXT'. */
"target": "ES2018", /* Specify ECMAScript target version: 'ES3' (default), 'ES5', 'ES2015', 'ES2016', 'ES2017','ES2018' or 'ESNEXT'. */
"module": "commonjs", /* Specify module code generation: 'none', 'commonjs', 'amd', 'system', 'umd', 'es2015', or 'ESNext'. */
// "lib": [], /* Specify library files to be included in the compilation. */
// "allowJs": true, /* Allow javascript files to be compiled. */
Expand Down

0 comments on commit 8fa816d

Please sign in to comment.