diff --git a/.changeset/neat-melons-fix.md b/.changeset/neat-melons-fix.md new file mode 100644 index 0000000..daee9cc --- /dev/null +++ b/.changeset/neat-melons-fix.md @@ -0,0 +1,5 @@ +--- +"any-ts": patch +--- + +fix: re-exports `some.instanceOf`; feat: adds `any.maybeIndexedBy` diff --git a/src/any/any.ts b/src/any/any.ts index 9265a04..13ba0bd 100644 --- a/src/any/any.ts +++ b/src/any/any.ts @@ -205,6 +205,13 @@ declare namespace any { = { [ix in invariant]: _ } > = type + export type maybeIndexedBy< + invariant extends any.index, + type extends + | { [ix in invariant]+?: _ } + = { [ix in invariant]+?: _ } + > = type + export type indexableBy< invariant extends any.index, type extends diff --git a/src/some/some.ts b/src/some/some.ts index 87ba67f..ed4a2fc 100644 --- a/src/some/some.ts +++ b/src/some/some.ts @@ -65,6 +65,8 @@ export declare namespace some { some_fieldOf as fieldOf, /** {@link some_subtypeOf `some.subtypeOf`} @external */ some_subtypeOf as subtypeOf, + /** {@link some_instanceOf `some.instanceOf`} @external */ + some_instanceOf as instanceOf, } }