@yerofey/cryptowallet-cli 1.17.2 → 1.17.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (3) hide show
  1. package/cli.js +1 -1
  2. package/package.json +1 -1
  3. package/src/utils.js +11 -3
package/cli.js CHANGED
@@ -29,7 +29,7 @@ import Method from './src/Method.js';
29
29
  return new Method('donate').init();
30
30
  }
31
31
 
32
- const chain = options.chain.toUpperCase() || '';
32
+ const chain = options.chain.toUpperCase() || 'ETH';
33
33
  if (supportedChains.includes(chain)) {
34
34
  return new Method('wallet', {
35
35
  chain,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@yerofey/cryptowallet-cli",
3
- "version": "1.17.2",
3
+ "version": "1.17.4",
4
4
  "description": "Crypto wallet generator CLI tool",
5
5
  "type": "module",
6
6
  "homepage": "https://github.com/yerofey/cryptowallet-cli",
package/src/utils.js CHANGED
@@ -37,8 +37,16 @@ const objectHasAllKeys = (obj, keysArray) =>
37
37
 
38
38
  let supportedChains = [];
39
39
  const chainsFolder = path.join(dirname(import.meta.url), 'chains');
40
- supportedChains = filesList(chainsFolder).map((item) =>
41
- item.replace(chainsFolder, '').replace('.json', '').replace('/', '')
42
- );
40
+ supportedChains = filesList(chainsFolder).map((item) => {
41
+ // Normalize path separators to the current OS's default
42
+ const normalizedItemPath = item.split(path.sep).join(path.posix.sep);
43
+ // Remove the chains folder path and the .json extension
44
+ return normalizedItemPath
45
+ .replace(
46
+ chainsFolder.split(path.sep).join(path.posix.sep) + path.posix.sep,
47
+ ''
48
+ )
49
+ .replace('.json', '');
50
+ });
43
51
 
44
52
  export { log, loadFile, loadJson, objectHasAllKeys, supportedChains };