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

@tldraw/utils

Package Overview
Dependencies
Maintainers
4
Versions
2244
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@tldraw/utils - npm Package Compare versions

Comparing version 3.8.0-canary.13edafe3f1e3 to 3.8.0-canary.14f2faba6b93

2

dist-cjs/index.d.ts

@@ -392,2 +392,4 @@ import { default as throttle } from 'lodash.throttle';

/* Excluded from this release type: mergeArraysAndReplaceDefaults */
/* Excluded from this release type: minBy */

@@ -394,0 +396,0 @@

3

dist-cjs/index.js

@@ -92,2 +92,3 @@ "use strict";

measureDuration: () => import_perf.measureDuration,
mergeArraysAndReplaceDefaults: () => import_array.mergeArraysAndReplaceDefaults,
minBy: () => import_array.minBy,

@@ -161,5 +162,5 @@ mockUniqueId: () => import_id.mockUniqueId,

"@tldraw/utils",
"3.8.0-canary.13edafe3f1e3",
"3.8.0-canary.14f2faba6b93",
"cjs"
);
//# sourceMappingURL=index.js.map

@@ -26,2 +26,3 @@ "use strict";

maxBy: () => maxBy,
mergeArraysAndReplaceDefaults: () => mergeArraysAndReplaceDefaults,
minBy: () => minBy,

@@ -99,2 +100,14 @@ partition: () => partition,

}
function mergeArraysAndReplaceDefaults(key, customEntries, defaults) {
const overrideTypes = new Set(customEntries.map((entry) => entry[key]));
const result = [];
for (const defaultEntry of defaults) {
if (overrideTypes.has(defaultEntry[key])) continue;
result.push(defaultEntry);
}
for (const customEntry of customEntries) {
result.push(customEntry);
}
return result;
}
//# sourceMappingURL=array.js.map
{
"name": "@tldraw/utils",
"description": "A tiny little drawing app (private utilities).",
"version": "3.8.0-canary.13edafe3f1e3",
"version": "3.8.0-canary.14f2faba6b93",
"author": {

@@ -6,0 +6,0 @@ "name": "tldraw Inc.",

@@ -13,2 +13,3 @@ import { registerTldrawLibraryVersion } from './lib/version'

maxBy,
mergeArraysAndReplaceDefaults,
minBy,

@@ -15,0 +16,0 @@ partition,

@@ -100,1 +100,21 @@ /**

}
/** @internal */
export function mergeArraysAndReplaceDefaults<
const Key extends string,
T extends { [K in Key]: string },
>(key: Key, customEntries: readonly T[], defaults: readonly T[]) {
const overrideTypes = new Set(customEntries.map((entry) => entry[key]))
const result = []
for (const defaultEntry of defaults) {
if (overrideTypes.has(defaultEntry[key])) continue
result.push(defaultEntry)
}
for (const customEntry of customEntries) {
result.push(customEntry)
}
return result
}

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

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