mirror of
https://github.com/marko-js/marko.git
synced 2025-12-08 19:26:05 +00:00
Marko v3: Removed helper functions that are no longer used
This commit is contained in:
parent
e59e50b790
commit
0c87b4a91a
@ -131,18 +131,6 @@ module.exports = {
|
|||||||
array(callback);
|
array(callback);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
/**
|
|
||||||
* Internal helper method to handle native for loops
|
|
||||||
* @private
|
|
||||||
*/
|
|
||||||
fl: function (array, func) {
|
|
||||||
if (array != null) {
|
|
||||||
if (!Array.isArray(array)) {
|
|
||||||
array = [array];
|
|
||||||
}
|
|
||||||
func(array, 0, array.length);
|
|
||||||
}
|
|
||||||
},
|
|
||||||
/**
|
/**
|
||||||
* Internal helper method for looping over the properties of any object
|
* Internal helper method for looping over the properties of any object
|
||||||
* @private
|
* @private
|
||||||
@ -179,17 +167,6 @@ module.exports = {
|
|||||||
* @private
|
* @private
|
||||||
*/
|
*/
|
||||||
xa: escapeXmlAttr,
|
xa: escapeXmlAttr,
|
||||||
/**
|
|
||||||
* Internal helper to prevent an object from being escaped
|
|
||||||
* @private
|
|
||||||
*/
|
|
||||||
nx: function (str) {
|
|
||||||
return {
|
|
||||||
toString: function () {
|
|
||||||
return str;
|
|
||||||
}
|
|
||||||
};
|
|
||||||
},
|
|
||||||
/**
|
/**
|
||||||
* Internal method to render a single HTML attribute
|
* Internal method to render a single HTML attribute
|
||||||
* @private
|
* @private
|
||||||
@ -256,36 +233,19 @@ module.exports = {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
/**
|
|
||||||
* Internal helper method that captures the output of rendering.
|
|
||||||
* This function works by swapping out the underlying writer to
|
|
||||||
* a temporary writer that buffers a string. The provided function
|
|
||||||
* is executed and the old writer is restored. Finally, the buffered
|
|
||||||
* string is returned.
|
|
||||||
*/
|
|
||||||
c: function (out, func) {
|
|
||||||
var output = out.captureString(func);
|
|
||||||
return {
|
|
||||||
toString: function () {
|
|
||||||
return output;
|
|
||||||
}
|
|
||||||
};
|
|
||||||
},
|
|
||||||
/**
|
/**
|
||||||
* Internal method to handle includes/partials
|
* Internal method to handle includes/partials
|
||||||
* @private
|
* @private
|
||||||
*/
|
*/
|
||||||
i: function(out, path, data) {
|
i: function(out, template, data) {
|
||||||
if (!path) {
|
if (!template) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (typeof path === 'string') {
|
if (typeof template.render === 'function') {
|
||||||
runtime.render(path, data, out);
|
template.render(data, out);
|
||||||
} else if (typeof path.render === 'function') {
|
|
||||||
path.render(data, out);
|
|
||||||
} else {
|
} else {
|
||||||
throw new Error('Invalid template');
|
throw new Error('Invalid template: ' + template);
|
||||||
}
|
}
|
||||||
|
|
||||||
return this;
|
return this;
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user