detectPackage protection?

This commit is contained in:
Jaco Greeff
2020-12-17 17:18:57 +01:00
parent 4625944ee4
commit 81101b69a3
4 changed files with 25 additions and 24 deletions
+2 -2
View File
@@ -15,8 +15,8 @@
},
"devDependencies": {
"@polkadot/dev": "^0.61.8",
"@polkadot/util": "^5.0.2-6",
"@polkadot/x-randomvalues": "^5.0.2-6",
"@polkadot/util": "^5.0.2-7",
"@polkadot/x-randomvalues": "^5.0.2-7",
"override-require": "^1.1.1"
},
"peerDependencies": {
+1 -1
View File
@@ -5,6 +5,6 @@ const util = require('@polkadot/util');
const packageInfo = require('./package-info.json');
util.detectPackage(packageInfo, () => __dirname);
util.detectPackage(packageInfo, () => typeof __dirname !== 'undefined' && __dirname);
exports.packageInfo = packageInfo;
+2 -1
View File
@@ -5,6 +5,7 @@ import { detectPackage } from '@polkadot/util';
import packageInfo from './package-info.json';
detectPackage(packageInfo, () => import.meta.url);
// eslint-disable-next-line @typescript-eslint/no-implied-eval,no-new-func
detectPackage(packageInfo, () => new Function('import()') && import.meta.url);
export { packageInfo };