This app provides monitoring and information features for the common freifunk user and the technical stuff of a freifunk community.
Code base is taken from a TUM Practical Course project and added here to see if Freifunk Altdorf can use it.
https://www.freifunk-altdorf.de
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
32 lines
791 B
32 lines
791 B
var AST = require('../../lib/ast-js/ast'); |
|
|
|
var artVar = new AST.Variable('ART'), |
|
moduleVar = new AST.Variable('module'), |
|
exportsProp = moduleVar.property('exports'), |
|
requireVar = new AST.Variable('require'), |
|
requireART = requireVar.call('art'), |
|
requireStatement = artVar.assign(requireART); |
|
|
|
var Modulizer = { |
|
|
|
artVar: artVar, |
|
|
|
toExpression: function(){ |
|
throw new Error('You need to implement toExpression on this class.'); |
|
}, |
|
|
|
_toModuleStatements: function(){ |
|
var fn = new AST.Function(null, null, [ new AST.Return(this.toExpression()) ]); |
|
return [requireStatement, exportsProp.assign(fn)]; |
|
}, |
|
|
|
toModule: function(){ |
|
return new AST.Block( |
|
// Make this overridable even when mixed in |
|
Modulizer._toModuleStatements.call(this) |
|
); |
|
} |
|
|
|
}; |
|
|
|
module.exports = Modulizer; |