Add conditionalGroup to allow manually specifying multiple representations of a document; use it to support expanding last parameter of functions
This commit is contained in:
1 parent
fa16988401
commit
588c8ce7cd
30 files changed
+567
-730
No files matched your search
@@ -103,18 +103,18 @@ buffer = buffer.fill(\"a\", 0, 0, \"utf8\");
|
||||
|
||||
buffer = buffer.fill(\"a\", \"utf8\");
|
||||
|
||||
maybeNum = buffer.find(
|
||||
(element: number, index: number, array: Uint8Array) => false
|
||||
);
|
||||
maybeNum = buffer.find(, (element: number,
|
||||
index: number,
|
||||
array: Uint8Array) => false);
|
||||
|
||||
maybeNum = buffer.find(
|
||||
(element: number, index: number, array: Uint8Array) => false,
|
||||
buffer
|
||||
);
|
||||
|
||||
num = buffer.findIndex(
|
||||
(element: number, index: number, array: Uint8Array) => false
|
||||
);
|
||||
num = buffer.findIndex(, (element: number,
|
||||
index: number,
|
||||
array: Uint8Array) => false);
|
||||
|
||||
num = buffer.findIndex(
|
||||
(element: number, index: number, array: Uint8Array) => false,
|
||||
|
||||
@@ -22,22 +22,15 @@ exec(\'ls\', {maxBuffer: 100}, function(error, stdout, stderr) {
|
||||
// options + callback.
|
||||
var exec = require(\"child_process\").exec;
|
||||
|
||||
exec(
|
||||
\"ls\",
|
||||
function(error, stdout, stderr) {
|
||||
console.info(stdout);
|
||||
}
|
||||
);
|
||||
exec(\"ls\", function(error, stdout, stderr) {
|
||||
console.info(stdout);
|
||||
});
|
||||
|
||||
exec(\"ls\", { timeout: 250 });
|
||||
|
||||
exec(
|
||||
\"ls\",
|
||||
{ maxBuffer: 100 },
|
||||
function(error, stdout, stderr) {
|
||||
console.info(stdout);
|
||||
}
|
||||
);
|
||||
exec(\"ls\", { maxBuffer: 100 }, function(error, stdout, stderr) {
|
||||
console.info(stdout);
|
||||
});
|
||||
"
|
||||
`;
|
||||
|
||||
@@ -81,33 +74,21 @@ var execFile = require(\"child_process\").execFile;
|
||||
|
||||
execFile(\"ls\", [ \"-lh\" ]);
|
||||
|
||||
execFile(
|
||||
\"ls\",
|
||||
function(error, stdout, stderr) {
|
||||
console.info(stdout);
|
||||
}
|
||||
);
|
||||
execFile(\"ls\", function(error, stdout, stderr) {
|
||||
console.info(stdout);
|
||||
});
|
||||
|
||||
execFile(\"wc\", { timeout: 250 });
|
||||
|
||||
execFile(
|
||||
\"ls\",
|
||||
[ \"-l\" ],
|
||||
function(error, stdout, stderr) {
|
||||
console.info(stdout);
|
||||
}
|
||||
);
|
||||
execFile(\"ls\", [ \"-l\" ], function(error, stdout, stderr) {
|
||||
console.info(stdout);
|
||||
});
|
||||
|
||||
execFile(\"ls\", [ \"-l\" ], { timeout: 250 });
|
||||
|
||||
execFile(
|
||||
\"ls\",
|
||||
[ \"-l\" ],
|
||||
{ timeout: 250 },
|
||||
function(error, stdout, stderr) {
|
||||
console.info(stdout);
|
||||
}
|
||||
);
|
||||
execFile(\"ls\", [ \"-l\" ], { timeout: 250 }, function(error, stdout, stderr) {
|
||||
console.info(stdout);
|
||||
});
|
||||
"
|
||||
`;
|
||||
|
||||
@@ -185,38 +166,27 @@ var child_process = require(\"child_process\");
|
||||
var ls = child_process.spawn(\"ls\");
|
||||
var wc = child_process.spawn(\"wc\", [ \"-l\" ]);
|
||||
|
||||
child_process.spawn(
|
||||
\"echo\",
|
||||
[ \"-n\", \"\\\"Testing...\\\"\" ],
|
||||
{ env: { TEST: \"foo\" } }
|
||||
);
|
||||
child_process.spawn(\"echo\", [ \"-n\", \"\\\"Testing...\\\"\" ], {
|
||||
env: { TEST: \"foo\" }
|
||||
});
|
||||
|
||||
child_process.spawn(\"echo\", { env: { FOO: 2 } });
|
||||
|
||||
ls.stdout.on(
|
||||
\"data\",
|
||||
function(data) {
|
||||
wc.stdin.write(data);
|
||||
}
|
||||
);
|
||||
ls.stdout.on(\"data\", function(data) {
|
||||
wc.stdin.write(data);
|
||||
});
|
||||
|
||||
ls.stderr.on(
|
||||
\"data\",
|
||||
function(data) {
|
||||
console.warn(data);
|
||||
}
|
||||
);
|
||||
ls.stderr.on(\"data\", function(data) {
|
||||
console.warn(data);
|
||||
});
|
||||
|
||||
ls.on(
|
||||
\"close\",
|
||||
function(code) {
|
||||
if (code !== 0) {
|
||||
console.warn(\"\`ls\` exited with code %s\", code);
|
||||
}
|
||||
|
||||
wc.stdin.end();
|
||||
ls.on(\"close\", function(code) {
|
||||
if (code !== 0) {
|
||||
console.warn(\"\`ls\` exited with code %s\", code);
|
||||
}
|
||||
);
|
||||
|
||||
wc.stdin.end();
|
||||
});
|
||||
|
||||
wc.stdout.pipe(process.stdout);
|
||||
|
||||
|
||||
@@ -53,14 +53,11 @@ let tests = [
|
||||
function() {
|
||||
const hmac = crypto.createHmac(\"sha256\", \"a secret\");
|
||||
|
||||
hmac.on(
|
||||
\"readable\",
|
||||
() => {
|
||||
(hmac.read(): ?(string | Buffer));
|
||||
hmac.on(\"readable\", () => {
|
||||
(hmac.read(): ?(string | Buffer));
|
||||
|
||||
(hmac.read(): number);
|
||||
}
|
||||
);
|
||||
(hmac.read(): number);
|
||||
});
|
||||
|
||||
hmac.write(\"some data to hash\");
|
||||
|
||||
|
||||
@@ -41,36 +41,21 @@ fs.readFile(\"file.exp\", {}, (_, data) => {
|
||||
// error
|
||||
var fs = require(\"fs\");
|
||||
|
||||
fs.readFile(
|
||||
\"file.exp\",
|
||||
(_, data) => {
|
||||
(data: Buffer);
|
||||
}
|
||||
);
|
||||
fs.readFile(\"file.exp\", (_, data) => {
|
||||
(data: Buffer);
|
||||
});
|
||||
|
||||
fs.readFile(
|
||||
\"file.exp\",
|
||||
\"blah\",
|
||||
(_, data) => {
|
||||
(data: string);
|
||||
}
|
||||
);
|
||||
fs.readFile(\"file.exp\", \"blah\", (_, data) => {
|
||||
(data: string);
|
||||
});
|
||||
|
||||
fs.readFile(
|
||||
\"file.exp\",
|
||||
{ encoding: \"blah\" },
|
||||
(_, data) => {
|
||||
(data: string);
|
||||
}
|
||||
);
|
||||
fs.readFile(\"file.exp\", { encoding: \"blah\" }, (_, data) => {
|
||||
(data: string);
|
||||
});
|
||||
|
||||
fs.readFile(
|
||||
\"file.exp\",
|
||||
{},
|
||||
(_, data) => {
|
||||
(data: Buffer);
|
||||
}
|
||||
);
|
||||
fs.readFile(\"file.exp\", {}, (_, data) => {
|
||||
(data: Buffer);
|
||||
});
|
||||
|
||||
(fs.readFileSync(\"file.exp\"): Buffer);
|
||||
|
||||
|
||||
Reference in new issue
Block a user