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

good-guy-http

Package Overview
Dependencies
Maintainers
2
Versions
30
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

good-guy-http - npm Package Compare versions

Comparing version 1.7.1 to 1.7.2

4

lib/caching/lru-cache.js
var Promise = require('bluebird');
var clone = require('clone');

@@ -23,3 +24,3 @@ module.exports = function(maxEntries) {

this._markAsRecent(key);
return Promise.resolve(entry);
return Promise.resolve(clone(entry));
} else {

@@ -31,2 +32,3 @@ return Promise.resolve(undefined);

store: function(key, value) {
value = clone(value);
var entry = this._entryMap[key];

@@ -33,0 +35,0 @@ if (entry !== undefined) {

{
"name": "good-guy-http",
"version": "1.7.1",
"version": "1.7.2",
"description": "The opinionated sane HTTP client with a good guy approach.",

@@ -20,2 +20,3 @@ "main": "lib/index.js",

"circuit-breaker-js": "Schibsted-Tech-Polska/circuit-breaker-js#v0.0.2",
"clone": "1.0.2",
"request": "2.69.0",

@@ -22,0 +23,0 @@ "underscore": "1.8.3",

@@ -16,2 +16,25 @@ var assert = require('assert');

it('should store values rather than references to elements', function(done) {
var lru = new LRUCache(2);
var original = {answer: 42};
lru.store('hitchhiker', original).then(function() {
original.answer = 43;
return lru.retrieve('hitchhiker');
}).then(function(object) {
assert.deepEqual(object, {answer: 42});
}).then(done).catch(done);
});
it('should return values rather than references to elements', function(done) {
var lru = new LRUCache(2);
lru.store('hitchhiker', {answer: 42}).then(function() {
return lru.retrieve('hitchhiker');
}).then(function(object) {
object.answer = 43;
return lru.retrieve('hitchhiker');
}).then(function(object) {
assert.deepEqual(object, {answer: 42});
}).then(done).catch(done);
});
it('should throw away oldest element when nothing is retrieved', function(done) {

@@ -18,0 +41,0 @@ var lru = new LRUCache(3);

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