Parsed representation of an allowed-types mask.
Build one from a comma-separated string (the HTML <input accept> format) using parseAllowedTypes, or construct it directly.
<input accept>
const types = parseAllowedTypes(".ts, .tsx, image/*, application/json");types.matches("photo.png", "image/png"); // truetypes.matches("README.md"); // false Copy
const types = parseAllowedTypes(".ts, .tsx, image/*, application/json");types.matches("photo.png", "image/png"); // truetypes.matches("README.md"); // false
Readonly
The individual type rules that make up this mask.
Returns true if the given filename (and optional MIME type) is permitted by at least one rule. Directories always return true.
true
The file name (used for extension matching).
Optional
Optional MIME type string (used for mime rules).
Parsed representation of an allowed-types mask.
Build one from a comma-separated string (the HTML
<input accept>format) using parseAllowedTypes, or construct it directly.Example