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

contentful-batch-libs

Package Overview
Dependencies
Maintainers
4
Versions
111
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

contentful-batch-libs - npm Package Compare versions

Comparing version 5.8.0 to 5.8.1

28

dist/transform/transform-space.js

@@ -7,15 +7,15 @@ 'use strict';

exports.default = function (sourceSpace, destinationSpace, customTransformers) {
exports.default = function (space, destinationSpace, customTransformers) {
var entities = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : spaceEntities;
var transformers = (0, _object.defaults)(customTransformers, defaultTransformers);
var newSpace = _object.omit.apply(undefined, [sourceSpace].concat(_toConsumableArray(entities)));
// Use bluebird collection methods to support async transforms.
// TODO maybe we don't need promises here at all
var newSpace = _object.omit.apply(undefined, [space].concat(_toConsumableArray(entities)));
return _bluebird2.default.reduce(entities, function (newSpace, type) {
var transformer = transformers[type];
var sourceEntities = sourceSpace[type];
var destinationEntities = destinationSpace[type];
var typeTransform = (0, _partialRight.partialRight)(applyTransformer, transformer, destinationEntities, destinationSpace);
return _bluebird2.default.map(sourceEntities, typeTransform).then(function (entities) {
return _bluebird2.default.map(space[type], function (entity) {
return _bluebird2.default.resolve({
original: entity,
transformed: transformers[type](entity, destinationSpace[type])
});
}).then(function (entities) {
newSpace[type] = entities;

@@ -33,4 +33,2 @@ return newSpace;

var _partialRight = require('lodash/partialRight');
var _transformers = require('./transformers');

@@ -52,10 +50,2 @@

*/
function applyTransformer(entity, transformer, destinationEntities, destinationSpace) {
return _bluebird2.default.props({
original: entity,
transformed: transformer(entity, destinationEntities, destinationSpace)
});
}
module.exports = exports['default'];
{
"name": "contentful-batch-libs",
"version": "5.8.0",
"version": "5.8.1",
"description": "Library modules used by contentful batch utility CLI tools.",

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

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