is-css-request
v1.0.1
Published
Utils for checking if a path or url points to a CSS request.
Downloads
3,945
Maintainers
Readme
is-css-request
Utils for checking if a path or url points to a CSS request.
Installation
npm i is-css-request
yarn add is-css-request
pnpm add is-css-request
Usage
API
// esm + ts
import { isCSSRequest, isModuleCSSRequest } from 'is-css-request'
// or cjs
// const { isCSSRequest, isModuleCSSRequest } = require('is-css-request')
isCSSRequest('http://foo.bar/css-file.css') // => true
isCSSRequest('some/path/to/a/css-file.css') // => true
isCSSRequest('ice/a/preprocessor.scss') // => true
isCSSRequest('ice/a/x.fac') // => false
isModuleCSSRequest('some/path/to/a/css-file.css') // => false
isModuleCSSRequest('some/path/to/a/css-file.module.css') // => true
Enum
import { PostCssDialectLang, PreprocessLang, PureCssLang } from 'is-css-request'
PureCssLang.css
PreprocessLang.less
PreprocessLang.sass
PreprocessLang.scss
PostCssDialectLang.sss
License
Contributing
- Fork it
- Create your feature branch (
git checkout -b feature/my-new-feature
) - Commit your changes (
git commit -am 'Add some feature'
) - Push to the branch (
git push origin feature/my-new-feature
) - Create new Pull Request