Skip to content

Commit

Permalink
[patch] allow any type parameter for KeyCount
Browse files Browse the repository at this point in the history
  • Loading branch information
electrovir committed Dec 26, 2024
1 parent 1e05bd3 commit 89426c9
Show file tree
Hide file tree
Showing 11 changed files with 50 additions and 50 deletions.
48 changes: 24 additions & 24 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@augment-vir/mono-repo-root",
"version": "31.2.0",
"version": "31.2.1",
"private": true,
"homepage": "https://github.com/electrovir/augment-vir",
"bugs": {
Expand Down
4 changes: 2 additions & 2 deletions packages/assert/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@augment-vir/assert",
"version": "31.2.0",
"version": "31.2.1",
"description": "A collection of assertions for test and production code alike.",
"keywords": [
"augment",
Expand Down Expand Up @@ -41,7 +41,7 @@
"test:update": "npm test"
},
"dependencies": {
"@augment-vir/core": "^31.2.0",
"@augment-vir/core": "^31.2.1",
"@date-vir/duration": "^7.0.1",
"deep-eql": "^5.0.2",
"expect-type": "^1.1.0",
Expand Down
6 changes: 3 additions & 3 deletions packages/common/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@augment-vir/common",
"version": "31.2.0",
"version": "31.2.1",
"description": "A collection of augments, helpers types, functions, and classes for any JavaScript environment.",
"keywords": [
"augment",
Expand Down Expand Up @@ -39,8 +39,8 @@
"test:web": "virmator --no-deps test web"
},
"dependencies": {
"@augment-vir/assert": "^31.2.0",
"@augment-vir/core": "^31.2.0",
"@augment-vir/assert": "^31.2.1",
"@augment-vir/core": "^31.2.1",
"@date-vir/duration": "^7.0.1",
"ansi-styles": "^6.2.1",
"json5": "^2.2.3",
Expand Down
4 changes: 1 addition & 3 deletions packages/common/src/augments/object/key-count.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
import type {AnyObject} from '@augment-vir/core';

/**
* Counts the number of unique keys in an object type. Note that a key of just `string` will count
* as 1.
Expand All @@ -8,7 +6,7 @@ import type {AnyObject} from '@augment-vir/core';
* @category Package : @augment-vir/common
* @package [`@augment-vir/common`](https://www.npmjs.com/package/@augment-vir/common)
*/
export type KeyCount<T extends AnyObject> = UnionToTuple<keyof T>['length'];
export type KeyCount<T> = UnionToTuple<keyof T>['length'];

/**
* This is not exported because its order is not stable but it's okay for our simple use case where
Expand Down
2 changes: 1 addition & 1 deletion packages/core/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@augment-vir/core",
"version": "31.2.0",
"version": "31.2.1",
"description": "Core augment-vir augments. Use @augment-vir/common instead.",
"homepage": "https://github.com/electrovir/augment-vir",
"bugs": {
Expand Down
8 changes: 4 additions & 4 deletions packages/node/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@augment-vir/node",
"version": "31.2.0",
"version": "31.2.1",
"description": "A collection of augments, helpers types, functions, and classes only for Node.js (backend) JavaScript environments.",
"keywords": [
"augment",
Expand Down Expand Up @@ -37,16 +37,16 @@
"test:update": "npm test"
},
"dependencies": {
"@augment-vir/assert": "^31.2.0",
"@augment-vir/common": "^31.2.0",
"@augment-vir/assert": "^31.2.1",
"@augment-vir/common": "^31.2.1",
"@date-vir/duration": "^7.0.1",
"ansi-styles": "^6.2.1",
"terminate": "^2.8.0",
"type-fest": "^4.29.0",
"typed-event-target": "^4.0.2"
},
"devDependencies": {
"@augment-vir/test": "^31.2.0",
"@augment-vir/test": "^31.2.1",
"@prisma/client": "^5.22.0",
"@types/node": "^22.10.0",
"@web/dev-server-esbuild": "^1.0.3",
Expand Down
10 changes: 5 additions & 5 deletions packages/scripts/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@augment-vir/scripts",
"version": "31.2.0",
"version": "31.2.1",
"private": true,
"homepage": "https://github.com/electrovir/augment-vir",
"bugs": {
Expand All @@ -24,15 +24,15 @@
"test:update": "npm test"
},
"dependencies": {
"@augment-vir/assert": "^31.2.0",
"@augment-vir/common": "^31.2.0",
"@augment-vir/node": "^31.2.0",
"@augment-vir/assert": "^31.2.1",
"@augment-vir/common": "^31.2.1",
"@augment-vir/node": "^31.2.1",
"@virmator/docs": "^13.10.3",
"jsdom": "^25.0.1",
"typedoc": "^0.27.0"
},
"devDependencies": {
"@augment-vir/test": "^31.2.0",
"@augment-vir/test": "^31.2.1",
"@types/jsdom": "^21.1.7",
"@types/node": "^22.10.0"
},
Expand Down
6 changes: 3 additions & 3 deletions packages/test/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@augment-vir/test",
"version": "31.2.0",
"version": "31.2.1",
"description": "A universal testing suite that works with Mocha style test runners _and_ Node.js's built-in test runner.",
"keywords": [
"test",
Expand Down Expand Up @@ -42,8 +42,8 @@
"test:web": "virmator test --no-deps web 'src/test-web/**/*.test.ts' 'src/augments/universal-testing-suite/**/*.test.ts'"
},
"dependencies": {
"@augment-vir/assert": "^31.2.0",
"@augment-vir/common": "^31.2.0",
"@augment-vir/assert": "^31.2.1",
"@augment-vir/common": "^31.2.1",
"@open-wc/testing-helpers": "^3.0.1",
"@virmator/test": "^13.10.3",
"type-fest": "^4.29.0"
Expand Down
8 changes: 4 additions & 4 deletions packages/web/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@augment-vir/web",
"version": "31.2.0",
"version": "31.2.1",
"description": "A collection of augments, helpers types, functions, and classes only for web (frontend) JavaScript environments.",
"keywords": [
"augment",
Expand Down Expand Up @@ -35,14 +35,14 @@
"test:update": "npm test"
},
"dependencies": {
"@augment-vir/assert": "^31.2.0",
"@augment-vir/common": "^31.2.0",
"@augment-vir/assert": "^31.2.1",
"@augment-vir/common": "^31.2.1",
"@date-vir/duration": "^7.0.1",
"html-spec-tags": "^2.2.1",
"type-fest": "^4.29.0"
},
"devDependencies": {
"@augment-vir/test": "^31.2.0",
"@augment-vir/test": "^31.2.1",
"bowser": "^2.11.0",
"typescript": "^5.6.3"
},
Expand Down
2 changes: 2 additions & 0 deletions todo.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,3 +36,5 @@
- like this: https://github.com/electrovir/proxy-vir/actions/runs/11876323290/job/33094520685
- remove type guard from equality checks? (like jsonEquals)
- add `this:void` to all functions
- better type guarding for `check.isIn`
- like in this situation: `check.isIn(someString, ['a', 'b', 'c'] as const)`

0 comments on commit 89426c9

Please sign in to comment.