import { Plugin , Transformer } from 'unified' ; import { Node } from 'unist' ; import { VFile } from 'vfile' ; import Options from './options' ; import Walker from './walker' ; function normalizeOptions ( options ) { let cfg = [ ... options . cfg , process . platform ] ; if ( process . platform === 'win32' ) { cfg . push ( 'windows' ) ; } else { cfg . push ( 'unix' ) ; } return { ... options , cfg } ; } function attacher ( options ) { async function transform ( node , file ) { return new Walker ( normalizeOptions ( options ) , file ) . walk ( node ) ; } return transform ; } const plugin = attacher ; export default plugin ;