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

dreambase-library

Package Overview
Dependencies
Maintainers
1
Versions
22
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

dreambase-library - npm Package Compare versions

Comparing version 1.0.7 to 1.0.8

1

dist/typeson-simplified/types/bigint.d.ts
import { TypeDefSet } from "../TypeDefSet.js";
export declare const MAXUINT64: number | bigint;
declare const bigIntDef: TypeDefSet;
export default bigIntDef;
//# sourceMappingURL=bigint.d.ts.map

23

dist/typeson-simplified/types/bigint.js
import { b64ToBigInt, bigint2B64 } from "../../common/bigint-conversion.js";
export const MAXUINT64 = typeof BigInt !== "undefined"
? BigInt("18446744073709551615")
: 281474976710655;
const bigIntDef = {
bigint: {
replace: (realVal) => {
const negative = realVal < 0;
const b64 = bigint2B64(negative ? -realVal : realVal);
return negative
? {
if (realVal <= MAXUINT64) {
// Negative and realtively small numbers - represent as normal numbers
return { $t: "bigint", v: "" + realVal };
}
else {
// Very large positive numbers - compress to base64
const b64 = bigint2B64(realVal);
return {
$t: "bigint",
neg: true,
b64,
}
: {
$t: "bigint",
b64,
};
}
},
revive: ({ neg, b64 }) => neg ? -b64ToBigInt(b64) : b64ToBigInt(b64),
revive: (obj) => ("v" in obj ? BigInt(obj.v) : b64ToBigInt(obj.b64)),
},
};
export default bigIntDef;

@@ -82,6 +82,2 @@ const { toString: toStr } = {};

switch (typeof realVal) {
case "string":
case "boolean":
case "undefined":
return typeDefs[type];
case "number":

@@ -91,4 +87,2 @@ return isNaN(realVal) || realVal === Infinity || realVal === -Infinity

: typeDefs.NormalNumber;
case "bigint":
return typeDefs.bigint;
case "object":

@@ -119,6 +113,6 @@ case "function": {

}
case "symbol":
return typeDefs.symbol;
default:
return typeDefs[type];
}
}
}
{
"name": "dreambase-library",
"version": "1.0.7",
"version": "1.0.8",
"description": "Library of dreambase-related code for use in other libraries.",

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

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

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