properties-file 3.5.13 → 3.6.1

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.
@@ -1,11 +1,10 @@
1
1
  /**
2
- * Unescape the content from either key or value of a property.
2
+ * Tries to unescape the content from either key or value of a property.
3
3
  *
4
- * @param escapedContent - The content to unescape.
4
+ * @param content - The content to unescape.
5
5
  *
6
6
  * @returns The unescaped content.
7
7
  *
8
- * @throws {@link Error}
9
- * This exception is thrown if malformed escaped unicode characters are present.
8
+ * @throws Error if malformed escaped unicode characters are present.
10
9
  */
11
- export declare const unescapeContent: (escapedContent: string) => string;
10
+ export declare const unescapeContent: (content: string) => string;
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.unescapeContent=void 0;var unescapeContent=function(e){return e.replace(/\\[^u]|\\u.{4}/g,function(e){var r=e.charAt(1);switch(r){case"f":return"\f";case"n":return"\n";case"r":return"\r";case"t":return"\t";case"u":var t=e.slice(2,6);if(!/[\da-f]{4}/i.test(t))throw new Error("malformed escaped unicode characters '\\u".concat(t,"'"));return String.fromCodePoint(Number.parseInt(t,16));default:return r}})};exports.unescapeContent=unescapeContent;
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.unescapeContent=void 0;var REGEX_INVALID_UNICODE_ESCAPE=/\\u(?![0-9a-fA-F]{4})/,REGEX_ESCAPE=/\\(?:([fnrt])|u([0-9a-fA-F]{4})|(.))/g,ESCAPE_MAP={f:"\f",n:"\n",r:"\r",t:"\t"},unescapeContent=function(e){if(!e.includes("\\"))return e;var n=e.match(REGEX_INVALID_UNICODE_ESCAPE);if(n){var r=n.index,t=e.slice(r,r+6);throw new Error("malformed escaped unicode characters '".concat(t,"'"))}return e.replace(REGEX_ESCAPE,function(e,n,r,t){return n?ESCAPE_MAP[n]:r?String.fromCodePoint(Number.parseInt(r,16)):t})};exports.unescapeContent=unescapeContent;
@@ -1,11 +1,10 @@
1
1
  /**
2
- * Unescape the content from either key or value of a property.
2
+ * Tries to unescape the content from either key or value of a property.
3
3
  *
4
- * @param escapedContent - The content to unescape.
4
+ * @param content - The content to unescape.
5
5
  *
6
6
  * @returns The unescaped content.
7
7
  *
8
- * @throws {@link Error}
9
- * This exception is thrown if malformed escaped unicode characters are present.
8
+ * @throws Error if malformed escaped unicode characters are present.
10
9
  */
11
- export declare const unescapeContent: (escapedContent: string) => string;
10
+ export declare const unescapeContent: (content: string) => string;
@@ -1 +1 @@
1
- export var unescapeContent=function(r){return r.replace(/\\[^u]|\\u.{4}/g,function(r){var e=r.charAt(1);switch(e){case"f":return"\f";case"n":return"\n";case"r":return"\r";case"t":return"\t";case"u":var t=r.slice(2,6);if(!/[\da-f]{4}/i.test(t))throw new Error("malformed escaped unicode characters '\\u".concat(t,"'"));return String.fromCodePoint(Number.parseInt(t,16));default:return e}})};
1
+ var REGEX_INVALID_UNICODE_ESCAPE=/\\u(?![0-9a-fA-F]{4})/,REGEX_ESCAPE=/\\(?:([fnrt])|u([0-9a-fA-F]{4})|(.))/g,ESCAPE_MAP={f:"\f",n:"\n",r:"\r",t:"\t"};export var unescapeContent=function(r){if(!r.includes("\\"))return r;var E=r.match(REGEX_INVALID_UNICODE_ESCAPE);if(E){var e=E.index,n=r.slice(e,e+6);throw new Error("malformed escaped unicode characters '".concat(n,"'"))}return r.replace(REGEX_ESCAPE,function(r,E,e,n){return E?ESCAPE_MAP[E]:e?String.fromCodePoint(Number.parseInt(e,16)):n})};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "properties-file",
3
- "version": "3.5.13",
3
+ "version": "3.6.1",
4
4
  "description": ".properties file parser, editor, formatter and Webpack loader.",
