requirejs-esm 2.2.0 → 2.2.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/plugin.js CHANGED
@@ -85276,16 +85276,21 @@
85276
85276
  if (length <= ++index) return false
85277
85277
  arg = args[index];
85278
85278
  }
85279
- return (arg.type === 'FunctionExpression' ||
85280
- arg.type === 'ArrowFunctionExpression' ||
85281
- arg.type === 'ObjectExpression') && { namespace, func, name, deps }
85279
+ if (arg.type === 'FunctionExpression' || arg.type === 'ArrowFunctionExpression') {
85280
+ return { namespace, func, name, deps, factory: arg }
85281
+ }
85282
+ return arg.type === 'ObjectExpression' && { namespace, func, name, deps, output: arg }
85282
85283
  }
85283
85284
 
85284
85285
  // require([deps], success, error)
85285
85286
  if (func.name === 'require') {
85286
85287
  const deps = args[0];
85287
- return deps.type === 'ArrayExpression' && length >= 2 &&
85288
- args[1].type === 'FunctionExpression' && { func, deps }
85288
+ if (deps.type === 'ArrayExpression' && length >= 2) {
85289
+ const body = args[1];
85290
+ if (body.type === 'FunctionExpression' || body.type === 'ArrowFunctionExpression') {
85291
+ return { func, deps, body }
85292
+ }
85293
+ }
85289
85294
  }
85290
85295
  }
85291
85296