Last active
December 19, 2015 12:58
-
-
Save subhaze/5958260 to your computer and use it in GitHub Desktop.
'Cause mootools is cool.
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
jQuery.moo = { | |
substitute: function(str, object, regexp){ | |
return String(str).replace(regexp || (/\\?\{([^{}]+)\}/g), function(match, name){ | |
if (match.charAt(0) == '\\') return match.slice(1); | |
return (object[name] != null) ? object[name] : ''; | |
}); | |
} | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment