File tree Expand file tree Collapse file tree 6 files changed +24
-38
lines changed Expand file tree Collapse file tree 6 files changed +24
-38
lines changed Original file line number Diff line number Diff line change 1
1
.DS_Store
2
2
* .log
3
- .nyc_output /
4
3
coverage /
5
4
node_modules /
6
- nlcst-normalize.js
7
- nlcst-normalize.min.js
8
5
yarn.lock
Original file line number Diff line number Diff line change 1
1
coverage /
2
- nlcst-normalize.js
3
- nlcst-normalize.min.js
4
- * .json
5
2
* .md
Original file line number Diff line number Diff line change 1
- 'use strict '
1
+ import { toString } from 'nlcst-to-string '
2
2
3
- var toString = require ( 'nlcst-to-string' )
4
-
5
- module . exports = normalize
6
-
7
- function normalize ( node , options ) {
3
+ export function normalize ( node , options ) {
8
4
var value = ( typeof node === 'string' ? node : toString ( node ) )
9
5
. toLowerCase ( )
10
6
. replace ( / ’ / g, "'" )
Original file line number Diff line number Diff line change 21
21
"contributors" : [
22
22
" Titus Wormer <[email protected] > (https://wooorm.com)"
23
23
],
24
+ "sideEffects" : false ,
25
+ "type" : " module" ,
26
+ "main" : " index.js" ,
24
27
"files" : [
25
28
" index.js"
26
29
],
27
30
"dependencies" : {
28
- "nlcst-to-string" : " ^2 .0.0"
31
+ "nlcst-to-string" : " ^3 .0.0"
29
32
},
30
33
"devDependencies" : {
31
- "browserify" : " ^17.0.0" ,
32
- "nyc" : " ^15.0.0" ,
34
+ "c8" : " ^7.0.0" ,
33
35
"prettier" : " ^2.0.0" ,
34
36
"remark-cli" : " ^9.0.0" ,
35
37
"remark-preset-wooorm" : " ^8.0.0" ,
36
38
"tape" : " ^5.0.0" ,
37
- "tinyify" : " ^3.0.0" ,
38
- "xo" : " ^0.38.0"
39
+ "xo" : " ^0.39.0"
39
40
},
40
41
"scripts" : {
41
42
"format" : " remark . -qfo && prettier . -w --loglevel warn && xo --fix" ,
42
- "build-bundle" : " browserify . -s nlcstNormalize -o nlcst-normalize.js" ,
43
- "build-mangle" : " browserify . -s nlcstNormalize -o nlcst-normalize.min.js -p tinyify" ,
44
- "build" : " npm run build-bundle && npm run build-mangle" ,
45
- "test-api" : " node test" ,
46
- "test-coverage" : " nyc --reporter lcov tape test.js" ,
47
- "test" : " npm run format && npm run build && npm run test-coverage"
48
- },
49
- "nyc" : {
50
- "check-coverage" : true ,
51
- "lines" : 100 ,
52
- "functions" : 100 ,
53
- "branches" : 100
43
+ "test-api" : " node test.js" ,
44
+ "test-coverage" : " c8 --check-coverage --branches 100 --functions 100 --lines 100 --statements 100 --reporter lcov node test.js" ,
45
+ "test" : " npm run format && npm run test-coverage"
54
46
},
55
47
"prettier" : {
56
48
"tabWidth" : 2 ,
62
54
},
63
55
"xo" : {
64
56
"prettier" : true ,
65
- "esnext " : false ,
66
- "ignore " : [
67
- " nlcst-normalize.js "
68
- ]
57
+ "rules " : {
58
+ "no-var " : " off " ,
59
+ "prefer-arrow-callback" : " off "
60
+ }
69
61
},
70
62
"remarkConfig" : {
71
63
"plugins" : [
Original file line number Diff line number Diff line change 12
12
13
13
## Install
14
14
15
+ This package is [ ESM only] ( https://gist.github.com/sindresorhus/a39789f98801d908bbc7ff3ecc99d99c ) :
16
+ Node 12+ is needed to use it and it must be ` import ` ed instead of ` require ` d.
17
+
15
18
[ npm] [ ] :
16
19
17
20
``` sh
@@ -21,7 +24,7 @@ npm install nlcst-normalize
21
24
## Use
22
25
23
26
``` js
24
- var normalize = require ( ' nlcst-normalize' )
27
+ import { normalize } from ' nlcst-normalize'
25
28
26
29
normalize (" Don't" ) // => 'dont'
27
30
normalize (' Don’t' ) // => 'dont'
@@ -41,6 +44,9 @@ normalize({
41
44
42
45
## API
43
46
47
+ This package exports the following identifiers: ` normalize ` .
48
+ There is no default export.
49
+
44
50
### ` normalize(value[, options]) `
45
51
46
52
Normalize a word (` string ` , [ ` Node ` ] [ node ] , ` Array.<Node> ` ) for easier
Original file line number Diff line number Diff line change 1
- 'use strict'
2
-
3
- var test = require ( 'tape' )
4
- var normalize = require ( '.' )
1
+ import test from 'tape'
2
+ import { normalize } from './index.js'
5
3
6
4
test ( 'Basic' , function ( t ) {
7
5
t . throws ( function ( ) {
You can’t perform that action at this time.
0 commit comments