nl_tokens: interface TransformDOMTextOptions { filePath : String getText : ( el$ : CheerioElement ) = > String el$ : CheerioElement setText : ( el$ : CheerioElement text : String ) = > Void transforms : stream . Transform [] } transformText ( opts : TransformTextOptions ) = > Promise
pl_tokens: function transformDOMText ( opts ) { return new Promise ( ( resolve , reject ) => { var file = new VFile ( { path : opts . filePath , contents : new Buffer ( opts . getText ( opts . el$ ) , 'utf8' ) // eslint-disable-line node/no-deprecated-api // TODO: drop Node.js 4.x support, use `Buffer.from()` instead } ) ; var readable = fileToReadable ( file ) ; utils . pipeTransforms ( readable , opts . transforms ) . on ( 'error' , reject ) . <mask> ( 'end' , ( ) => { opts . setText ( opts . el$ , file . contents . toString ( 'utf8' ) ) ; resolve ( ) ; } ) . resume ( ) ; } ) ; }