@vitrical/utils
Advanced tools
Comparing version 1.0.10 to 1.0.11
18
api.js
@@ -77,11 +77,13 @@ "use strict"; | ||
req.set('Key', key); | ||
if (options === null || options === void 0 ? void 0 : options.headers) { | ||
req.set(options.headers); | ||
if (typeof options === 'object') { | ||
if ('headers' in options) { | ||
req.set(options.headers); | ||
} | ||
if ('body' in options) { | ||
req.send(options.body); | ||
} | ||
if ('query' in options) { | ||
req.query(options.query); | ||
} | ||
} | ||
if (options === null || options === void 0 ? void 0 : options.body) { | ||
req.set(options.body); | ||
} | ||
if (options === null || options === void 0 ? void 0 : options.query) { | ||
req.query(options.query); | ||
} | ||
return [4, req]; | ||
@@ -88,0 +90,0 @@ case 1: |
18
api.ts
@@ -38,11 +38,13 @@ import superagent from 'superagent' | ||
req.set('Key', key) | ||
if (options?.headers) { | ||
req.set(options.headers) | ||
if (typeof options === 'object') { | ||
if ('headers' in options) { | ||
req.set(options.headers) | ||
} | ||
if ('body' in options) { | ||
req.send(options.body) | ||
} | ||
if ('query' in options) { | ||
req.query(options.query) | ||
} | ||
} | ||
if (options?.body) { | ||
req.set(options.body) | ||
} | ||
if (options?.query) { | ||
req.query(options.query) | ||
} | ||
const res = await req | ||
@@ -49,0 +51,0 @@ |
{ | ||
"name": "@vitrical/utils", | ||
"version": "1.0.10", | ||
"version": "1.0.11", | ||
"description": "Collection of useful functions and typings", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
50002
905