@protobase/schema 0.127.5 → 0.128.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -41,6 +41,7 @@ const capturedAccept = (accept) => {
|
|
|
41
41
|
};
|
|
42
42
|
/** The types of `.accept()` on a field that opens the camera, which takes only images. */
|
|
43
43
|
const checkedCaptureAccept = (types) => {
|
|
44
|
+
if (types.length === 0) throw new Error("A field with .capture() takes only images, so .accept() needs at least one image type, such as image/*");
|
|
44
45
|
const other = types.find((type) => !type.startsWith("image/"));
|
|
45
46
|
if (other) throw new Error(`"${other}" is not an image type, and a field with .capture() takes only images`);
|
|
46
47
|
return [...types];
|