customized-fabric 1.9.8 → 1.9.9

Sign up to get free protection for your applications and to get access to all the features.
@@ -18,7 +18,7 @@ const CurvedTextClass = fabric_1.fabric.util.createClass(fabric_1.fabric.Group,
18
18
  objectCaching: false,
19
19
  ...constants_1.CURVED_TEXT_OBJECT_ATTRIBUTES.stroke,
20
20
  });
21
- const { prefix = "", infix = "A", suffix = "" } = text ?? {};
21
+ const { prefix = "", infix = "", suffix = "" } = text ?? {};
22
22
  this.textObject = new fabric_1.fabric.IText("", {
23
23
  originX: "center",
24
24
  originY: "center",
@@ -17,7 +17,7 @@ const TextInputClass = fabric_1.fabric.util.createClass(fabric_1.fabric.Group, {
17
17
  objectCaching: false,
18
18
  ...constants_1.TEXT_INPUT_OBJECT_ATTRIBUTES.stroke,
19
19
  });
20
- const { prefix = "", infix = "A", suffix = "", isAllCapital, lineHeight, charSpacing, } = text ?? {};
20
+ const { prefix = "", infix = "", suffix = "", isAllCapital, lineHeight, charSpacing, } = text ?? {};
21
21
  const fullText = prefix + infix + suffix;
22
22
  this.textObject = new fabric_1.fabric.IText("", {
23
23
  originX: "center",
@@ -128,11 +128,11 @@ class ObjectId extends bson_value_1.BSONValue {
128
128
  PROCESS_UNIQUE = byte_utils_1.ByteUtils.randomBytes(5);
129
129
  }
130
130
  // 5-byte process unique
131
- buffer[4] = PROCESS_UNIQUE[0];
132
- buffer[5] = PROCESS_UNIQUE[1];
133
- buffer[6] = PROCESS_UNIQUE[2];
134
- buffer[7] = PROCESS_UNIQUE[3];
135
- buffer[8] = PROCESS_UNIQUE[4];
131
+ buffer[4] = PROCESS_UNIQUE[0] || 0;
132
+ buffer[5] = PROCESS_UNIQUE[1] || 0;
133
+ buffer[6] = PROCESS_UNIQUE[2] || 0;
134
+ buffer[7] = PROCESS_UNIQUE[3] || 0;
135
+ buffer[8] = PROCESS_UNIQUE[4] || 0;
136
136
  // 3-byte counter
137
137
  buffer[11] = inc & 0xff;
138
138
  buffer[10] = (inc >> 8) & 0xff;
@@ -92,10 +92,10 @@ exports.webByteUtils = {
92
92
  for (let i = 0; i < evenLengthHex.length; i += 2) {
93
93
  const firstDigit = evenLengthHex[i];
94
94
  const secondDigit = evenLengthHex[i + 1];
95
- if (!HEX_DIGIT.test(firstDigit)) {
95
+ if (!HEX_DIGIT.test(firstDigit || "")) {
96
96
  break;
97
97
  }
98
- if (!HEX_DIGIT.test(secondDigit)) {
98
+ if (!HEX_DIGIT.test(secondDigit || "")) {
99
99
  break;
100
100
  }
101
101
  const hexDigit = Number.parseInt(`${firstDigit}${secondDigit}`, 16);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "customized-fabric",
3
- "version": "1.9.8",
3
+ "version": "1.9.9",
4
4
  "description": "Customized fabric",
5
5
  "main": "lib/index.js",
6
6
  "types": "lib/index.d.ts",