@tldraw/utils
Advanced tools
Comparing version 2.0.0-canary.0c11822f to 2.0.0-canary.10d819b95
@@ -1,2 +0,2 @@ | ||
/* Excluded from this release type: _annotateError */ | ||
/* Excluded from this release type: annotateError */ | ||
@@ -171,2 +171,4 @@ /* Excluded from this release type: assert */ | ||
/* Excluded from this release type: partition */ | ||
/* Excluded from this release type: promiseWithResolve */ | ||
@@ -173,0 +175,0 @@ |
@@ -25,2 +25,3 @@ "use strict"; | ||
minBy: () => minBy, | ||
partition: () => partition, | ||
rotateArray: () => rotateArray | ||
@@ -63,2 +64,14 @@ }); | ||
} | ||
function partition(arr, predicate) { | ||
const satisfies = []; | ||
const doesNotSatisfy = []; | ||
for (const item of arr) { | ||
if (predicate(item)) { | ||
satisfies.push(item); | ||
} else { | ||
doesNotSatisfy.push(item); | ||
} | ||
} | ||
return [satisfies, doesNotSatisfy]; | ||
} | ||
//# sourceMappingURL=array.js.map |
@@ -21,3 +21,3 @@ "use strict"; | ||
__export(error_exports, { | ||
_annotateError: () => _annotateError, | ||
annotateError: () => annotateError, | ||
getErrorAnnotations: () => getErrorAnnotations | ||
@@ -27,3 +27,3 @@ }); | ||
const annotationsByError = /* @__PURE__ */ new WeakMap(); | ||
function _annotateError(error, annotations) { | ||
function annotateError(error, annotations) { | ||
if (typeof error !== "object" || error === null) | ||
@@ -30,0 +30,0 @@ return; |
{ | ||
"name": "@tldraw/utils", | ||
"description": "A tiny little drawing app (private utilities).", | ||
"version": "2.0.0-canary.0c11822f", | ||
"version": "2.0.0-canary.10d819b95", | ||
"author": { | ||
@@ -29,4 +29,5 @@ "name": "tldraw GB Ltd.", | ||
"files": [ | ||
"dist-esm/**/*", | ||
"dist-cjs/**/*" | ||
"dist-esm", | ||
"dist-cjs", | ||
"src" | ||
], | ||
@@ -36,6 +37,5 @@ "scripts": { | ||
"test:coverage": "yarn run -T jest --coverage", | ||
"typecheck": "yarn run -T tsc --build", | ||
"build:types": "yarn run -T tsx ../../scripts/build-types.ts", | ||
"build": "echo 'build should be run by turbo'", | ||
"build:package": "yarn run -T tsx ../../scripts/build-package.ts", | ||
"build:types": "yarn run -T tsx ../../scripts/build-types.ts", | ||
"build:api": "yarn run -T tsx ../../scripts/build-api.ts", | ||
@@ -42,0 +42,0 @@ "prepack": "yarn run -T tsx ../../scripts/prepack.ts", |
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
98808
65
1646