Skip to content

Commit ea6e075

Browse files
committed
Don't throw when validating unexpected values
1 parent 8f88198 commit ea6e075

File tree

3 files changed

+7
-3
lines changed

3 files changed

+7
-3
lines changed

packages/connect-react/CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
11
<!-- markdownlint-disable MD024 -->
22
# Changelog
33

4+
# [1.0.0-preview.12] - 2024-12-13
5+
6+
- Don't throw when validating unexpected values from the api
7+
48
# [1.0.0-preview.11] - 2024-12-13
59

610
- Make prop validation more consistent with app behavior

packages/connect-react/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@pipedream/connect-react",
3-
"version": "1.0.0-preview.11",
3+
"version": "1.0.0-preview.12",
44
"description": "Pipedream Connect library for React",
55
"files": [
66
"dist"

packages/connect-react/src/utils/component.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,13 +35,13 @@ export function valuesFromOptions<T>(value: unknown | T[] | PropOptions<T>): T[]
3535
results.push(emitValue as T)
3636
}
3737
} else {
38-
throw "unexpected value"
38+
return []
3939
}
4040
}
4141
return results
4242
}
4343
if (!Array.isArray(value))
44-
throw "unexpected value"
44+
return []
4545
return value as T[]
4646
}
4747

0 commit comments

Comments
 (0)