@devsnicket/eunice-dependency-and-structure
Advanced tools
Comparing version 2.1.0 to 2.2.0
const | ||
testDependsUponMissing = require("./testDependsUponMissing"), | ||
testDependsUponTwoChildrenMissingFromMissing = require("./testDependsUponTwoChildrenMissingFromMissing"), | ||
testFirstDependsUponChildMissingFromSecond = require("./testFirstDependsUponChildMissingFromSecond"), | ||
@@ -15,3 +14,2 @@ testFirstDependsUponChildOfSecond = require("./testFirstDependsUponChildOfSecond"), | ||
testDependsUponMissing(); | ||
testDependsUponTwoChildrenMissingFromMissing(); | ||
testFirstDependsUponChildMissingFromSecond(); | ||
@@ -18,0 +16,0 @@ testFirstDependsUponChildOfSecond(); |
@@ -0,1 +1,3 @@ | ||
const createDependsUpon = require("./createDependsUpon"); | ||
module.exports = createYamlFromStack; | ||
@@ -73,42 +75,6 @@ | ||
&& | ||
{ | ||
dependsUpon: | ||
dependsUpon.length === 1 | ||
? | ||
createDependUpon(dependsUpon[0]) | ||
: | ||
dependsUpon.map(createDependUpon), | ||
} | ||
{ dependsUpon: createDependsUpon(dependsUpon) } | ||
); | ||
} | ||
function createDependUpon( | ||
dependUpon, | ||
) { | ||
return getWhenParent() || getIdentifierPropertyOrValue(dependUpon.item); | ||
function getWhenParent() { | ||
return ( | ||
dependUpon.parent | ||
&& | ||
{ | ||
id: | ||
getIdentifierPropertyOrValue( | ||
dependUpon.parent, | ||
), | ||
items: | ||
getIdentifierPropertyOrValue( | ||
dependUpon.item, | ||
), | ||
} | ||
); | ||
} | ||
function getIdentifierPropertyOrValue( | ||
value, | ||
) { | ||
return value.id || value; | ||
} | ||
} | ||
function createItemsProperty( | ||
@@ -115,0 +81,0 @@ items, |
const testDependsUponMissing = require("./testDependsUponMissing"), | ||
testDependsUponTwoChildrenMissingFromMissing = require("./testDependsUponTwoChildrenMissingFromMissing"), | ||
testFirstDependsUponChildMissingFromSecond = require("./testFirstDependsUponChildMissingFromSecond"), | ||
@@ -10,3 +9,2 @@ testFirstDependsUponChildOfSecond = require("./testFirstDependsUponChildOfSecond"), | ||
testDependsUponMissing(); | ||
testDependsUponTwoChildrenMissingFromMissing(); | ||
testFirstDependsUponChildMissingFromSecond(); | ||
@@ -13,0 +11,0 @@ testFirstDependsUponChildOfSecond(); |
@@ -5,2 +5,4 @@ var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; | ||
const createDependsUpon = require("./createDependsUpon"); | ||
module.exports = createYamlFromStack; | ||
@@ -41,22 +43,5 @@ | ||
function createDependsUponProperty(dependsUpon) { | ||
return dependsUpon && { | ||
dependsUpon: dependsUpon.length === 1 ? createDependUpon(dependsUpon[0]) : dependsUpon.map(createDependUpon) | ||
}; | ||
return dependsUpon && { dependsUpon: createDependsUpon(dependsUpon) }; | ||
} | ||
function createDependUpon(dependUpon) { | ||
return getWhenParent() || getIdentifierPropertyOrValue(dependUpon.item); | ||
function getWhenParent() { | ||
return dependUpon.parent && { | ||
id: getIdentifierPropertyOrValue(dependUpon.parent), | ||
items: getIdentifierPropertyOrValue(dependUpon.item) | ||
}; | ||
} | ||
function getIdentifierPropertyOrValue(value) { | ||
return value.id || value; | ||
} | ||
} | ||
function createItemsProperty(items) { | ||
@@ -63,0 +48,0 @@ return items && { items: createYamlFromStack(items) }; |
@@ -65,3 +65,3 @@ { | ||
}, | ||
"version": "2.1.0" | ||
"version": "2.2.0" | ||
} |
@@ -1,2 +0,4 @@ | ||
const testDependsUponChildMissingFromMissing = require("./testDependsUponChildMissingFromMissing"); | ||
const | ||
testDependsUponChildMissingFromMissing = require("./testDependsUponChildMissingFromMissing"), | ||
testDependsUponTwoChildrenMissingFromMissing = require("./testDependsUponTwoChildrenMissingFromMissing"); | ||
@@ -7,4 +9,6 @@ module.exports = | ||
"mapping", | ||
() => | ||
testDependsUponChildMissingFromMissing(test), | ||
() => { | ||
testDependsUponChildMissingFromMissing(test); | ||
testDependsUponTwoChildrenMissingFromMissing(test); | ||
}, | ||
); |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
146645
109
2763