You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
rpm-mcarman b9f7ec4306 First Commit преди 3 години
..
.github/workflows First Commit преди 3 години
dist First Commit преди 3 години
src First Commit преди 3 години
test First Commit преди 3 години
.codeclimate.yml First Commit преди 3 години
.editorconfig First Commit преди 3 години
.eslintrc First Commit преди 3 години
LICENSE First Commit преди 3 години
README.md First Commit преди 3 години
index.d.ts First Commit преди 3 години
package.json First Commit преди 3 години
webpack.config.js First Commit преди 3 години

README.md

attr-accept

JavaScript implementation of the “accept” attribute for HTML5 <input type="file">

npm version semantic-release

See https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input/file#accept for more information.

Installation

npm install --save attr-accept

Usage

var accept = require('attr-accept');
accept({
    name: 'my file.png',
    type: 'image/png'
}, 'image/*') // => true

accept({
    name: 'my file.json',
    type: 'application/json'
}, 'image/*') // => false

accept({
    name: 'my file.srt',
    type: ''
}, '.srt') // => true

You can also pass multiple mime types as a comma delimited string or array.

accept({
    name: 'my file.json',
    type: 'application/json'
}, 'application/json,video/*') // => true

accept({
    name: 'my file.json',
    type: 'application/json'
}, ['application/json', 'video/*']) // => true