capitalsix-data-table 0.1.1 → 0.1.2
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/README.md +1 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +4 -4
- package/dist/index.d.ts +4 -4
- package/dist/index.js.map +1 -1
- package/package.json +3 -13
package/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# DataTable
|
|
2
2
|
|
|
3
|
-
A lightweight, framework-agnostic in-memory data table with fully typed CRUD operations. Use it anywhere you need to manage a collection of objects: plain TypeScript, Node.js, React state handlers,
|
|
3
|
+
A lightweight, framework-agnostic in-memory data table with fully typed CRUD operations. Use it anywhere you need to manage a collection of objects: plain TypeScript, Node.js, React state handlers, etc.
|
|
4
4
|
|
|
5
5
|
## Features
|
|
6
6
|
|
package/dist/index.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/index.ts","../src/DataTable.ts"],"sourcesContent":["export { DataTable, type IDataTable } from './DataTable';\n","/**\r\n * Minimal initializer contract for replacing all rows in the table.\r\n */\r\nexport interface IDataTableInitial<T extends object> {\r\n /**\r\n * Replaces all current rows with the provided rows.\r\n */\r\n setRows: (rows: T[]) => void;\r\n}\r\n\r\n/**\r\n * Result of an upsert operation.\r\n * `inserted` contains rows that did not exist yet.\r\n * `updated` contains rows that matched an existing primary key.\r\n */\r\nexport interface
|
|
1
|
+
{"version":3,"sources":["../src/index.ts","../src/DataTable.ts"],"sourcesContent":["export { DataTable, type IDataTable } from './DataTable';\n","/**\r\n * Minimal initializer contract for replacing all rows in the table.\r\n */\r\nexport interface IDataTableInitial<T extends object> {\r\n /**\r\n * Replaces all current rows with the provided rows.\r\n */\r\n setRows: (rows: T[]) => void;\r\n}\r\n\r\n/**\r\n * Result of an upsert operation.\r\n * `inserted` contains rows that did not exist yet.\r\n * `updated` contains rows that matched an existing primary key.\r\n */\r\nexport interface IDataTableUpsertResult<T extends object> {\r\n inserted: T[];\r\n updated: T[];\r\n}\r\n\r\n/**\r\n * Table-like CRUD and query operations for in-memory rows.\r\n */\r\nexport interface IDataTable<T extends object> {\r\n /**\r\n * Returns all rows, or only rows matching the predicate when provided.\r\n */\r\n getRows: (predicate?: (row: T) => boolean) => T[];\r\n\r\n /**\r\n * Appends rows to the table.\r\n * When `primaryKey` is provided, the method validates that no incoming key\r\n * already exists in the current table.\r\n */\r\n insertRows: (rows: T[], primaryKey?: keyof T) => void;\r\n\r\n /**\r\n * Updates all rows that match `predicate`.\r\n *\r\n * - When `update` is a function, the function mutates each matched row.\r\n * - When `update` is an object, `primaryKey` is required and preserved on each row.\r\n *\r\n * Returns the matched rows by reference (already reflecting any applied mutations).\r\n */\r\n updateRows: (\r\n predicate: (row: T) => boolean,\r\n update: T | ((updateRow: T) => void),\r\n primaryKey?: keyof T) => T[];\r\n\r\n /**\r\n * Upserts rows by `primaryKey`.\r\n *\r\n * - If a matching key exists, the existing row is updated in place.\r\n * - If no matching key exists, the row is inserted.\r\n *\r\n * Returns a `IDataTableUpsertResult` where:\r\n * - `updated` contains the incoming rows that matched existing keys.\r\n * - `inserted` contains the incoming rows that were newly added.\r\n */\r\n upsertRows: (rows: T[], primaryKey: keyof T) => IDataTableUpsertResult<T>;\r\n\r\n /**\r\n * Deletes matching rows and returns the deleted rows.\r\n */\r\n deleteRows: (predicate: (row: T) => boolean) => T[];\r\n \r\n /**\r\n * Sorts rows in place with the provided compare function.\r\n */\r\n sortRows: (compareFn: (a: T, b: T) => number) => void;\r\n}\r\n\r\n/**\r\n * Generic in-memory data table with mutable row operations.\r\n */\r\nexport class DataTable<T extends object> implements IDataTable<T>, IDataTableInitial<T> {\r\n private rows: T[] = [];\r\n\r\n public constructor(initialRows: T[] = []) {\r\n this.rows = initialRows;\r\n }\r\n\r\n public getRows = (predicate?: (row: T) => boolean): T[] => {\r\n return predicate ? this.rows.filter(predicate) : this.rows;\r\n };\r\n\r\n public setRows = (newRows: T[]): void => {\r\n this.rows.length = 0;\r\n this.rows.push(...newRows);\r\n };\r\n\r\n public insertRows = (newRows: T[], primaryKey?: keyof T): void => {\r\n if (primaryKey) {\r\n // Reject insert when any incoming row key already exists in the current table.\r\n if (this.rows.some(row => newRows.findIndex(r => r[primaryKey] === row[primaryKey]) !== -1))\r\n {\r\n throw new Error(\r\n `Duplicate primary key value found in existing rows for key: ${String(primaryKey)}`);\r\n }\r\n }\r\n this.rows.push(...newRows);\r\n };\r\n\r\n public updateRows = (\r\n predicate: (row: T) => boolean,\r\n update: T | ((updateRow: T) => void),\r\n primaryKey?: keyof T): T[] => {\r\n // Keep references to matched rows; these objects are mutated in place below.\r\n const updatedRows: T[] = this.rows.filter(predicate);\r\n\r\n let updateFunction: (updateRow: T) => void;\r\n if (typeof update === 'function') {\r\n updateFunction = update as (updateRow: T) => void;\r\n } else if (primaryKey === undefined) {\r\n throw new Error('Primary key must be provided when update is an object.');\r\n } else {\r\n // Preserve the original primary key when doing object-style updates.\r\n updateFunction = (updateRow: T): void => {\r\n Object.assign(updateRow, { ...update, [primaryKey!]: updateRow[primaryKey!] });\r\n };\r\n }\r\n\r\n for (let i = 0; i < this.rows.length; i++) {\r\n if (predicate(this.rows[i])) {\r\n updateFunction(this.rows[i]);\r\n }\r\n }\r\n\r\n return updatedRows;\r\n };\r\n\r\n public upsertRows = (newRows: T[], primaryKey: keyof T): IDataTableUpsertResult<T> => {\r\n const result: IDataTableUpsertResult<T> = { inserted: [], updated: [] };\r\n // Index existing rows by primary key for efficient upsert lookup.\r\n const existingRowsMap = new Map(this.rows.map(row => [ row[primaryKey], row ]));\r\n for (const newRow of newRows) {\r\n const key = newRow[primaryKey];\r\n if (existingRowsMap.has(key)) {\r\n Object.assign(existingRowsMap.get(key)!, newRow);\r\n result.updated.push(newRow);\r\n } else {\r\n this.rows.push(newRow);\r\n result.inserted.push(newRow);\r\n }\r\n }\r\n return result;\r\n };\r\n\r\n public deleteRows = (predicate: (row: T) => boolean): T[] => {\r\n const deletedRows = this.rows.filter(predicate);\r\n\r\n // Iterate backwards to safely remove items from the same array.\r\n for (let i = this.rows.length - 1; i >= 0; i--) {\r\n if (predicate(this.rows[i])) {\r\n this.rows.splice(i, 1);\r\n }\r\n }\r\n\r\n return deletedRows;\r\n };\r\n\r\n public sortRows = (compareFn: (a: T, b: T) => number): void => {\r\n this.rows.sort(compareFn);\r\n };\r\n}\r\n\r\nexport default DataTable;\r\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;;;AC2EO,IAAM,YAAN,MAAiF;AAAA,EAG/E,YAAY,cAAmB,CAAC,GAAG;AAF1C,SAAQ,OAAY,CAAC;AAMrB,SAAO,UAAU,CAAC,cAAyC;AACzD,aAAO,YAAY,KAAK,KAAK,OAAO,SAAS,IAAI,KAAK;AAAA,IACxD;AAEA,SAAO,UAAU,CAAC,YAAuB;AACvC,WAAK,KAAK,SAAS;AACnB,WAAK,KAAK,KAAK,GAAG,OAAO;AAAA,IAC3B;AAEA,SAAO,aAAa,CAAC,SAAc,eAA+B;AAChE,UAAI,YAAY;AAEd,YAAI,KAAK,KAAK,KAAK,SAAO,QAAQ,UAAU,OAAK,EAAE,UAAU,MAAM,IAAI,UAAU,CAAC,MAAM,EAAE,GAC1F;AACE,gBAAM,IAAI;AAAA,YACR,+DAA+D,OAAO,UAAU,CAAC;AAAA,UAAE;AAAA,QACvF;AAAA,MACF;AACA,WAAK,KAAK,KAAK,GAAG,OAAO;AAAA,IAC3B;AAEA,SAAO,aAAa,CAClB,WACA,QACA,eAA8B;AAE9B,YAAM,cAAmB,KAAK,KAAK,OAAO,SAAS;AAEnD,UAAI;AACJ,UAAI,OAAO,WAAW,YAAY;AAChC,yBAAiB;AAAA,MACnB,WAAW,eAAe,QAAW;AACnC,cAAM,IAAI,MAAM,wDAAwD;AAAA,MAC1E,OAAO;AAEL,yBAAiB,CAAC,cAAuB;AACvC,iBAAO,OAAO,WAAW,EAAE,GAAG,QAA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12
|
* `inserted` contains rows that did not exist yet.
|
|
13
13
|
* `updated` contains rows that matched an existing primary key.
|
|
14
14
|
*/
|
|
15
|
-
interface
|
|
15
|
+
interface IDataTableUpsertResult<T extends object> {
|
|
16
16
|
inserted: T[];
|
|
17
17
|
updated: T[];
|
|
18
18
|
}
|
|
@@ -45,11 +45,11 @@ interface IDataTable<T extends object> {
|
|
|
45
45
|
* - If a matching key exists, the existing row is updated in place.
|
|
46
46
|
* - If no matching key exists, the row is inserted.
|
|
47
47
|
*
|
|
48
|
-
* Returns a `
|
|
48
|
+
* Returns a `IDataTableUpsertResult` where:
|
|
49
49
|
* - `updated` contains the incoming rows that matched existing keys.
|
|
50
50
|
* - `inserted` contains the incoming rows that were newly added.
|
|
51
51
|
*/
|
|
52
|
-
upsertRows: (rows: T[], primaryKey: keyof T) =>
|
|
52
|
+
upsertRows: (rows: T[], primaryKey: keyof T) => IDataTableUpsertResult<T>;
|
|
53
53
|
/**
|
|
54
54
|
* Deletes matching rows and returns the deleted rows.
|
|
55
55
|
*/
|
|
@@ -69,7 +69,7 @@ declare class DataTable<T extends object> implements IDataTable<T>, IDataTableIn
|
|
|
69
69
|
setRows: (newRows: T[]) => void;
|
|
70
70
|
insertRows: (newRows: T[], primaryKey?: keyof T) => void;
|
|
71
71
|
updateRows: (predicate: (row: T) => boolean, update: T | ((updateRow: T) => void), primaryKey?: keyof T) => T[];
|
|
72
|
-
upsertRows: (newRows: T[], primaryKey: keyof T) =>
|
|
72
|
+
upsertRows: (newRows: T[], primaryKey: keyof T) => IDataTableUpsertResult<T>;
|
|
73
73
|
deleteRows: (predicate: (row: T) => boolean) => T[];
|
|
74
74
|
sortRows: (compareFn: (a: T, b: T) => number) => void;
|
|
75
75
|
}
|
package/dist/index.d.ts
CHANGED
|
@@ -12,7 +12,7 @@ interface IDataTableInitial<T extends object> {
|
|
|
12
12
|
* `inserted` contains rows that did not exist yet.
|
|
13
13
|
* `updated` contains rows that matched an existing primary key.
|
|
14
14
|
*/
|
|
15
|
-
interface
|
|
15
|
+
interface IDataTableUpsertResult<T extends object> {
|
|
16
16
|
inserted: T[];
|
|
17
17
|
updated: T[];
|
|
18
18
|
}
|
|
@@ -45,11 +45,11 @@ interface IDataTable<T extends object> {
|
|
|
45
45
|
* - If a matching key exists, the existing row is updated in place.
|
|
46
46
|
* - If no matching key exists, the row is inserted.
|
|
47
47
|
*
|
|
48
|
-
* Returns a `
|
|
48
|
+
* Returns a `IDataTableUpsertResult` where:
|
|
49
49
|
* - `updated` contains the incoming rows that matched existing keys.
|
|
50
50
|
* - `inserted` contains the incoming rows that were newly added.
|
|
51
51
|
*/
|
|
52
|
-
upsertRows: (rows: T[], primaryKey: keyof T) =>
|
|
52
|
+
upsertRows: (rows: T[], primaryKey: keyof T) => IDataTableUpsertResult<T>;
|
|
53
53
|
/**
|
|
54
54
|
* Deletes matching rows and returns the deleted rows.
|
|
55
55
|
*/
|
|
@@ -69,7 +69,7 @@ declare class DataTable<T extends object> implements IDataTable<T>, IDataTableIn
|
|
|
69
69
|
setRows: (newRows: T[]) => void;
|
|
70
70
|
insertRows: (newRows: T[], primaryKey?: keyof T) => void;
|
|
71
71
|
updateRows: (predicate: (row: T) => boolean, update: T | ((updateRow: T) => void), primaryKey?: keyof T) => T[];
|
|
72
|
-
upsertRows: (newRows: T[], primaryKey: keyof T) =>
|
|
72
|
+
upsertRows: (newRows: T[], primaryKey: keyof T) => IDataTableUpsertResult<T>;
|
|
73
73
|
deleteRows: (predicate: (row: T) => boolean) => T[];
|
|
74
74
|
sortRows: (compareFn: (a: T, b: T) => number) => void;
|
|
75
75
|
}
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/DataTable.ts"],"sourcesContent":["/**\r\n * Minimal initializer contract for replacing all rows in the table.\r\n */\r\nexport interface IDataTableInitial<T extends object> {\r\n /**\r\n * Replaces all current rows with the provided rows.\r\n */\r\n setRows: (rows: T[]) => void;\r\n}\r\n\r\n/**\r\n * Result of an upsert operation.\r\n * `inserted` contains rows that did not exist yet.\r\n * `updated` contains rows that matched an existing primary key.\r\n */\r\nexport interface
|
|
1
|
+
{"version":3,"sources":["../src/DataTable.ts"],"sourcesContent":["/**\r\n * Minimal initializer contract for replacing all rows in the table.\r\n */\r\nexport interface IDataTableInitial<T extends object> {\r\n /**\r\n * Replaces all current rows with the provided rows.\r\n */\r\n setRows: (rows: T[]) => void;\r\n}\r\n\r\n/**\r\n * Result of an upsert operation.\r\n * `inserted` contains rows that did not exist yet.\r\n * `updated` contains rows that matched an existing primary key.\r\n */\r\nexport interface IDataTableUpsertResult<T extends object> {\r\n inserted: T[];\r\n updated: T[];\r\n}\r\n\r\n/**\r\n * Table-like CRUD and query operations for in-memory rows.\r\n */\r\nexport interface IDataTable<T extends object> {\r\n /**\r\n * Returns all rows, or only rows matching the predicate when provided.\r\n */\r\n getRows: (predicate?: (row: T) => boolean) => T[];\r\n\r\n /**\r\n * Appends rows to the table.\r\n * When `primaryKey` is provided, the method validates that no incoming key\r\n * already exists in the current table.\r\n */\r\n insertRows: (rows: T[], primaryKey?: keyof T) => void;\r\n\r\n /**\r\n * Updates all rows that match `predicate`.\r\n *\r\n * - When `update` is a function, the function mutates each matched row.\r\n * - When `update` is an object, `primaryKey` is required and preserved on each row.\r\n *\r\n * Returns the matched rows by reference (already reflecting any applied mutations).\r\n */\r\n updateRows: (\r\n predicate: (row: T) => boolean,\r\n update: T | ((updateRow: T) => void),\r\n primaryKey?: keyof T) => T[];\r\n\r\n /**\r\n * Upserts rows by `primaryKey`.\r\n *\r\n * - If a matching key exists, the existing row is updated in place.\r\n * - If no matching key exists, the row is inserted.\r\n *\r\n * Returns a `IDataTableUpsertResult` where:\r\n * - `updated` contains the incoming rows that matched existing keys.\r\n * - `inserted` contains the incoming rows that were newly added.\r\n */\r\n upsertRows: (rows: T[], primaryKey: keyof T) => IDataTableUpsertResult<T>;\r\n\r\n /**\r\n * Deletes matching rows and returns the deleted rows.\r\n */\r\n deleteRows: (predicate: (row: T) => boolean) => T[];\r\n \r\n /**\r\n * Sorts rows in place with the provided compare function.\r\n */\r\n sortRows: (compareFn: (a: T, b: T) => number) => void;\r\n}\r\n\r\n/**\r\n * Generic in-memory data table with mutable row operations.\r\n */\r\nexport class DataTable<T extends object> implements IDataTable<T>, IDataTableInitial<T> {\r\n private rows: T[] = [];\r\n\r\n public constructor(initialRows: T[] = []) {\r\n this.rows = initialRows;\r\n }\r\n\r\n public getRows = (predicate?: (row: T) => boolean): T[] => {\r\n return predicate ? this.rows.filter(predicate) : this.rows;\r\n };\r\n\r\n public setRows = (newRows: T[]): void => {\r\n this.rows.length = 0;\r\n this.rows.push(...newRows);\r\n };\r\n\r\n public insertRows = (newRows: T[], primaryKey?: keyof T): void => {\r\n if (primaryKey) {\r\n // Reject insert when any incoming row key already exists in the current table.\r\n if (this.rows.some(row => newRows.findIndex(r => r[primaryKey] === row[primaryKey]) !== -1))\r\n {\r\n throw new Error(\r\n `Duplicate primary key value found in existing rows for key: ${String(primaryKey)}`);\r\n }\r\n }\r\n this.rows.push(...newRows);\r\n };\r\n\r\n public updateRows = (\r\n predicate: (row: T) => boolean,\r\n update: T | ((updateRow: T) => void),\r\n primaryKey?: keyof T): T[] => {\r\n // Keep references to matched rows; these objects are mutated in place below.\r\n const updatedRows: T[] = this.rows.filter(predicate);\r\n\r\n let updateFunction: (updateRow: T) => void;\r\n if (typeof update === 'function') {\r\n updateFunction = update as (updateRow: T) => void;\r\n } else if (primaryKey === undefined) {\r\n throw new Error('Primary key must be provided when update is an object.');\r\n } else {\r\n // Preserve the original primary key when doing object-style updates.\r\n updateFunction = (updateRow: T): void => {\r\n Object.assign(updateRow, { ...update, [primaryKey!]: updateRow[primaryKey!] });\r\n };\r\n }\r\n\r\n for (let i = 0; i < this.rows.length; i++) {\r\n if (predicate(this.rows[i])) {\r\n updateFunction(this.rows[i]);\r\n }\r\n }\r\n\r\n return updatedRows;\r\n };\r\n\r\n public upsertRows = (newRows: T[], primaryKey: keyof T): IDataTableUpsertResult<T> => {\r\n const result: IDataTableUpsertResult<T> = { inserted: [], updated: [] };\r\n // Index existing rows by primary key for efficient upsert lookup.\r\n const existingRowsMap = new Map(this.rows.map(row => [ row[primaryKey], row ]));\r\n for (const newRow of newRows) {\r\n const key = newRow[primaryKey];\r\n if (existingRowsMap.has(key)) {\r\n Object.assign(existingRowsMap.get(key)!, newRow);\r\n result.updated.push(newRow);\r\n } else {\r\n this.rows.push(newRow);\r\n result.inserted.push(newRow);\r\n }\r\n }\r\n return result;\r\n };\r\n\r\n public deleteRows = (predicate: (row: T) => boolean): T[] => {\r\n const deletedRows = this.rows.filter(predicate);\r\n\r\n // Iterate backwards to safely remove items from the same array.\r\n for (let i = this.rows.length - 1; i >= 0; i--) {\r\n if (predicate(this.rows[i])) {\r\n this.rows.splice(i, 1);\r\n }\r\n }\r\n\r\n return deletedRows;\r\n };\r\n\r\n public sortRows = (compareFn: (a: T, b: T) => number): void => {\r\n this.rows.sort(compareFn);\r\n };\r\n}\r\n\r\nexport default DataTable;\r\n"],"mappings":";AA2EO,IAAM,YAAN,MAAiF;AAAA,EAG/E,YAAY,cAAmB,CAAC,GAAG;AAF1C,SAAQ,OAAY,CAAC;AAMrB,SAAO,UAAU,CAAC,cAAyC;AACzD,aAAO,YAAY,KAAK,KAAK,OAAO,SAAS,IAAI,KAAK;AAAA,IACxD;AAEA,SAAO,UAAU,CAAC,YAAuB;AACvC,WAAK,KAAK,SAAS;AACnB,WAAK,KAAK,KAAK,GAAG,OAAO;AAAA,IAC3B;AAEA,SAAO,aAAa,CAAC,SAAc,eAA+B;AAChE,UAAI,YAAY;AAEd,YAAI,KAAK,KAAK,KAAK,SAAO,QAAQ,UAAU,OAAK,EAAE,UAAU,MAAM,IAAI,UAAU,CAAC,MAAM,EAAE,GAC1F;AACE,gBAAM,IAAI;AAAA,YACR,+DAA+D,OAAO,UAAU,CAAC;AAAA,UAAE;AAAA,QACvF;AAAA,MACF;AACA,WAAK,KAAK,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C,YAAI,UAAU,KAAK,KAAK,CAAC,CAAC,GAAG;AAC3B,eAAK,KAAK,OAAO,GAAG,CAAC;AAAA,QACvB;AAAA,MACF;AAEA,aAAO;AAAA,IACT;AAEA,SAAO,WAAW,CAAC,cAA4C;AAC7D,WAAK,KAAK,KAAK,SAAS;AAAA,IAC1B;AApFE,SAAK,OAAO;AAAA,EACd;AAoFF;","names":[]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "capitalsix-data-table",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.2",
|
|
4
4
|
"description": "A lightweight, framework-agnostic in-memory data table with typed CRUD operations: insert, update, upsert, delete, sort, and query rows.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|
|
@@ -24,7 +24,7 @@
|
|
|
24
24
|
"url": "https://capitalsix.nl"
|
|
25
25
|
},
|
|
26
26
|
"repository": {
|
|
27
|
-
"url": "https://github.com/capital-six/data-table"
|
|
27
|
+
"url": "https://github.com/capital-six/capitalsix-data-table"
|
|
28
28
|
},
|
|
29
29
|
"keywords": [
|
|
30
30
|
"react",
|
|
@@ -45,24 +45,14 @@
|
|
|
45
45
|
"typecheck": "tsc --noEmit",
|
|
46
46
|
"prepack": "npmignore --auto"
|
|
47
47
|
},
|
|
48
|
-
"peerDependencies": {
|
|
49
|
-
"react": "^18.3.1",
|
|
50
|
-
"react-dom": "^18.3.1"
|
|
51
|
-
},
|
|
52
48
|
"devDependencies": {
|
|
53
49
|
"@testing-library/jest-dom": "^6.4.8",
|
|
54
|
-
"@testing-library/react": "^16.0.1",
|
|
55
50
|
"@types/node": "^22.10.2",
|
|
56
|
-
"@types/react": "^18.3.1",
|
|
57
|
-
"@types/react-dom": "^18.3.1",
|
|
58
|
-
"@vitejs/plugin-react": "^5.0.0",
|
|
59
51
|
"jsdom": "^25.0.1",
|
|
52
|
+
"npmignore": "^0.3.5",
|
|
60
53
|
"tsup": "^8.3.5",
|
|
61
54
|
"typescript": "^5.7.3",
|
|
62
55
|
"vite": "^6.0.5",
|
|
63
56
|
"vitest": "^2.1.8"
|
|
64
|
-
},
|
|
65
|
-
"dependencies": {
|
|
66
|
-
"npmignore": "^0.3.5"
|
|
67
57
|
}
|
|
68
58
|
}
|