DefinitelyTyped/types/shell-quote/shell-quote-tests.ts
2017-07-11 10:20:17 -04:00

9 lines
373 B
TypeScript

import { parse, quote } from 'shell-quote';
quote([ 'a', 'b c d', '$f', '"g"' ]);
parse('a "b c" \\$def \'it\\\'s great\'');
parse('beep --boop="$PWD"', { PWD: '/home/robot' });
parse('beep --boop="$PWD"', { PWD: '/home/robot' }, { escape: '^' });
parse('beep --boop="$PWD"', (key: string) => '/home/robot');
parse('beep --boop="$PWD"', (key: string) => ({ op: '||' }));