New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.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.2.3 to 1.3.0

2

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

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

@@ -125,2 +125,6 @@ "use strict";

var value = prop.pluck ? q.pluck.apply(q, prop.pluck) : q.value;
if(isSet(value) && prop.transform){
value = prop.transform(value);
}
if(isSet(value)){

@@ -152,3 +156,7 @@ plucked = deepWrite(plucked, prop.target, value);

var value = prop.pluck ? q.pluck.apply(q, prop.pluck) : q.value;
if(value){
if(isSet(value) && prop.transform){
value = prop.transform(value);
}
if(isSet(value)){
extracted = deepWrite(extracted, prop.target, value);

@@ -155,0 +163,0 @@ }

@@ -118,2 +118,23 @@ 'use strict';

it('Should be able to transform values whilst extracting', function(){
var transform = function(date){
return new Date(date).toString();
};
var expected = transform(fixtures.esArticle._source._lastUpdatedDateTime);
var result = quizas(fixtures.esArticle, '_source').extract({source:'_lastUpdatedDateTime', target:'date', transform:transform});
expect(result).to.have.property('date');
expect(result.date).to.equal(expected);
});
it('Should be able to transform values whilst plucking', function(){
var transform = function(date){
return new Date(date).toString();
};
var expected = fixtures.esResults.hits.hits.map(function(hit){
return {date:transform(hit._source._lastUpdatedDateTime)};
});
var result = quizas(fixtures.esResults, 'hits.hits').pluck({source:'_source._lastUpdatedDateTime', target:'date', transform:transform})
expect(result).to.deep.equal(expected);
});
describe('Bugs', function() {

@@ -120,0 +141,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