one
Version:
One is a React framework for web, iOS, and Android apps.
1 lines • 1.5 kB
Source Map (JSON)
{"version":3,"file":"options.js","names":[],"sources":["esm/platform/document-picker/options.js"],"sourcesContent":["function resolveDocumentPickerOptions(options = {}) {\n const { type = \"*/*\", multiple = false } = options;\n const list = Array.isArray(type) ? type : [type];\n if (list.length === 0) {\n throw new Error(\"DocumentPicker type must list at least one mime type\");\n }\n for (const mimeType of list) {\n if (typeof mimeType !== \"string\" || !/^[^\\s/]+\\/[^\\s/]+$/.test(mimeType)) {\n throw new Error(\n `DocumentPicker type must be a mime type like 'application/pdf' or 'image/*', got '${String(mimeType)}'`\n );\n }\n }\n if (typeof multiple !== \"boolean\") {\n throw new Error(`DocumentPicker multiple must be a boolean, got '${String(multiple)}'`);\n }\n return { types: [...new Set(list.map((mimeType) => mimeType.toLowerCase()))], multiple };\n}\nexport {\n resolveDocumentPickerOptions\n};\n//# sourceMappingURL=options.js.map\n"],"mappings":";AAAA,SAAS,6BAA6B,UAAU,CAAC,GAAG;CAClD,MAAM,EAAE,OAAO,OAAO,WAAW,UAAU;CAC3C,MAAM,OAAO,MAAM,QAAQ,IAAI,IAAI,OAAO,CAAC,IAAI;CAC/C,IAAI,KAAK,WAAW,GAAG;EACrB,MAAM,IAAI,MAAM,sDAAsD;CACxE;CACA,KAAK,MAAM,YAAY,MAAM;EAC3B,IAAI,OAAO,aAAa,YAAY,CAAC,qBAAqB,KAAK,QAAQ,GAAG;GACxE,MAAM,IAAI,MACR,qFAAqF,OAAO,QAAQ,EAAE,EACxG;EACF;CACF;CACA,IAAI,OAAO,aAAa,WAAW;EACjC,MAAM,IAAI,MAAM,mDAAmD,OAAO,QAAQ,EAAE,EAAE;CACxF;CACA,OAAO;EAAE,OAAO,CAAC,GAAG,IAAI,IAAI,KAAK,KAAK,aAAa,SAAS,YAAY,CAAC,CAAC,CAAC;EAAG;CAAS;AACzF"}