Skip to content

Commit eae0a78

Browse files
committed
Fix precondition for exactly one artifact
1 parent 73353bd commit eae0a78

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
@@ -141,7 +141,10 @@ export const platform: Platform<Triplet[], AndroidOpts> = {
141141
);
142142
const [sharedLibrary] = sharedLibraries;
143143
const { artifacts } = sharedLibrary;
144-
assert(artifacts && artifacts.length, "Expected exactly one artifact");
144+
assert(
145+
artifacts && artifacts.length === 1,
146+
"Expected exactly one artifact",
147+
);
145148
const [artifact] = artifacts;
146149
// Add prebuild entry, creating a new entry if needed
147150
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
@@ -153,7 +153,10 @@ export const platform: Platform<Triplet[], AppleOpts> = {
153153
);
154154
const [sharedLibrary] = sharedLibraries;
155155
const { artifacts } = sharedLibrary;
156-
assert(artifacts && artifacts.length, "Expected exactly one artifact");
156+
assert(
157+
artifacts && artifacts.length === 1,
158+
"Expected exactly one artifact",
159+
);
157160
const [artifact] = artifacts;
158161
// Add prebuild entry, creating a new entry if needed
159162
if (!(sharedLibrary.name in prebuilds)) {

0 commit comments

Comments
 (0)