Big News: Socket raises $60M Series C at a $1B valuation to secure software supply chains for AI-driven development.Announcement
Sign In

@harmoniclabs/plutus-data

Package Overview
Dependencies
Maintainers
1
Versions
10
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@harmoniclabs/plutus-data - npm Package Compare versions

Comparing version
1.2.4
to
1.2.6
+13
-12
dist/fromCbor.js

@@ -36,18 +36,19 @@ "use strict";

// any unrecognized tag
tag < BigInt(0) ||
!(Object.getPrototypeOf(data) === cbor_1.CborArray.prototype) ||
!(data instanceof cbor_1.CborArray) // for typescript to be happy
) {
tag < BigInt(0)
|| !(data instanceof cbor_1.CborArray)) {
// ignore the tag and and treats the object as if it were normal CBOR
return dataFromCborObj(data);
}
if (tag === BigInt(102)) {
(0, assert_1.assert)(data.array.length === 2 &&
data.array[0] instanceof cbor_1.CborUInt &&
data.array[1] instanceof cbor_1.CborArray, "invalid fileds for cbor tag 102 while constructing DataConstr");
return new DataConstr_1.DataConstr(data.array[0].num, data.array[1].array.map(dataFromCborObj));
if (tag === BigInt(102)
// DO NOT REMOVE
// THIS IS A FIX TO A EDGE CASE
// `cborTagToConstrNumber` will return 102 for cbor tag 1375 ( which is a DataConstr tag 102 )
&& cborObj.tag !== BigInt(1375)) {
var dataArr = data.array;
if (!(dataArr.length === 2 &&
dataArr[0] instanceof cbor_1.CborUInt &&
dataArr[1] instanceof cbor_1.CborArray))
throw new Error("invalid fileds for cbor tag 102 while constructing DataConstr");
return new DataConstr_1.DataConstr(dataArr[0].num, dataArr[1].array.map(dataFromCborObj));
}
(0, assert_1.assert)((Object.getPrototypeOf(data) === cbor_1.CborArray.prototype) &&
(data instanceof cbor_1.CborArray), // for typescript to be happy
"invalid CBOR fields for DataConstr");
return new DataConstr_1.DataConstr(tag, data.array.map(dataFromCborObj));

@@ -54,0 +55,0 @@ }

import { Data } from "../Data.js";
export type ToDataVersion = "v1" | "v2" | "v3";
export interface ToData {
toData: (version?: "v1" | "v2" | "v3") => Data;
toData: (version?: ToDataVersion) => Data;
}
{
"name": "@harmoniclabs/plutus-data",
"version": "1.2.4",
"version": "1.2.6",
"description": "",

@@ -5,0 +5,0 @@ "main": "./dist/index.js",