nodejs-util-lib 0.1.15 → 0.1.17
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/eslint.config.cjs +33 -0
- package/lib/string-utils.js +1 -2
- package/package.json +10 -10
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
const { defineConfig, globalIgnores } = require("eslint/config");
|
|
2
|
+
const globals = require("globals");
|
|
3
|
+
const js = require("@eslint/js");
|
|
4
|
+
const { FlatCompat } = require("@eslint/eslintrc");
|
|
5
|
+
|
|
6
|
+
const compat = new FlatCompat({
|
|
7
|
+
baseDirectory: __dirname,
|
|
8
|
+
recommendedConfig: js.configs.recommended,
|
|
9
|
+
allConfig: js.configs.all,
|
|
10
|
+
});
|
|
11
|
+
|
|
12
|
+
module.exports = defineConfig([
|
|
13
|
+
// compat.extends returns config objects that should be spread
|
|
14
|
+
...compat.extends("eslint:recommended"),
|
|
15
|
+
|
|
16
|
+
{
|
|
17
|
+
languageOptions: {
|
|
18
|
+
globals: {
|
|
19
|
+
...globals.browser,
|
|
20
|
+
...globals.commonjs,
|
|
21
|
+
...globals.jest,
|
|
22
|
+
},
|
|
23
|
+
ecmaVersion: "latest",
|
|
24
|
+
parserOptions: {},
|
|
25
|
+
},
|
|
26
|
+
|
|
27
|
+
rules: {
|
|
28
|
+
"no-useless-escape": "off",
|
|
29
|
+
},
|
|
30
|
+
},
|
|
31
|
+
|
|
32
|
+
globalIgnores(["node_modules/", "eslint.config.cjs"]),
|
|
33
|
+
]);
|
package/lib/string-utils.js
CHANGED
|
@@ -69,8 +69,7 @@ exports.replaceAll = (stringValue, valueToReplace, replaceWith) => {
|
|
|
69
69
|
if (exports.isEmpty(stringValue) || exports.isEmpty(valueToReplace)) {
|
|
70
70
|
return null;
|
|
71
71
|
}
|
|
72
|
-
|
|
73
|
-
/* eslint-disable no-useless-escape */
|
|
72
|
+
|
|
74
73
|
const escapedChars = valueToReplace.replace(/([.*+?^=!:${}()|\[\]\/\\])/g, "\\$1");
|
|
75
74
|
return stringValue.replace(new RegExp(escapedChars, 'g'), replaceWith);
|
|
76
75
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "nodejs-util-lib",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.17",
|
|
4
4
|
"description": "Nodejs Utility Library",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"author": "Michael Uranaka",
|
|
@@ -14,20 +14,20 @@
|
|
|
14
14
|
"url": "git://github.com/uranakam/nodejs-util-lib.git"
|
|
15
15
|
},
|
|
16
16
|
"engines": {
|
|
17
|
-
"node": ">=
|
|
17
|
+
"node": ">= 20.19.0"
|
|
18
18
|
},
|
|
19
19
|
"dependencies": {
|
|
20
|
-
"lodash": "^4.17.
|
|
20
|
+
"lodash": "^4.17.23"
|
|
21
21
|
},
|
|
22
22
|
"devDependencies": {
|
|
23
|
-
"eslint":"^
|
|
24
|
-
"eslint
|
|
25
|
-
"eslint
|
|
26
|
-
"
|
|
27
|
-
"
|
|
28
|
-
"jest": "^29.7.0"
|
|
23
|
+
"@eslint/eslintrc": "^3.3.5",
|
|
24
|
+
"@eslint/js": "^10.0.1",
|
|
25
|
+
"eslint": "^10.1.0",
|
|
26
|
+
"globals": "^17.4.0",
|
|
27
|
+
"jest": "^30.3.0"
|
|
29
28
|
},
|
|
30
29
|
"overrides": {
|
|
31
|
-
"js-yaml": "4.1.1"
|
|
30
|
+
"js-yaml": "4.1.1",
|
|
31
|
+
"flatted": "3.4.2"
|
|
32
32
|
}
|
|
33
33
|
}
|