@mrxsys/mrx-core 2.9.0 → 2.10.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.
@@ -0,0 +1,9 @@
1
+ /**
2
+ * Adds a specified prefix to all keys in an object type.
3
+ *
4
+ * @template T - The original object type extending object
5
+ * @template Prefix - The prefix to add to each key
6
+ */
7
+ export type AddPrefixToAllKeys<T extends object, Prefix extends string> = {
8
+ [K in keyof T as K extends string ? `${Prefix}${K}` : never]: T[K];
9
+ };
@@ -1,3 +1,4 @@
1
+ export type { AddPrefixToAllKeys } from './add-prefix-to-all-key';
1
2
  export type { RenameKey } from './rename-key';
2
3
  export type { StreamWithAsyncIterable } from './stream-with-async-iterable';
3
4
  export type { TFlatten } from './tflatten';
@@ -1,10 +1,10 @@
1
1
  /**
2
2
  * Renames a key in an object type while preserving all other properties.
3
3
  *
4
- * @template T - The original object type
4
+ * @template T - The original object type extending object
5
5
  * @template From - The key to rename (must exist in T)
6
6
  * @template To - The new key name
7
7
  */
8
- export type RenameKey<T, From extends keyof T, To extends PropertyKey> = {
8
+ export type RenameKey<T extends object, From extends keyof T, To extends PropertyKey> = {
9
9
  [K in keyof T as K extends From ? To : K]: T[K];
10
10
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mrxsys/mrx-core",
3
- "version": "2.9.0",
3
+ "version": "2.10.0",
4
4
  "author": "Ruby",
5
5
  "devDependencies": {
6
6
  "@eslint/js": "^9.36.0",