Skip to content

Commit

Permalink
fix(types): make JsonifiableObject extendable
Browse files Browse the repository at this point in the history
Signed-off-by: Lexus Drumgold <[email protected]>
  • Loading branch information
unicornware committed Dec 2, 2022
1 parent 6789428 commit bb49d82
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions src/types/jsonifiable-object.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,15 @@
import type Jsonifiable from './jsonifiable'

/**
* Matches an object whose items can be losslessly converted to JSON.
* Matches an object that can be losslessly converted to JSON.
*
* @see [`Jsonifiable`]({@link ./jsonifiable.ts})
* For objects with `toJSON` methods, use [`JsonifiableInstance`][1] instead.
*
* [1]: {@link ./jsonifiable-instance.ts}
* [2]: {@link ./jsonifiable.ts}
*
* @see [`Jsonifiable`][2]
*/
type JsonifiableObject =
| { [K in string]?: Jsonifiable }
| { toJSON(): Jsonifiable }
type JsonifiableObject = { [K in string]?: Jsonifiable }

export type { JsonifiableObject as default }

0 comments on commit bb49d82

Please sign in to comment.