nano-pow 5.1.6 → 5.1.7

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 (2) hide show
  1. package/dist/main.min.js +6 -3
  2. package/package.json +3 -2
package/dist/main.min.js CHANGED
@@ -1387,8 +1387,11 @@ async function generate4(hash, difficulty, effort, debug) {
1387
1387
  // src/lib/config/index.ts
1388
1388
  //! SPDX-FileCopyrightText: 2025 Chris Duncan <chris@zoso.dev>
1389
1389
  //! SPDX-License-Identifier: GPL-3.0-or-later
1390
- var NanoPowConfigConstructor = class _NanoPowConfigConstructor {
1390
+ var NanoPowConfigConstructor = class {
1391
1391
  static #isInternal = false;
1392
+ static get isInternal() {
1393
+ return this.#isInternal;
1394
+ }
1392
1395
  api;
1393
1396
  debug;
1394
1397
  difficulty;
@@ -1402,14 +1405,13 @@ var NanoPowConfigConstructor = class _NanoPowConfigConstructor {
1402
1405
  };
1403
1406
  }
1404
1407
  constructor(api, debug, difficulty, effort) {
1405
- if (!_NanoPowConfigConstructor.#isInternal) {
1408
+ if (!this.constructor.isInternal) {
1406
1409
  throw new TypeError(`NanoPowConfig cannot be constructed with 'new'.`);
1407
1410
  }
1408
1411
  this.api = api;
1409
1412
  this.debug = debug;
1410
1413
  this.difficulty = difficulty;
1411
1414
  this.effort = effort;
1412
- _NanoPowConfigConstructor.#isInternal = false;
1413
1415
  }
1414
1416
  static async create(options) {
1415
1417
  const input = options;
@@ -1419,6 +1421,7 @@ var NanoPowConfigConstructor = class _NanoPowConfigConstructor {
1419
1421
  const effort = this.#getValidEffort(input);
1420
1422
  this.#isInternal = true;
1421
1423
  const config = new this(api, debug, difficulty, effort);
1424
+ this.#isInternal = false;
1422
1425
  return config;
1423
1426
  }
1424
1427
  // Check platform support for default API setting
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "nano-pow",
3
- "version": "5.1.6",
3
+ "version": "5.1.7",
4
4
  "description": "Proof-of-work generation and validation with WebGPU/WebGL/WASM for Nano cryptocurrency.",
5
5
  "keywords": [
6
6
  "nemo",
@@ -43,8 +43,9 @@
43
43
  },
44
44
  "scripts": {
45
45
  "benchmark": "npm run build && ./dist/bin/nano-pow.sh --benchmark 10 --debug",
46
- "build": "rm -rf {dist,types} && tsc && npm run generate && node esbuild.mjs && cp -p src/bin/nano-pow.sh dist/bin",
46
+ "build": "npm run clean && npm run generate && node esbuild.mjs && cp -p src/bin/nano-pow.sh dist/bin",
47
47
  "build:dev": "NODE_ENV=development npm run build",
48
+ "clean": "rm -rf dist types && tsc",
48
49
  "generate": "node ./scripts/blake2b-gen.js && asc src/lib/generate/wasm/asm/index.ts",
49
50
  "prepare": "npm run build",
50
51
  "score": "npm run build && ./dist/bin/nano-pow.sh --effort 4 --benchmark 10 --score 10",