Skip to content

Commit 4674d1f

Browse files
Roland Grozarolandjitsu
authored andcommitted
style: format whole repo with oxfmt, matching sibling repos
1 parent 0f5d749 commit 4674d1f

3 files changed

Lines changed: 46 additions & 26 deletions

File tree

.github/workflows/release.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,10 @@ jobs:
1414
name: Release
1515
runs-on: ubuntu-latest
1616
permissions:
17-
contents: write # to be able to publish a GitHub release
18-
issues: write # to be able to comment on released issues
17+
contents: write # to be able to publish a GitHub release
18+
issues: write # to be able to comment on released issues
1919
pull-requests: write # to be able to comment on released pull requests
20-
id-token: write # OIDC for npm trusted publishing (+ provenance)
20+
id-token: write # OIDC for npm trusted publishing (+ provenance)
2121
steps:
2222
- name: Checkout repository
2323
uses: actions/checkout@v7

README.md

Lines changed: 41 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
# attr-accept
2+
23
> JavaScript implementation of the "accept" attribute for HTML5 `<input type="file">`
34
45
[![npm](https://img.shields.io/npm/v/attr-accept.svg?style=flat-square)](https://www.npmjs.com/package/attr-accept)
@@ -9,44 +10,63 @@ See https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input/file#attr-ac
910
Ships as both ES modules and CommonJS with bundled TypeScript type definitions.
1011

1112
## Installation
13+
1214
```sh
1315
npm install --save attr-accept
1416
```
1517

1618
## Usage
19+
1720
```javascript
1821
import accept from "attr-accept";
1922

20-
accept({
21-
name: "my file.png",
22-
type: "image/png"
23-
}, "image/*"); // => true
23+
accept(
24+
{
25+
name: "my file.png",
26+
type: "image/png"
27+
},
28+
"image/*"
29+
); // => true
2430

25-
accept({
26-
name: "my file.json",
27-
type: "application/json"
28-
}, "image/*"); // => false
31+
accept(
32+
{
33+
name: "my file.json",
34+
type: "application/json"
35+
},
36+
"image/*"
37+
); // => false
2938

30-
accept({
31-
name: "my file.srt",
32-
type: ""
33-
}, ".srt"); // => true
39+
accept(
40+
{
41+
name: "my file.srt",
42+
type: ""
43+
},
44+
".srt"
45+
); // => true
3446
```
3547

3648
You can also pass multiple mime types as a comma delimited string or array.
49+
3750
```javascript
38-
accept({
39-
name: "my file.json",
40-
type: "application/json"
41-
}, "application/json,video/*"); // => true
42-
43-
accept({
44-
name: "my file.json",
45-
type: "application/json"
46-
}, ["application/json", "video/*"]); // => true
51+
accept(
52+
{
53+
name: "my file.json",
54+
type: "application/json"
55+
},
56+
"application/json,video/*"
57+
); // => true
58+
59+
accept(
60+
{
61+
name: "my file.json",
62+
type: "application/json"
63+
},
64+
["application/json", "video/*"]
65+
); // => true
4766
```
4867

4968
In a CommonJS environment, use `require` instead:
69+
5070
```javascript
5171
const accept = require("attr-accept");
5272
```

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,8 +58,8 @@
5858
"lint": "oxlint",
5959
"lint:fix": "oxlint --fix",
6060
"lint:type-aware": "oxlint --type-aware",
61-
"format": "oxfmt \"src/**/*.ts\" \"*.ts\"",
62-
"format:check": "oxfmt --check \"src/**/*.ts\" \"*.ts\"",
61+
"format": "oxfmt .",
62+
"format:check": "oxfmt --check .",
6363
"pretest:cov": "npm run type-check && npm run lint && npm run format:check",
6464
"test": "vitest",
6565
"test:cov": "vitest run --coverage",

0 commit comments

Comments
 (0)