@depup/i18n 0.15.3-depup.0 → 0.15.4-depup.0
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/README.md +2 -2
- package/SECURITY.md +4 -4
- package/changes.json +10 -0
- package/i18n.js +15 -0
- package/package.json +12 -8
package/README.md
CHANGED
|
@@ -13,8 +13,8 @@ npm install @depup/i18n
|
|
|
13
13
|
|
|
14
14
|
| Field | Value |
|
|
15
15
|
|-------|-------|
|
|
16
|
-
| Original | [i18n](https://www.npmjs.com/package/i18n) @ 0.15.
|
|
17
|
-
| Processed | 2026-03
|
|
16
|
+
| Original | [i18n](https://www.npmjs.com/package/i18n) @ 0.15.4 |
|
|
17
|
+
| Processed | 2026-09-03 |
|
|
18
18
|
| Smoke test | passed |
|
|
19
19
|
| Deps updated | 1 |
|
|
20
20
|
|
package/SECURITY.md
CHANGED
|
@@ -5,10 +5,10 @@
|
|
|
5
5
|
Use this section to tell people about which versions of your project are
|
|
6
6
|
currently being supported with security updates.
|
|
7
7
|
|
|
8
|
-
| Version
|
|
9
|
-
|
|
|
10
|
-
| 0.
|
|
11
|
-
| < 0.
|
|
8
|
+
| Version | Supported |
|
|
9
|
+
| -------- | ------------------ |
|
|
10
|
+
| 0.15.x | :white_check_mark: |
|
|
11
|
+
| < 0.15.0 | :x: |
|
|
12
12
|
|
|
13
13
|
## Reporting a Vulnerability
|
|
14
14
|
|
package/changes.json
ADDED
package/i18n.js
CHANGED
|
@@ -1332,12 +1332,27 @@ const i18n = function I18n(_OPTS = false) {
|
|
|
1332
1332
|
* basic normalization of filepath
|
|
1333
1333
|
*/
|
|
1334
1334
|
const getStorageFilePath = (locale) => {
|
|
1335
|
+
// only accept plain locale names before building any path.
|
|
1336
|
+
if (!/^[A-Za-z0-9_-]+$/.test(String(locale))) {
|
|
1337
|
+
throw new Error(`i18n: invalid locale "${locale}".`)
|
|
1338
|
+
}
|
|
1339
|
+
|
|
1335
1340
|
// changed API to use .json as default, #16
|
|
1336
1341
|
const ext = extension || '.json'
|
|
1337
1342
|
const filepath = path.normalize(directory + pathsep + prefix + locale + ext)
|
|
1338
1343
|
const filepathJS = path.normalize(
|
|
1339
1344
|
directory + pathsep + prefix + locale + '.js'
|
|
1340
1345
|
)
|
|
1346
|
+
|
|
1347
|
+
// ensure the resolved file stays inside the locales dir
|
|
1348
|
+
const base = path.resolve(directory) + path.sep
|
|
1349
|
+
if (
|
|
1350
|
+
!path.resolve(filepath).startsWith(base) ||
|
|
1351
|
+
!path.resolve(filepathJS).startsWith(base)
|
|
1352
|
+
) {
|
|
1353
|
+
throw new Error(`i18n: locale "${locale}" escapes the locales directory.`)
|
|
1354
|
+
}
|
|
1355
|
+
|
|
1341
1356
|
// use .js as fallback if already existing
|
|
1342
1357
|
try {
|
|
1343
1358
|
if (fs.statSync(filepathJS)) {
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@depup/i18n",
|
|
3
|
-
"description": "
|
|
4
|
-
"version": "0.15.
|
|
3
|
+
"description": "lightweight translation module with dynamic json storage (with updated dependencies)",
|
|
4
|
+
"version": "0.15.4-depup.0",
|
|
5
5
|
"homepage": "http://github.com/mashpie/i18n-node",
|
|
6
6
|
"repository": {
|
|
7
7
|
"type": "git",
|
|
@@ -15,13 +15,17 @@
|
|
|
15
15
|
"files": [
|
|
16
16
|
"i18n.js",
|
|
17
17
|
"index.js",
|
|
18
|
-
"SECURITY.md"
|
|
18
|
+
"SECURITY.md",
|
|
19
|
+
"changes.json",
|
|
20
|
+
"README.md"
|
|
19
21
|
],
|
|
20
22
|
"keywords": [
|
|
21
|
-
"depup",
|
|
22
|
-
"dependency-bumped",
|
|
23
|
-
"updated-deps",
|
|
24
23
|
"i18n",
|
|
24
|
+
"depup",
|
|
25
|
+
"updated-dependencies",
|
|
26
|
+
"security",
|
|
27
|
+
"latest",
|
|
28
|
+
"patched",
|
|
25
29
|
"template",
|
|
26
30
|
"l10n"
|
|
27
31
|
],
|
|
@@ -84,8 +88,8 @@
|
|
|
84
88
|
},
|
|
85
89
|
"depsUpdated": 1,
|
|
86
90
|
"originalPackage": "i18n",
|
|
87
|
-
"originalVersion": "0.15.
|
|
88
|
-
"processedAt": "2026-
|
|
91
|
+
"originalVersion": "0.15.4",
|
|
92
|
+
"processedAt": "2026-09-03T00:34:33.836Z",
|
|
89
93
|
"smokeTest": "passed"
|
|
90
94
|
}
|
|
91
95
|
}
|