@bhsd/common 0.14.1 → 0.15.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/dist/index.d.ts +1 -1
- package/dist/index.js +5 -3
- package/dist/index.mjs +5 -3
- package/dist/stylelint.d.ts +3 -3
- package/eslintrc.browser.cjs +10 -0
- package/package.json +11 -11
package/dist/index.d.ts
CHANGED
|
@@ -5,7 +5,7 @@ declare type ConfigGetter = () => Promise<ConfigData>;
|
|
|
5
5
|
declare global {
|
|
6
6
|
const define: unknown;
|
|
7
7
|
}
|
|
8
|
-
export declare const CDN = "https://testingcf.jsdelivr.net";
|
|
8
|
+
export declare const CDN = "https://testingcf.jsdelivr.net", wmf = "wiktionary|wiki(?:pedia|books|news|quote|source|versity|voyage)";
|
|
9
9
|
/**
|
|
10
10
|
* 解码HTML实体
|
|
11
11
|
* @param str 要解码的字符串
|
package/dist/index.js
CHANGED
|
@@ -34,11 +34,12 @@ __export(index_exports, {
|
|
|
34
34
|
sanitizeInlineStyle: () => sanitizeInlineStyle,
|
|
35
35
|
setI18N: () => setI18N,
|
|
36
36
|
setObject: () => setObject,
|
|
37
|
-
splitColors: () => splitColors
|
|
37
|
+
splitColors: () => splitColors,
|
|
38
|
+
wmf: () => wmf
|
|
38
39
|
});
|
|
39
40
|
module.exports = __toCommonJS(index_exports);
|
|
40
41
|
var define_LANGS_default = ["zh-hans", "zh-hant"];
|
|
41
|
-
const CDN = "https://testingcf.jsdelivr.net";
|
|
42
|
+
const CDN = "https://testingcf.jsdelivr.net", wmf = "wiktionary|wiki(?:pedia|books|news|quote|source|versity|voyage)";
|
|
42
43
|
const textarea = /* @__PURE__ */ (() => typeof document === "object" ? document.createElement("textarea") : void 0)();
|
|
43
44
|
const decodeHTML = (str) => {
|
|
44
45
|
textarea.innerHTML = str;
|
|
@@ -177,8 +178,9 @@ const refreshStdout = (str) => {
|
|
|
177
178
|
process.stdout.write(`\x1B[K\x1B[?7l${str}\x1B[?7h\r`);
|
|
178
179
|
};
|
|
179
180
|
function getRegex(f) {
|
|
181
|
+
const map = /* @__PURE__ */ new Map(), weakMap = /* @__PURE__ */ new WeakMap();
|
|
180
182
|
return (s) => {
|
|
181
|
-
const regexp =
|
|
183
|
+
const regexp = typeof s === "string" ? map : weakMap;
|
|
182
184
|
if (regexp.has(s)) {
|
|
183
185
|
const re2 = regexp.get(s);
|
|
184
186
|
re2.lastIndex = 0;
|
package/dist/index.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
var define_LANGS_default = ["zh-hans", "zh-hant"];
|
|
2
|
-
const CDN = "https://testingcf.jsdelivr.net";
|
|
2
|
+
const CDN = "https://testingcf.jsdelivr.net", wmf = "wiktionary|wiki(?:pedia|books|news|quote|source|versity|voyage)";
|
|
3
3
|
const textarea = /* @__PURE__ */ (() => typeof document === "object" ? document.createElement("textarea") : void 0)();
|
|
4
4
|
const decodeHTML = (str) => {
|
|
5
5
|
textarea.innerHTML = str;
|
|
@@ -138,8 +138,9 @@ const refreshStdout = (str) => {
|
|
|
138
138
|
process.stdout.write(`\x1B[K\x1B[?7l${str}\x1B[?7h\r`);
|
|
139
139
|
};
|
|
140
140
|
function getRegex(f) {
|
|
141
|
+
const map = /* @__PURE__ */ new Map(), weakMap = /* @__PURE__ */ new WeakMap();
|
|
141
142
|
return (s) => {
|
|
142
|
-
const regexp =
|
|
143
|
+
const regexp = typeof s === "string" ? map : weakMap;
|
|
143
144
|
if (regexp.has(s)) {
|
|
144
145
|
const re2 = regexp.get(s);
|
|
145
146
|
re2.lastIndex = 0;
|
|
@@ -168,5 +169,6 @@ export {
|
|
|
168
169
|
sanitizeInlineStyle,
|
|
169
170
|
setI18N,
|
|
170
171
|
setObject,
|
|
171
|
-
splitColors
|
|
172
|
+
splitColors,
|
|
173
|
+
wmf
|
|
172
174
|
};
|
package/dist/stylelint.d.ts
CHANGED
|
@@ -3,8 +3,8 @@ import type { PublicApi, Warning, Config } from 'stylelint';
|
|
|
3
3
|
* 使用Stylelint检查CSS代码
|
|
4
4
|
* @param stylelint Stylelint实例
|
|
5
5
|
* @param code CSS代码
|
|
6
|
-
* @param
|
|
6
|
+
* @param additionalConfig 额外的规则
|
|
7
7
|
* @param fix 是否修正
|
|
8
8
|
*/
|
|
9
|
-
export declare function styleLint(stylelint: PublicApi, code: string,
|
|
10
|
-
export declare function styleLint(stylelint: PublicApi, code: string,
|
|
9
|
+
export declare function styleLint(stylelint: PublicApi, code: string, additionalConfig?: Config | Config['rules'] | null, fix: true): Promise<string>;
|
|
10
|
+
export declare function styleLint(stylelint: PublicApi, code: string, additionalConfig?: Config | Config['rules'] | null): Promise<Warning[]>;
|
package/eslintrc.browser.cjs
CHANGED
|
@@ -23,13 +23,23 @@ module.exports = {
|
|
|
23
23
|
'es-x/no-array-prototype-with': 2,
|
|
24
24
|
'es-x/no-error-cause': 2,
|
|
25
25
|
'es-x/no-map-groupby': 2,
|
|
26
|
+
'es-x/no-math-f16round': 2,
|
|
26
27
|
'es-x/no-object-groupby': 2,
|
|
27
28
|
'es-x/no-object-hasown': 2,
|
|
28
29
|
'es-x/no-promise-any': 2,
|
|
30
|
+
'es-x/no-promise-try': 2,
|
|
29
31
|
'es-x/no-promise-withresolvers': 2,
|
|
30
32
|
'es-x/no-regexp-d-flag': 2,
|
|
33
|
+
'es-x/no-regexp-escape': 2,
|
|
31
34
|
'es-x/no-regexp-lookbehind-assertions': 2,
|
|
32
35
|
'es-x/no-regexp-v-flag': 2,
|
|
36
|
+
'es-x/no-set-prototype-difference': 2,
|
|
37
|
+
'es-x/no-set-prototype-intersection': 2,
|
|
38
|
+
'es-x/no-set-prototype-isdisjointfrom': 2,
|
|
39
|
+
'es-x/no-set-prototype-issubsetof': 2,
|
|
40
|
+
'es-x/no-set-prototype-issupersetof': 2,
|
|
41
|
+
'es-x/no-set-prototype-symmetricdifference': 2,
|
|
42
|
+
'es-x/no-set-prototype-union': 2,
|
|
33
43
|
'es-x/no-string-prototype-at': 2,
|
|
34
44
|
'es-x/no-string-prototype-iswellformed': 2,
|
|
35
45
|
'es-x/no-string-prototype-replaceall': 2,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@bhsd/common",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.15.0",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"author": "Bhsd",
|
|
6
6
|
"files": [
|
|
@@ -47,21 +47,21 @@
|
|
|
47
47
|
"@stylistic/eslint-plugin": "^3.1.0",
|
|
48
48
|
"@stylistic/stylelint-plugin": "^3.1.2",
|
|
49
49
|
"@types/mocha": "^10.0.10",
|
|
50
|
-
"@types/node": "^24.0.
|
|
51
|
-
"@typescript-eslint/eslint-plugin": "^8.
|
|
52
|
-
"@typescript-eslint/parser": "^8.
|
|
53
|
-
"esbuild": "^0.25.
|
|
50
|
+
"@types/node": "^24.0.10",
|
|
51
|
+
"@typescript-eslint/eslint-plugin": "^8.35.1",
|
|
52
|
+
"@typescript-eslint/parser": "^8.35.1",
|
|
53
|
+
"esbuild": "^0.25.5",
|
|
54
54
|
"eslint": "^8.57.1",
|
|
55
|
-
"eslint-plugin-es-x": "^8.
|
|
55
|
+
"eslint-plugin-es-x": "^8.7.0",
|
|
56
56
|
"eslint-plugin-eslint-comments": "^3.2.0",
|
|
57
|
-
"eslint-plugin-jsdoc": "^51.3.
|
|
57
|
+
"eslint-plugin-jsdoc": "^51.3.3",
|
|
58
58
|
"eslint-plugin-json-es": "^1.6.0",
|
|
59
|
-
"eslint-plugin-n": "^17.
|
|
59
|
+
"eslint-plugin-n": "^17.20.0",
|
|
60
60
|
"eslint-plugin-promise": "^7.2.1",
|
|
61
|
-
"eslint-plugin-regexp": "^2.
|
|
61
|
+
"eslint-plugin-regexp": "^2.9.0",
|
|
62
62
|
"eslint-plugin-unicorn": "^56.0.1",
|
|
63
|
-
"stylelint": "^16.21.
|
|
63
|
+
"stylelint": "^16.21.1",
|
|
64
64
|
"typescript": "^5.8.2",
|
|
65
|
-
"wikiparser-node": "^1.21.
|
|
65
|
+
"wikiparser-node": "^1.21.3"
|
|
66
66
|
}
|
|
67
67
|
}
|