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

@dfinity/candid

Package Overview
Dependencies
Maintainers
10
Versions
68
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@dfinity/candid - npm Package Compare versions

Comparing version 0.12.1 to 0.12.2-beta.0

6

lib/cjs/candid-ui.js
"use strict";
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
var desc = Object.getOwnPropertyDescriptor(m, k);
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
desc = { enumerable: true, get: function() { return m[k]; } };
}
Object.defineProperty(o, k2, desc);
}) : (function(o, m, k, k2) {

@@ -6,0 +10,0 @@ if (k2 === undefined) k2 = k;

54

lib/cjs/idl.js

@@ -197,3 +197,3 @@ "use strict";

encodeType() {
return (0, leb128_1.slebEncode)(-17 /* Empty */);
return (0, leb128_1.slebEncode)(-17 /* IDLTypeIds.Empty */);
}

@@ -283,3 +283,3 @@ decodeValue() {

encodeType() {
return (0, leb128_1.slebEncode)(-2 /* Bool */);
return (0, leb128_1.slebEncode)(-2 /* IDLTypeIds.Bool */);
}

@@ -316,3 +316,3 @@ decodeValue(b, t) {

encodeType() {
return (0, leb128_1.slebEncode)(-1 /* Null */);
return (0, leb128_1.slebEncode)(-1 /* IDLTypeIds.Null */);
}

@@ -342,3 +342,3 @@ decodeValue(b, t) {

encodeType() {
return (0, leb128_1.slebEncode)(-16 /* Reserved */);
return (0, leb128_1.slebEncode)(-16 /* IDLTypeIds.Reserved */);
}

@@ -372,3 +372,3 @@ decodeValue(b, t) {

encodeType() {
return (0, leb128_1.slebEncode)(-15 /* Text */);
return (0, leb128_1.slebEncode)(-15 /* IDLTypeIds.Text */);
}

@@ -406,3 +406,3 @@ decodeValue(b, t) {

encodeType() {
return (0, leb128_1.slebEncode)(-4 /* Int */);
return (0, leb128_1.slebEncode)(-4 /* IDLTypeIds.Int */);
}

@@ -437,3 +437,3 @@ decodeValue(b, t) {

encodeType() {
return (0, leb128_1.slebEncode)(-3 /* Nat */);
return (0, leb128_1.slebEncode)(-3 /* IDLTypeIds.Nat */);
}

@@ -481,3 +481,3 @@ decodeValue(b, t) {

encodeType() {
const opcode = this._bits === 32 ? -13 /* Float32 */ : -14 /* Float64 */;
const opcode = this._bits === 32 ? -13 /* IDLTypeIds.Float32 */ : -14 /* IDLTypeIds.Float64 */;
return (0, leb128_1.slebEncode)(opcode);

@@ -657,3 +657,3 @@ }

this._type.buildTypeTable(typeTable);
const opCode = (0, leb128_1.slebEncode)(-19 /* Vector */);
const opCode = (0, leb128_1.slebEncode)(-19 /* IDLTypeIds.Vector */);
const buffer = this._type.encodeType(typeTable);

@@ -739,3 +739,3 @@ typeTable.add(this, (0, buffer_1.concat)(opCode, buffer));

this._type.buildTypeTable(typeTable);
const opCode = (0, leb128_1.slebEncode)(-18 /* Opt */);
const opCode = (0, leb128_1.slebEncode)(-18 /* IDLTypeIds.Opt */);
const buffer = this._type.encodeType(typeTable);

@@ -814,3 +814,3 @@ typeTable.add(this, (0, buffer_1.concat)(opCode, buffer));

this._fields.forEach(([_, value]) => value.buildTypeTable(T));
const opCode = (0, leb128_1.slebEncode)(-20 /* Record */);
const opCode = (0, leb128_1.slebEncode)(-20 /* IDLTypeIds.Record */);
const len = (0, leb128_1.lebEncode)(this._fields.length);

@@ -971,3 +971,3 @@ const fields = this._fields.map(([key, value]) => (0, buffer_1.concat)((0, leb128_1.lebEncode)((0, hash_1.idlLabelToId)(key)), value.encodeType(T)));

});
const opCode = (0, leb128_1.slebEncode)(-21 /* Variant */);
const opCode = (0, leb128_1.slebEncode)(-21 /* IDLTypeIds.Variant */);
const len = (0, leb128_1.lebEncode)(this._fields.length);

@@ -1107,3 +1107,3 @@ const fields = this._fields.map(([key, value]) => (0, buffer_1.concat)((0, leb128_1.lebEncode)((0, hash_1.idlLabelToId)(key)), value.encodeType(typeTable)));

encodeType() {
return (0, leb128_1.slebEncode)(-24 /* Principal */);
return (0, leb128_1.slebEncode)(-24 /* IDLTypeIds.Principal */);
}

@@ -1158,3 +1158,3 @@ decodeValue(b, t) {

this.retTypes.forEach(arg => arg.buildTypeTable(T));
const opCode = (0, leb128_1.slebEncode)(-22 /* Func */);
const opCode = (0, leb128_1.slebEncode)(-22 /* IDLTypeIds.Func */);
const argLen = (0, leb128_1.lebEncode)(this.argTypes.length);

@@ -1226,3 +1226,3 @@ const args = (0, buffer_1.concat)(...this.argTypes.map(arg => arg.encodeType(T)));

this._fields.forEach(([_, func]) => func.buildTypeTable(T));
const opCode = (0, leb128_1.slebEncode)(-23 /* Service */);
const opCode = (0, leb128_1.slebEncode)(-23 /* IDLTypeIds.Service */);
const len = (0, leb128_1.lebEncode)(this._fields.length);

@@ -1303,4 +1303,4 @@ const meths = this._fields.map(([label, func]) => {

switch (ty) {
case -18 /* Opt */:
case -19 /* Vector */: {
case -18 /* IDLTypeIds.Opt */:
case -19 /* IDLTypeIds.Vector */: {
const t = Number((0, leb128_1.slebDecode)(pipe));

@@ -1310,4 +1310,4 @@ typeTable.push([ty, t]);

}
case -20 /* Record */:
case -21 /* Variant */: {
case -20 /* IDLTypeIds.Record */:
case -21 /* IDLTypeIds.Variant */: {
const fields = [];

@@ -1331,3 +1331,3 @@ let objectLength = Number((0, leb128_1.lebDecode)(pipe));

}
case -22 /* Func */: {
case -22 /* IDLTypeIds.Func */: {
const args = [];

@@ -1363,3 +1363,3 @@ let argLength = Number((0, leb128_1.lebDecode)(pipe));

}
case -23 /* Service */: {
case -23 /* IDLTypeIds.Service */: {
let servLength = Number((0, leb128_1.lebDecode)(pipe));

@@ -1445,11 +1445,11 @@ const methods = [];

switch (entry[0]) {
case -19 /* Vector */: {
case -19 /* IDLTypeIds.Vector */: {
const ty = getType(entry[1]);
return Vec(ty);
}
case -18 /* Opt */: {
case -18 /* IDLTypeIds.Opt */: {
const ty = getType(entry[1]);
return Opt(ty);
}
case -20 /* Record */: {
case -20 /* IDLTypeIds.Record */: {
const fields = {};

@@ -1469,3 +1469,3 @@ for (const [hash, ty] of entry[1]) {

}
case -21 /* Variant */: {
case -21 /* IDLTypeIds.Variant */: {
const fields = {};

@@ -1478,7 +1478,7 @@ for (const [hash, ty] of entry[1]) {

}
case -22 /* Func */: {
case -22 /* IDLTypeIds.Func */: {
const [args, returnValues, annotations] = entry[1];
return Func(args.map((t) => getType(t)), returnValues.map((t) => getType(t)), annotations);
}
case -23 /* Service */: {
case -23 /* IDLTypeIds.Service */: {
const rec = {};

@@ -1485,0 +1485,0 @@ const methods = entry[1];

"use strict";
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
var desc = Object.getOwnPropertyDescriptor(m, k);
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
desc = { enumerable: true, get: function() { return m[k]; } };
}
Object.defineProperty(o, k2, desc);
}) : (function(o, m, k, k2) {

@@ -6,0 +10,0 @@ if (k2 === undefined) k2 = k;

@@ -189,3 +189,3 @@ // tslint:disable:max-classes-per-file

encodeType() {
return slebEncode(-17 /* Empty */);
return slebEncode(-17 /* IDLTypeIds.Empty */);
}

@@ -273,3 +273,3 @@ decodeValue() {

encodeType() {
return slebEncode(-2 /* Bool */);
return slebEncode(-2 /* IDLTypeIds.Bool */);
}

@@ -305,3 +305,3 @@ decodeValue(b, t) {

encodeType() {
return slebEncode(-1 /* Null */);
return slebEncode(-1 /* IDLTypeIds.Null */);
}

@@ -330,3 +330,3 @@ decodeValue(b, t) {

encodeType() {
return slebEncode(-16 /* Reserved */);
return slebEncode(-16 /* IDLTypeIds.Reserved */);
}

@@ -359,3 +359,3 @@ decodeValue(b, t) {

encodeType() {
return slebEncode(-15 /* Text */);
return slebEncode(-15 /* IDLTypeIds.Text */);
}

@@ -392,3 +392,3 @@ decodeValue(b, t) {

encodeType() {
return slebEncode(-4 /* Int */);
return slebEncode(-4 /* IDLTypeIds.Int */);
}

@@ -422,3 +422,3 @@ decodeValue(b, t) {

encodeType() {
return slebEncode(-3 /* Nat */);
return slebEncode(-3 /* IDLTypeIds.Nat */);
}

@@ -465,3 +465,3 @@ decodeValue(b, t) {

encodeType() {
const opcode = this._bits === 32 ? -13 /* Float32 */ : -14 /* Float64 */;
const opcode = this._bits === 32 ? -13 /* IDLTypeIds.Float32 */ : -14 /* IDLTypeIds.Float64 */;
return slebEncode(opcode);

@@ -638,3 +638,3 @@ }

this._type.buildTypeTable(typeTable);
const opCode = slebEncode(-19 /* Vector */);
const opCode = slebEncode(-19 /* IDLTypeIds.Vector */);
const buffer = this._type.encodeType(typeTable);

@@ -719,3 +719,3 @@ typeTable.add(this, concat(opCode, buffer));

this._type.buildTypeTable(typeTable);
const opCode = slebEncode(-18 /* Opt */);
const opCode = slebEncode(-18 /* IDLTypeIds.Opt */);
const buffer = this._type.encodeType(typeTable);

@@ -793,3 +793,3 @@ typeTable.add(this, concat(opCode, buffer));

this._fields.forEach(([_, value]) => value.buildTypeTable(T));
const opCode = slebEncode(-20 /* Record */);
const opCode = slebEncode(-20 /* IDLTypeIds.Record */);
const len = lebEncode(this._fields.length);

@@ -948,3 +948,3 @@ const fields = this._fields.map(([key, value]) => concat(lebEncode(idlLabelToId(key)), value.encodeType(T)));

});
const opCode = slebEncode(-21 /* Variant */);
const opCode = slebEncode(-21 /* IDLTypeIds.Variant */);
const len = lebEncode(this._fields.length);

@@ -1082,3 +1082,3 @@ const fields = this._fields.map(([key, value]) => concat(lebEncode(idlLabelToId(key)), value.encodeType(typeTable)));

encodeType() {
return slebEncode(-24 /* Principal */);
return slebEncode(-24 /* IDLTypeIds.Principal */);
}

@@ -1132,3 +1132,3 @@ decodeValue(b, t) {

this.retTypes.forEach(arg => arg.buildTypeTable(T));
const opCode = slebEncode(-22 /* Func */);
const opCode = slebEncode(-22 /* IDLTypeIds.Func */);
const argLen = lebEncode(this.argTypes.length);

@@ -1199,3 +1199,3 @@ const args = concat(...this.argTypes.map(arg => arg.encodeType(T)));

this._fields.forEach(([_, func]) => func.buildTypeTable(T));
const opCode = slebEncode(-23 /* Service */);
const opCode = slebEncode(-23 /* IDLTypeIds.Service */);
const len = lebEncode(this._fields.length);

@@ -1274,4 +1274,4 @@ const meths = this._fields.map(([label, func]) => {

switch (ty) {
case -18 /* Opt */:
case -19 /* Vector */: {
case -18 /* IDLTypeIds.Opt */:
case -19 /* IDLTypeIds.Vector */: {
const t = Number(slebDecode(pipe));

@@ -1281,4 +1281,4 @@ typeTable.push([ty, t]);

}
case -20 /* Record */:
case -21 /* Variant */: {
case -20 /* IDLTypeIds.Record */:
case -21 /* IDLTypeIds.Variant */: {
const fields = [];

@@ -1302,3 +1302,3 @@ let objectLength = Number(lebDecode(pipe));

}
case -22 /* Func */: {
case -22 /* IDLTypeIds.Func */: {
const args = [];

@@ -1334,3 +1334,3 @@ let argLength = Number(lebDecode(pipe));

}
case -23 /* Service */: {
case -23 /* IDLTypeIds.Service */: {
let servLength = Number(lebDecode(pipe));

@@ -1416,11 +1416,11 @@ const methods = [];

switch (entry[0]) {
case -19 /* Vector */: {
case -19 /* IDLTypeIds.Vector */: {
const ty = getType(entry[1]);
return Vec(ty);
}
case -18 /* Opt */: {
case -18 /* IDLTypeIds.Opt */: {
const ty = getType(entry[1]);
return Opt(ty);
}
case -20 /* Record */: {
case -20 /* IDLTypeIds.Record */: {
const fields = {};

@@ -1440,3 +1440,3 @@ for (const [hash, ty] of entry[1]) {

}
case -21 /* Variant */: {
case -21 /* IDLTypeIds.Variant */: {
const fields = {};

@@ -1449,7 +1449,7 @@ for (const [hash, ty] of entry[1]) {

}
case -22 /* Func */: {
case -22 /* IDLTypeIds.Func */: {
const [args, returnValues, annotations] = entry[1];
return Func(args.map((t) => getType(t)), returnValues.map((t) => getType(t)), annotations);
}
case -23 /* Service */: {
case -23 /* IDLTypeIds.Service */: {
const rec = {};

@@ -1456,0 +1456,0 @@ const methods = entry[1];

{
"name": "@dfinity/candid",
"version": "0.12.1",
"version": "0.12.2-beta.0",
"author": "DFINITY Stiftung <sdk@dfinity.org>",

@@ -49,18 +49,20 @@ "license": "Apache-2.0",

"devDependencies": {
"@types/jest": "^27.0.2",
"@typescript-eslint/eslint-plugin": "^4.14.2",
"@typescript-eslint/parser": "^4.14.2",
"eslint": "^7.19.0",
"eslint-plugin-jsdoc": "^31.6.0",
"jest": "^27.3.1",
"@types/jest": "^28.1.4",
"@typescript-eslint/eslint-plugin": "^5.30.5",
"@typescript-eslint/parser": "^5.30.5",
"eslint": "^8.19.0",
"eslint-plugin-jsdoc": "^39.3.3",
"jest": "^28.1.2",
"jest-diff": "^27.3.1",
"node-fetch": "^2.6.7",
"prettier": "^2.0.5",
"text-encoding": "^0.7.0",
"ts-jest": "^27.0.7",
"ts-jest": "^28.0.5",
"tslint": "^5.20.0",
"typedoc": "^0.22.11",
"typescript": "^4.2.3",
"typescript": "^4.7.4",
"whatwg-fetch": "^3.0.0"
},
"dependencies": {
"ts-node": "^10.8.2"
}
}

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

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