This file contains hidden or 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
function toCamelCase(string) { | |
string = string.toLowerCase().replace(/(?:(^.)|([-_\s]+.))/g, function(match) { | |
return match.charAt(match.length-1).toUpperCase(); | |
}); | |
return string.charAt(0).toLowerCase() + string.substring(1); | |
} |
This file contains hidden or 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
/* Examples: | |
* var test = "test {0} {1}, {2} - {0} {1} {2}".format('a', 'b', 'c'); | |
* var test2 = "the {0} ate the {1}".format("cat", "canary"); | |
*/ | |
String.prototype.format = function () { | |
var self = this; | |
var re = /\{\d+\}/g; | |
var m = self.match(re); | |
var indexes = []; | |
This file contains hidden or 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
(function(AP, isF) { | |
'use strict'; | |
// isArray : https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/Array/isArray | |
Array.isArray || (Array.isArray = function (a) { | |
return Object.prototype.toString.call(a) == "[object Array]"; | |
}); | |
// toSource(Non-standard) | |
AP.toSource || (AP.toSource = function() { |