Module: tastypie/lib/util

General helpers

Author:
  • Eric Satterwhite
Source:

Methods


<static> createCallback(Arguments)

returns a node style callback if from a list of arguments

Parameters:
Name Type Argument Description
Arguments Object <repeatable>

to generate a callback from

Source:
Returns:
Type
function

<static> toModule(string [, resolve])

Parameters:
Name Type Argument Description
string String

to a module or module member to resolve

resolve Boolean <optional>

True to force path resoluation. by default, if the string starts with a dot, the path will be resolved

Source:
Examples
toModule('express/router.Router') // returns Router class from express router module
toModule('./packages/hive-stdlib/string.startWith') // returns startsWith function from string module with auth path resolution
toModule('test/module', true) // attempts to require module called test/module relative to the process's CWD