bun-match-svg 0.0.7 → 0.0.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/index.ts +6 -6
- package/package.json +1 -1
- package/tsconfig.json +11 -1
package/index.ts
CHANGED
|
@@ -25,7 +25,7 @@ async function toMatchSvgSnapshot(
|
|
|
25
25
|
const updateSnapshot =
|
|
26
26
|
process.argv.includes("--update-snapshots") ||
|
|
27
27
|
process.argv.includes("-u") ||
|
|
28
|
-
Boolean(process.env
|
|
28
|
+
Boolean(process.env["BUN_UPDATE_SNAPSHOTS"])
|
|
29
29
|
|
|
30
30
|
if (!fs.existsSync(filePath) || updateSnapshot) {
|
|
31
31
|
console.log("Writing snapshot to", filePath)
|
|
@@ -38,7 +38,7 @@ async function toMatchSvgSnapshot(
|
|
|
38
38
|
|
|
39
39
|
const existingSnapshot = fs.readFileSync(filePath, "utf-8")
|
|
40
40
|
|
|
41
|
-
const result = await looksSame(
|
|
41
|
+
const result: any = await looksSame(
|
|
42
42
|
Buffer.from(received),
|
|
43
43
|
Buffer.from(existingSnapshot),
|
|
44
44
|
{
|
|
@@ -75,8 +75,8 @@ async function toMatchMultipleSvgSnapshots(
|
|
|
75
75
|
testPathOriginal: string,
|
|
76
76
|
svgNames: string[],
|
|
77
77
|
): Promise<MatcherResult> {
|
|
78
|
-
const passed = []
|
|
79
|
-
const failed = []
|
|
78
|
+
const passed: any[] = []
|
|
79
|
+
const failed: any[] = []
|
|
80
80
|
for (let index = 0; index < svgNames.length; index++) {
|
|
81
81
|
const svgName = svgNames[index]
|
|
82
82
|
const received = await receivedMaybePromise
|
|
@@ -94,7 +94,7 @@ async function toMatchMultipleSvgSnapshots(
|
|
|
94
94
|
const updateSnapshot =
|
|
95
95
|
process.argv.includes("--update-snapshots") ||
|
|
96
96
|
process.argv.includes("-u") ||
|
|
97
|
-
Boolean(process.env
|
|
97
|
+
Boolean(process.env["BUN_UPDATE_SNAPSHOTS"])
|
|
98
98
|
|
|
99
99
|
if (!fs.existsSync(filePath) || updateSnapshot) {
|
|
100
100
|
console.log("Writing snapshot to", filePath)
|
|
@@ -108,7 +108,7 @@ async function toMatchMultipleSvgSnapshots(
|
|
|
108
108
|
|
|
109
109
|
const existingSnapshot = fs.readFileSync(filePath, "utf-8")
|
|
110
110
|
|
|
111
|
-
const result = await looksSame(
|
|
111
|
+
const result: any = await looksSame(
|
|
112
112
|
Buffer.from(received[index] as any),
|
|
113
113
|
Buffer.from(existingSnapshot),
|
|
114
114
|
{
|
package/package.json
CHANGED
package/tsconfig.json
CHANGED
|
@@ -13,6 +13,16 @@
|
|
|
13
13
|
"allowImportingTsExtensions": true,
|
|
14
14
|
"verbatimModuleSyntax": true,
|
|
15
15
|
"noEmit": true,
|
|
16
|
+
"noImplicitAny": true,
|
|
17
|
+
"strictNullChecks": true,
|
|
18
|
+
"strictFunctionTypes": true,
|
|
19
|
+
"strictBindCallApply": true,
|
|
20
|
+
"strictPropertyInitialization": true,
|
|
21
|
+
"noImplicitThis": true,
|
|
22
|
+
"useUnknownInCatchVariables": true,
|
|
23
|
+
"alwaysStrict": true,
|
|
24
|
+
"exactOptionalPropertyTypes": false,
|
|
25
|
+
"noImplicitReturns": true,
|
|
16
26
|
|
|
17
27
|
// Best practices
|
|
18
28
|
"strict": true,
|
|
@@ -22,6 +32,6 @@
|
|
|
22
32
|
// Some stricter flags (disabled by default)
|
|
23
33
|
"noUnusedLocals": false,
|
|
24
34
|
"noUnusedParameters": false,
|
|
25
|
-
"noPropertyAccessFromIndexSignature":
|
|
35
|
+
"noPropertyAccessFromIndexSignature": true
|
|
26
36
|
}
|
|
27
37
|
}
|