Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

io-ng-util

Package Overview
Dependencies
Maintainers
1
Versions
23
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

io-ng-util - npm Package Compare versions

Comparing version 4.2.2 to 4.2.3

2

common/http.service.d.ts

@@ -17,4 +17,4 @@ import 'rxjs/add/operator/catch';

handleError(err: any): any;
makeHeaders(): RequestOptions;
makeHeaders(multiPart?: boolean): RequestOptions;
private extractData(res);
}

@@ -22,6 +22,21 @@ 'use strict';

HttpService.prototype.httpPost = function (url, body, flatten) {
var values = !flatten
? JSON.stringify(cleanObject(body))
: JSON.stringify(flattenObject(body));
return this.http.post(url, values, this.makeHeaders())
var formData;
var data = !flatten
? cleanObject(body)
: flattenObject(body);
var multiPart = false;
if (data.files) {
formData = new FormData();
for (var _i = 0, _a = data.files; _i < _a.length; _i++) {
var file = _a[_i];
formData.append('file', file, file.name);
}
delete data.files;
formData.append('body', JSON.stringify(data));
multiPart = true;
}
else {
formData = JSON.stringify(data);
}
return this.http.post(url, formData, this.makeHeaders(multiPart))
.map(this.extractData)

@@ -59,6 +74,14 @@ .catch(this.handleError);

};
HttpService.prototype.makeHeaders = function () {
var h = {
'Content-Type': 'application/json',
};
HttpService.prototype.makeHeaders = function (multiPart) {
var h;
if (multiPart) {
h = {
'Content-Type': 'multipart/form-data',
};
}
else {
h = {
'Content-Type': 'application/json',
};
}
if (this.env.user.token) {

@@ -65,0 +88,0 @@ h.Authorization = "Bearer " + this.env.user.token;

{
"name": "io-ng-util",
"version": "4.2.2",
"version": "4.2.3",
"description": "Angular Base Utilities",

@@ -27,4 +27,4 @@ "main": "index.js",

"@types/core-js": "^0.9.43",
"@types/node": "^8.0.32",
"codelyzer": "^3.2.0",
"@types/node": "^8.0.33",
"codelyzer": "^3.2.1",
"eslint": "^4.8.0",

@@ -43,2 +43,2 @@ "rxjs": "^5.4.3",

"dependencies": {}
}
}
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc