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

quizas

Package Overview
Dependencies
Maintainers
1
Versions
16
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

quizas - npm Package Compare versions

Comparing version 1.4.0 to 1.5.0

2

package.json
{
"name": "quizas",
"version": "1.4.0",
"version": "1.5.0",
"description": "A sort-of monad for reading values from objects",

@@ -5,0 +5,0 @@ "main": "src/quizas",

@@ -207,2 +207,20 @@ "use strict";

}
},
'filter': {
value: function(func){
if(!result.found || !Array.isArray(result.value)){
return [];
}
return result.value.filter(func);
}
},
'map': {
value: function(func){
if(!result.found || !Array.isArray(result.value)){
return [];
}
return result.value.map(func);
}
}

@@ -209,0 +227,0 @@ });

@@ -147,2 +147,18 @@ 'use strict';

it('Should be able to filter a value if it\'s an array', function() {
var filterFunc = function(h){ return h.isListed; };
var expected = fixtures.esResults.hits.hits.filter(filterFunc);
var result = quizas(fixtures.esResults, 'hits.hits').filter(filterFunc);
expect(result).to.be.an('array');
expect(result).to.deep.equal(expected);
});
it('Should be able to map a value if it\'s an array', function() {
var mapFunc = function(h){ return h._id; };
var expected = fixtures.esResults.hits.hits.map(mapFunc);
var result = quizas(fixtures.esResults, 'hits.hits').map(mapFunc);
expect(result).to.be.an('array');
expect(result).to.deep.equal(expected);
});
describe('Bugs', function() {

@@ -149,0 +165,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