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

@awesomeeng/awesome-utils

Package Overview
Dependencies
Maintainers
1
Versions
22
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@awesomeeng/awesome-utils - npm Package Compare versions

Comparing version 1.4.3 to 1.4.4

3

package.json
{
"name": "@awesomeeng/awesome-utils",
"version": "1.4.3",
"version": "1.4.4",
"author": "the awesome engineering company",

@@ -20,2 +20,3 @@ "license": "MIT",

"scripts": {
"lint": "eslint src test",
"docs": "jsdoc2md src/** --separators > docs/API.md",

@@ -22,0 +23,0 @@ "test": "mocha test",

# AwesomeUtils Release Notes
#### **Version 1.4.4**
- AwesomeUtils.Request: Fix minor bugs in contentType and contentEncoding parsers. Adds contetType and contentEncoding properties to response object.
#### **Version 1.4.3**

@@ -4,0 +8,0 @@

@@ -7,4 +7,2 @@ // (c) 2018, The Awesome Engineering Company, https://awesomeneg.com

const STACK_PARSER = /^\s*(at)\s((.+)\s\(|)(.+)(:(\d+))(:(\d+))\)?$|^\s*(at)\s(.+)\s\((<anonymous>)\)?$/;
/**

@@ -111,3 +109,3 @@ * Utilities for working with modules, or understanding the code itself.

* @param {Number} [end=start+10]
* @return {Array<String>}
* @return {Array<String>}
*/

@@ -114,0 +112,0 @@ moduleStack(mod,start=0,end=start+10) {

@@ -43,2 +43,6 @@ // (c) 2018, The Awesome Engineering Company, https://awesomeneg.com

createContentGetter.call(this,response);
// add contentType field.
response.contentType = this.parseContentType(response.headers);
// add contentEncoding field.
response.contentEncoding = this.parseContentEncoding(response.headers);

@@ -96,3 +100,3 @@ resolve(response);

parseContentType(headers) {
let contentType = typeof headers!=="string" && headers["content-type"] || typeof headers==="string" && headers || "application/octet-stream";
let contentType = typeof headers!=="string" && headers["content-type"] || typeof headers!=="string" && headers["Content-Type"] || typeof headers==="string" && headers || "application/octet-stream";
contentType = contentType.replace(/;.*$/,"");

@@ -103,3 +107,3 @@ return contentType;

parseContentEncoding(headers) {
let contentType = typeof headers!=="string" && headers["content-type"] || typeof headers==="string" && headers || "application/octet-stream";
let contentType = typeof headers!=="string" && headers["content-type"] || typeof headers!=="string" && headers["Content-Type"] || typeof headers==="string" && headers || "application/octet-stream";
let contentEncoding = "utf-8";

@@ -118,4 +122,4 @@ contentType.split(/;\s?/g).forEach((segment)=>{

const createContentGetter = function createContentGetter(response) {
let contentType = this.parseContentType(response.headers && response.headers["content-type"] || "application/octet-stream");
let contentEncoding = this.parseContentEncoding(response.headers && response.headers["content-type"] || "application/octet-stream");
let contentType = this.parseContentType(response.headers);
let contentEncoding = this.parseContentEncoding(response.headers);

@@ -122,0 +126,0 @@ let error = undefined;

@@ -16,3 +16,3 @@ // (c) 2018, The Awesome Engineering Company, https://awesomeneg.com

this.slow(250);
let start,spent;

@@ -44,3 +44,2 @@

assert(spent<25);
});

@@ -96,3 +95,2 @@

catch (ex) {
console.log(ex);
assert.fail("Promise should resolve before timeout.");

@@ -99,0 +97,0 @@ }

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