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

@adt/json-rpc

Package Overview
Dependencies
Maintainers
1
Versions
19
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@adt/json-rpc - npm Package Compare versions

Comparing version 0.0.1-SNAPSHOT.12 to 0.0.1-SNAPSHOT.13

65

dist/JsonRpc.cjs.js

@@ -213,2 +213,64 @@ 'use strict';

/**
* UUID
* @constructor
*/
function UUID(uuid) {
return Object.create(UUID.prototype,/** @lends UUID.prototype */ {
value : { value : uuid, writable : true},
serialize : {value : function() {
const val = this.value;
return [
val[0] + val[1],
val[2],
val[3],
val[4],
val[5] + val[6] + val[7]].join("-");
}}
});
}
UUID.randomUUID = function () {
return UUID(guid());
};
UUID.fromString = function(str) {
const replaced = str.replace(/-/g,"");
const a = [];
for(let i=0;i<32;i+=4){
a.push(replaced.slice(i,i+4));
}
return UUID(a);
};
/**
* Helper function
* @returns {String}
*/
function s4() {
return Math.floor((1 + Math.random()) * 0x10000).toString(16).substring(1);
}
/**
* Helper function
* @return {Array}
*/
function guid() {
const ar=[];
for(let i=0;i<8;i++){
ar.push(s4());
}
return ar;
}
/**
* JSON-RPC Request

@@ -231,4 +293,3 @@ * TODO: Maybe length of 'method' parameter should be checked? Specification does not say anything about empty string as method name

//this.id = "id" in o ? o.id : UUID.randomUUID().serialize();
const id = "id" in o ? o.id : 1;
const id = "id" in o ? o.id : UUID.randomUUID();

@@ -235,0 +296,0 @@ return Object.freeze(Object.create(JsonRpcRequest.prototype,/** @lends JsonRpcRequest.prototype */ {

@@ -209,2 +209,64 @@ /**

/**
* UUID
* @constructor
*/
function UUID(uuid) {
return Object.create(UUID.prototype,/** @lends UUID.prototype */ {
value : { value : uuid, writable : true},
serialize : {value : function() {
const val = this.value;
return [
val[0] + val[1],
val[2],
val[3],
val[4],
val[5] + val[6] + val[7]].join("-");
}}
});
}
UUID.randomUUID = function () {
return UUID(guid());
};
UUID.fromString = function(str) {
const replaced = str.replace(/-/g,"");
const a = [];
for(let i=0;i<32;i+=4){
a.push(replaced.slice(i,i+4));
}
return UUID(a);
};
/**
* Helper function
* @returns {String}
*/
function s4() {
return Math.floor((1 + Math.random()) * 0x10000).toString(16).substring(1);
}
/**
* Helper function
* @return {Array}
*/
function guid() {
const ar=[];
for(let i=0;i<8;i++){
ar.push(s4());
}
return ar;
}
/**
* JSON-RPC Request

@@ -227,4 +289,3 @@ * TODO: Maybe length of 'method' parameter should be checked? Specification does not say anything about empty string as method name

//this.id = "id" in o ? o.id : UUID.randomUUID().serialize();
const id = "id" in o ? o.id : 1;
const id = "id" in o ? o.id : UUID.randomUUID();

@@ -231,0 +292,0 @@ return Object.freeze(Object.create(JsonRpcRequest.prototype,/** @lends JsonRpcRequest.prototype */ {

@@ -221,2 +221,64 @@ (function (global, factory) {

/**
* UUID
* @constructor
*/
function UUID(uuid) {
return Object.create(UUID.prototype,/** @lends UUID.prototype */ {
value : { value : uuid, writable : true},
serialize : {value : function() {
const val = this.value;
return [
val[0] + val[1],
val[2],
val[3],
val[4],
val[5] + val[6] + val[7]].join("-");
}}
});
}
UUID.randomUUID = function () {
return UUID(guid());
};
UUID.fromString = function(str) {
const replaced = str.replace(/-/g,"");
const a = [];
for(let i=0;i<32;i+=4){
a.push(replaced.slice(i,i+4));
}
return UUID(a);
};
/**
* Helper function
* @returns {String}
*/
function s4() {
return Math.floor((1 + Math.random()) * 0x10000).toString(16).substring(1);
}
/**
* Helper function
* @return {Array}
*/
function guid() {
const ar=[];
for(let i=0;i<8;i++){
ar.push(s4());
}
return ar;
}
/**
* JSON-RPC Request

@@ -239,4 +301,3 @@ * TODO: Maybe length of 'method' parameter should be checked? Specification does not say anything about empty string as method name

//this.id = "id" in o ? o.id : UUID.randomUUID().serialize();
const id = "id" in o ? o.id : 1;
const id = "id" in o ? o.id : UUID.randomUUID();

@@ -243,0 +304,0 @@ return Object.freeze(Object.create(JsonRpcRequest.prototype,/** @lends JsonRpcRequest.prototype */ {

{
"name": "@adt/json-rpc",
"version": "0.0.1-SNAPSHOT.12",
"version": "0.0.1-SNAPSHOT.13",
"license": "MIT",

@@ -27,3 +27,12 @@ "main": "dist/JsonRpc.cjs.js",

"dist"
],
"keywords": [
"jsonrpc",
"json",
"rpc",
"remote",
"procedure",
"call",
"request-response"
]
}
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