Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@mlabs-haskell/cardano-serialization-lib-gc-browser

Package Overview
Dependencies
Maintainers
6
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@mlabs-haskell/cardano-serialization-lib-gc-browser - npm Package Compare versions

Comparing version 1.0.0 to 1.0.1

39

index.js

@@ -1,37 +0,4 @@

const process = (lib) => {
const finRegistry = new FinalizationRegistry((x) => {
try {
x.free();
} catch (_) {}
});
const csl = require("@emurgo/cardano-serialization-lib-browser");
const wrappedCsl = require('@mlabs-haskell/csl-gc-wrapper')(csl);
const classWrap = (classObj) => {
Object.getOwnPropertyNames(classObj).forEach((propName) => {
if (propName === "__wrap") {
const oldMethod = classObj[propName];
classObj[propName] = function () {
const retVal = oldMethod.apply(classObj, arguments);
if (retVal && retVal.ptr) {
const px = new Proxy(retVal, {});
finRegistry.register(px, retVal, px);
return px;
}
return retVal;
};
}
});
return classObj;
};
Object.keys(lib).forEach((k) => {
if (k[0].toUpperCase() == k[0] && k[0] != "_") {
classWrap(lib[k]);
}
});
return lib;
};
const lib = process(await import("@emurgo/cardano-serialization-lib-browser"));
export default lib;
module.exports = wrappedCsl;

8

package.json
{
"name": "@mlabs-haskell/cardano-serialization-lib-gc-browser",
"type": "module",
"version": "1.0.0",
"version": "1.0.1",
"description": "This is a small library that provides a wrapper for managing garbage collection for cardano-serialization-library (Browser version)",
"main": "index.js",
"module": "index.js",
"scripts": {

@@ -17,4 +16,5 @@ "test": "echo \"Error: no test specified\" && exit 1"

"dependencies": {
"@emurgo/cardano-serialization-lib-browser": "^11.4.0"
"@emurgo/cardano-serialization-lib-browser": "^11.2.1",
"@mlabs-haskell/csl-gc-wrapper": "^1.0.1"
}
}
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc