X-Git-Url: http://git.squeep.com/?p=squeep-indieauth-helper;a=blobdiff_plain;f=lib%2Fcommon.js;fp=lib%2Fcommon.js;h=7a918bb9f4eaf1d7b588152d35290268ced89aa5;hp=b52b819da963d5172a06779e279cf3e2531acbcb;hb=ddf28d2e4816d7c4e188f8dd510b48ad87aee478;hpb=45d151c0587750c9a8ed3e3180ca79139a6ccb5e diff --git a/lib/common.js b/lib/common.js index b52b819..7a918bb 100644 --- a/lib/common.js +++ b/lib/common.js @@ -1,21 +1,5 @@ 'use strict'; -const path = require('path'); -const { name: packageName, version: packageVersion } = require('../package'); - -const libraryIdentifier = `${packageName}@${packageVersion}`; - -/** - * Return a function which combines a part of the filename with a scope, for use in logging. - * @param {string} filename - */ -const fileScope = (filename) => { - const shortFilename = path.basename(filename, '.js'); - const fScope = (shortFilename === 'index') ? path.basename(path.dirname(filename)) : shortFilename; - return (scope) => [libraryIdentifier, fScope, scope].join(':'); -} - - /** * Pick out useful got response fields. * @param {GotResponse} res @@ -108,10 +92,9 @@ const properURLComponentName = (component) => { module.exports = { - fileScope, gotResponseLogData, logTruncate, pick, setSymmetricDifference, properURLComponentName, -}; \ No newline at end of file +};