Skip to content

Instantly share code, notes, and snippets.

@craigmarvelley
Created November 4, 2011 13:20
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save craigmarvelley/1339292 to your computer and use it in GitHub Desktop.
Save craigmarvelley/1339292 to your computer and use it in GitHub Desktop.
Titanium 1.7.5 and underscore.string.js
// (Starting line 446)
// CommonJS module is defined
if (typeof module !== 'undefined' && module.exports) {
// Export module
module.exports = _s;
// Added: Support Titanium's CommonJS implementation)
} else if (typeof exports !== 'undefined' && exports) {
exports._s = _s;
// Integrate with Underscore.js
} else if (typeof root._ !== 'undefined') {
root._.mixin(_s);
// Or define it
} else {
root._ = _s;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment