mirror of
https://github.com/leanote/desktop-app.git
synced 2025-10-19 10:07:12 +00:00
init add. warning: it can't run!
This commit is contained in:
49
node_modules/jade/lib/utils.js
generated
vendored
Executable file
49
node_modules/jade/lib/utils.js
generated
vendored
Executable file
@@ -0,0 +1,49 @@
|
||||
|
||||
/*!
|
||||
* Jade - utils
|
||||
* Copyright(c) 2010 TJ Holowaychuk <tj@vision-media.ca>
|
||||
* MIT Licensed
|
||||
*/
|
||||
|
||||
/**
|
||||
* Convert interpolation in the given string to JavaScript.
|
||||
*
|
||||
* @param {String} str
|
||||
* @return {String}
|
||||
* @api private
|
||||
*/
|
||||
|
||||
var interpolate = exports.interpolate = function(str){
|
||||
return str.replace(/(\\)?([#!]){(.*?)}/g, function(str, escape, flag, code){
|
||||
return escape
|
||||
? str
|
||||
: "' + "
|
||||
+ ('!' == flag ? '' : 'escape')
|
||||
+ "((interp = " + code.replace(/\\'/g, "'")
|
||||
+ ") == null ? '' : interp) + '";
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* Escape single quotes in `str`.
|
||||
*
|
||||
* @param {String} str
|
||||
* @return {String}
|
||||
* @api private
|
||||
*/
|
||||
|
||||
var escape = exports.escape = function(str) {
|
||||
return str.replace(/'/g, "\\'");
|
||||
};
|
||||
|
||||
/**
|
||||
* Interpolate, and escape the given `str`.
|
||||
*
|
||||
* @param {String} str
|
||||
* @return {String}
|
||||
* @api private
|
||||
*/
|
||||
|
||||
exports.text = function(str){
|
||||
return interpolate(escape(str));
|
||||
};
|
Reference in New Issue
Block a user