Comparing version 1.2.1 to 1.3.0
@@ -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 dataToFormData: (data: Record<string, any>) => FormData; | ||
export declare const dataToURLString: (data: Record<string, any>) => string; | ||
@@ -40,0 +39,0 @@ export declare const optionToRequest: (option?: AspidaParams<any> | undefined, type?: "string" | "ArrayBuffer" | "any" | "FormData" | "URLSearchParams" | "Blob" | undefined) => AspidaRequest | undefined; |
@@ -34,3 +34,3 @@ "use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.optionToRequest = exports.dataToURLString = exports.dataToFormData = exports.headersToObject = void 0; | ||
exports.optionToRequest = exports.dataToURLString = exports.headersToObject = void 0; | ||
var headersToObject = function (headers) { | ||
@@ -50,3 +50,3 @@ return __spread(headers.entries()).reduce(function (prev, _a) { | ||
} | ||
else { | ||
else if (data[key] != null) { | ||
formData.append(key, data[key]); | ||
@@ -60,3 +60,2 @@ } | ||
}; | ||
exports.dataToFormData = dataToFormData; | ||
var encode = function (str) { | ||
@@ -77,2 +76,3 @@ return encodeURIComponent(str).replace(/[!'()~]|%20|%00/g, function (match) { | ||
return Object.keys(data) | ||
.filter(function (key) { return data[key] != null; }) | ||
.map(function (key) { | ||
@@ -93,3 +93,3 @@ return Array.isArray(data[key]) | ||
case 'FormData': | ||
httpBody = exports.dataToFormData(option.body); | ||
httpBody = dataToFormData(option.body); | ||
break; | ||
@@ -96,0 +96,0 @@ case 'URLSearchParams': |
{ | ||
"name": "aspida", | ||
"version": "1.2.1", | ||
"version": "1.3.0", | ||
"description": "TypeScript friendly HTTP client wrapper for the browser and node.js", | ||
@@ -29,5 +29,5 @@ "author": "Solufa <solufa2020@gmail.com>", | ||
"@types/minimist": "^1.2.1", | ||
"chokidar": "^3.4.3", | ||
"chokidar": "^3.5.1", | ||
"minimist": "^1.2.5" | ||
} | ||
} |
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
105879
1052
Updatedchokidar@^3.5.1