@node-novel/normalize 1.0.28 → 1.0.30
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/CHANGELOG.md +37 -0
- package/index.js +3 -3
- package/index.js.map +1 -1
- package/package.json +8 -8
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,43 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
+
## [1.0.30](https://github.com/bluelovers/ws-node-novel/compare/@node-novel/normalize@1.0.28...@node-novel/normalize@1.0.30) (2022-05-16)
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
### 🛠 Build System
|
|
10
|
+
|
|
11
|
+
* update typescript ([c16e9f8](https://github.com/bluelovers/ws-node-novel/commit/c16e9f83eb0ba558175485120a2e9334f80bcbd3))
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
### ♻️ Chores
|
|
15
|
+
|
|
16
|
+
* **deps:** update deps ([60c8a11](https://github.com/bluelovers/ws-node-novel/commit/60c8a119f095ed04a4c28dcd1774e4e8f0970970))
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
### 🔖 Miscellaneous
|
|
20
|
+
|
|
21
|
+
* . ([57ee43d](https://github.com/bluelovers/ws-node-novel/commit/57ee43d121d63feb6ec6588641bebc7343a18342))
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
## [1.0.29](https://github.com/bluelovers/ws-node-novel/compare/@node-novel/normalize@1.0.28...@node-novel/normalize@1.0.29) (2022-05-16)
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
### 🛠 Build System
|
|
31
|
+
|
|
32
|
+
* update typescript ([c16e9f8](https://github.com/bluelovers/ws-node-novel/commit/c16e9f83eb0ba558175485120a2e9334f80bcbd3))
|
|
33
|
+
|
|
34
|
+
|
|
35
|
+
### ♻️ Chores
|
|
36
|
+
|
|
37
|
+
* **deps:** update deps ([60c8a11](https://github.com/bluelovers/ws-node-novel/commit/60c8a119f095ed04a4c28dcd1774e4e8f0970970))
|
|
38
|
+
|
|
39
|
+
|
|
40
|
+
|
|
41
|
+
|
|
42
|
+
|
|
6
43
|
## [1.0.28](https://github.com/bluelovers/ws-node-novel/compare/@node-novel/normalize@1.0.27...@node-novel/normalize@1.0.28) (2021-07-08)
|
|
7
44
|
|
|
8
45
|
|
package/index.js
CHANGED
|
@@ -5,9 +5,9 @@
|
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
exports.normalize_val = exports.normalize_strip = void 0;
|
|
7
7
|
const tslib_1 = require("tslib");
|
|
8
|
-
const str_util_1 =
|
|
9
|
-
const normalize_num_1 =
|
|
10
|
-
const novel_filename_1 =
|
|
8
|
+
const str_util_1 = tslib_1.__importDefault(require("str-util"));
|
|
9
|
+
const normalize_num_1 = tslib_1.__importDefault(require("normalize-num"));
|
|
10
|
+
const novel_filename_1 = tslib_1.__importDefault(require("@lazy-cjk/novel-filename"));
|
|
11
11
|
const zh_slugify_1 = require("@lazy-cjk/zh-slugify");
|
|
12
12
|
function normalize_strip(str, isDir) {
|
|
13
13
|
if (isDir) {
|
package/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["index.ts"],"names":[],"mappings":";AAAA;;GAEG;;;;AAEH,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["index.ts"],"names":[],"mappings":";AAAA;;GAEG;;;;AAEH,gEAA+B;AAC/B,0EAAoC;AAEpC,sFAAqD;AACrD,qDAA+C;AAQ/C,SAAgB,eAAe,CAAC,GAAW,EAAE,KAAe;IAE3D,IAAI,KAAK,EACT;QACC,IAAI,+BAA+B,CAAC,IAAI,CAAC,GAAG,CAAC,EAC7C;YACC,GAAG,GAAG,MAAM,CAAC,EAAE,CAAC;SAChB;aACI,IAAI,gCAA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AA,uBAAO,EAAC,GAAG,EAAE;QAClB,GAAG,EAAE,IAAI;QACT,KAAK,EAAE,OAAO,CAAC,UAAU;KACzB,CAAC,CAAC;IAEH;;;;;;;;;;;;;;MAcE;IAEF,GAAG,GAAG,GAAG,CAAC,OAAO,CAAC,MAAM,EAAE,UAAU,EAAE;QAErC,OAAO,EAAE,CAAC,QAAQ,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;IACjC,CAAC,CAAC,CAAC;IAEH,GAAG,GAAG,GAAG;SACP,OAAO,CAAC,KAAK,EAAE,EAAE,CAAC;QACnB,8BAA8B;QAC9B,2BAA2B;QAC3B,sBAAsB;SACrB,OAAO,CAAC,uBAAuB,EAAE,GAAG,CAAC;SACrC,OAAO,CAAC,QAAQ,EAAE,GAAG,CAAC;SACtB,OAAO,CAAC,2BAA2B,EAAE,GAAG,CAAC;SACzC,OAAO,CAAC,mCAAmC,EAAE,GAAG,CAAC;SACjD,OAAO,CAAC,cAAc,EAAE,GAAG,CAAC;SAC5B,OAAO,CAAC,QAAQ,EAAE,GAAG,CAAC;SACtB,OAAO,CAAC,MAAM,EAAE,EAAE,CAAC;SACnB,OAAO,CAAC,KAAK,EAAE,GAAG,CAAC,CAEpB;IAED;;;;MAIE;IAEF;;;;;;;;;;MAUE;IAEF,GAAG,GAAG,IAAA,oBAAO,EAAC,GAAG,EAAE,IAAI,CAAC,CAAC;IAEzB,OAAO,GAAG,CAAC;AACZ,CAAC;AA9FD,sCA8FC;AAED,kBAAe,OAAmC,CAAC","sourcesContent":["/**\n * Created by user on 2018/2/14/014.\n */\n\nimport StrUtil from 'str-util';\nimport str2num from 'normalize-num';\n\nimport novelFilename from '@lazy-cjk/novel-filename';\nimport { slugify } from '@lazy-cjk/zh-slugify';\n\nexport interface IOptions\n{\n\tpadNum?: number,\n\tcheckRoman?: boolean,\n}\n\nexport function normalize_strip(str: string, isDir?: boolean)\n{\n\tif (isDir)\n\t{\n\t\tif (/^p?\\d{4,}[\\s_](.+)(_\\(\\d+\\))$/.exec(str))\n\t\t{\n\t\t\tstr = RegExp.$1;\n\t\t}\n\t\telse if (/^p?\\d{4,}[\\s_](.+)(_\\(\\d+\\))?$/.exec(str))\n\t\t{\n\t\t\tstr = RegExp.$1;\n\t\t}\n\t}\n\telse\n\t{\n\t\tif (/^\\d+_(.+)\\.\\d+$/.exec(str))\n\t\t{\n\t\t\tstr = RegExp.$1;\n\t\t}\n\t\telse if (/^c?\\d{4,}_(.+)$/.exec(str))\n\t\t{\n\t\t\tstr = RegExp.$1;\n\t\t}\n\t}\n\n\tstr = StrUtil.trim(str, ' ');\n\n\treturn str;\n}\n\nexport function normalize_val(str: string, padNum: number = 5, options: IOptions = {}): string\n{\n\tpadNum = padNum || options.padNum;\n\n\t//console.log(111, str);\n\n\tstr = novelFilename.filename(str);\n\n\tif (/^(?:序|プロローグ|Prologue)/i.test(str))\n\t{\n\t\tstr = '0_' + str;\n\t}\n\n\tstr = str.replace(/^(web)版(\\d+)/i, '$1$2');\n\n\t//str = str.replace(/^[cp](\\d{4,}_)/, '$1');\n\n\tstr = StrUtil.toHalfWidth(str)\n\t\t.toLowerCase()\n\t;\n\tstr = StrUtil.trim(str, ' ');\n\n\tstr = StrUtil.zh2num(str).toString();\n\n\tstr = StrUtil.zh2num(str, {\n\t\ttruncateOne: 2,\n\t\tflags: 'ug',\n\t}).toString();\n\n\t//console.log(str);\n\n\tstr = str2num(str, {\n\t\tall: true,\n\t\troman: options.checkRoman,\n\t});\n\n\t/*\n\tif (options.checkRoman)\n\t{\n\t\tlet m = isRoman(str);\n\n\t\tif (m)\n\t\t{\n\t\t\tlet n = deromanize(normalizeRoman(m[1]));\n\t\t\tstr = n.toString() + str.slice(m[1].length);\n\t\t\t//console.log(m[1], n, str);\n\t\t}\n\t}\n\n\tstr = circle2num(str);\n\t*/\n\n\tstr = str.replace(/\\d+/g, function ($0)\n\t{\n\t\treturn $0.padStart(padNum, '0');\n\t});\n\n\tstr = str\n\t\t.replace(/^第+/, '')\n\t\t//.replace(/(\\d)[章話]/g, '$1_')\n\t\t//.replace(/第(\\d)/g, '_$1')\n\t\t//.replace(/\\./g, '_')\n\t\t.replace(/[―—-──\\-―—─==―——─ー─]/g, '_')\n\t\t.replace(/[\\s ]/g, '_')\n\t\t.replace(/[\\(\\)〔[【《(「『』」》)】〕]〔[〕]]/g, '_')\n\t\t.replace(/[·‧・···•・·᛫•․‧∙⋅⸱⸳・ꞏ·‧・···•˙●‧﹒]/g, '_')\n\t\t.replace(/[::︰﹕:︓∶:]/ug, '_')\n\t\t.replace(/[・:,]/g, '_')\n\t\t.replace(/_+$/g, '')\n\t\t.replace(/_+/g, '_')\n\n\t;\n\n\t/*\n\tstr = zh2jp(cn2tw(str) as string, {\n\t\tsafe: false,\n\t});\n\t*/\n\n\t/*\n\tstr = zhTable.auto(cn2tw(str, {\n\t\tsafe: false,\n\t\t// @ts-ignore\n\t\tgreedyTable: true,\n\t}), {\n\t\tsafe: false,\n\t\t// @ts-ignore\n\t\tgreedyTable: true,\n\t})[0];\n\t*/\n\n\tstr = slugify(str, true);\n\n\treturn str;\n}\n\nexport default exports as typeof import('./index');\n"]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@node-novel/normalize",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.30",
|
|
4
4
|
"description": "normalize file name for sort",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"@node-novel",
|
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
"sort",
|
|
12
12
|
"strip"
|
|
13
13
|
],
|
|
14
|
-
"homepage": "https://github.com/bluelovers/ws-node-novel/tree/master/packages/node-novel-
|
|
14
|
+
"homepage": "https://github.com/bluelovers/ws-node-novel/tree/master/packages/node-novel-normalize#readme",
|
|
15
15
|
"bugs": {
|
|
16
16
|
"url": "https://github.com/bluelovers/ws-node-novel/issues"
|
|
17
17
|
},
|
|
@@ -36,14 +36,14 @@
|
|
|
36
36
|
"sort-package-json": "npx yarn-tool sort"
|
|
37
37
|
},
|
|
38
38
|
"dependencies": {
|
|
39
|
-
"@lazy-cjk/novel-filename": "^1.0.
|
|
40
|
-
"@lazy-cjk/zh-slugify": "^1.0.
|
|
41
|
-
"normalize-num": "^1.0.
|
|
42
|
-
"str-util": "^2.3.
|
|
43
|
-
"tslib": "^2
|
|
39
|
+
"@lazy-cjk/novel-filename": "^1.0.46",
|
|
40
|
+
"@lazy-cjk/zh-slugify": "^1.0.82",
|
|
41
|
+
"normalize-num": "^1.0.5",
|
|
42
|
+
"str-util": "^2.3.28",
|
|
43
|
+
"tslib": "^2"
|
|
44
44
|
},
|
|
45
45
|
"publishConfig": {
|
|
46
46
|
"access": "public"
|
|
47
47
|
},
|
|
48
|
-
"gitHead": "
|
|
48
|
+
"gitHead": "aaa1c09413d3adf36c65d58a20450c4927f0d570"
|
|
49
49
|
}
|