From e7bfc24a941e1d73de88de3f4a034e1da33cc8ae Mon Sep 17 00:00:00 2001 From: Dzmitry Shuiski Date: Fri, 3 Jan 2025 15:31:26 +0100 Subject: [PATCH] Allow "constructor" property This change is necessary since the "constructor" property frequently appears when working with Cardano datums. However, it may also place additional responsibility on library users to sanitize user input properly, preventing JS prototype pollution attacks where applicable. --- src/Aeson.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/Aeson.js b/src/Aeson.js index 70a8dd2..ede8331 100644 --- a/src/Aeson.js +++ b/src/Aeson.js @@ -1,4 +1,8 @@ -import JSONbig from "@mlabs-haskell/json-bigint"; +import JSONbigConfigurable from "@mlabs-haskell/json-bigint"; +const JSONbig = JSONbigConfigurable({ + protoAction: "error", + constructorAction: "preserve" +}); const identity = x => x; const constant = x => _ => x;