Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
let outImgDir = '';
let outJsonDir = '';
if (typeof options === 'string') {
outImgDir = options;
outJsonDir = options;
} else {
if (options.outImgDir) {
outImgDir = options.outImgDir;
}
if (options.outJsonDir) {
outJsonDir = options.outJsonDir;
}
}
// get root node.
const psdData = psd.fromFile(psdFilePath);
psdData.parse();
const rootNode = psdData.tree();
const queueNodes = [];
const queueNodesIndex = [];
const queueNodesName = [];
const queueNodesStructure = [];
queueNodes.push(rootNode._children);
queueNodesIndex.push(0);
queueNodesName.push(undefined);
const psdStructure = {
'group' : []
};
queueNodesStructure.push(psdStructure);
var LayersfromPathes = R.reduce(function(acc,path){
var psd = PSD.fromFile(path);
psd.parse();
var psdChildren = psd.tree().children()
return R.concat(acc, psdChildren.map(metaAdder(path)));
}, []);