Skip to content

Commit 7bb654c

Browse files
committed
feat: US-183 - Add lodash-es project-matrix fixture
1 parent 3424d66 commit 7bb654c

5 files changed

Lines changed: 66 additions & 0 deletions

File tree

docs/nodejs-compatibility.mdx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,7 @@ The [project-matrix test suite](https://github.com/rivet-dev/secure-exec/tree/ma
8080
| [ws](https://npmjs.com/package/ws) | Networking | WebSocket client/server, HTTP upgrade, events |
8181
| [jsonwebtoken](https://npmjs.com/package/jsonwebtoken) | Crypto | JWT signing (HS256), verification, decode |
8282
| [bcryptjs](https://npmjs.com/package/bcryptjs) | Crypto | Pure JS password hashing and verification |
83+
| [lodash-es](https://npmjs.com/package/lodash-es) | Utility | Large ESM module resolution at scale |
8384
| [zod](https://npmjs.com/package/zod) | Validation | Schema definition, parsing, safe parse, transforms |
8485
| [rivetkit](https://npmjs.com/package/rivetkit) | SDK | Local vendor package resolution |
8586
| crypto (builtin) | Crypto | `crypto.randomBytes`, `randomUUID`, `getRandomValues` |
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
{
2+
"entry": "src/index.js",
3+
"expectation": "pass"
4+
}
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
{
2+
"name": "project-matrix-lodash-es-pass",
3+
"private": true,
4+
"type": "module",
5+
"dependencies": {
6+
"lodash-es": "4.17.21"
7+
}
8+
}

packages/secure-exec/tests/projects/lodash-es-pass/pnpm-lock.yaml

Lines changed: 22 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
import map from "lodash-es/map.js";
2+
import filter from "lodash-es/filter.js";
3+
import groupBy from "lodash-es/groupBy.js";
4+
import debounce from "lodash-es/debounce.js";
5+
import sortBy from "lodash-es/sortBy.js";
6+
import uniq from "lodash-es/uniq.js";
7+
8+
const items = [
9+
{ name: "Alice", group: "A", score: 90 },
10+
{ name: "Bob", group: "B", score: 85 },
11+
{ name: "Carol", group: "A", score: 95 },
12+
{ name: "Dave", group: "B", score: 80 },
13+
];
14+
15+
const names = map(items, "name");
16+
const highScores = filter(items, (i) => i.score >= 90);
17+
const grouped = groupBy(items, "group");
18+
const sorted = sortBy(items, "score").map((i) => i.name);
19+
const unique = uniq([1, 2, 2, 3, 3, 3]);
20+
21+
const result = {
22+
names,
23+
highScoreNames: map(highScores, "name"),
24+
groupKeys: Object.keys(grouped).sort(),
25+
groupACount: grouped["A"].length,
26+
sorted,
27+
unique,
28+
debounceType: typeof debounce,
29+
};
30+
31+
console.log(JSON.stringify(result));

0 commit comments

Comments
 (0)