/usr/lib/nodejs/lazy-debug-legacy/src/index.js is in node-lazy-debug-legacy 0.0.1-1.
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 29 30 | var debug = require('debug');
var getModuleDebugId = require('./functions').getModuleDebugId;
var filter;
var cache = {};
var api = module.exports = {
configure: function(opts) {
if ( !opts ) opts = {};
if ( opts.filter && typeof opts.filter === 'function' ) {
filter = opts.filter;
cache = {};
}
},
get: function( filename, submoduleName ) {
return debug(api.getModuleDebugName(filename, submoduleName));
},
getModuleDebugName: function ( filename, submoduleName ) {
var name = cache[filename];
if ( !name ) {
name = getModuleDebugId(filename, {platform: process.platform, filter:filter});
cache[filename] = name;
}
if ( submoduleName ) {
return name + ':' + submoduleName;
} else {
return name;
}
}
};
|