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

tarry

Package Overview
Dependencies
Maintainers
1
Versions
16
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

tarry - npm Package Compare versions

Comparing version 0.2.2 to 0.2.3

13

index.d.ts

@@ -143,1 +143,14 @@ /**

export declare function mergeBy<T>(items: T[], idKey?: string): T[];
/**
Convert an Array of objects with fixed keys to an object with variable keys.
E.g.:
toObject([
{key: 'firstname', value: 'Chris'},
{key: 'lastname', value: 'Brown'},
]) => [
{firstname: 'Chris', lastname: 'Brown'},
]
*/
export declare function toObject<T>(items: T[], nameKey?: string, valueKey?: string): {};

@@ -266,1 +266,23 @@ /**

exports.mergeBy = mergeBy;
/**
Convert an Array of objects with fixed keys to an object with variable keys.
E.g.:
toObject([
{key: 'firstname', value: 'Chris'},
{key: 'lastname', value: 'Brown'},
]) => [
{firstname: 'Chris', lastname: 'Brown'},
]
*/
function toObject(items, nameKey, valueKey) {
if (nameKey === void 0) { nameKey = 'key'; }
if (valueKey === void 0) { valueKey = 'value'; }
var object = {};
items.forEach(function (item) {
object[item[nameKey]] = item[valueKey];
});
return object;
}
exports.toObject = toObject;

2

package.json
{
"name": "tarry",
"version": "0.2.2",
"version": "0.2.3",
"description": "Utility library for manipulating JavaScript Arrays",

@@ -5,0 +5,0 @@ "keywords": [

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