Skip to content

Commit b5e096c

Browse files
authored
fix(index): revert #483 (#489)
1 parent 0ead965 commit b5e096c

File tree

3 files changed

+6
-6
lines changed

3 files changed

+6
-6
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@
8080
"@commitlint/cli": "^20.1.0",
8181
"@commitlint/config-conventional": "^20.0.0",
8282
"@eslint/compat": "^1.3.1",
83-
"@fdawgs/eslint-config": "^1.0.5",
83+
"@fdawgs/eslint-config": "^1.0.9",
8484
"@jest/globals": "^30.0.5",
8585
"@types/node": "^24.5.2",
8686
"@types/semver": "^7.7.0",

src/index.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,9 @@ const RTF_MAGIC_BUFFER = Buffer.from(RTF_MAGIC_NUMBER);
1414
const RTF_MAGIC_NUMBER_LENGTH = RTF_MAGIC_NUMBER.length;
1515

1616
// Cache immutable regex as they are expensive to create and garbage collect
17-
const UNRTF_PATH_REG = /(.+)unrtf/v;
17+
const UNRTF_PATH_REG = /(.+)unrtf/u;
1818
// UnRTF version output is inconsistent between versions but always starts with the semantic version number
19-
const UNRTF_VERSION_REG = /^(\d{1,2}\.\d{1,2}\.\d{1,2})/v;
19+
const UNRTF_VERSION_REG = /^(\d{1,2}\.\d{1,2}\.\d{1,2})/u;
2020

2121
/**
2222
* @typedef {object} OptionDetails

src/index.test.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ const file = `${testDirectory}test-rtf-complex.rtf`;
3131

3232
// Cache immutable regex as they are expensive to create and garbage collect
3333
const HTML_REG =
34-
/^\s*<!doctype html\b[^>]*>|<(?:html|body)\b[^>]*>|<x-[^>]+>/iv;
34+
/^\s*<!doctype html\b[^>]*>|<(?:html|body)\b[^>]*>|<x-[^>]+>/iu;
3535

3636
/**
3737
* @description Returns the path to the UnRTF binary based on the OS.
@@ -41,7 +41,7 @@ function getTestBinaryPath() {
4141
const which = spawnSync(platform === "win32" ? "where" : "which", [
4242
"unrtf",
4343
]).stdout.toString();
44-
let unrtfPath = /(.+)unrtf/v.exec(which)?.[1];
44+
let unrtfPath = /(.+)unrtf/u.exec(which)?.[1];
4545

4646
if (platform === "win32" && !unrtfPath) {
4747
unrtfPath = join(__dirname, "lib", "win32", "unrtf-0.19.3", "bin");
@@ -130,7 +130,7 @@ describe("Node-UnRTF module", () => {
130130
join(testBinaryPath, "unrtf"),
131131
["--version"]
132132
);
133-
version = /^(\d{1,2}\.\d{1,2}\.\d{1,2})/v.exec(stderr)[1];
133+
version = /^(\d{1,2}\.\d{1,2}\.\d{1,2})/u.exec(stderr)[1];
134134
});
135135

136136
it("Converts RTF if any valid options are set", async () => {

0 commit comments

Comments
 (0)