@saihu/common 1.1.8 → 1.1.10
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/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -0
- package/dist/util/chn-initials.d.ts +2 -0
- package/dist/util/chn-initials.d.ts.map +1 -0
- package/dist/util/chn-initials.js +15 -0
- package/dist/util/index.d.ts +3 -0
- package/dist/util/index.d.ts.map +1 -0
- package/dist/util/index.js +18 -0
- package/dist/util/payload.util.d.ts +2 -0
- package/dist/util/payload.util.d.ts.map +1 -0
- package/dist/util/payload.util.js +6 -0
- package/package.json +3 -2
package/dist/index.d.ts
CHANGED
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,OAAO,CAAC;AACtB,cAAc,gBAAgB,CAAC;AAC/B,cAAc,WAAW,CAAC;AAC1B,cAAc,QAAQ,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,OAAO,CAAC;AACtB,cAAc,gBAAgB,CAAC;AAC/B,cAAc,WAAW,CAAC;AAC1B,cAAc,QAAQ,CAAC;AACvB,cAAc,QAAQ,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"chn-initials.d.ts","sourceRoot":"","sources":["../../src/util/chn-initials.ts"],"names":[],"mappings":"AAEA,wBAAgB,WAAW,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAUhD"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.chnInitials = chnInitials;
|
|
4
|
+
const pinyin_pro_1 = require("pinyin-pro");
|
|
5
|
+
function chnInitials(text) {
|
|
6
|
+
return text
|
|
7
|
+
.split('')
|
|
8
|
+
.map((char) => {
|
|
9
|
+
if (/[\u4e00-\u9fa5]/.test(char)) {
|
|
10
|
+
return (0, pinyin_pro_1.pinyin)(char, { pattern: 'initial' });
|
|
11
|
+
}
|
|
12
|
+
return char; // preserve symbols like '-' or spaces
|
|
13
|
+
})
|
|
14
|
+
.join('');
|
|
15
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/util/index.ts"],"names":[],"mappings":"AAAA,cAAc,gBAAgB,CAAC;AAC/B,cAAc,gBAAgB,CAAC"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./payload.util"), exports);
|
|
18
|
+
__exportStar(require("./chn-initials"), exports);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"payload.util.d.ts","sourceRoot":"","sources":["../../src/util/payload.util.ts"],"names":[],"mappings":"AAAA,wBAAgB,YAAY,CAAC,CAAC,GAAG,GAAG,EAAE,OAAO,EAAE,MAAM,GAAG,CAAC,GAAG,CAAC,CAE5D"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@saihu/common",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.10",
|
|
4
4
|
"description": "Common utilities for NestJS applications",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -30,6 +30,7 @@
|
|
|
30
30
|
"dependencies": {
|
|
31
31
|
"@nestjs/core": "^11.1.1",
|
|
32
32
|
"@nestjs/jwt": "^11.0.0",
|
|
33
|
-
"express": "^5.1.0"
|
|
33
|
+
"express": "^5.1.0",
|
|
34
|
+
"pinyin-pro": "^3.26.0"
|
|
34
35
|
}
|
|
35
36
|
}
|