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

@agoric/internal

Package Overview
Dependencies
Maintainers
5
Versions
1928
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@agoric/internal - npm Package Compare versions

Comparing version 0.2.1-dev-885125e.0 to 0.2.1-dev-8ac3c4c.0

4

package.json
{
"name": "@agoric/internal",
"version": "0.2.1-dev-885125e.0+885125e",
"version": "0.2.1-dev-8ac3c4c.0+8ac3c4c",
"description": "Externally unsupported utilities internal to agoric-sdk",

@@ -37,3 +37,3 @@ "type": "module",

},
"gitHead": "885125e69c57b78923cc2aa6862c06af68f6b590"
"gitHead": "8ac3c4c434e732c30f90f3709a5cbc7750ef14bf"
}

@@ -11,5 +11,31 @@ // @ts-check

const { details: X } = assert;
const { details: X, quote: q } = assert;
/**
* Throws if multiple entries use the same property name. Otherwise acts
* like `Object.fromEntries`. Use it to protect from property names
* computed from user-provided data.
*
* @template K,V
* @param {Iterable<[K,V]>} allEntries
* @returns {{[k: K]: V}}
*/
export const fromUniqueEntries = allEntries => {
const entriesArray = [...allEntries];
const result = fromEntries(entriesArray);
if (ownKeys(result).length === entriesArray.length) {
return result;
}
const names = new Set();
for (const [name, _] of entriesArray) {
if (names.has(name)) {
assert.fail(X`collision on property name ${q(name)}: ${entriesArray}`);
}
names.add(name);
}
assert.fail(X`internal: failed to create object from unique entries`);
};
harden(fromUniqueEntries);
/**
* By analogy with how `Array.prototype.map` will map the elements of

@@ -16,0 +42,0 @@ * an array to transformed elements of an array of the same shape,

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