New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@wharfkit/abicache

Package Overview
Dependencies
Maintainers
3
Versions
10
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@wharfkit/abicache - npm Package Compare versions

Comparing version 1.2.1 to 1.2.2

12

lib/abicache.js

@@ -44,7 +44,7 @@ 'use strict';

action_results: mergeAndDeduplicate(existing.action_results, abi.action_results),
types: mergeAndDeduplicate(existing.types, abi.types),
types: mergeAndDeduplicate(existing.types, abi.types, 'new_type_name'),
structs: mergeAndDeduplicate(existing.structs, abi.structs),
actions: mergeAndDeduplicate(existing.actions, abi.actions),
tables: mergeAndDeduplicate(existing.tables, abi.tables),
ricardian_clauses: mergeAndDeduplicate(existing.ricardian_clauses, abi.ricardian_clauses),
ricardian_clauses: mergeAndDeduplicate(existing.ricardian_clauses, abi.ricardian_clauses, 'id'),
variants: mergeAndDeduplicate(existing.variants, abi.variants),

@@ -59,9 +59,9 @@ version: abi.version,

}
function mergeAndDeduplicate(array1, array2) {
return [...array1, ...array2].reduce((acc, current) => {
if (!acc.some((obj) => String(obj.name) === String(current.name))) {
function mergeAndDeduplicate(array1, array2, byField = 'name') {
return array2.reduce((acc, current) => {
if (!acc.some((obj) => String(obj[byField]) === String(current[byField]))) {
acc.push(current);
}
return acc;
}, []);
}, array1.slice());
}

@@ -68,0 +68,0 @@

@@ -37,7 +37,7 @@ import { ABI } from '@wharfkit/antelope';

action_results: mergeAndDeduplicate(existing.action_results, abi.action_results),
types: mergeAndDeduplicate(existing.types, abi.types),
types: mergeAndDeduplicate(existing.types, abi.types, 'new_type_name'),
structs: mergeAndDeduplicate(existing.structs, abi.structs),
actions: mergeAndDeduplicate(existing.actions, abi.actions),
tables: mergeAndDeduplicate(existing.tables, abi.tables),
ricardian_clauses: mergeAndDeduplicate(existing.ricardian_clauses, abi.ricardian_clauses),
ricardian_clauses: mergeAndDeduplicate(existing.ricardian_clauses, abi.ricardian_clauses, 'id'),
variants: mergeAndDeduplicate(existing.variants, abi.variants),

@@ -52,9 +52,9 @@ version: abi.version,

}
function mergeAndDeduplicate(array1, array2) {
return [...array1, ...array2].reduce((acc, current) => {
if (!acc.some((obj) => String(obj.name) === String(current.name))) {
function mergeAndDeduplicate(array1, array2, byField = 'name') {
return array2.reduce((acc, current) => {
if (!acc.some((obj) => String(obj[byField]) === String(current[byField]))) {
acc.push(current);
}
return acc;
}, []);
}, array1.slice());
}

@@ -61,0 +61,0 @@

{
"name": "@wharfkit/abicache",
"description": "ABI Caching Mechanism for use in Session and Contract Kits",
"version": "1.2.1",
"version": "1.2.2",
"homepage": "https://github.com/wharfkit/abicache",

@@ -6,0 +6,0 @@ "license": "BSD-3-Clause",

@@ -53,3 +53,3 @@ import {ABI, ABIDef, API, APIClient, NameType} from '@wharfkit/antelope'

),
types: mergeAndDeduplicate(existing.types, abi.types),
types: mergeAndDeduplicate(existing.types, abi.types, 'new_type_name'),
structs: mergeAndDeduplicate(existing.structs, abi.structs),

@@ -60,3 +60,4 @@ actions: mergeAndDeduplicate(existing.actions, abi.actions),

existing.ricardian_clauses,
abi.ricardian_clauses
abi.ricardian_clauses,
'id'
),

@@ -73,9 +74,9 @@ variants: mergeAndDeduplicate(existing.variants, abi.variants),

function mergeAndDeduplicate(array1, array2) {
return [...array1, ...array2].reduce((acc, current) => {
if (!acc.some((obj) => String(obj.name) === String(current.name))) {
function mergeAndDeduplicate(array1, array2, byField = 'name') {
return array2.reduce((acc: any[], current: any) => {
if (!acc.some((obj: any) => String(obj[byField]) === String(current[byField]))) {
acc.push(current)
}
return acc
}, [])
}, array1.slice())
}

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