File tree Expand file tree Collapse file tree 5 files changed +10
-14
lines changed Expand file tree Collapse file tree 5 files changed +10
-14
lines changed Original file line number Diff line number Diff line change 1
1
/**
2
- Check if a filepath is a text file.
2
+ Check if a file path is a text file.
3
3
4
4
@example
5
5
```
6
6
import isTextPath = require('is-text-path');
7
7
8
- isTextPath('src /unicorn.txt');
8
+ isTextPath('source /unicorn.txt');
9
9
//=> true
10
10
11
- isTextPath('src /unicorn.png');
11
+ isTextPath('source /unicorn.png');
12
12
//=> false
13
13
```
14
14
*/
Original file line number Diff line number Diff line change @@ -4,6 +4,4 @@ const textExtensions = require('text-extensions');
4
4
5
5
const extensions = new Set ( textExtensions ) ;
6
6
7
- module . exports = filepath => {
8
- return extensions . has ( path . extname ( filepath ) . slice ( 1 ) . toLowerCase ( ) ) ;
9
- } ;
7
+ module . exports = filePath => extensions . has ( path . extname ( filePath ) . slice ( 1 ) . toLowerCase ( ) ) ;
Original file line number Diff line number Diff line change 1
1
import { expectType } from 'tsd' ;
2
2
import isTextPath = require( '.' ) ;
3
3
4
- expectType < boolean > ( isTextPath ( 'src /unicorn.txt' ) ) ;
4
+ expectType < boolean > ( isTextPath ( 'source /unicorn.txt' ) ) ;
Original file line number Diff line number Diff line change 1
1
{
2
2
"name" : " is-text-path" ,
3
3
"version" : " 1.0.1" ,
4
- "description" : " Check if a filepath is a text file" ,
4
+ "description" : " Check if a file path is a text file" ,
5
5
"license" : " MIT" ,
6
6
"repository" : " sindresorhus/is-text-path" ,
7
7
"author" : {
20
20
" index.d.ts"
21
21
],
22
22
"keywords" : [
23
- " txt" ,
24
23
" text" ,
25
- " ext" ,
26
24
" extensions" ,
27
25
" extension" ,
28
26
" file" ,
Original file line number Diff line number Diff line change 1
1
# is-text-path [ ![ Build Status] ( https://travis-ci.org/sindresorhus/is-text-path.svg?branch=master )] ( https://travis-ci.org/sindresorhus/is-text-path )
2
2
3
- > Check if a filepath is a text file
3
+ > Check if a file path is a text file
4
4
5
5
6
6
## Install
@@ -15,18 +15,18 @@ $ npm install is-text-path
15
15
``` js
16
16
const isTextPath = require (' is-text-path' );
17
17
18
- isTextPath (' src /unicorn.txt' );
18
+ isTextPath (' source /unicorn.txt' );
19
19
// => true
20
20
21
- isTextPath (' src /unicorn.png' );
21
+ isTextPath (' source /unicorn.png' );
22
22
// => false
23
23
```
24
24
25
25
26
26
## Related
27
27
28
28
- [ ` text-extensions ` ] ( https://github.com/sindresorhus/text-extensions ) - List of text file extensions
29
- - [ ` is-binary-path ` ] ( https://github.com/sindresorhus/is-binary-path ) - Check if a filepath is a binary file
29
+ - [ ` is-binary-path ` ] ( https://github.com/sindresorhus/is-binary-path ) - Check if a file path is a binary file
30
30
31
31
32
32
## License
You can’t perform that action at this time.
0 commit comments