export interface NbconvertParams { args : string [ ] ; directory ? : string ; timeout ? : number ; } export function parseTo ( args ) { let j = 0 ; let to = "" ; for ( let i = 0 ; i < args . length ; i ++ ) { if ( args [ i ] === "--to" ) { j = i ; to = args [ i + 1 ] ; break ; } } return { to , j } ; } export function parseSource ( args ) { for ( let i = 0 ; i < args . length ; i ++ ) { if ( args [ i ] . startsWith ( "--" ) ) { if ( args [ i ] != "--" && ! args [ i ] . includes ( "=" ) ) { i += 1 ; } continue ; } return args [ i ] ; } throw Error ( "no source" ) ; }