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.
125 lines
2.9 KiB
125 lines
2.9 KiB
"use strict"; |
|
|
|
Object.defineProperty(exports, "__esModule", { |
|
value: true |
|
}); |
|
exports.default = void 0; |
|
|
|
function _helperPluginUtils() { |
|
const data = require("@babel/helper-plugin-utils"); |
|
|
|
_helperPluginUtils = function () { |
|
return data; |
|
}; |
|
|
|
return data; |
|
} |
|
|
|
function _helperAnnotateAsPure() { |
|
const data = _interopRequireDefault(require("@babel/helper-annotate-as-pure")); |
|
|
|
_helperAnnotateAsPure = function () { |
|
return data; |
|
}; |
|
|
|
return data; |
|
} |
|
|
|
function _helperFunctionName() { |
|
const data = _interopRequireDefault(require("@babel/helper-function-name")); |
|
|
|
_helperFunctionName = function () { |
|
return data; |
|
}; |
|
|
|
return data; |
|
} |
|
|
|
function _helperSplitExportDeclaration() { |
|
const data = _interopRequireDefault(require("@babel/helper-split-export-declaration")); |
|
|
|
_helperSplitExportDeclaration = function () { |
|
return data; |
|
}; |
|
|
|
return data; |
|
} |
|
|
|
function _core() { |
|
const data = require("@babel/core"); |
|
|
|
_core = function () { |
|
return data; |
|
}; |
|
|
|
return data; |
|
} |
|
|
|
function _globals() { |
|
const data = _interopRequireDefault(require("globals")); |
|
|
|
_globals = function () { |
|
return data; |
|
}; |
|
|
|
return data; |
|
} |
|
|
|
var _transformClass = _interopRequireDefault(require("./transformClass")); |
|
|
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } |
|
|
|
const getBuiltinClasses = category => Object.keys(_globals().default[category]).filter(name => /^[A-Z]/.test(name)); |
|
|
|
const builtinClasses = new Set([...getBuiltinClasses("builtin"), ...getBuiltinClasses("browser")]); |
|
|
|
var _default = (0, _helperPluginUtils().declare)((api, options) => { |
|
api.assertVersion(7); |
|
const { |
|
loose |
|
} = options; |
|
const VISITED = Symbol(); |
|
return { |
|
visitor: { |
|
ExportDefaultDeclaration(path) { |
|
if (!path.get("declaration").isClassDeclaration()) return; |
|
(0, _helperSplitExportDeclaration().default)(path); |
|
}, |
|
|
|
ClassDeclaration(path) { |
|
const { |
|
node |
|
} = path; |
|
const ref = node.id || path.scope.generateUidIdentifier("class"); |
|
path.replaceWith(_core().types.variableDeclaration("let", [_core().types.variableDeclarator(ref, _core().types.toExpression(node))])); |
|
}, |
|
|
|
ClassExpression(path, state) { |
|
const { |
|
node |
|
} = path; |
|
if (node[VISITED]) return; |
|
const inferred = (0, _helperFunctionName().default)(path); |
|
|
|
if (inferred && inferred !== node) { |
|
path.replaceWith(inferred); |
|
return; |
|
} |
|
|
|
node[VISITED] = true; |
|
path.replaceWith((0, _transformClass.default)(path, state.file, builtinClasses, loose)); |
|
|
|
if (path.isCallExpression()) { |
|
(0, _helperAnnotateAsPure().default)(path); |
|
|
|
if (path.get("callee").isArrowFunctionExpression()) { |
|
path.get("callee").arrowFunctionToExpression(); |
|
} |
|
} |
|
} |
|
|
|
} |
|
}; |
|
}); |
|
|
|
exports.default = _default; |