attr-accept

WebJar for attr-accept

License

License

MIT
GroupId

GroupId

org.webjars.npm
ArtifactId

ArtifactId

attr-accept
Last Version

Last Version

2.2.1
Release Date

Release Date

Type

Type

jar
Description

Description

attr-accept
WebJar for attr-accept
Project URL

Project URL

https://www.webjars.org
Source Code Management

Source Code Management

https://github.com/react-dropzone/attr-accept

Download attr-accept

How to add to project

<!-- https://jarcasting.com/artifacts/org.webjars.npm/attr-accept/ -->
<dependency>
    <groupId>org.webjars.npm</groupId>
    <artifactId>attr-accept</artifactId>
    <version>2.2.1</version>
</dependency>
// https://jarcasting.com/artifacts/org.webjars.npm/attr-accept/
implementation 'org.webjars.npm:attr-accept:2.2.1'
// https://jarcasting.com/artifacts/org.webjars.npm/attr-accept/
implementation ("org.webjars.npm:attr-accept:2.2.1")
'org.webjars.npm:attr-accept:jar:2.2.1'
<dependency org="org.webjars.npm" name="attr-accept" rev="2.2.1">
  <artifact name="attr-accept" type="jar" />
</dependency>
@Grapes(
@Grab(group='org.webjars.npm', module='attr-accept', version='2.2.1')
)
libraryDependencies += "org.webjars.npm" % "attr-accept" % "2.2.1"
[org.webjars.npm/attr-accept "2.2.1"]

Dependencies

There are no dependencies for this project. It is a standalone project that does not depend on any other jars.

Project Modules

There are no modules declared in this project.

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
org.webjars.npm

Versions

Version
2.2.1
1.1.3
1.0.3
1.0.1