@javakha77/circomlibjs-hinkal-fork 0.0.11 → 0.0.12

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.
package/main.js CHANGED
@@ -3,3 +3,9 @@ export { default as buildBabyjub } from "./src/babyjub.js";
3
3
  export { default as buildEddsa } from "./src/eddsa.js";
4
4
 
5
5
  export { buildPoseidon, buildPoseidonWasm } from "./src/poseidon_wasm.js";
6
+
7
+ export { buildEddsaRN } from "./src/EddsaRN.js";
8
+
9
+ export { BabyJubRN } from "./src/babyjubRN.js";
10
+
11
+ export { PoseidonRN } from "./src/poseidonRN.js";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@javakha77/circomlibjs-hinkal-fork",
3
- "version": "0.0.11",
3
+ "version": "0.0.12",
4
4
  "description": "Javascript library to work with circomlib",
5
5
  "keywords": [
6
6
  "circom",
@@ -1,28 +1,6 @@
1
1
  /**
2
2
  * @typedef {((key: string, value: any) => any) | null} JsonReplacer
3
3
  */
4
-
5
- /**
6
- * Deep-clones a value into plain JSON-serializable data: every `bigint` becomes a decimal string.
7
- * Use with `res.json(...)` so Express never hits "Do not know how to serialize a BigInt".
8
- */
9
- export const toJsonSafe = (value) => {
10
- if (typeof value === 'bigint') {
11
- return value.toString();
12
- }
13
- if (value === null || typeof value !== 'object') {
14
- return value;
15
- }
16
- if (Array.isArray(value)) {
17
- return value.map((item) => toJsonSafe(item));
18
- }
19
- if (value instanceof Date) {
20
- return value.toISOString();
21
- }
22
- return Object.fromEntries(
23
- Object.entries(value).map(([key, nested]) => [key, toJsonSafe(nested)]),
24
- );
25
- };
26
4
 
27
5
  // Safe JSON.stringify wrapper. Converts BigInt -> string so JSON serialization never throws.
28
6
  export const safeJsonStringify = (value, replacer = null, space) =>
@@ -33,17 +11,4 @@ export const toJsonSafe = (value) => {
33
11
  return typeof next === 'bigint' ? next.toString() : next;
34
12
  },
35
13
  space,
36
- );
37
-
38
- export const CustomJSONStringify = (args) => {
39
- return JSON.stringify(args, (_, value) => (typeof value === 'bigint' ? `bigint:${value.toString()}` : value));
40
- };
41
-
42
- export const CustomJSONParse = (stringifiedJSON) => {
43
- return JSON.parse(stringifiedJSON, (_, value) => {
44
- if (typeof value === 'string' && value.startsWith('bigint:')) {
45
- return BigInt(value.slice(7));
46
- }
47
- return value;
48
- });
49
- };
14
+ );