Skip to content
This repository was archived by the owner on Mar 28, 2018. It is now read-only.

Commit ebc2ffb

Browse files
committed
Bring module up to date
1 parent 541f9c3 commit ebc2ffb

File tree

7 files changed

+40
-54
lines changed

7 files changed

+40
-54
lines changed

.travis.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
language: node_js
22

33
node_js:
4-
- 0.10
5-
- 0.11
4+
- '7'
5+
- '6'

index.js

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,8 @@
1-
'use strict'
1+
const path = require('path')
22

3-
var path = require('path')
4-
5-
module.exports = function isCss(cssFilePath) {
3+
module.exports = cssFilePath => {
64
if (typeof cssFilePath !== 'string') {
7-
throw new TypeError('is-css expects a string')
5+
throw new TypeError('is-css expected a string')
86
}
97

108
return /^\.css$/i.test(path.extname(cssFilePath))

LICENSE.md renamed to license

File renamed without changes.

package.json

Lines changed: 7 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,32 +1,25 @@
11
{
22
"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",
44
"author": "John Otander",
55
"version": "1.0.0",
66
"main": "index.js",
7-
"directories": {
8-
"test": "test"
9-
},
7+
"files": [
8+
"index.js"
9+
],
1010
"scripts": {
11-
"test": "mocha test"
12-
},
13-
"repository": {
14-
"type": "git",
15-
"url": "https://github.com/johnotander/is-css.git"
11+
"test": "ava -v"
1612
},
13+
"repository": "cssstats/is-css",
1714
"keywords": [
1815
"css",
1916
"url",
2017
"extension",
2118
"is-css"
2219
],
2320
"license": "MIT",
24-
"bugs": {
25-
"url": "https://github.com/johnotander/is-css/issues"
26-
},
27-
"homepage": "https://github.com/johnotander/is-css",
2821
"dependencies": {},
2922
"devDependencies": {
30-
"mocha": "*"
23+
"ava": "^0.16.0"
3124
}
3225
}

README.md renamed to readme.md

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
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)
42

53
Check if a path or url points to a css file.
64

@@ -13,7 +11,7 @@ npm install --save is-css
1311
## Usage
1412

1513
```javascript
16-
var isCss = require('is-css')
14+
const isCss = require('is-css')
1715

1816
isCss('http://foo.bar/css-file.css') // => true
1917
isCss('some/path/to/a/css-file.css') // => true

test.js

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
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+
})

test/test.js

Lines changed: 0 additions & 29 deletions
This file was deleted.

0 commit comments

Comments
 (0)