Comparing version 0.21.0 to 0.21.1
@@ -37,3 +37,2 @@ export declare type HttpMethod = 'GET' | 'POST' | 'PUT' | 'DELETE' | 'HEAD' | 'PATCH' | 'OPTIONS'; | ||
export declare const headersToObject: (headers: Headers) => any; | ||
export declare const $arrayTypeKeysName = "$arrayTypeKeys"; | ||
export declare const dataToFormData: (data: Record<string, any>) => FormData; | ||
@@ -40,0 +39,0 @@ export declare const dataToURLString: (data: Record<string, any>) => string; |
@@ -34,3 +34,3 @@ "use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.optionToRequest = exports.dataToURLString = exports.dataToFormData = exports.$arrayTypeKeysName = exports.headersToObject = void 0; | ||
exports.optionToRequest = exports.dataToURLString = exports.dataToFormData = exports.headersToObject = void 0; | ||
exports.headersToObject = function (headers) { | ||
@@ -43,9 +43,6 @@ return __spread(headers.entries()).reduce(function (prev, _a) { | ||
}; | ||
exports.$arrayTypeKeysName = '$arrayTypeKeys'; | ||
exports.dataToFormData = function (data) { | ||
var formData = new FormData(); | ||
var arrayTypeKeys = []; | ||
var _loop_1 = function (key) { | ||
if (Array.isArray(data[key])) { | ||
arrayTypeKeys.push(key); | ||
data[key].forEach(function (d) { return formData.append(key, d); }); | ||
@@ -60,5 +57,2 @@ } | ||
} | ||
if (arrayTypeKeys.length) { | ||
formData.append(exports.$arrayTypeKeysName, arrayTypeKeys.join(',')); | ||
} | ||
return formData; | ||
@@ -65,0 +59,0 @@ }; |
import { LowerHttpMethod, AspidaMethodParams } from './'; | ||
export declare type Doc = string[]; | ||
declare type MethodsProperties = keyof AspidaMethodParams; | ||
@@ -8,3 +9,2 @@ declare type Prop = { | ||
}; | ||
export declare type Doc = string[]; | ||
export declare type Method = { | ||
@@ -11,0 +11,0 @@ name: LowerHttpMethod; |
{ | ||
"name": "aspida", | ||
"version": "0.21.0", | ||
"version": "0.21.1", | ||
"description": "TypeScript friendly HTTP client wrapper for the browser and node.js", | ||
@@ -5,0 +5,0 @@ "author": "Solufa <solufa2020@gmail.com>", |
@@ -24,5 +24,2 @@ # aspida | ||
</a> | ||
<a href="https://dependabot.com"> | ||
<img src="https://api.dependabot.com/badges/status?host=github&repo=aspida/aspida" alt="Dependabot Status" /> | ||
</a> | ||
<a href="https://github.com/aspida/aspida/blob/master/packages/aspida/LICENSE"> | ||
@@ -307,2 +304,4 @@ <img src="https://img.shields.io/npm/l/aspida" alt="License" /> | ||
1. [Use mock](#tips11) | ||
1. [Use with SWR (React Hooks)](#tips12) | ||
1. [Use with SWRV (Vue Composition API)](#tips13) | ||
@@ -665,4 +664,16 @@ <a id="tips1"></a> | ||
**[GitHub aspida/aspida-mock](https://github.com/aspida/aspida-mock)** | ||
**[GitHub aspida-mock](https://github.com/aspida/aspida-mock)** | ||
<a id="tips12"></a> | ||
### Use with SWR (React Hooks) | ||
**[GitHub @aspida/swr](https://github.com/aspida/aspida/tree/master/packages/aspida-swr#readme)** | ||
<a id="tips13"></a> | ||
### Use with SWRV (Vue Composition API) | ||
**[GitHub @aspida/swrv](https://github.com/aspida/aspida/tree/master/packages/aspida-swrv#readme)** | ||
## Support | ||
@@ -669,0 +680,0 @@ |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
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
685
92831
937