@bhsd/common 0.9.1 → 0.9.3

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/cm.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import type { Config } from 'wikiparser-node/base';
1
+ import type { ConfigData } from 'wikiparser-node/dist/base';
2
2
  export interface MwConfig {
3
3
  readonly tags: Record<string, true>;
4
4
  tagModes: Record<string, string>;
@@ -30,7 +30,7 @@ export declare const getConfig: (magicWords: MagicWord[], rule: MagicRule, flip?
30
30
  * @param minConfig 基础Config
31
31
  * @param mwConfig MwConfig
32
32
  */
33
- export declare const getParserConfig: (minConfig: Config, mwConfig: MwConfig) => Config;
33
+ export declare const getParserConfig: (minConfig: ConfigData, mwConfig: MwConfig) => ConfigData;
34
34
  /**
35
35
  * 获取语言变体
36
36
  * @param variants 语言变体列表
package/dist/index.js CHANGED
@@ -48,10 +48,10 @@ const normalizeTitle = (title) => {
48
48
  };
49
49
  const numToHex = (d) => Math.round(d * 255).toString(16).padStart(2, "0");
50
50
  const regex = /* @__PURE__ */ (() => {
51
- const hexColor = String.raw`#(?:[\da-f]{3,4}|(?:[\da-f]{2}){3,4})(?![\p{L}\d_])`, rgbValue = String.raw`(?:\d*\.)?\d+%?`, hue = String.raw`(?:\d*\.)?\d+(?:deg|grad|rad|turn)?`, rgbColor = String.raw`rgba?\(\s*(?:${String.raw`${new Array(3).fill(rgbValue).join(String.raw`\s+`)}(?:\s*\/\s*${rgbValue})?`}|${String.raw`${new Array(3).fill(rgbValue).join(String.raw`\s*,\s*`)}(?:\s*,\s*${rgbValue})?`})\s*\)`, hslColor = String.raw`hsla?\(\s*(?:${String.raw`${hue}\s+${rgbValue}\s+${rgbValue}(?:\s*\/\s*${rgbValue})?`}|${String.raw`${hue}${String.raw`\s*,\s*(?:\d*\.)?\d+%`.repeat(2)}(?:\s*,\s*${rgbValue})?`})\s*\)`;
51
+ const hexColor = String.raw`#(?:[\da-f]{3,4}|(?:[\da-f]{2}){3,4})(?![\p{L}\p{N}_])`, rgbValue = String.raw`(?:\d*\.)?\d+%?`, hue = String.raw`(?:\d*\.)?\d+(?:deg|grad|rad|turn)?`, rgbColor = String.raw`rgba?\(\s*(?:${String.raw`${new Array(3).fill(rgbValue).join(String.raw`\s+`)}(?:\s*\/\s*${rgbValue})?`}|${String.raw`${new Array(3).fill(rgbValue).join(String.raw`\s*,\s*`)}(?:\s*,\s*${rgbValue})?`})\s*\)`, hslColor = String.raw`hsla?\(\s*(?:${String.raw`${hue}\s+${rgbValue}\s+${rgbValue}(?:\s*\/\s*${rgbValue})?`}|${String.raw`${hue}${String.raw`\s*,\s*(?:\d*\.)?\d+%`.repeat(2)}(?:\s*,\s*${rgbValue})?`})\s*\)`;
52
52
  return {
53
- full: new RegExp(String.raw`(^|[^\p{L}\d_])(${hexColor}|${rgbColor}|${hslColor})`, "giu"),
54
- rgb: new RegExp(String.raw`(^|[^\p{L}\d_])(${hexColor}|${rgbColor})`, "giu")
53
+ full: new RegExp(String.raw`(^|[^\p{L}\p{N}_])(${hexColor}|${rgbColor}|${hslColor})`, "giu"),
54
+ rgb: new RegExp(String.raw`(^|[^\p{L}\p{N}_])(${hexColor}|${rgbColor})`, "giu")
55
55
  };
56
56
  })();
57
57
  const splitColors = (str, hsl = true) => {
package/dist/index.mjs CHANGED
@@ -11,10 +11,10 @@ const normalizeTitle = (title) => {
11
11
  };
12
12
  const numToHex = (d) => Math.round(d * 255).toString(16).padStart(2, "0");
13
13
  const regex = /* @__PURE__ */ (() => {
14
- const hexColor = String.raw`#(?:[\da-f]{3,4}|(?:[\da-f]{2}){3,4})(?![\p{L}\d_])`, rgbValue = String.raw`(?:\d*\.)?\d+%?`, hue = String.raw`(?:\d*\.)?\d+(?:deg|grad|rad|turn)?`, rgbColor = String.raw`rgba?\(\s*(?:${String.raw`${new Array(3).fill(rgbValue).join(String.raw`\s+`)}(?:\s*\/\s*${rgbValue})?`}|${String.raw`${new Array(3).fill(rgbValue).join(String.raw`\s*,\s*`)}(?:\s*,\s*${rgbValue})?`})\s*\)`, hslColor = String.raw`hsla?\(\s*(?:${String.raw`${hue}\s+${rgbValue}\s+${rgbValue}(?:\s*\/\s*${rgbValue})?`}|${String.raw`${hue}${String.raw`\s*,\s*(?:\d*\.)?\d+%`.repeat(2)}(?:\s*,\s*${rgbValue})?`})\s*\)`;
14
+ const hexColor = String.raw`#(?:[\da-f]{3,4}|(?:[\da-f]{2}){3,4})(?![\p{L}\p{N}_])`, rgbValue = String.raw`(?:\d*\.)?\d+%?`, hue = String.raw`(?:\d*\.)?\d+(?:deg|grad|rad|turn)?`, rgbColor = String.raw`rgba?\(\s*(?:${String.raw`${new Array(3).fill(rgbValue).join(String.raw`\s+`)}(?:\s*\/\s*${rgbValue})?`}|${String.raw`${new Array(3).fill(rgbValue).join(String.raw`\s*,\s*`)}(?:\s*,\s*${rgbValue})?`})\s*\)`, hslColor = String.raw`hsla?\(\s*(?:${String.raw`${hue}\s+${rgbValue}\s+${rgbValue}(?:\s*\/\s*${rgbValue})?`}|${String.raw`${hue}${String.raw`\s*,\s*(?:\d*\.)?\d+%`.repeat(2)}(?:\s*,\s*${rgbValue})?`})\s*\)`;
15
15
  return {
16
- full: new RegExp(String.raw`(^|[^\p{L}\d_])(${hexColor}|${rgbColor}|${hslColor})`, "giu"),
17
- rgb: new RegExp(String.raw`(^|[^\p{L}\d_])(${hexColor}|${rgbColor})`, "giu")
16
+ full: new RegExp(String.raw`(^|[^\p{L}\p{N}_])(${hexColor}|${rgbColor}|${hslColor})`, "giu"),
17
+ rgb: new RegExp(String.raw`(^|[^\p{L}\p{N}_])(${hexColor}|${rgbColor})`, "giu")
18
18
  };
19
19
  })();
20
20
  const splitColors = (str, hsl = true) => {
package/eslintrc.cjs CHANGED
@@ -720,6 +720,7 @@ module.exports = {
720
720
  '@stylistic/quotes': 0,
721
721
  strict: 0,
722
722
  'unicorn/prefer-string-raw': 0,
723
+ 'unicorn/numeric-separators-style': 0,
723
724
  },
724
725
  },
725
726
  {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bhsd/common",
3
- "version": "0.9.1",
3
+ "version": "0.9.3",
4
4
  "license": "MIT",
5
5
  "author": "Bhsd",
6
6
  "files": [
@@ -46,9 +46,9 @@
46
46
  "@stylistic/stylelint-plugin": "^3.1.2",
47
47
  "@types/mocha": "^10.0.10",
48
48
  "@types/node": "^22.13.1",
49
- "@typescript-eslint/eslint-plugin": "^8.23.0",
50
- "@typescript-eslint/parser": "^8.23.0",
51
- "esbuild": "^0.25.0",
49
+ "@typescript-eslint/eslint-plugin": "^8.29.0",
50
+ "@typescript-eslint/parser": "^8.29.0",
51
+ "esbuild": "^0.25.2",
52
52
  "eslint": "^8.57.1",
53
53
  "eslint-plugin-es-x": "^8.4.1",
54
54
  "eslint-plugin-eslint-comments": "^3.2.0",
@@ -62,7 +62,7 @@
62
62
  "http-server": "^14.1.1",
63
63
  "mocha": "^11.1.0",
64
64
  "stylelint": "^16.14.1",
65
- "typescript": "^5.7.3",
66
- "wikiparser-node": "^1.18.3"
65
+ "typescript": "^5.8.2",
66
+ "wikiparser-node": "^1.19.0"
67
67
  }
68
68
  }