1.0.0 • Published 4 years ago
unwrap-jsonp v1.0.0
unwrap-jsonp
Unwrap the values in a JSONP function.
Install
npm install unwrap-jsonp
Usage
const unwrapJsonp = require("unwrap-jsonp")
unwrapJsonp(`fn({a: "b"})`)
//=> {a: "b"}
unwrapJsonp(`fn("a", "b")`, {multiArgs: true})
//=> ["a", "b"]
API
unwrapJsonp(data, options?)
data
Type: string
The jsonp to parse.
options
Type: object
multiArgs
Type: boolean
\
Default: false
Return an array of the function arguments instead of just the first one.
1.0.0
4 years ago