This repository was archived by the owner on Mar 28, 2018. It is now read-only.
File tree 7 files changed +40
-54
lines changed
7 files changed +40
-54
lines changed Original file line number Diff line number Diff line change 1
1
language : node_js
2
2
3
3
node_js :
4
- - 0.10
5
- - 0.11
4
+ - ' 7 '
5
+ - ' 6 '
Original file line number Diff line number Diff line change 1
- 'use strict'
1
+ const path = require ( 'path' )
2
2
3
- var path = require ( 'path' )
4
-
5
- module . exports = function isCss ( cssFilePath ) {
3
+ module . exports = cssFilePath => {
6
4
if ( typeof cssFilePath !== 'string' ) {
7
- throw new TypeError ( 'is-css expects a string' )
5
+ throw new TypeError ( 'is-css expected a string' )
8
6
}
9
7
10
8
return / ^ \. c s s $ / i. test ( path . extname ( cssFilePath ) )
File renamed without changes.
Original file line number Diff line number Diff line change 1
1
{
2
2
"name" : " is-css" ,
3
- "description" : " Check if a path or url points to a css file. " ,
3
+ "description" : " Check if a path or url points to a css file" ,
4
4
"author" : " John Otander" ,
5
5
"version" : " 1.0.0" ,
6
6
"main" : " index.js" ,
7
- "directories " : {
8
- "test" : " test "
9
- } ,
7
+ "files " : [
8
+ " index.js "
9
+ ] ,
10
10
"scripts" : {
11
- "test" : " mocha test"
12
- },
13
- "repository" : {
14
- "type" : " git" ,
15
- "url" : " https://github.com/johnotander/is-css.git"
11
+ "test" : " ava -v"
16
12
},
13
+ "repository" : " cssstats/is-css" ,
17
14
"keywords" : [
18
15
" css" ,
19
16
" url" ,
20
17
" extension" ,
21
18
" is-css"
22
19
],
23
20
"license" : " MIT" ,
24
- "bugs" : {
25
- "url" : " https://github.com/johnotander/is-css/issues"
26
- },
27
- "homepage" : " https://github.com/johnotander/is-css" ,
28
21
"dependencies" : {},
29
22
"devDependencies" : {
30
- "mocha " : " * "
23
+ "ava " : " ^0.16.0 "
31
24
}
32
25
}
Original file line number Diff line number Diff line change 1
- # is-css
2
-
3
- [ ![ Build Status] ( https://secure.travis-ci.org/cssstats/is-css.png?branch=master )] ( https://travis-ci.org/cssstats/is-css )
1
+ # is-css [ ![ Build Status] ( https://secure.travis-ci.org/cssstats/is-css.svg?branch=master )] ( https://travis-ci.org/cssstats/is-css ) [ ![ js-standard-style] ( https://img.shields.io/badge/code%20style-standard-brightgreen.svg?style=flat )] ( https://github.com/feross/standard )
4
2
5
3
Check if a path or url points to a css file.
6
4
@@ -13,7 +11,7 @@ npm install --save is-css
13
11
## Usage
14
12
15
13
``` javascript
16
- var isCss = require (' is-css' )
14
+ const isCss = require (' is-css' )
17
15
18
16
isCss (' http://foo.bar/css-file.css' ) // => true
19
17
isCss (' some/path/to/a/css-file.css' ) // => true
Original file line number Diff line number Diff line change
1
+ import test from 'ava'
2
+ import isCss from './'
3
+
4
+ const cssPaths = [
5
+ 'foo/file.css' ,
6
+ 'src/foo/bar/file.CSS' ,
7
+ 'http://foo.com/bar.css'
8
+ ]
9
+
10
+ const nonCssPaths = [
11
+ 'foo/filecss' ,
12
+ 'file' ,
13
+ 'file.scss'
14
+ ]
15
+
16
+ test ( 'returns true for css files' , t => {
17
+ t . plan ( cssPaths . length )
18
+
19
+ cssPaths . forEach ( file => t . truthy ( isCss ( file ) ) )
20
+ } )
21
+
22
+ test ( 'returns false for non css files' , t => {
23
+ t . plan ( nonCssPaths . length )
24
+
25
+ nonCssPaths . forEach ( file => t . falsy ( isCss ( file ) ) )
26
+ } )
Load Diff This file was deleted.
You can’t perform that action at this time.
0 commit comments