File tree 4 files changed +8
-12
lines changed
4 files changed +8
-12
lines changed Original file line number Diff line number Diff line change 12
12
* @param {Options } [options]
13
13
* @returns {string }
14
14
*/
15
- export function toString ( node , options ) {
16
- var { includeImageAlt = true } = options || { }
15
+ export function toString ( node , options = { } ) {
16
+ const { includeImageAlt = true } = options
17
17
return one ( node , includeImageAlt )
18
18
}
19
19
@@ -44,8 +44,8 @@ function one(node, includeImageAlt) {
44
44
*/
45
45
function all ( values , includeImageAlt ) {
46
46
/** @type {Array.<string> } */
47
- var result = [ ]
48
- var index = - 1
47
+ const result = [ ]
48
+ let index = - 1
49
49
50
50
while ( ++ index < values . length ) {
51
51
result [ index ] = one ( values [ index ] , includeImageAlt )
Original file line number Diff line number Diff line change 61
61
"trailingComma" : " none"
62
62
},
63
63
"xo" : {
64
- "prettier" : true ,
65
- "rules" : {
66
- "no-var" : " off" ,
67
- "prefer-arrow-callback" : " off"
68
- }
64
+ "prettier" : true
69
65
},
70
66
"remarkConfig" : {
71
67
"plugins" : [
Original file line number Diff line number Diff line change @@ -24,11 +24,11 @@ npm install mdast-util-to-string
24
24
## Use
25
25
26
26
``` js
27
- import unified from ' unified'
27
+ import { unified } from ' unified'
28
28
import remarkParse from ' remark-parse'
29
29
import {toString } from ' mdast-util-to-string'
30
30
31
- var tree = unified ()
31
+ const tree = unified ()
32
32
.use (remarkParse)
33
33
.parse (' Some _emphasis_, **importance**, and `code`.' )
34
34
Original file line number Diff line number Diff line change 1
1
import test from 'tape'
2
2
import { toString } from './index.js'
3
3
4
- test ( 'toString' , function ( t ) {
4
+ test ( 'toString' , ( t ) => {
5
5
t . equal ( toString ( ) , '' , 'should not fail on a missing node' )
6
6
t . equal ( toString ( null ) , '' , 'should not fail on `null` missing node' )
7
7
You can’t perform that action at this time.
0 commit comments