1.0.42 • Published 7 months ago

mime-validator v1.0.42

Weekly downloads
1
License
MIT
Repository
gitlab
Last release
7 months ago

mime-validator

Description

Validate file type against official MIME standard types

Build

npm run build

Tests

Test are using jest. To run tests use:

npm run test

Usage

Validate method accepts string or array as arguments. Returns boolean or throws exception if invalid argument.

import { validate, mimeType } from 'mime-validator';

type = 'application/xml';

validate(type, 'xml'); // => true
validate(type, ['application/xml', 'application/rss+xml', 'application/pdf']) // => false
validate(type, [mimeType.PNG, mimeType.GIF, mimeType.JPEG]) // => false

Contributing

We welcome and appreciate contributions from the community to help improve and enhance this project. Please follow these steps to contribute:

  1. Fork the project to your GitLab account by clicking the "Fork" button at the top right of the project's GitLab page. This creates a copy of the project in your account.
  1. Clone the forked repository to your local machine using Git. Replace <your-username> with your GitLab username.
git clone https://gitlab.com/<your-username>/mime-validator.git
  1. Create a new branch for your feature or bug fix. Use a clear and descriptive branch name that reflects the purpose of your changes.
git checkout -b feature-name
  1. Make changes

  2. Add and commit your changes with clear and descriptive commit messages.

git add .
git commit -m "Add feature XYZ" or "Fix issue #123"
  1. Push your branch to your GitLab fork:
git push origin feature-name
  1. Create a Pull Request
    • Go to the GitLab page of your forked repository.
    • Click on the "New Pull Request" button.
    • Select the branch you just pushed (e.g., feature-name) as the source branch.
    • Provide a clear title and description for your pull request. Reference any related issues, if applicable.
    • Click the "Create Pull Request" button.

License

MIT © Branko Gabelica

1.0.40

8 months ago

1.0.42

7 months ago

1.0.41

8 months ago

1.0.19

2 years ago

1.0.2

2 years ago

1.0.18

2 years ago

1.0.1

2 years ago

1.0.39

2 years ago

1.0.17

2 years ago

1.0.38

2 years ago

1.0.16

2 years ago

1.0.9

2 years ago

1.0.8

2 years ago

1.0.7

2 years ago

1.0.6

2 years ago

1.0.5

2 years ago

1.0.4

2 years ago

1.0.3

2 years ago

1.0.22

2 years ago

1.0.20

2 years ago

1.0.26

2 years ago

1.0.25

2 years ago

1.0.24

2 years ago

1.0.23

2 years ago

1.0.29

2 years ago

1.0.28

2 years ago

1.0.27

2 years ago

1.0.33

2 years ago

1.0.11

2 years ago

1.0.32

2 years ago

1.0.10

2 years ago

1.0.31

2 years ago

1.0.30

2 years ago

1.0.37

2 years ago

1.0.15

2 years ago

1.0.36

2 years ago

1.0.14

2 years ago

1.0.35

2 years ago

1.0.13

2 years ago

1.0.34

2 years ago

1.0.12

2 years ago

1.0.0

8 years ago