Socket
Socket
Sign inDemoInstall

@metamask/utils

Package Overview
Dependencies
Maintainers
8
Versions
36
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@metamask/utils - npm Package Compare versions

Comparing version 3.3.0 to 3.3.1

10

dist/json.d.ts

@@ -59,3 +59,3 @@ import { Infer, Struct } from 'superstruct';

export declare type JsonRpcError = OptionalField<Infer<typeof JsonRpcErrorStruct>, 'data'>;
export declare const JsonRpcParamsStruct: Struct<unknown[] | Record<string, unknown> | undefined, null>;
export declare const JsonRpcParamsStruct: Struct<Record<string, Json> | Json[] | undefined, null>;
export declare type JsonRpcParams = Infer<typeof JsonRpcParamsStruct>;

@@ -66,3 +66,3 @@ export declare const JsonRpcRequestStruct: Struct<{

jsonrpc: "2.0";
params?: unknown[] | Record<string, unknown> | undefined;
params?: Record<string, Json> | Json[] | undefined;
}, {

@@ -72,3 +72,3 @@ id: Struct<string | number | null, null>;

method: Struct<string, null>;
params: Struct<unknown[] | Record<string, unknown> | undefined, null>;
params: Struct<Record<string, Json> | Json[] | undefined, null>;
}>;

@@ -87,3 +87,3 @@ export declare type InferWithParams<Type extends Struct<any, unknown>, Params extends JsonRpcParams> = Omit<Infer<Type>, 'params'> & (keyof Params extends undefined ? {

jsonrpc: "2.0";
params?: unknown[] | Record<string, unknown> | undefined;
params?: Record<string, Json> | Json[] | undefined;
}, Omit<{

@@ -93,3 +93,3 @@ id: Struct<string | number | null, null>;

method: Struct<string, null>;
params: Struct<unknown[] | Record<string, unknown> | undefined, null>;
params: Struct<Record<string, Json> | Json[] | undefined, null>;
}, "id">>;

@@ -96,0 +96,0 @@ /**

@@ -5,7 +5,10 @@ "use strict";

const superstruct_1 = require("superstruct");
const assert_1 = require("./assert");
const misc_1 = require("./misc");
const assert_1 = require("./assert");
exports.JsonStruct = (0, superstruct_1.define)('Json', (value) => {
const [isValid] = validateJsonAndGetSize(value, true);
return isValid;
if (!isValid) {
return 'Expected a valid JSON-serializable value';
}
return true;
});

@@ -35,3 +38,3 @@ /**

});
exports.JsonRpcParamsStruct = (0, superstruct_1.optional)((0, superstruct_1.union)([(0, superstruct_1.object)(), (0, superstruct_1.array)()]));
exports.JsonRpcParamsStruct = (0, superstruct_1.optional)((0, superstruct_1.union)([(0, superstruct_1.record)((0, superstruct_1.string)(), exports.JsonStruct), (0, superstruct_1.array)(exports.JsonStruct)]));
exports.JsonRpcRequestStruct = (0, superstruct_1.object)({

@@ -38,0 +41,0 @@ id: exports.JsonRpcIdStruct,

{
"name": "@metamask/utils",
"version": "3.3.0",
"version": "3.3.1",
"description": "Various JavaScript/TypeScript utilities of wide relevance to the MetaMask codebase.",

@@ -5,0 +5,0 @@ "repository": {

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