Skip to content

Commit c5ee44e

Browse files
committed
implement GH feedback
1 parent 9e264f9 commit c5ee44e

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

index.d.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ export type SjsSchema = { [prop: string]: AttrExecutable | SjsSchema };
2727
*
2828
* Serialize any object enforcing the provided schema.
2929
*/
30-
export type SjsSerializer = (obj: object) => string;
30+
export type SjsSerializer = (obj: unknown) => string;
3131

3232
/**
3333
* SjsEscaper
@@ -68,10 +68,11 @@ export function attr(type: AttrType, serializer?: Serializer): AttrExecutable;
6868
* @default regex - \\n|\\r|\\t|\\"|\\\\
6969
*/
7070
export function escape(regex?: RegExp): (str: string) => string;
71+
7172
/**
7273
* sjs
7374
*
7475
* compile the provided schema and exports a function
7576
* that serialize objects enforcing the schema.
7677
*/
77-
export function sjs(schema: SjsSchema): SjsEscaper;
78+
export function sjs(schema: SjsSchema): SjsSerializer;

0 commit comments

Comments
 (0)