Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
this._attributes[key] = (params[key].toLowerCase() === 'true') ? true : false;
break;
default:
this._attributes[key] = params[key];
}
} else {
this._attributes[key] = this._schema[key].default;
}
}
}
/* --- Handle file uploads --- */
deferred.map(files, _.bind(uploader, this))
(function (result) {
def.resolve(self);
}, function(err) {
def.resolve(err);
});
return def.promise;
}
.readInput(input)(path => {
a(path, "__playground/lib/program", "Path");
a.deep(Object.keys(parser.modules).sort(), ["__playground"], "Modules");
return deferred.map(keys(map), filePath =>
readFile(filePath)(content => { a(map[filePath], String(content), filePath); })
)(() => null);
})
.done(d, d);
}) (function() {
deferred.map (replacedTracks, function (track) {
return client.publish ("/tracks/replace", track)
.then (function() {
console.log ("Announced replacement track " + track.label)
}, function() {
console.log ("Failed to announce replacement track " + track.label)
process.exit()
})
}) (function() {
process.exit()
})
})
} else {
return read(filename, this, filename.split(sep).slice(-2 - tree.length).join("/"))(data => {
this.modulesFiles.push(filename);
scope[name] = data.content;
return deferred
.map(data.deps, this.resolve.bind(this, filename, dirname(filename), scope, tree))
.aside(filePath => { this.depsMap[filename] = filePath; });
});
},
function (files) {
return deferred.map(files, function (relativePath) {
var filename = resolve(source, relativePath);
return lstat(filename)(function (stats) {
if (stats.isDirectory()) {
return mkdir(resolve(dest, relativePath), { intermediate: true });
}
if (stats.isFile()) {
return copyFile(filename, resolve(dest, relativePath), {
intermediate: true
});
}
if (!stats.isSymbolicLink()) return null;
return readlink(filename)(function (linkPath) {
linkPath = resolve(dirname(filename), linkPath);
var linkDirname = dirname(linkPath);
if (
linkDirname === sourceTop ||
function (nextData) {
deferred
.map(
nextData.added,
function (dir) {
return self.call(
this,
this.read(this.path + sep + rootPath + dir, depth - 1),
rootPath + dir + sep, depth - 1
);
},
this
)
.done();
nextData.removed.forEach(
function (dir) {
var path = rootPath + dir + sep, reader = this.readers[path];
if (reader) {
readFileContent(fileContent, name, this, name)(data => {
scope[name] = data.content;
return deferred.map(
data.deps, this.resolve.bind(this, input, dirname(input), scope, [])
);
})
);
generate = function (path, tpl, stringify, map) {
return deferred.map(Object.keys(map), function (name) {
return writeFile(resolve(path, name + '.js'),
tpl.replace('$DEPS$', stringify(map[name])));
});
};
exports.setSize = function(results) {
var measureImages = deferred.map(
results.images,
deferred.gate(function(result) {
return result.setFileSize();
}, 50)
);
return measureImages().then(function() {
return results;
});
};
module.exports = function(path, basename, ext, sizes) {
deferred.map(sizes, function(size) {
var def = deferred(),
dim = size.substr(1),
dims = (size[0] === 's') ? dim : dim + 'x' + dim,
src = path + basename + ext,
dest = path + basename + '_' + size + ext,
args = {},
command = '';
size = size.toLowerCase();
if (size[0] === 'c') {
args.resize = format('%s^', dims);
args.crop = format('%s+0+0', dims);
args.background = 'white';
args.gravity = 'center';
convert(src, dest, args, def);