From d0410180076ee91774c95660943d0eac7da00808 Mon Sep 17 00:00:00 2001 From: bokuweb Date: Thu, 30 Apr 2020 20:06:01 +0900 Subject: [PATCH] 0.0.66 (#68) * fix: border type case * fix: json --- docx-wasm/js/index.ts | 20 ++++++++++---------- docx-wasm/js/table-cell-border.ts | 20 ++++++++++---------- docx-wasm/js/table-cell-borders.ts | 14 +++++++------- docx-wasm/js/table-cell.ts | 2 +- docx-wasm/package.json | 2 +- 5 files changed, 29 insertions(+), 29 deletions(-) diff --git a/docx-wasm/js/index.ts b/docx-wasm/js/index.ts index 05a2d41..e781a7d 100644 --- a/docx-wasm/js/index.ts +++ b/docx-wasm/js/index.ts @@ -21,25 +21,25 @@ import * as wasm from "./pkg"; const convertBorderType = (t: BorderType) => { switch (t) { - case "Nil": + case "nil": return wasm.BorderType.Nil; - case "None": + case "none": return wasm.BorderType.None; - case "Single": + case "single": return wasm.BorderType.Single; - case "Thick": + case "thick": return wasm.BorderType.Thick; - case "Double": + case "double": return wasm.BorderType.Double; - case "Dotted": + case "dotted": return wasm.BorderType.Dotted; - case "Dashed": + case "dashed": return wasm.BorderType.Dashed; - case "DotDash": + case "dotDash": return wasm.BorderType.DotDash; - case "DotDotDash": + case "dotDotDash": return wasm.BorderType.DotDotDash; - case "Triple": + case "triple": return wasm.BorderType.Triple; default: return wasm.BorderType.Single; diff --git a/docx-wasm/js/table-cell-border.ts b/docx-wasm/js/table-cell-border.ts index e49f8a9..612a260 100644 --- a/docx-wasm/js/table-cell-border.ts +++ b/docx-wasm/js/table-cell-border.ts @@ -1,14 +1,14 @@ export type BorderType = - | "Nil" - | "None" - | "Single" - | "Thick" - | "Double" - | "Dotted" - | "Dashed" - | "DotDash" - | "DotDotDash" - | "Triple"; + | "nil" + | "none" + | "single" + | "thick" + | "double" + | "dotted" + | "dashed" + | "dotDash" + | "dotDotDash" + | "triple"; export type BorderPosition = | "left" diff --git a/docx-wasm/js/table-cell-borders.ts b/docx-wasm/js/table-cell-borders.ts index ddbcfab..04c2d56 100644 --- a/docx-wasm/js/table-cell-borders.ts +++ b/docx-wasm/js/table-cell-borders.ts @@ -35,7 +35,7 @@ export class TableCellBorders { } clear(position: BorderPosition) { - let nil = new TableCellBorder(position).border_type("Nil"); + let nil = new TableCellBorder(position).border_type("nil"); switch (position) { case "top": this.top = nil; @@ -54,12 +54,12 @@ export class TableCellBorders { } clearAll() { - this.top = new TableCellBorder("top").border_type("Nil"); - this.left = new TableCellBorder("left").border_type("Nil"); - this.bottom = new TableCellBorder("bottom").border_type("Nil"); - this.right = new TableCellBorder("right").border_type("Nil"); - this.insideH = new TableCellBorder("insideH").border_type("Nil"); - this.insideV = new TableCellBorder("insideV").border_type("Nil"); + this.top = new TableCellBorder("top").border_type("nil"); + this.left = new TableCellBorder("left").border_type("nil"); + this.bottom = new TableCellBorder("bottom").border_type("nil"); + this.right = new TableCellBorder("right").border_type("nil"); + this.insideH = new TableCellBorder("insideH").border_type("nil"); + this.insideV = new TableCellBorder("insideV").border_type("nil"); return this; } } diff --git a/docx-wasm/js/table-cell.ts b/docx-wasm/js/table-cell.ts index 75b4f47..c91c271 100644 --- a/docx-wasm/js/table-cell.ts +++ b/docx-wasm/js/table-cell.ts @@ -53,7 +53,7 @@ export class TableCell { clearBorder(position: BorderPosition) { this.property.borders[ position.toLowerCase() as PositionKeys - ] = new TableCellBorder(position).border_type("Nil"); + ] = new TableCellBorder(position).border_type("nil"); return this; } } diff --git a/docx-wasm/package.json b/docx-wasm/package.json index e7b1d2e..57aafe2 100644 --- a/docx-wasm/package.json +++ b/docx-wasm/package.json @@ -1,6 +1,6 @@ { "name": "docx-wasm", - "version": "0.0.65", + "version": "0.0.66", "main": "dist/node/index.js", "browser": "dist/web/index.js", "author": "bokuweb ",