MCPcopy
hub / github.com/browserify/browserify / addTransform

Function addTransform

bin/args.js:196–212  ·  view source on GitHub ↗
(t, opts)

Source from the content-addressed store, hash-verified

194 ;
195
196 function addTransform (t, opts) {
197 if (typeof t === 'string' || typeof t === 'function') {
198 b.transform(opts, t);
199 }
200 else if (t && typeof t === 'object') {
201 if (!t._[0] || typeof t._[0] !== 'string') {
202 return error(
203 'expected first parameter to be a transform string'
204 );
205 }
206 if (opts) Object.keys(opts).forEach(function (key) {
207 t[key] = opts[key];
208 });
209 b.transform(t, t._.shift());
210 }
211 else error('unexpected transform of type ' + typeof t);
212 }
213
214 [].concat(argv.command).filter(Boolean)
215 .forEach(function (c) {

Callers 1

args.jsFile · 0.85

Calls 1

errorFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…