5
5
  "keywords": [
6
6
  ".properties",
@@ -85,9 +85,11 @@
85
85
  "scripts": {
86
86
  "add-file-type-declaration": "node ./dist/esm/add-import-type.js && find ./dist -name 'add-import-type.*' -type f -delete",
87
87
  "build": "npm run check-nvm-node-version && npm run prettier-write && npm run eslint-fix && rm -Rf ./dist && tsc -p tsconfig.cjs.json && tsc -p tsconfig.esm.json && echo '{ \"type\": \"commonjs\" }' > dist/cjs/package.json && tsc -p src/build-scripts/tsconfig.json && node dist/build-scripts/build.js && npm run test",
88
- "check-nvm-node-version": "check-node-version --node $(node -p \"'>=' + require('fs').readFileSync('.nvmrc', 'utf-8').trim()\")",
88
+ "check-nvm-node-version": "check-node-version --node $(node -p \"'>='+require('fs').readFileSync('.nvmrc','utf-8').trim()\")",
89
89
  "depcheck": "depcheck",
90
90
  "eslint-fix": "eslint --fix",
91
+ "ncu": "npm-check-updates",
92
+ "ncu-update": "npm-check-updates -u",
91
93
  "prepare": "husky",
92
94
  "prettier-write": "prettier --write .",
93
95
  "release": "dotenv -- release-it --only-version",
@@ -96,32 +98,33 @@
96
98
  "devDependencies": {
97
99
  "@release-it/conventional-changelog": "10.0.1",
98
100
  "@types/jest": "30.0.0",
99
- "@types/node": "24.0.15",
101
+ "@types/node": "24.3.1",
100
102
  "check-node-version": "4.2.1",
101
103
  "depcheck": "1.4.7",
102
- "dotenv-cli": "8.0.0",
103
- "eslint": "9.31.0",
104
+ "dotenv-cli": "10.0.0",
105
+ "eslint": "9.35.0",
104
106
  "eslint-config-prettier": "10.1.8",
105
107
  "eslint-import-resolver-typescript": "4.4.4",
106
108
  "eslint-plugin-compat": "6.0.2",
107
109
  "eslint-plugin-import-x": "4.16.1",
108
110
  "eslint-plugin-jest": "29.0.1",
109
- "eslint-plugin-json-files": "5.1.0",
111
+ "eslint-plugin-json-files": "5.1.1",
110
112
  "eslint-plugin-prefer-arrow-functions": "3.6.2",
111
- "eslint-plugin-prettier": "5.5.3",
113
+ "eslint-plugin-prettier": "5.5.4",
112
114
  "eslint-plugin-tsdoc": "0.4.0",
113
- "eslint-plugin-unicorn": "60.0.0",
115
+ "eslint-plugin-unicorn": "61.0.1",
114
116
  "husky": "9.1.7",
115
- "jest": "30.0.4",
116
- "jiti": "2.4.2",
117
+ "jest": "30.1.3",
118
+ "jiti": "2.5.1",
117
119
  "jsonc-eslint-parser": "2.4.0",
120
+ "npm-check-updates": "18.1.0",
118
121
  "prettier": "3.6.2",
119
- "prettier-plugin-organize-imports": "4.1.0",
122
+ "prettier-plugin-organize-imports": "4.2.0",
120
123
  "release-it": "19.0.4",
121
- "terser": "5.43.1",
122
- "ts-jest": "29.4.0",
123
- "typescript": "5.8.3",
124
- "typescript-eslint": "8.38.0"
124
+ "terser": "5.44.0",
125
+ "ts-jest": "29.4.1",
126
+ "typescript": "5.9.2",
127
+ "typescript-eslint": "8.42.0"
125
128
  },
126
129
  "engines": {
127
130
  "node": "*"