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

@dfinity/utils

Package Overview
Dependencies
Maintainers
10
Versions
886
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@dfinity/utils - npm Package Compare versions

Comparing version 0.0.2 to 0.0.3-next-2022-09-22

dist/types/utils/arrays.utils.d.ts

2

dist/cjs/index.cjs.js

@@ -1,2 +0,2 @@

"use strict";var p=Object.defineProperty;var y=Object.getOwnPropertyDescriptor;var A=Object.getOwnPropertyNames;var g=Object.prototype.hasOwnProperty;var x=(t,e)=>{for(var o in e)p(t,o,{get:e[o],enumerable:!0})},b=(t,e,o,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let r of A(e))!g.call(t,r)&&r!==o&&p(t,r,{get:()=>e[r],enumerable:!(n=y(e,r))||n.enumerable});return t};var I=t=>b(p({},"__esModule",{value:!0}),t);var C={};x(C,{NullishError:()=>s,assertNonNullish:()=>m,createServices:()=>N,defaultAgent:()=>a,fromDefinedNullable:()=>O,fromNullable:()=>d,toNullable:()=>S});module.exports=I(C);var f=require("@dfinity/agent");var i=require("@dfinity/agent"),a=()=>new i.HttpAgent({host:"https://ic0.app",identity:new i.AnonymousIdentity});var N=({options:{canisterId:t,serviceOverride:e,certifiedServiceOverride:o,agent:n},idlFactory:r,certifiedIdlFactory:l})=>{let c=n??a(),T=e??f.Actor.createActor(r,{agent:c,canisterId:t}),u=o??f.Actor.createActor(l,{agent:c,canisterId:t});return{service:T,certifiedService:u,agent:c,canisterId:t}};var s=class extends Error{},m=(t,e)=>{if(t==null)throw new s(e)};var S=t=>t?[t]:[],d=t=>t==null?void 0:t[0],O=t=>{let e=d(t);return m(e),e};0&&(module.exports={NullishError,assertNonNullish,createServices,defaultAgent,fromDefinedNullable,fromNullable,toNullable});
"use strict";var c=Object.defineProperty;var T=Object.getOwnPropertyDescriptor;var l=Object.getOwnPropertyNames;var d=Object.prototype.hasOwnProperty;var x=(t,r)=>{for(var e in r)c(t,e,{get:r[e],enumerable:!0})},b=(t,r,e,o)=>{if(r&&typeof r=="object"||typeof r=="function")for(let n of l(r))!d.call(t,n)&&n!==e&&c(t,n,{get:()=>r[n],enumerable:!(o=T(r,n))||o.enumerable});return t};var I=t=>b(c({},"__esModule",{value:!0}),t);var D={};x(D,{NullishError:()=>s,arrayBufferToUint8Array:()=>N,arrayOfNumberToUint8Array:()=>B,asciiStringToByteArray:()=>S,assertNonNullish:()=>y,createServices:()=>U,defaultAgent:()=>p,fromDefinedNullable:()=>C,fromNullable:()=>m,toNullable:()=>h,uint8ArrayToArrayOfNumber:()=>O,uint8ArrayToBigInt:()=>w});module.exports=I(D);var f=require("@dfinity/agent");var i=require("@dfinity/agent"),p=()=>new i.HttpAgent({host:"https://ic0.app",identity:new i.AnonymousIdentity});var U=({options:{canisterId:t,serviceOverride:r,certifiedServiceOverride:e,agent:o},idlFactory:n,certifiedIdlFactory:A})=>{let a=o??p(),u=r??f.Actor.createActor(n,{agent:a,canisterId:t}),g=e??f.Actor.createActor(A,{agent:a,canisterId:t});return{service:u,certifiedService:g,agent:a,canisterId:t}};var w=t=>{let r=new DataView(t.buffer,t.byteOffset,t.byteLength);if(typeof r.getBigUint64=="function")return r.getBigUint64(0);{let e=BigInt(r.getUint32(0)),o=BigInt(r.getUint32(4));return(e<<BigInt(32))+o}},N=t=>new Uint8Array(t),O=t=>Array.from(t),B=t=>new Uint8Array(t),S=t=>Array.from(t).map(r=>r.charCodeAt(0));var s=class extends Error{},y=(t,r)=>{if(t==null)throw new s(r)};var h=t=>t?[t]:[],m=t=>t==null?void 0:t[0],C=t=>{let r=m(t);return y(r),r};0&&(module.exports={NullishError,arrayBufferToUint8Array,arrayOfNumberToUint8Array,asciiStringToByteArray,assertNonNullish,createServices,defaultAgent,fromDefinedNullable,fromNullable,toNullable,uint8ArrayToArrayOfNumber,uint8ArrayToBigInt});
//# sourceMappingURL=index.cjs.js.map

