-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Don't allow
console
logging statements (#96)
* Don't allow `console` logging statements
- Loading branch information
Showing
7 changed files
with
28 additions
and
21 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,5 @@ | ||
const util = require("util") | ||
const svgPathBbox = require("../dist/wrapper.js"); | ||
|
||
console.log(svgPathBbox("M0 0H3V6Z")); | ||
const bbox = svgPathBbox("M0 0H3V6Z"); | ||
process.stdout.write(`${util.inspect(bbox)}\n`) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,5 @@ | ||
import { inspect } from "node:util"; | ||
import svgPathBbox from "../dist/wrapper.js"; | ||
|
||
console.log(svgPathBbox("M0 0H3V6Z")); | ||
const bbox = svgPathBbox("M0 0H3V6Z"); | ||
process.stdout.write(`${inspect(bbox)}\n`) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,15 @@ | ||
import { inspect } from "node:util"; | ||
import svgPathBbox from "../src"; | ||
import type { BBox } from "../src"; | ||
|
||
type CasesTuple = Array<[string, BBox]>; | ||
|
||
const cases: CasesTuple = [["M0 0H3V6Z", [0, 0, 3, 6]]]; | ||
const cases: [string, BBox][] = [["M0 0H3V6Z", [0, 0, 3, 6]]]; | ||
|
||
for (const [path, expectedBbox] of cases) { | ||
const result = svgPathBbox(path); | ||
const stringResult = JSON.stringify(result); | ||
if (stringResult !== JSON.stringify(expectedBbox)) { | ||
console.error(`UNEXPECTED BBOX: ${result}`); | ||
const bbox = svgPathBbox(path); | ||
if (JSON.stringify(bbox) !== JSON.stringify(expectedBbox)) { | ||
process.stderr.write(`UNEXPECTED BBOX: ${inspect(bbox)}\n`); | ||
process.exit(1); | ||
} else { | ||
console.log(result); | ||
process.stdout.write(`${inspect(bbox)}\n`); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters