/usr/lib/nodejs/mithril/module/module.js is in node-mithril 1.1.6-2.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 | "use strict"
require.$$modules = {}
require.$$current = function() {
var href = window.location.href
var searchIndex = href.indexOf("?")
var hashIndex = href.indexOf("#")
var pathnameEnd = searchIndex > -1 ? searchIndex : hashIndex > -1 ? hashIndex : href.length
try {throw new Error} catch (e) {var error = e}
var src = error.stack.match(/^(?:(?!^Error|\/module\/module\.js).)*$/m).toString().match(/((?:file|https|http):\/\/.+)(?::\d+){2}/)[1] || href.slice(0, pathnameEnd)
return src.replace(/\.js$/, "")
}
window.module = {
get exports() {return require.$$modules[require.$$current()]},
set exports(value) {require.$$modules[require.$$current()] = value},
}
function require(name) {
var relative = require.$$current()
var slashIndex = relative.lastIndexOf("/")
var path = slashIndex > -1 ? relative.slice(0, slashIndex + 1) : "./"
var absolute = (path + name).replace(/\/\.\//g, "/")
var dotdot = /\/[^\/]+?\/\.{2}/
while (dotdot.test(absolute)) absolute = absolute.replace(dotdot, "")
if (absolute in require.$$modules) return require.$$modules[absolute]
else throw new Error("Module does not exist: " + absolute)
}
|