mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-06-28 14:20:12 +00:00
Add shell-quote types
This commit is contained in:
12
types/shell-quote/index.d.ts
vendored
Normal file
12
types/shell-quote/index.d.ts
vendored
Normal file
@@ -0,0 +1,12 @@
|
||||
// Type definitions for shell-quote 1.6
|
||||
// Project: https://github.com/substack/node-shell-quote
|
||||
// Definitions by: Jason Cheatham <https://github.com/jason0x43>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
// TypeScript Version: 2.2
|
||||
|
||||
export function quote(args: string[]): string;
|
||||
export function parse(
|
||||
cmd: string,
|
||||
env?: { [key: string]: string } | ((key: string) => string | object),
|
||||
opts?: { [key: string]: string }
|
||||
): string[];
|
||||
8
types/shell-quote/shell-quote-tests.ts
Normal file
8
types/shell-quote/shell-quote-tests.ts
Normal file
@@ -0,0 +1,8 @@
|
||||
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: '||' }));
|
||||
22
types/shell-quote/tsconfig.json
Normal file
22
types/shell-quote/tsconfig.json
Normal file
@@ -0,0 +1,22 @@
|
||||
{
|
||||
"files": [
|
||||
"index.d.ts",
|
||||
"shell-quote-tests.ts"
|
||||
],
|
||||
"compilerOptions": {
|
||||
"module": "commonjs",
|
||||
"lib": [
|
||||
"es6"
|
||||
],
|
||||
"noImplicitAny": true,
|
||||
"noImplicitThis": true,
|
||||
"strictNullChecks": false,
|
||||
"baseUrl": "../",
|
||||
"typeRoots": [
|
||||
"../"
|
||||
],
|
||||
"types": [],
|
||||
"noEmit": true,
|
||||
"forceConsistentCasingInFileNames": true
|
||||
}
|
||||
}
|
||||
1
types/shell-quote/tslint.json
Normal file
1
types/shell-quote/tslint.json
Normal file
@@ -0,0 +1 @@
|
||||
{ "extends": "dtslint/dt.json" }
|
||||
Reference in New Issue
Block a user