diff --git a/package-lock.json b/package-lock.json index 99a5f5a0..c9d04318 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "augment-vir", - "version": "29.1.5", + "version": "29.1.6", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "augment-vir", - "version": "29.1.5", + "version": "29.1.6", "license": "(MIT or CC0 1.0)", "workspaces": [ "./packages/*" @@ -16521,15 +16521,15 @@ }, "packages/browser": { "name": "@augment-vir/browser", - "version": "29.1.5", + "version": "29.1.6", "license": "MIT", "dependencies": { - "@augment-vir/common": "^29.1.4", + "@augment-vir/common": "^29.1.5", "html-spec-tags": "^2.2.0", "run-time-assertions": "^1.5.1" }, "devDependencies": { - "@augment-vir/browser-testing": "^29.1.4", + "@augment-vir/browser-testing": "^29.1.5", "@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.5", + "version": "29.1.6", "license": "MIT", "dependencies": { - "@augment-vir/common": "^29.1.4", - "@augment-vir/testing": "^29.1.4", + "@augment-vir/common": "^29.1.5", + "@augment-vir/testing": "^29.1.5", "@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.5", + "version": "29.1.6", "license": "MIT", "dependencies": { - "@augment-vir/common": "^29.1.4", - "@augment-vir/testing": "^29.1.4", + "@augment-vir/common": "^29.1.5", + "@augment-vir/testing": "^29.1.5", "type-fest": "^4.20.1" }, "devDependencies": { @@ -16622,7 +16622,7 @@ }, "packages/common": { "name": "@augment-vir/common", - "version": "29.1.5", + "version": "29.1.6", "license": "MIT", "dependencies": { "browser-or-node": "^3.0.0", @@ -16635,12 +16635,12 @@ }, "packages/common-tests": { "name": "@augment-vir/common-tests", - "version": "29.1.5", + "version": "29.1.6", "license": "MIT", "devDependencies": { - "@augment-vir/chai": "^29.1.4", - "@augment-vir/common": "^29.1.4", - "@augment-vir/node-js": "^29.1.4", + "@augment-vir/chai": "^29.1.5", + "@augment-vir/common": "^29.1.5", + "@augment-vir/node-js": "^29.1.5", "@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.5", + "version": "29.1.6", "license": "MIT", "dependencies": { - "@augment-vir/common": "^29.1.4", - "@augment-vir/node-js": "^29.1.4" + "@augment-vir/common": "^29.1.5", + "@augment-vir/node-js": "^29.1.5" }, "devDependencies": { "typescript": "5.5.2" @@ -16694,10 +16694,10 @@ }, "packages/node-js": { "name": "@augment-vir/node-js", - "version": "29.1.5", + "version": "29.1.6", "license": "MIT", "dependencies": { - "@augment-vir/common": "^29.1.4", + "@augment-vir/common": "^29.1.5", "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.4", + "@augment-vir/chai": "^29.1.5", "@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.5", + "version": "29.1.6", "license": "MIT", "dependencies": { - "@augment-vir/common": "^29.1.4", - "@augment-vir/node-js": "^29.1.4", + "@augment-vir/common": "^29.1.5", + "@augment-vir/node-js": "^29.1.5", "type-fest": "^4.20.1" }, "devDependencies": { @@ -16761,11 +16761,11 @@ }, "packages/scripts": { "name": "@augment-vir/scripts", - "version": "29.1.5", + "version": "29.1.6", "license": "MIT", "dependencies": { - "@augment-vir/common": "^29.1.4", - "@augment-vir/node-js": "^29.1.4" + "@augment-vir/common": "^29.1.5", + "@augment-vir/node-js": "^29.1.5" }, "devDependencies": { "@electrovir/nyc": "^15.1.0-fix0", @@ -16797,10 +16797,10 @@ }, "packages/testing": { "name": "@augment-vir/testing", - "version": "29.1.5", + "version": "29.1.6", "license": "MIT", "dependencies": { - "@augment-vir/common": "^29.1.4", + "@augment-vir/common": "^29.1.5", "expect-type": "^0.15.0", "type-fest": "^4.20.1" }, diff --git a/package.json b/package.json index 138122c0..0c6c22e4 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "augment-vir", - "version": "29.1.5", + "version": "29.1.6", "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 a4ab05de..244403d6 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.5", + "version": "29.1.6", "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.5", - "@augment-vir/testing": "^29.1.5", + "@augment-vir/common": "^29.1.6", + "@augment-vir/testing": "^29.1.6", "@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 edc1695e..77140132 100644 --- a/packages/browser/package.json +++ b/packages/browser/package.json @@ -1,6 +1,6 @@ { "name": "@augment-vir/browser", - "version": "29.1.5", + "version": "29.1.6", "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.5", + "@augment-vir/common": "^29.1.6", "html-spec-tags": "^2.2.0", "run-time-assertions": "^1.5.1" }, "devDependencies": { - "@augment-vir/browser-testing": "^29.1.5", + "@augment-vir/browser-testing": "^29.1.6", "@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 2067e728..452d7ecb 100644 --- a/packages/chai/package.json +++ b/packages/chai/package.json @@ -1,6 +1,6 @@ { "name": "@augment-vir/chai", - "version": "29.1.5", + "version": "29.1.6", "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.5", - "@augment-vir/testing": "^29.1.5", + "@augment-vir/common": "^29.1.6", + "@augment-vir/testing": "^29.1.6", "type-fest": "^4.20.1" }, "devDependencies": { diff --git a/packages/common-tests/package.json b/packages/common-tests/package.json index 0a7a619b..aee204fa 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.5", + "version": "29.1.6", "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.5", - "@augment-vir/common": "^29.1.5", - "@augment-vir/node-js": "^29.1.5", + "@augment-vir/chai": "^29.1.6", + "@augment-vir/common": "^29.1.6", + "@augment-vir/node-js": "^29.1.6", "@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/object-entries.test.ts b/packages/common-tests/src/tests/object/object-entries.test.ts index 5961231d..f0334cbf 100644 --- a/packages/common-tests/src/tests/object/object-entries.test.ts +++ b/packages/common-tests/src/tests/object/object-entries.test.ts @@ -113,7 +113,7 @@ describe(getObjectTypedEntries.name, () => { }, ]); - it('has proper types', () => { + it('merges all entries into unions', () => { const exampleObject = { hi: 'hi', bye: 5, @@ -124,6 +124,20 @@ describe(getObjectTypedEntries.name, () => { ['bye' | 'hi' | 'somethingElse', string | number | RegExp][] >(); }); + + it('handles optional properties', () => { + const exampleObject = {} as Partial>; + + assertTypeOf(getObjectTypedEntries(exampleObject)).toEqualTypeOf<[Planet, string][]>(); + }); + + it('handles nullable properties', () => { + const exampleObject = {} as Partial>; + + assertTypeOf(getObjectTypedEntries(exampleObject)).toEqualTypeOf< + [Planet, string | undefined][] + >(); + }); }); describe(getObjectTypedKeys.name, () => { @@ -180,6 +194,18 @@ describe(getObjectTypedValues.name, () => { ], }, ]); + + it('handles optional properties', () => { + const exampleObject = {} as Partial>; + + assertTypeOf(getObjectTypedValues(exampleObject)).toEqualTypeOf(); + }); + + it('handles nullable properties', () => { + const exampleObject = {} as Partial>; + + assertTypeOf(getObjectTypedValues(exampleObject)).toEqualTypeOf<(string | undefined)[]>(); + }); }); describe(getEntriesSortedByKey.name, () => { diff --git a/packages/common/package.json b/packages/common/package.json index 43553fed..fc054dc6 100644 --- a/packages/common/package.json +++ b/packages/common/package.json @@ -1,6 +1,6 @@ { "name": "@augment-vir/common", - "version": "29.1.5", + "version": "29.1.6", "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/object-entries.ts b/packages/common/src/augments/object/object-entries.ts index 0a2a3177..194cee19 100644 --- a/packages/common/src/augments/object/object-entries.ts +++ b/packages/common/src/augments/object/object-entries.ts @@ -26,7 +26,7 @@ export function getObjectTypedKeys( export function getObjectTypedValues( input: ObjectGeneric, -): ObjectGeneric[keyof ObjectGeneric][] { +): Required[keyof ObjectGeneric][] { return getObjectTypedKeys(input).map( (key) => input[key], ) as ObjectGeneric[keyof ObjectGeneric][]; @@ -34,7 +34,7 @@ export function getObjectTypedValues( export function getObjectTypedEntries( input: ObjectGeneric, -): [keyof ObjectGeneric, ObjectGeneric[keyof ObjectGeneric]][] { +): [keyof ObjectGeneric, Required[keyof ObjectGeneric]][] { return getObjectTypedKeys(input).map((key) => [ key, input[key], diff --git a/packages/docker/package.json b/packages/docker/package.json index 70ab0fc7..6e631aa3 100644 --- a/packages/docker/package.json +++ b/packages/docker/package.json @@ -1,6 +1,6 @@ { "name": "@augment-vir/docker", - "version": "29.1.5", + "version": "29.1.6", "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.5", - "@augment-vir/node-js": "^29.1.5" + "@augment-vir/common": "^29.1.6", + "@augment-vir/node-js": "^29.1.6" }, "devDependencies": { "typescript": "5.5.2" diff --git a/packages/node-js/package.json b/packages/node-js/package.json index 8c092ec2..b2e63c58 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.5", + "version": "29.1.6", "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.5", + "@augment-vir/common": "^29.1.6", "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.5", + "@augment-vir/chai": "^29.1.6", "@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 617ba3f3..a422d46e 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.5", + "version": "29.1.6", "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.5", - "@augment-vir/node-js": "^29.1.5", + "@augment-vir/common": "^29.1.6", + "@augment-vir/node-js": "^29.1.6", "type-fest": "^4.20.1" }, "devDependencies": { diff --git a/packages/scripts/package.json b/packages/scripts/package.json index 391a2bf9..28626f61 100644 --- a/packages/scripts/package.json +++ b/packages/scripts/package.json @@ -1,6 +1,6 @@ { "name": "@augment-vir/scripts", - "version": "29.1.5", + "version": "29.1.6", "private": true, "license": "MIT", "author": { @@ -14,8 +14,8 @@ "verify": "ts-node src/index.ts" }, "dependencies": { - "@augment-vir/common": "^29.1.5", - "@augment-vir/node-js": "^29.1.5" + "@augment-vir/common": "^29.1.6", + "@augment-vir/node-js": "^29.1.6" }, "devDependencies": { "@electrovir/nyc": "^15.1.0-fix0", diff --git a/packages/testing/package.json b/packages/testing/package.json index 77a83fc0..310d4574 100644 --- a/packages/testing/package.json +++ b/packages/testing/package.json @@ -1,6 +1,6 @@ { "name": "@augment-vir/testing", - "version": "29.1.5", + "version": "29.1.6", "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.5", + "@augment-vir/common": "^29.1.6", "expect-type": "^0.15.0", "type-fest": "^4.20.1" },