API Docs for: 0.2.0
Show:

utils Class

Exports few utility methods and constants for express-yui components.

Item Index

Methods

Properties

Methods

clone

(
  • oldObj
)
Object static

Defined in lib/utils.js:59

Deep clone of an object.

Parameters:

  • oldObj Object

    the origal object to be cloned

Returns:

Object:

The cloned object

extend

(
  • obj
  • supplier
)
Object static

Defined in lib/utils.js:27

Extends object with properties from other objects.

var a = { foo: 'bar' }
  , b = { bar: 'baz' }
  , c = { baz: 'xyz' };

utils.extends(a, b, c);
// a => { foo: 'bar', bar: 'baz', baz: 'xyz' }

Parameters:

  • obj Object

    the receiver object to be extended

  • supplier Object

    objects

Returns:

Object:

The extended object

joinURLFolder

(
  • url
)
String static

Defined in lib/utils.js:120

Utility method to use the loader base and add the folder name that represents a group to complete the new base and root value for each custom group.

utils.joinURLFolder('http://foo.com/bar', 'baz');  // => http://foo.com/bar/baz/
utils.joinURLFolder('https://foo.com/bar', 'baz'); // => https://foo.com/bar/baz/
utils.joinURLFolder('//foo.com/bar/', 'baz');      // => //foo.com/bar/baz/
utils.joinURLFolder('/bar', 'baz');                // => /bar/baz/

Parameters:

  • url String

    the url that should get the new segment added at the end

Returns:

String:

the new url

minifyFunction

(
  • fn
)
Function static

Defined in lib/utils.js:94

Minify the body of a function by removing spaces, tabs, comments, breaklines, etc. This is specially useful to optimize the function before serializing it to send it to the client side as a js blob.

Parameters:

  • fn Function

    the function to minify

Returns:

Function:

the minified function

Properties

debugMode

Boolean static

Defined in lib/utils.js:152

Whether the app is running in debug mode or not. True if nodejs is running in development mode.

DEFAULT_COMBO_CONFIG

Object static

Defined in lib/utils.js:139

The default combo handler configuration for app origin.