Skip to content

Commit 7a1db49

Browse files
authored
1 parent a917aae commit 7a1db49

File tree

3 files changed

+11
-9
lines changed

3 files changed

+11
-9
lines changed

packages/cursorless-vscode/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -861,7 +861,7 @@
861861
"@types/vscode": "~1.61.0",
862862
"chai": "^4.3.6",
863863
"esbuild": "^0.17.11",
864-
"fast-xml-parser": "^3.20.0",
864+
"fast-xml-parser": "^4.2.4",
865865
"fs-extra": "11.1.0",
866866
"glob": "^7.1.7",
867867
"mocha": "^8.1.3"

packages/cursorless-vscode/src/scripts/preprocessSvgHats.ts

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,15 +6,17 @@ import * as path from "path";
66
async function main() {
77
const directory = path.join(getCursorlessRepoRoot(), "images/hats");
88

9-
const dumper = new parser.j2xParser({
9+
const dumper = new parser.XMLBuilder({
1010
ignoreAttributes: false,
11-
supressEmptyNode: true,
11+
suppressEmptyNode: true,
1212
});
1313

1414
readdirSync(directory, { withFileTypes: true }).forEach(async (dirent) => {
1515
const filePath = path.join(directory, dirent.name);
1616
const rawSvg = await fsp.readFile(filePath, { encoding: "utf8" });
17-
const svgJson = parser.parse(rawSvg, { ignoreAttributes: false });
17+
const svgJson = new parser.XMLParser({ ignoreAttributes: false }).parse(
18+
rawSvg,
19+
);
1820

1921
svgJson.svg["@_width"] = "1em";
2022
svgJson.svg["@_height"] = "1em";
@@ -27,7 +29,7 @@ async function main() {
2729
}
2830

2931
const outputSvg = dumper
30-
.parse(svgJson)
32+
.build(svgJson)
3133
.replace(/fill="[^"]+"/, `fill="#666666"`)
3234
.replace(/fill:[^;]+;/, `fill:#666666;`);
3335

pnpm-lock.yaml

Lines changed: 4 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)