mirror of
https://github.com/less/less.js.git
synced 2026-04-09 03:00:20 -04:00
move functions into its own folder and give it a set interface
This commit is contained in:
18
lib/less/functions/function-registry.js
Normal file
18
lib/less/functions/function-registry.js
Normal file
@@ -0,0 +1,18 @@
|
||||
module.exports = {
|
||||
_data: {},
|
||||
add: function(name, func) {
|
||||
if (this._data.hasOwnProperty(name)) {
|
||||
//TODO warn
|
||||
}
|
||||
this._data[name] = func;
|
||||
},
|
||||
addMultiple: function(functions) {
|
||||
Object.keys(functions).forEach(
|
||||
function(name) {
|
||||
this.add(name, functions[name]);
|
||||
}.bind(this));
|
||||
},
|
||||
get: function(name) {
|
||||
return this._data[name];
|
||||
}
|
||||
};
|
||||
Reference in New Issue
Block a user