UNPKG

jsonp-body

Version:

Helper to create more safe jsonp response body for koa and other web framework

11 lines (10 loc) 452 B
interface Options { /** length limit for callback function name, default to `512` */ limit?: number; /** replacer in `JSON.stringify(obj, [replacer, [space]])` */ replacer?: Parameters<typeof JSON.stringify>[1]; /** space in `JSON.stringify(obj, [replacer, [space]])` */ space?: Parameters<typeof JSON.stringify>[2]; } export declare function jsonp(obj: any, callback?: string | string[], options?: Options): string; export {};