UNPKG

cwebp

Version:

node.js wrapper for cwebp and dwebp binaries from WebP image processing utility

34 lines (32 loc) 892 B
// Generated by CoffeeScript 1.12.7 var slice = [].slice; module.exports = { command: function() { var args, ref; args = 1 <= arguments.length ? slice.call(arguments, 0) : []; (ref = this._args._).push.apply(ref, args); return this; }, _arg: function() { var key, vals; key = arguments[0], vals = 2 <= arguments.length ? slice.call(arguments, 1) : []; this._args[key] = vals; return this; }, args: function() { var args, key, preset, ref, vals; args = []; if (preset = this._args.preset) { args.push.apply(args, ['-preset'].concat(slice.call(preset))); } ref = this._args; for (key in ref) { vals = ref[key]; if (key === '_' || key === '-' || key === 'preset') { continue; } args.push.apply(args, ["-" + key].concat(slice.call(vals))); } return args.concat(this._args._); } };