* Utility and miscellaneous functions.
*/
-const path = require('path');
-const crypto = require('crypto');
+const crypto = require('node:crypto');
const uuid = require('uuid');
const Enum = require('./enum');
-
-/**
- * @callback ScopeFn
- * @param {String} scope
- * @returns {String}
- */
-/**
- * Return a function which prefixes a provided scope with the most-
- * relevant part of the filename, for use in logging.
- * @param {String} filename
- * @returns {ScopeFn}
- */
-const fileScope = (filename) => {
- let fScope = path.basename(filename, '.js');
- if (fScope === 'index') {
- fScope = path.basename(path.dirname(filename));
- }
- return (scope) => `${fScope}:${scope}`;
-};
+const { fileScope } = require('@squeep/log-helper');
/**
* Simple ETag from data.