File tree Expand file tree Collapse file tree 4 files changed +8
-12
lines changed Expand file tree Collapse file tree 4 files changed +8
-12
lines changed Original file line number Diff line number Diff line change 1212 * @param {Options } [options]
1313 * @returns {string }
1414 */
15- export function toString ( node , options ) {
16- var { includeImageAlt = true } = options || { }
15+ export function toString ( node , options = { } ) {
16+ const { includeImageAlt = true } = options
1717 return one ( node , includeImageAlt )
1818}
1919
@@ -44,8 +44,8 @@ function one(node, includeImageAlt) {
4444 */
4545function all ( values , includeImageAlt ) {
4646 /** @type {Array.<string> } */
47- var result = [ ]
48- var index = - 1
47+ const result = [ ]
48+ let index = - 1
4949
5050 while ( ++ index < values . length ) {
5151 result [ index ] = one ( values [ index ] , includeImageAlt )
Original file line number Diff line number Diff line change 6161 "trailingComma" : " none"
6262 },
6363 "xo" : {
64- "prettier" : true ,
65- "rules" : {
66- "no-var" : " off" ,
67- "prefer-arrow-callback" : " off"
68- }
64+ "prettier" : true
6965 },
7066 "remarkConfig" : {
7167 "plugins" : [
Original file line number Diff line number Diff line change @@ -24,11 +24,11 @@ npm install mdast-util-to-string
2424## Use
2525
2626``` js
27- import unified from ' unified'
27+ import { unified } from ' unified'
2828import remarkParse from ' remark-parse'
2929import {toString } from ' mdast-util-to-string'
3030
31- var tree = unified ()
31+ const tree = unified ()
3232 .use (remarkParse)
3333 .parse (' Some _emphasis_, **importance**, and `code`.' )
3434
Original file line number Diff line number Diff line change 11import test from 'tape'
22import { toString } from './index.js'
33
4- test ( 'toString' , function ( t ) {
4+ test ( 'toString' , ( t ) => {
55 t . equal ( toString ( ) , '' , 'should not fail on a missing node' )
66 t . equal ( toString ( null ) , '' , 'should not fail on `null` missing node' )
77
You can’t perform that action at this time.
0 commit comments