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

node-json-transform

Package Overview
Dependencies
Maintainers
1
Versions
25
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

node-json-transform - npm Package Compare versions

Comparing version 1.0.16 to 1.0.17

6

index.js

@@ -79,5 +79,5 @@ // DataTransform

var value = this.getValue(data, map.list);
var normalized = {};
if(value) {
var normalized = [];
if(!_.isEmpty(value)) {
var list = this.getList();

@@ -84,0 +84,0 @@ normalized = map.item ? _.map(list, _.bind(this.iterator, this, map.item)) : list;

{
"name": "node-json-transform",
"version": "1.0.16",
"version": "1.0.17",
"description": "A node module for transforming and performing operations on JSON.",

@@ -5,0 +5,0 @@ "main": "index.js",

@@ -343,3 +343,4 @@ # node-data-transform

## Changelog
1.0.16 ES5 compatibility
1.0.17 Ensure transform always returns an array
1.0.16 ES5 compatibility
1.0.15 Add support for a context object that is passed through to the operate.run and each functions.

@@ -346,0 +347,0 @@ 1.0.14 Add support for default values via "defaults" definition. Add support for removing attributes via the "remove" definition.

@@ -350,2 +350,31 @@ var DataTransform = require('../index.js').DataTransform,

it("should exclude data if not specified", function(){
var data = {
posts: [
{name: "peter", unwanted: true},
{name: "paul", unwanted: true},
{name: "marry", unwanted:true}
]
};
var map = {
list: 'posts',
item: {
name: 'name'
}
};
var dataTransform = DataTransform(data, map);
var result = dataTransform.transform();
expect(result).toEqual([
{name: "peter"},
{name: "paul"},
{name: "marry"}
]);
});
});

@@ -64,2 +64,9 @@ var DataTransform = require('../index.js').DataTransform,

it("should always return an array", function() {
var dataTransform = DataTransform({}, {});
expect(_.isArray(dataTransform.transform())).toEqual(true);
});
});
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