Skip to content

Commit 307cbb6

Browse files
committed
🌹 Upgrade to Standard v14
1 parent a0d6acf commit 307cbb6

File tree

4 files changed

+311
-276
lines changed

4 files changed

+311
-276
lines changed

index.js

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -9,36 +9,36 @@ class ImageData {
99

1010
if (typeof width === 'object') {
1111
if (!(width instanceof Uint8ClampedArray)) {
12-
throw new TypeError(`Failed to construct 'ImageData': parameter 1 is not of type 'Uint8ClampedArray'.`)
12+
throw new TypeError("Failed to construct 'ImageData': parameter 1 is not of type 'Uint8ClampedArray'.")
1313
}
1414

1515
if (typeof height !== 'number' || height === 0) {
16-
throw new Error(`Failed to construct 'ImageData': The source width is zero or not a number.`)
16+
throw new Error("Failed to construct 'ImageData': The source width is zero or not a number.")
1717
}
1818

1919
height = height >>> 0
2020

2121
if ((height * 4) > width.length) {
22-
throw new Error(`Failed to construct 'ImageData': The requested image size exceeds the supported range.`)
22+
throw new Error("Failed to construct 'ImageData': The requested image size exceeds the supported range.")
2323
}
2424

2525
if ((width.length % 4) !== 0) {
26-
throw new Error(`Failed to construct 'ImageData': The input data length is not a multiple of 4.`)
26+
throw new Error("Failed to construct 'ImageData': The input data length is not a multiple of 4.")
2727
}
2828

2929
if ((width.length % (4 * height)) !== 0) {
30-
throw new Error(`Failed to construct 'ImageData': The input data length is not a multiple of (4 * width).`)
30+
throw new Error("Failed to construct 'ImageData': The input data length is not a multiple of (4 * width).")
3131
}
3232

3333
if (typeof args[0] !== 'undefined') {
3434
if (typeof args[0] !== 'number' || args[0] === 0) {
35-
throw new Error(`Failed to construct 'ImageData': The source height is zero or not a number.`)
35+
throw new Error("Failed to construct 'ImageData': The source height is zero or not a number.")
3636
}
3737

3838
args[0] = args[0] >>> 0
3939

4040
if ((width.length % (4 * height * args[0])) !== 0) {
41-
throw new Error(`Failed to construct 'ImageData': The input data length is not equal to (4 * width * height).`)
41+
throw new Error("Failed to construct 'ImageData': The input data length is not equal to (4 * width * height).")
4242
}
4343
}
4444

@@ -47,19 +47,19 @@ class ImageData {
4747
Object.defineProperty(this, 'data', { configurable: true, enumerable: true, value: width, writable: false })
4848
} else {
4949
if (typeof width !== 'number' || width === 0) {
50-
throw new Error(`Failed to construct 'ImageData': The source width is zero or not a number.`)
50+
throw new Error("Failed to construct 'ImageData': The source width is zero or not a number.")
5151
}
5252

5353
width = width >>> 0
5454

5555
if (typeof height !== 'number' || height === 0) {
56-
throw new Error(`Failed to construct 'ImageData': The source height is zero or not a number.`)
56+
throw new Error("Failed to construct 'ImageData': The source height is zero or not a number.")
5757
}
5858

5959
height = height >>> 0
6060

6161
if ((width * height) >= (1 << 30)) {
62-
throw new Error(`Failed to construct 'ImageData': The requested image size exceeds the supported range.`)
62+
throw new Error("Failed to construct 'ImageData': The requested image size exceeds the supported range.")
6363
}
6464

6565
widthMap.set(this, width)

0 commit comments

Comments
 (0)