Skip to content

Commit d462fcb

Browse files
committed
Fix precondition for exactly one artifact
1 parent 7ccbe2e commit d462fcb

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

packages/cmake-rn/src/platforms/android.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,10 @@ export const platform: Platform<Triplet[], AndroidOpts> = {
140140
);
141141
const [sharedLibrary] = sharedLibraries;
142142
const { artifacts } = sharedLibrary;
143-
assert(artifacts && artifacts.length, "Expected exactly one artifact");
143+
assert(
144+
artifacts && artifacts.length === 1,
145+
"Expected exactly one artifact",
146+
);
144147
const [artifact] = artifacts;
145148
// Add prebuild entry, creating a new entry if needed
146149
if (!(sharedLibrary.name in prebuilds)) {

packages/cmake-rn/src/platforms/apple.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,10 @@ export const platform: Platform<Triplet[], AppleOpts> = {
152152
);
153153
const [sharedLibrary] = sharedLibraries;
154154
const { artifacts } = sharedLibrary;
155-
assert(artifacts && artifacts.length, "Expected exactly one artifact");
155+
assert(
156+
artifacts && artifacts.length === 1,
157+
"Expected exactly one artifact",
158+
);
156159
const [artifact] = artifacts;
157160
// Add prebuild entry, creating a new entry if needed
158161
if (!(sharedLibrary.name in prebuilds)) {

0 commit comments

Comments
 (0)