-
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
tunnckoCore
committed
Mar 4, 2016
1 parent
1991526
commit 424e505
Showing
5 changed files
with
125 additions
and
55 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
'use strict' | ||
|
||
/** | ||
* Module dependencies | ||
*/ | ||
|
||
var utils = require('lazy-cache')(require) | ||
|
||
/** | ||
* Temporarily re-assign `require` to trick browserify and | ||
* webpack into reconizing lazy dependencies. | ||
* | ||
* This tiny bit of ugliness has the huge dual advantage of | ||
* only loading modules that are actually called at some | ||
* point in the lifecycle of the application, whilst also | ||
* allowing browserify and webpack to find modules that | ||
* are depended on but never actually called. | ||
*/ | ||
|
||
var fn = require | ||
require = utils // eslint-disable-line no-undef, no-native-reassign | ||
|
||
/** | ||
* Lazily required module dependencies | ||
*/ | ||
|
||
require('arr-map') | ||
require('bind-context') | ||
require('is-arguments') | ||
require('isobject') | ||
require('useware') | ||
|
||
/** | ||
* Restore `require` | ||
*/ | ||
|
||
require = fn // eslint-disable-line no-undef, no-native-reassign | ||
|
||
utils.isObject = function isObject (val) { | ||
if (!val) return false | ||
if (utils.isArguments(val)) return false | ||
if (utils.isobject(val)) return true | ||
return false | ||
} | ||
|
||
/** | ||
* Expose `utils` modules | ||
*/ | ||
|
||
module.exports = utils |