@@ -1,2 +0,2 @@

import{Actor as i}from"@dfinity/agent";import{AnonymousIdentity as d,HttpAgent as T}from"@dfinity/agent";var n=()=>new T({host:"https://ic0.app",identity:new d});var b=({options:{canisterId:t,serviceOverride:e,certifiedServiceOverride:c,agent:p},idlFactory:a,certifiedIdlFactory:f})=>{let r=p??n(),l=e??i.createActor(a,{agent:r,canisterId:t}),m=c??i.createActor(f,{agent:r,canisterId:t});return{service:l,certifiedService:m,agent:r,canisterId:t}};var o=class extends Error{},s=(t,e)=>{if(t==null)throw new o(e)};var O=t=>t?[t]:[],u=t=>t?.[0],v=t=>{let e=u(t);return s(e),e};export{o as NullishError,s as assertNonNullish,b as createServices,n as defaultAgent,v as fromDefinedNullable,u as fromNullable,O as toNullable};
import{Actor as a}from"@dfinity/agent";import{AnonymousIdentity as u,HttpAgent as A}from"@dfinity/agent";var s=()=>new A({host:"https://ic0.app",identity:new u});var b=({options:{canisterId:t,serviceOverride:r,certifiedServiceOverride:e,agent:n},idlFactory:p,certifiedIdlFactory:f})=>{let o=n??s(),y=r??a.createActor(p,{agent:o,canisterId:t}),m=e??a.createActor(f,{agent:o,canisterId:t});return{service:y,certifiedService:m,agent:o,canisterId:t}};var U=t=>{let r=new DataView(t.buffer,t.byteOffset,t.byteLength);if(typeof r.getBigUint64=="function")return r.getBigUint64(0);{let e=BigInt(r.getUint32(0)),n=BigInt(r.getUint32(4));return(e<<BigInt(32))+n}},w=t=>new Uint8Array(t),N=t=>Array.from(t),O=t=>new Uint8Array(t),B=t=>Array.from(t).map(r=>r.charCodeAt(0));var i=class extends Error{},c=(t,r)=>{if(t==null)throw new i(r)};var C=t=>t?[t]:[],l=t=>t?.[0],D=t=>{let r=l(t);return c(r),r};export{i as NullishError,w as arrayBufferToUint8Array,O as arrayOfNumberToUint8Array,B as asciiStringToByteArray,c as assertNonNullish,b as createServices,s as defaultAgent,D as fromDefinedNullable,l as fromNullable,C as toNullable,N as uint8ArrayToArrayOfNumber,U as uint8ArrayToBigInt};
//# sourceMappingURL=index.js.map
export type { CanisterOptions } from "./types/canister.options";
export * from "./utils/actor.utils";
export * from "./utils/agent.utils";
export * from "./utils/arrays.utils";
export * from "./utils/asserts.utils";
export * from "./utils/did.utils";
{
"name": "@dfinity/utils",
"version": "0.0.2",
"version": "0.0.3-next-2022-09-22",
"description": "A collection of utilities and constants for NNS/SNS projects.",

@@ -51,2 +51,2 @@ "license": "Apache-2.0",

]
}
}

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