Skip to content

Commit

Permalink
fix(compatibility): Make Module assignment more generic. (#38)
Browse files Browse the repository at this point in the history
  • Loading branch information
jdalton authored and danez committed Nov 10, 2017
1 parent e4dada2 commit e543ad0
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/index.js
@@ -1,8 +1,13 @@
/* (c) 2015 Ari Porad (@ariporad) <http://ariporad.com>. License: ariporad.mit-license.org */
import Module from 'module';
import BuiltinModule from 'module';
import path from 'path';
import nodeModulesRegex from 'node-modules-regexp';

// Guard against poorly mocked module constructors.
const Module = module.constructor.length > 1
? module.constructor
: BuiltinModule;

const HOOK_RETURNED_NOTHING_ERROR_MESSAGE = '[Pirates] A hook returned a non-string, or nothing at all! This is a' +
' violation of intergalactic law!\n' +
'--------------------\n' +
Expand Down

0 comments on commit e543ad0

Please sign in to comment.