ts-type 3.0.17 → 3.0.18

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 CHANGED
@@ -3,6 +3,21 @@
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
+ ## [3.0.18](https://github.com/bluelovers/ws-ts-type/compare/ts-type@3.0.17...ts-type@3.0.18) (2026-09-27)
7
+
8
+
9
+
10
+ ### 🐛 Bug Fixes
11
+
12
+ * **string-composition:** 修正 ITSStringLiteralPrefixedRecord 泛型參數傳遞錯誤 ([4125b4e](https://github.com/bluelovers/ws-ts-type/commit/4125b4ede86a67fe334fb66479acd299fd503960))
13
+
14
+
15
+ ### 🛠 Build System
16
+
17
+ * **release:** update generated files ([1cc9935](https://github.com/bluelovers/ws-ts-type/commit/1cc9935b91c928fae284cd26d3bd641793dd0119))
18
+
19
+
20
+
6
21
  ## [3.0.17](https://github.com/bluelovers/ws-ts-type/compare/ts-type@3.0.16...ts-type@3.0.17) (2026-09-27)
7
22
 
8
23
 
@@ -45,7 +45,7 @@ export type ITSStringLiteralSuffixed<Name extends ITSTemplateLiteralAllowedType,
45
45
  * // }
46
46
  */
47
47
  export type ITSStringLiteralPrefixedRecord<Name extends string, Prefix extends ITSTemplateLiteralAllowedType> = {
48
- [K in Name]: ITSStringLiteralPrefixed<Prefix, K>;
48
+ [K in Name]: ITSStringLiteralPrefixed<K, Prefix>;
49
49
  };
50
50
  /**
51
51
  * 以 Name 聯集的每個成員為鍵,建立其值為「鍵名 + 後綴」的對應記錄型別
@@ -1 +1 @@
1
- {"version":3,"file":"string-composition.js","sourceRoot":"","sources":["string-composition.ts"],"names":[],"mappings":"","sourcesContent":["/*\n * 字串字面量組合工具\n * String Literal Composition Utilities\n *\n * 以 EnumStatusAttr(枚舉狀態屬性)為例的組合流程 / composition flow:\n *\n * EnumStatusAttr\n * │\n * ├──────────────┐\n * │ │\n * ▼ ▼\n * Name Union PrefixedRecord\n * │ │\n * │ └── STR → UpSTR\n * │ INT → UpINT\n * │ DEX → UpDEX\n * │\n * ▼\n * PrefixedUnion\n * │\n * └── 'UpSTR' | 'UpINT' | 'UpDEX' | ...\n */\nimport { ITSTemplateLiteralAllowedType, ITSToStringLiteral } from \"../string\";\n\n/**\n * 將字串字面量加上前綴,組合成新的字串字面量\n * Combines a prefix with a name into a new string literal.\n *\n * 當 Name 為聯集時,結果會對應展開為聯集\n * When Name is a union, the result expands to a union accordingly.\n *\n * @example\n * type A = ITSStringLiteralPrefixed<\"STR\", \"Up\">;\n * // type A = \"UpSTR\"\n *\n * @example\n * type B = ITSStringLiteralPrefixed<\"STR\" | \"INT\", \"Up\">;\n * // type B = \"UpSTR\" | \"UpINT\"\n */\nexport type ITSStringLiteralPrefixed<\n\tName extends ITSTemplateLiteralAllowedType,\n\tPrefix extends ITSTemplateLiteralAllowedType,\n> = `${Prefix}${Name}`;\n\n/**\n * 將字串字面量加上後綴,組合成新的字串字面量\n * Combines a name with a suffix into a new string literal.\n *\n * 當 Name 為聯集時,結果會對應展開為聯集\n * When Name is a union, the result expands to a union accordingly.\n *\n * @example\n * type A = ITSStringLiteralSuffixed<\"STR\", \"Status\">;\n * // type A = \"STRStatus\"\n *\n * @example\n * type B = ITSStringLiteralSuffixed<\"STR\" | \"INT\", \"Status\">;\n * // type B = \"STRStatus\" | \"INTStatus\"\n */\nexport type ITSStringLiteralSuffixed<\n\tName extends ITSTemplateLiteralAllowedType,\n\tSuffix extends ITSTemplateLiteralAllowedType,\n> = `${Name}${Suffix}`;\n\n/**\n * 以 Name 聯集的每個成員為鍵,建立其值為「前綴 + 鍵名」的對應記錄型別\n * Builds a record whose keys are the members of the Name union and\n * whose values are the prefixed string literal of each key.\n *\n * @example\n * type T = ITSStringLiteralPrefixedRecord<\"STR\" | \"INT\" | \"DEX\", \"Up\">;\n * // type T = {\n * // STR: \"UpSTR\";\n * // INT: \"UpINT\";\n * // DEX: \"UpDEX\";\n * // }\n */\nexport type ITSStringLiteralPrefixedRecord<\n\tName extends string,\n\tPrefix extends ITSTemplateLiteralAllowedType,\n> = {\n\t[K in Name]: ITSStringLiteralPrefixed<Prefix, K>;\n};\n\n/**\n * 以 Name 聯集的每個成員為鍵,建立其值為「鍵名 + 後綴」的對應記錄型別\n * Builds a record whose keys are the members of the Name union and\n * whose values are the suffixed string literal of each key.\n *\n * @example\n * type T = ITSStringLiteralSuffixedRecord<\"STR\" | \"INT\", \"Status\">;\n * // type T = {\n * // STR: \"STRStatus\";\n * // INT: \"INTStatus\";\n * // }\n */\nexport type ITSStringLiteralSuffixedRecord<\n\tName extends string,\n\tSuffix extends ITSTemplateLiteralAllowedType,\n> = {\n\t[K in Name]: ITSStringLiteralSuffixed<K, Suffix>;\n};\n\n/**\n * 以 Name 聯集為基礎,透過 KeyMap 重新映射鍵名、並以 ValueMap 指定\n * 對應的值型別,建立一組自訂的對應記錄型別\n * Builds a custom mapped record from the Name union, remapping each\n * key via KeyMap and assigning the value type from ValueMap.\n *\n * @example\n * type Name = \"STR\" | \"INT\" | \"DEX\";\n * type KeyMap = { STR: \"str\"; INT: \"int\"; DEX: \"dex\" };\n * type ValueMap = { STR: number; INT: number; DEX: number };\n *\n * type T = ITSRecordMap<Name, KeyMap, ValueMap>;\n * // type T = {\n * // str: number;\n * // int: number;\n * // dex: number;\n * // }\n *\n * @example\n * 當 ValueMap 的值型別為 string 時:\n * type Name = \"STR\" | \"INT\" | \"DEX\";\n * type KeyMap = { STR: \"str\"; INT: \"int\"; DEX: \"dex\" };\n * type ValueMap = { STR: string; INT: string; DEX: string };\n *\n * type T = ITSRecordMap<Name, KeyMap, ValueMap>;\n * // type T = {\n * // str: string;\n * // int: string;\n * // dex: string;\n * // }\n *\n * @example\n * 當 ValueMap 的值型別為物件型別時:\n * type Name = \"STR\" | \"INT\" | \"DEX\";\n * type KeyMap = { STR: \"str\"; INT: \"int\"; DEX: \"dex\" };\n * type ValueMap = {\n * STR: { label: string; value: number };\n * INT: { label: string; value: number };\n * DEX: { label: string; value: number };\n * };\n *\n * type T = ITSRecordMap<Name, KeyMap, ValueMap>;\n * // type T = {\n * // str: { label: string; value: number };\n * // int: { label: string; value: number };\n * // dex: { label: string; value: number };\n * // }\n */\nexport type ITSRecordMap<\n\tName extends ITSTemplateLiteralAllowedType,\n\tKeyMap extends Record<ITSToStringLiteral<Name>, PropertyKey>,\n\tValueMap extends Record<ITSToStringLiteral<Name>, unknown>,\n> = {\n\t[K in ITSToStringLiteral<Name> as KeyMap[K]]:\n\t\tValueMap[K];\n};\n"]}
1
+ {"version":3,"file":"string-composition.js","sourceRoot":"","sources":["string-composition.ts"],"names":[],"mappings":"","sourcesContent":["/*\n * 字串字面量組合工具\n * String Literal Composition Utilities\n *\n * 以 EnumStatusAttr(枚舉狀態屬性)為例的組合流程 / composition flow:\n *\n * EnumStatusAttr\n * │\n * ├──────────────┐\n * │ │\n * ▼ ▼\n * Name Union PrefixedRecord\n * │ │\n * │ └── STR → UpSTR\n * │ INT → UpINT\n * │ DEX → UpDEX\n * │\n * ▼\n * PrefixedUnion\n * │\n * └── 'UpSTR' | 'UpINT' | 'UpDEX' | ...\n */\nimport { ITSTemplateLiteralAllowedType, ITSToStringLiteral } from \"../string\";\n\n/**\n * 將字串字面量加上前綴,組合成新的字串字面量\n * Combines a prefix with a name into a new string literal.\n *\n * 當 Name 為聯集時,結果會對應展開為聯集\n * When Name is a union, the result expands to a union accordingly.\n *\n * @example\n * type A = ITSStringLiteralPrefixed<\"STR\", \"Up\">;\n * // type A = \"UpSTR\"\n *\n * @example\n * type B = ITSStringLiteralPrefixed<\"STR\" | \"INT\", \"Up\">;\n * // type B = \"UpSTR\" | \"UpINT\"\n */\nexport type ITSStringLiteralPrefixed<\n\tName extends ITSTemplateLiteralAllowedType,\n\tPrefix extends ITSTemplateLiteralAllowedType,\n> = `${Prefix}${Name}`;\n\n/**\n * 將字串字面量加上後綴,組合成新的字串字面量\n * Combines a name with a suffix into a new string literal.\n *\n * 當 Name 為聯集時,結果會對應展開為聯集\n * When Name is a union, the result expands to a union accordingly.\n *\n * @example\n * type A = ITSStringLiteralSuffixed<\"STR\", \"Status\">;\n * // type A = \"STRStatus\"\n *\n * @example\n * type B = ITSStringLiteralSuffixed<\"STR\" | \"INT\", \"Status\">;\n * // type B = \"STRStatus\" | \"INTStatus\"\n */\nexport type ITSStringLiteralSuffixed<\n\tName extends ITSTemplateLiteralAllowedType,\n\tSuffix extends ITSTemplateLiteralAllowedType,\n> = `${Name}${Suffix}`;\n\n/**\n * 以 Name 聯集的每個成員為鍵,建立其值為「前綴 + 鍵名」的對應記錄型別\n * Builds a record whose keys are the members of the Name union and\n * whose values are the prefixed string literal of each key.\n *\n * @example\n * type T = ITSStringLiteralPrefixedRecord<\"STR\" | \"INT\" | \"DEX\", \"Up\">;\n * // type T = {\n * // STR: \"UpSTR\";\n * // INT: \"UpINT\";\n * // DEX: \"UpDEX\";\n * // }\n */\nexport type ITSStringLiteralPrefixedRecord<\n\tName extends string,\n\tPrefix extends ITSTemplateLiteralAllowedType,\n> = {\n\t[K in Name]: ITSStringLiteralPrefixed<K, Prefix>;\n};\n\n/**\n * 以 Name 聯集的每個成員為鍵,建立其值為「鍵名 + 後綴」的對應記錄型別\n * Builds a record whose keys are the members of the Name union and\n * whose values are the suffixed string literal of each key.\n *\n * @example\n * type T = ITSStringLiteralSuffixedRecord<\"STR\" | \"INT\", \"Status\">;\n * // type T = {\n * // STR: \"STRStatus\";\n * // INT: \"INTStatus\";\n * // }\n */\nexport type ITSStringLiteralSuffixedRecord<\n\tName extends string,\n\tSuffix extends ITSTemplateLiteralAllowedType,\n> = {\n\t[K in Name]: ITSStringLiteralSuffixed<K, Suffix>;\n};\n\n/**\n * 以 Name 聯集為基礎,透過 KeyMap 重新映射鍵名、並以 ValueMap 指定\n * 對應的值型別,建立一組自訂的對應記錄型別\n * Builds a custom mapped record from the Name union, remapping each\n * key via KeyMap and assigning the value type from ValueMap.\n *\n * @example\n * type Name = \"STR\" | \"INT\" | \"DEX\";\n * type KeyMap = { STR: \"str\"; INT: \"int\"; DEX: \"dex\" };\n * type ValueMap = { STR: number; INT: number; DEX: number };\n *\n * type T = ITSRecordMap<Name, KeyMap, ValueMap>;\n * // type T = {\n * // str: number;\n * // int: number;\n * // dex: number;\n * // }\n *\n * @example\n * 當 ValueMap 的值型別為 string 時:\n * type Name = \"STR\" | \"INT\" | \"DEX\";\n * type KeyMap = { STR: \"str\"; INT: \"int\"; DEX: \"dex\" };\n * type ValueMap = { STR: string; INT: string; DEX: string };\n *\n * type T = ITSRecordMap<Name, KeyMap, ValueMap>;\n * // type T = {\n * // str: string;\n * // int: string;\n * // dex: string;\n * // }\n *\n * @example\n * 當 ValueMap 的值型別為物件型別時:\n * type Name = \"STR\" | \"INT\" | \"DEX\";\n * type KeyMap = { STR: \"str\"; INT: \"int\"; DEX: \"dex\" };\n * type ValueMap = {\n * STR: { label: string; value: number };\n * INT: { label: string; value: number };\n * DEX: { label: string; value: number };\n * };\n *\n * type T = ITSRecordMap<Name, KeyMap, ValueMap>;\n * // type T = {\n * // str: { label: string; value: number };\n * // int: { label: string; value: number };\n * // dex: { label: string; value: number };\n * // }\n */\nexport type ITSRecordMap<\n\tName extends ITSTemplateLiteralAllowedType,\n\tKeyMap extends Record<ITSToStringLiteral<Name>, PropertyKey>,\n\tValueMap extends Record<ITSToStringLiteral<Name>, unknown>,\n> = {\n\t[K in ITSToStringLiteral<Name> as KeyMap[K]]:\n\t\tValueMap[K];\n};\n"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ts-type",
3
- "version": "3.0.17",
3
+ "version": "3.0.18",
4
4
  "description": "TypeScript 類型工具庫:提供豐富的類型操作工具和重新導出的內建類型 / TypeScript type utility library: provides rich type manipulation utilities and re-exported built-in types",
5
5
  "keywords": [
6
6
  ".d.ts",
@@ -95,10 +95,10 @@
95
95
  "typedarray-dts": "^1.0.0"
96
96
  },
97
97
  "devDependencies": {
98
- "@ts-type/object-freeze": "^1.0.17"
98
+ "@ts-type/object-freeze": "^1.0.18"
99
99
  },
100
100
  "peerDependencies": {
101
101
  "ts-toolbelt": "^9.6.0"
102
102
  },
103
- "gitHead": "5c1f001f22adc4bb3159fafc74742e61d457e0ab"
103
+ "gitHead": "f65a3f8ec0a02c9312a5805422f1025a318f6280"
104
104
  }