@tenjuu99/blog 0.2.50 → 0.2.54
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/lib/filter.js +2 -4
- package/lib/indexer.js +3 -1
- package/package.json +4 -3
package/lib/filter.js
CHANGED
|
@@ -95,10 +95,8 @@ const replaceScriptFilter = async (text, variables) => {
|
|
|
95
95
|
if (result instanceof Promise) {
|
|
96
96
|
result = await result
|
|
97
97
|
}
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
case 'null':
|
|
101
|
-
result = ''
|
|
98
|
+
if (result === undefined || result === null) {
|
|
99
|
+
result = ''
|
|
102
100
|
}
|
|
103
101
|
replaced = replaced.replace(script.replace, result)
|
|
104
102
|
}
|
package/lib/indexer.js
CHANGED
|
@@ -17,7 +17,9 @@ const collect = (dir, namePrefix = '', promises = []) => {
|
|
|
17
17
|
const dirents = readdirSync(dir, { withFileTypes: true })
|
|
18
18
|
dirents.forEach((dirent) => {
|
|
19
19
|
if (dirent.isDirectory()) {
|
|
20
|
-
|
|
20
|
+
// Node.js v22 compatibility: fallback to dirent.path if parentPath is unavailable
|
|
21
|
+
const basePath = dirent.parentPath ?? dirent.path ?? dir;
|
|
22
|
+
collect(`${basePath}/${dirent.name}`, namePrefix + dirent.name + '/', promises)
|
|
21
23
|
} else {
|
|
22
24
|
const regexp = `\\.(${config.allowedSrcExt})$`
|
|
23
25
|
if (dirent.name.match(regexp)) {
|
package/package.json
CHANGED
|
@@ -1,13 +1,14 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tenjuu99/blog",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.54",
|
|
4
4
|
"description": "blog template",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"scripts": {
|
|
7
7
|
"dev": "node bin/dev-server",
|
|
8
8
|
"server": "node bin/server",
|
|
9
9
|
"generate": "node bin/generate",
|
|
10
|
-
"test": "
|
|
10
|
+
"test": "node --test --test-concurrency=1 test/**/*.test.js",
|
|
11
|
+
"test:watch": "node --test --watch test/**/*.test.js"
|
|
11
12
|
},
|
|
12
13
|
"bin": {
|
|
13
14
|
"generate": "bin/generate",
|
|
@@ -29,7 +30,7 @@
|
|
|
29
30
|
},
|
|
30
31
|
"type": "module",
|
|
31
32
|
"engines": {
|
|
32
|
-
"node": ">=
|
|
33
|
+
"node": ">=22"
|
|
33
34
|
},
|
|
34
35
|
"files": [
|
|
35
36
|
"lib",
|