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

d2l-lms-launch-darkly-feature-converter-plugin

Package Overview
Dependencies
Maintainers
1
Versions
40
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

d2l-lms-launch-darkly-feature-converter-plugin - npm Package Compare versions

Comparing version 0.6.0 to 0.7.0

test/EnvironmentMapperTests.js

2

package.json
{
"name": "d2l-lms-launch-darkly-feature-converter-plugin",
"version": "0.6.0",
"version": "0.7.0",
"description": "",

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

const _ = require( 'lodash' );
const duplicatesDeep = require( './utils.js' ).duplicatesDeep;

@@ -20,2 +21,11 @@ module.exports = class EnvironmentMapper {

const duplciateTargets = duplicatesDeep(
_.map( targets, t => t.values )
);
if( duplciateTargets.length > 0 ) {
const msg = `Duplicate targets: ${ _.join( duplciateTargets, ', ' ) }`;
throw new Error( msg );
}
const rules = _.map(

@@ -22,0 +32,0 @@ definition.rules || [],

const _ = require( 'lodash' );
const anyIntersections = require( '../utils.js' ).anyIntersections;
const duplicatesDeep = require( '../utils.js' ).duplicatesDeep;

@@ -46,7 +46,7 @@ module.exports = class InstanceTargetsMapper {

const duplicates = _.orderBy(
anyIntersections(
duplicatesDeep( [
implicitInstanceIds,
explicitInstanceIds,
mixedExplicitInstanceIds
)
] )
);

@@ -53,0 +53,0 @@

const _ = require( 'lodash' );
const anyIntersections = require( '../utils.js' ).anyIntersections;
const duplicatesDeep = require( '../utils.js' ).duplicatesDeep;

@@ -46,7 +46,7 @@ module.exports = class OrgTargetsMapper {

const duplicates = _.orderBy(
anyIntersections(
duplicatesDeep( [
implicitTenantIds,
explicitTenantIds,
mixedExplicitTenantIds
)
] )
);

@@ -53,0 +53,0 @@

const _ = require( 'lodash' );
function anyIntersections( items1, items2, items3 ) {
function duplicatesDeep( arrays ) {
const intersections = _.uniq(
_.flatten( [
_.intersection(
items1,
items2
),
_.intersection(
items1,
items3
),
_.intersection(
items2,
items3
)
] )
);
const visited = new Set();
const duplicates = new Set();
return intersections;
const all = _.flattenDeep( arrays );
_.forEach( all, item => {
if( visited.has( item ) ) {
duplicates.add( item );
} else {
visited.add( item );
}
} );
return Array.from( duplicates );
}
module.exports = {
anyIntersections
duplicatesDeep
};
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