diff --git a/package-lock.json b/package-lock.json index ce7232ee..0ef9d732 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "augment-vir", - "version": "29.1.8", + "version": "29.1.9", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "augment-vir", - "version": "29.1.8", + "version": "29.1.9", "license": "(MIT or CC0 1.0)", "workspaces": [ "./packages/*" @@ -16521,15 +16521,15 @@ }, "packages/browser": { "name": "@augment-vir/browser", - "version": "29.1.8", + "version": "29.1.9", "license": "MIT", "dependencies": { - "@augment-vir/common": "^29.1.7", + "@augment-vir/common": "^29.1.8", "html-spec-tags": "^2.2.0", "run-time-assertions": "^1.5.1" }, "devDependencies": { - "@augment-vir/browser-testing": "^29.1.7", + "@augment-vir/browser-testing": "^29.1.8", "@open-wc/testing": "^4.0.0", "@types/chai": "^4.3.16", "@types/mocha": "^10.0.7", @@ -16548,11 +16548,11 @@ }, "packages/browser-testing": { "name": "@augment-vir/browser-testing", - "version": "29.1.8", + "version": "29.1.9", "license": "MIT", "dependencies": { - "@augment-vir/common": "^29.1.7", - "@augment-vir/testing": "^29.1.7", + "@augment-vir/common": "^29.1.8", + "@augment-vir/testing": "^29.1.8", "@open-wc/testing": "^4.0.0", "@types/mocha": "^10.0.7", "@web/test-runner-commands": "^0.9.0", @@ -16594,11 +16594,11 @@ }, "packages/chai": { "name": "@augment-vir/chai", - "version": "29.1.8", + "version": "29.1.9", "license": "MIT", "dependencies": { - "@augment-vir/common": "^29.1.7", - "@augment-vir/testing": "^29.1.7", + "@augment-vir/common": "^29.1.8", + "@augment-vir/testing": "^29.1.8", "type-fest": "^4.20.1" }, "devDependencies": { @@ -16622,7 +16622,7 @@ }, "packages/common": { "name": "@augment-vir/common", - "version": "29.1.8", + "version": "29.1.9", "license": "MIT", "dependencies": { "browser-or-node": "^3.0.0", @@ -16635,12 +16635,12 @@ }, "packages/common-tests": { "name": "@augment-vir/common-tests", - "version": "29.1.8", + "version": "29.1.9", "license": "MIT", "devDependencies": { - "@augment-vir/chai": "^29.1.7", - "@augment-vir/common": "^29.1.7", - "@augment-vir/node-js": "^29.1.7", + "@augment-vir/chai": "^29.1.8", + "@augment-vir/common": "^29.1.8", + "@augment-vir/node-js": "^29.1.8", "@electrovir/nyc": "^15.1.0-fix0", "@istanbuljs/nyc-config-typescript": "^1.0.2", "@types/chai": "^4.3.16", @@ -16682,11 +16682,11 @@ }, "packages/docker": { "name": "@augment-vir/docker", - "version": "29.1.8", + "version": "29.1.9", "license": "MIT", "dependencies": { - "@augment-vir/common": "^29.1.7", - "@augment-vir/node-js": "^29.1.7" + "@augment-vir/common": "^29.1.8", + "@augment-vir/node-js": "^29.1.8" }, "devDependencies": { "typescript": "5.5.2" @@ -16694,10 +16694,10 @@ }, "packages/node-js": { "name": "@augment-vir/node-js", - "version": "29.1.8", + "version": "29.1.9", "license": "MIT", "dependencies": { - "@augment-vir/common": "^29.1.7", + "@augment-vir/common": "^29.1.8", "ansi-colors": "^4.1.3", "axios": "^1.7.2", "fs-extra": "^11.2.0", @@ -16706,7 +16706,7 @@ "type-fest": "^4.20.1" }, "devDependencies": { - "@augment-vir/chai": "^29.1.7", + "@augment-vir/chai": "^29.1.8", "@electrovir/nyc": "^15.1.0-fix0", "@istanbuljs/nyc-config-typescript": "^1.0.2", "@types/chai": "^4.3.16", @@ -16735,11 +16735,11 @@ }, "packages/prisma-node-js": { "name": "@augment-vir/prisma-node-js", - "version": "29.1.8", + "version": "29.1.9", "license": "MIT", "dependencies": { - "@augment-vir/common": "^29.1.7", - "@augment-vir/node-js": "^29.1.7", + "@augment-vir/common": "^29.1.8", + "@augment-vir/node-js": "^29.1.8", "type-fest": "^4.20.1" }, "devDependencies": { @@ -16761,11 +16761,11 @@ }, "packages/scripts": { "name": "@augment-vir/scripts", - "version": "29.1.8", + "version": "29.1.9", "license": "MIT", "dependencies": { - "@augment-vir/common": "^29.1.7", - "@augment-vir/node-js": "^29.1.7" + "@augment-vir/common": "^29.1.8", + "@augment-vir/node-js": "^29.1.8" }, "devDependencies": { "@electrovir/nyc": "^15.1.0-fix0", @@ -16797,10 +16797,10 @@ }, "packages/testing": { "name": "@augment-vir/testing", - "version": "29.1.8", + "version": "29.1.9", "license": "MIT", "dependencies": { - "@augment-vir/common": "^29.1.7", + "@augment-vir/common": "^29.1.8", "expect-type": "^0.15.0", "type-fest": "^4.20.1" }, diff --git a/package.json b/package.json index 30df3673..3c2a4523 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "augment-vir", - "version": "29.1.8", + "version": "29.1.9", "private": true, "homepage": "https://github.com/electrovir/augment-vir", "bugs": { diff --git a/packages/browser-testing/package.json b/packages/browser-testing/package.json index b91b8217..de92698d 100644 --- a/packages/browser-testing/package.json +++ b/packages/browser-testing/package.json @@ -1,6 +1,6 @@ { "name": "@augment-vir/browser-testing", - "version": "29.1.8", + "version": "29.1.9", "homepage": "https://github.com/electrovir/augment-vir/tree/main/packages/common", "bugs": { "url": "https://github.com/electrovir/augment-vir/issues" @@ -23,8 +23,8 @@ "test:coverage": "npm test" }, "dependencies": { - "@augment-vir/common": "^29.1.8", - "@augment-vir/testing": "^29.1.8", + "@augment-vir/common": "^29.1.9", + "@augment-vir/testing": "^29.1.9", "@open-wc/testing": "^4.0.0", "@types/mocha": "^10.0.7", "@web/test-runner-commands": "^0.9.0", diff --git a/packages/browser/package.json b/packages/browser/package.json index 303bffb4..46c2d422 100644 --- a/packages/browser/package.json +++ b/packages/browser/package.json @@ -1,6 +1,6 @@ { "name": "@augment-vir/browser", - "version": "29.1.8", + "version": "29.1.9", "homepage": "https://github.com/electrovir/augment-vir/tree/main/packages/browser", "bugs": { "url": "https://github.com/electrovir/augment-vir/issues" @@ -24,12 +24,12 @@ "test:watch": "web-test-runner --color --config configs/web-test-runner.config.mjs --watch" }, "dependencies": { - "@augment-vir/common": "^29.1.8", + "@augment-vir/common": "^29.1.9", "html-spec-tags": "^2.2.0", "run-time-assertions": "^1.5.1" }, "devDependencies": { - "@augment-vir/browser-testing": "^29.1.8", + "@augment-vir/browser-testing": "^29.1.9", "@open-wc/testing": "^4.0.0", "@types/chai": "^4.3.16", "@types/mocha": "^10.0.7", diff --git a/packages/chai/package.json b/packages/chai/package.json index a3bf333b..dc4b8cc9 100644 --- a/packages/chai/package.json +++ b/packages/chai/package.json @@ -1,6 +1,6 @@ { "name": "@augment-vir/chai", - "version": "29.1.8", + "version": "29.1.9", "homepage": "https://github.com/electrovir/augment-vir/tree/main/packages/common", "bugs": { "url": "https://github.com/electrovir/augment-vir/issues" @@ -23,8 +23,8 @@ "test:coverage": "npm test" }, "dependencies": { - "@augment-vir/common": "^29.1.8", - "@augment-vir/testing": "^29.1.8", + "@augment-vir/common": "^29.1.9", + "@augment-vir/testing": "^29.1.9", "type-fest": "^4.20.1" }, "devDependencies": { diff --git a/packages/common-tests/package.json b/packages/common-tests/package.json index 5f46fc2d..e9cdeb27 100644 --- a/packages/common-tests/package.json +++ b/packages/common-tests/package.json @@ -1,6 +1,6 @@ { "name": "@augment-vir/common-tests", - "version": "29.1.8", + "version": "29.1.9", "private": true, "homepage": "https://github.com/electrovir/augment-vir/tree/main/packages/common-tests", "bugs": { @@ -22,9 +22,9 @@ "test:types": "tsc --noEmit" }, "devDependencies": { - "@augment-vir/chai": "^29.1.8", - "@augment-vir/common": "^29.1.8", - "@augment-vir/node-js": "^29.1.8", + "@augment-vir/chai": "^29.1.9", + "@augment-vir/common": "^29.1.9", + "@augment-vir/node-js": "^29.1.9", "@electrovir/nyc": "^15.1.0-fix0", "@istanbuljs/nyc-config-typescript": "^1.0.2", "@types/chai": "^4.3.16", diff --git a/packages/common-tests/src/tests/object/selection-set.test.ts b/packages/common-tests/src/tests/object/selection-set.test.ts index 999f3bd8..b561e7ae 100644 --- a/packages/common-tests/src/tests/object/selection-set.test.ts +++ b/packages/common-tests/src/tests/object/selection-set.test.ts @@ -2,6 +2,7 @@ import {itCases} from '@augment-vir/chai'; import { AnyObject, GenericSelectionSet, + PartialAndUndefined, PickCollapsedSelection, PickSelection, SelectionSet, @@ -364,6 +365,16 @@ describe('SelectionSet', () => { }>(); }); + it('allows selecting into potentially undefined properties', () => { + const test: SelectionSet> = { + top: { + mid: { + low: true, + }, + }, + }; + }); + it('combines unions', () => { assertTypeOf< SelectionSet<{ @@ -439,6 +450,28 @@ describe('PickSelection', () => { }; }>(); }); + + it('allows selecting into potentially undefined properties', () => { + assertTypeOf< + PickSelection< + PartialAndUndefined<{top: {mid: {low: string[]}}}>, + { + top: { + mid: { + low: true; + }; + }; + } + > + >().toEqualTypeOf<{ + top: + | undefined + | { + mid: {low: string[]}; + }; + }>(); + }); + it('selects through arrays', () => { assertTypeOf< PickSelection< diff --git a/packages/common/package.json b/packages/common/package.json index 1de895f9..0960e045 100644 --- a/packages/common/package.json +++ b/packages/common/package.json @@ -1,6 +1,6 @@ { "name": "@augment-vir/common", - "version": "29.1.8", + "version": "29.1.9", "homepage": "https://github.com/electrovir/augment-vir/tree/main/packages/common", "bugs": { "url": "https://github.com/electrovir/augment-vir/issues" diff --git a/packages/common/src/augments/object/selection-set.ts b/packages/common/src/augments/object/selection-set.ts index b6049c34..011882be 100644 --- a/packages/common/src/augments/object/selection-set.ts +++ b/packages/common/src/augments/object/selection-set.ts @@ -82,7 +82,7 @@ export type SelectionSet< IsAny extends true ? any : Depth extends TsTooMuchRecursion - ? ['Error: recursive object depth is too deep.'] + ? boolean : Full extends ReadonlyArray ? SelectionSet> : Partial<{ @@ -90,7 +90,11 @@ export type SelectionSet< Exclude > extends true ? boolean - : boolean | UnionToIntersection>>; + : + | UnionToIntersection< + SelectionSet[Key]>, TsRecurse> + > + | boolean; }>; export function selectFrom< diff --git a/packages/docker/package.json b/packages/docker/package.json index 0761dcf7..b73ba7d1 100644 --- a/packages/docker/package.json +++ b/packages/docker/package.json @@ -1,6 +1,6 @@ { "name": "@augment-vir/docker", - "version": "29.1.8", + "version": "29.1.9", "homepage": "https://github.com/electrovir/augment-vir/tree/main/packages/docker", "bugs": { "url": "https://github.com/electrovir/augment-vir/issues" @@ -22,8 +22,8 @@ "test:coverage": "npm test" }, "dependencies": { - "@augment-vir/common": "^29.1.8", - "@augment-vir/node-js": "^29.1.8" + "@augment-vir/common": "^29.1.9", + "@augment-vir/node-js": "^29.1.9" }, "devDependencies": { "typescript": "5.5.2" diff --git a/packages/node-js/package.json b/packages/node-js/package.json index 699a7df2..ca099acb 100644 --- a/packages/node-js/package.json +++ b/packages/node-js/package.json @@ -1,6 +1,6 @@ { "name": "@augment-vir/node-js", - "version": "29.1.8", + "version": "29.1.9", "homepage": "https://github.com/electrovir/augment-vir/tree/main/packages/node-js", "bugs": { "url": "https://github.com/electrovir/augment-vir/issues" @@ -22,7 +22,7 @@ "test:coverage": "npm test coverage" }, "dependencies": { - "@augment-vir/common": "^29.1.8", + "@augment-vir/common": "^29.1.9", "ansi-colors": "^4.1.3", "axios": "^1.7.2", "fs-extra": "^11.2.0", @@ -31,7 +31,7 @@ "type-fest": "^4.20.1" }, "devDependencies": { - "@augment-vir/chai": "^29.1.8", + "@augment-vir/chai": "^29.1.9", "@electrovir/nyc": "^15.1.0-fix0", "@istanbuljs/nyc-config-typescript": "^1.0.2", "@types/chai": "^4.3.16", diff --git a/packages/prisma-node-js/package.json b/packages/prisma-node-js/package.json index 64a7d9db..cbaaafc5 100644 --- a/packages/prisma-node-js/package.json +++ b/packages/prisma-node-js/package.json @@ -1,6 +1,6 @@ { "name": "@augment-vir/prisma-node-js", - "version": "29.1.8", + "version": "29.1.9", "homepage": "https://github.com/electrovir/augment-vir/tree/main/packages/prisma-node-js", "bugs": { "url": "https://github.com/electrovir/augment-vir/issues" @@ -22,8 +22,8 @@ "test:coverage": "npm test" }, "dependencies": { - "@augment-vir/common": "^29.1.8", - "@augment-vir/node-js": "^29.1.8", + "@augment-vir/common": "^29.1.9", + "@augment-vir/node-js": "^29.1.9", "type-fest": "^4.20.1" }, "devDependencies": { diff --git a/packages/scripts/package.json b/packages/scripts/package.json index 70043aef..52f52484 100644 --- a/packages/scripts/package.json +++ b/packages/scripts/package.json @@ -1,6 +1,6 @@ { "name": "@augment-vir/scripts", - "version": "29.1.8", + "version": "29.1.9", "private": true, "license": "MIT", "author": { @@ -14,8 +14,8 @@ "verify": "ts-node src/index.ts" }, "dependencies": { - "@augment-vir/common": "^29.1.8", - "@augment-vir/node-js": "^29.1.8" + "@augment-vir/common": "^29.1.9", + "@augment-vir/node-js": "^29.1.9" }, "devDependencies": { "@electrovir/nyc": "^15.1.0-fix0", diff --git a/packages/testing/package.json b/packages/testing/package.json index d9498d0e..4d7fa52e 100644 --- a/packages/testing/package.json +++ b/packages/testing/package.json @@ -1,6 +1,6 @@ { "name": "@augment-vir/testing", - "version": "29.1.8", + "version": "29.1.9", "homepage": "https://github.com/electrovir/augment-vir/tree/main/packages/testing", "bugs": { "url": "https://github.com/electrovir/augment-vir/issues" @@ -23,7 +23,7 @@ "test:coverage": "npm test coverage" }, "dependencies": { - "@augment-vir/common": "^29.1.8", + "@augment-vir/common": "^29.1.9", "expect-type": "^0.15.0", "type-fest": "^4.20.1" },