Update dependencies
This commit is contained in:
+5
-5
@@ -71,16 +71,16 @@
|
||||
"@pika/plugin-ts-standard-pkg": "^0.9.2",
|
||||
"@size-limit/preset-small-lib": "^4.4.5",
|
||||
"@types/jest": "^25.2.1",
|
||||
"@types/node": "^13.11.1",
|
||||
"@types/node": "^13.13.2",
|
||||
"flowgen": "^1.10.0",
|
||||
"jest": "^25.3.0",
|
||||
"jest": "^25.4.0",
|
||||
"nock": "^12.0.3",
|
||||
"pika-plugin-package.json": "^1.0.2",
|
||||
"pika-plugin-typedefs-to-flow": "^0.0.2",
|
||||
"prettier": "^2.0.4",
|
||||
"prettier": "^2.0.5",
|
||||
"size-limit": "^4.4.5",
|
||||
"ts-jest": "^25.3.1",
|
||||
"ts-node": "^8.8.2",
|
||||
"ts-jest": "^25.4.0",
|
||||
"ts-node": "^8.9.0",
|
||||
"tslint": "^6.1.1",
|
||||
"tslint-config-prettier": "^1.18.0",
|
||||
"tslint-config-security": "^1.16.0",
|
||||
|
||||
+6
-6
@@ -16,11 +16,11 @@ export const gotenberg = (
|
||||
client?: GotenbergClient | GotenbergClientFunction | GotenbergClientClass | object,
|
||||
config?: object
|
||||
) => {
|
||||
let clnt: GotenbergClient
|
||||
let instance: GotenbergClient
|
||||
|
||||
// if GotenbergClient object / instance provided -> just use it
|
||||
if (typeof client === 'object' && 'post' in client) {
|
||||
clnt = client
|
||||
instance = client
|
||||
}
|
||||
|
||||
// if GotenbergClientFunction or GotenbergClientClass -> call or instantiate it
|
||||
@@ -29,10 +29,10 @@ export const gotenberg = (
|
||||
// hope this will do ¯\_(ツ)_/¯
|
||||
if (/^class\s/.test(Function.prototype.toString.call(client))) {
|
||||
// guess this is GotenbergClientClass
|
||||
clnt = new (client as GotenbergClientClass)(config)
|
||||
instance = new (client as GotenbergClientClass)(config)
|
||||
} else {
|
||||
// guess this is GotenbergClientFunction
|
||||
clnt = (client as GotenbergClientFunction)(config)
|
||||
instance = (client as GotenbergClientFunction)(config)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -40,13 +40,13 @@ export const gotenberg = (
|
||||
// (or maybe it is just undefined)
|
||||
// -> use native client
|
||||
else {
|
||||
clnt = native(config || client)
|
||||
instance = native(config || client)
|
||||
}
|
||||
|
||||
return (source: Source): Request => ({
|
||||
type: RequestType.Undefined,
|
||||
url: url.toString(),
|
||||
client: clnt,
|
||||
client: instance,
|
||||
source,
|
||||
fields: {},
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user