| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -1,34 +1,34 @@ | |||
| 1 | 1 | (function () { | |
| 2 | - const socket = new WebSocket('ws://localhost:8080'); // $clientSocket | ||
| 2 | + const socket = new WebSocket('ws://localhost:8080'); // $ clientSocket | ||
| 3 | 3 | ||
| 4 | 4 | socket.addEventListener('open', function (event) { | |
| 5 | - socket.send('Hi from browser!'); // $clientSend | ||
| 5 | + socket.send('Hi from browser!'); // $ clientSend | ||
| 6 | 6 | }); | |
| 7 | 7 | ||
| 8 | 8 | socket.addEventListener('message', function (event) { | |
| 9 | 9 | console.log('Message from server ', event.data); // $ remoteFlow | |
| 10 | - }); // $clientReceive | ||
| 10 | + }); // $ clientReceive | ||
| 11 | 11 | ||
| 12 | 12 | socket.onmessage = function (event) { | |
| 13 | 13 | console.log("Message from server 2", event.data); // $ remoteFlow | |
| 14 | - }; // $clientReceive | ||
| 14 | + }; // $ clientReceive | ||
| 15 | 15 | })(); | |
| 16 | 16 | ||
| 17 | 17 | ||
| 18 | 18 | (function () { | |
| 19 | - var sock = new SockJS('http://0.0.0.0:9999/echo'); // $clientSocket | ||
| 19 | + var sock = new SockJS('http://0.0.0.0:9999/echo'); // $ clientSocket | ||
| 20 | 20 | sock.onopen = function () { | |
| 21 | - sock.send('test'); // $clientSend | ||
| 21 | + sock.send('test'); // $ clientSend | ||
| 22 | 22 | }; | |
| 23 | - | ||
| 23 | + | ||
| 24 | 24 | sock.onmessage = function (e) { | |
| 25 | 25 | console.log('message', e.data); // $ remoteFlow | |
| 26 | 26 | sock.close(); | |
| 27 | - }; // $clientReceive | ||
| 28 | - | ||
| 27 | + }; // $ clientReceive | ||
| 28 | + | ||
| 29 | 29 | sock.addEventListener('message', function (event) { | |
| 30 | 30 | console.log('Using addEventListener ', event.data); // $ remoteFlow | |
| 31 | - }); // $clientReceive | ||
| 31 | + }); // $ clientReceive | ||
| 32 | 32 | })(); | |
| 33 | 33 | ||
| 34 | 34 | export const MyWebSocket = WebSocket; | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -1,15 +1,15 @@ | |||
| 1 | 1 | const WebSocket = require('ws'); | |
| 2 | 2 | ||
| 3 | 3 | (function () { | |
| 4 | - const ws = new WebSocket('ws://example.org'); // $clientSocket | ||
| 4 | + const ws = new WebSocket('ws://example.org'); // $ clientSocket | ||
| 5 | 5 | ||
| 6 | 6 | ws.on('open', function open() { | |
| 7 | - ws.send('Hi from client!'); // $clientSend | ||
| 7 | + ws.send('Hi from client!'); // $ clientSend | ||
| 8 | 8 | }); | |
| 9 | 9 | ||
| 10 | 10 | ws.on('message', function incoming(data) { // $ remoteFlow | |
| 11 | 11 | console.log(data); | |
| 12 | - }); // $clientReceive | ||
| 12 | + }); // $ clientReceive | ||
| 13 | 13 | })(); | |
| 14 | 14 | ||
| 15 | 15 | module.exports.MyWebSocketWS = require('ws'); | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -3,12 +3,12 @@ const WebSocket = require('ws'); | |||
| 3 | 3 | (function () { | |
| 4 | 4 | const wss = new WebSocket.Server({ port: 8080 }); | |
| 5 | 5 | ||
| 6 | - wss.on('connection', function connection(ws) { // $serverSocket | ||
| 7 | - ws.on('message', function incoming(message) { // $remoteFlow | ||
| 6 | + wss.on('connection', function connection(ws) { // $ serverSocket | ||
| 7 | + ws.on('message', function incoming(message) { // $ remoteFlow | ||
| 8 | 8 | console.log('received: %s', message); | |
| 9 | - }); // $serverReceive | ||
| 9 | + }); // $ serverReceive | ||
| 10 | 10 | ||
| 11 | - ws.send('Hi from server!'); // $serverSend | ||
| 11 | + ws.send('Hi from server!'); // $ serverSend | ||
| 12 | 12 | }); | |
| 13 | 13 | })(); | |
| 14 | 14 | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -5,11 +5,11 @@ const sockjs = require('sockjs'); | |||
| 5 | 5 | const app = express(); | |
| 6 | 6 | const server = http.createServer(app); | |
| 7 | 7 | const sockjs_echo = sockjs.createServer({}); | |
| 8 | - sockjs_echo.on('connection', function (conn) { // $serverSocket | ||
| 9 | - conn.on('data', function (message) { // $remoteFlow | ||
| 8 | + sockjs_echo.on('connection', function (conn) { // $ serverSocket | ||
| 9 | + conn.on('data', function (message) { // $ remoteFlow | ||
| 10 | 10 | var data = JSON.parse(message); | |
| 11 | - conn.write(JSON.stringify(eval(data.test))); // $serverSend | ||
| 12 | - }); // $serverReceive | ||
| 11 | + conn.write(JSON.stringify(eval(data.test))); // $ serverSend | ||
| 12 | + }); // $ serverReceive | ||
| 13 | 13 | }); | |
| 14 | 14 | ||
| 15 | 15 | sockjs_echo.installHandlers(server, { prefix: '/echo' }); | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -7,7 +7,7 @@ interface MyInterface { | |||
| 7 | 7 | constructor(): string; // $ Alert - This a called "constructor" | |
| 8 | 8 | new(): Date; // OK - This a constructor signature. | |
| 9 | 9 | ||
| 10 | - myNumber: 123; | ||
| 10 | + myNumber: 123; | ||
| 11 | 11 | } | |
| 12 | 12 | ||
| 13 | 13 | var a : MyFunction = null as any; | |
@@ -25,7 +25,7 @@ class Foo { | |||
| 25 | 25 | ||
| 26 | 26 | } | |
| 27 | 27 | myString = "foobar" | |
| 28 | - | ||
| 28 | + | ||
| 29 | 29 | myMethod(): boolean { | |
| 30 | 30 | return Math.random() > 0.5; | |
| 31 | 31 | } | |
@@ -71,17 +71,17 @@ class StaticMethods { | |||
| 71 | 71 | } | |
| 72 | 72 | ||
| 73 | 73 | interface Overloaded { | |
| 74 | - function(x: string): string; // $Alert | ||
| 75 | - function(x: number): number; // $Alert | ||
| 76 | - function(x: any): any; // $Alert | ||
| 74 | + function(x: string): string; // $ Alert | ||
| 75 | + function(x: number): number; // $ Alert | ||
| 76 | + function(x: any): any; // $ Alert | ||
| 77 | 77 | } | |
| 78 | 78 | ||
| 79 | 79 | abstract class AbstractFoo { | |
| 80 | - abstract new(): void; // $Alert | ||
| 80 | + abstract new(): void; // $ Alert | ||
| 81 | 81 | } | |
| 82 | 82 | ||
| 83 | 83 | abstract class AbstractFooFunction { | |
| 84 | - abstract function(): number; // $Alert | ||
| 84 | + abstract function(): number; // $ Alert | ||
| 85 | 85 | } | |
| 86 | 86 | ||
| 87 | 87 | abstract class AbstractFooConstructor { | |
@@ -90,12 +90,12 @@ abstract class AbstractFooConstructor { | |||
| 90 | 90 | ||
| 91 | 91 | declare module "some-module" { | |
| 92 | 92 | interface ModuleInterface { | |
| 93 | - function(): void; // $Alert | ||
| 93 | + function(): void; // $ Alert | ||
| 94 | 94 | } | |
| 95 | 95 | } | |
| 96 | 96 | ||
| 97 | 97 | type Intersection = { | |
| 98 | - function(): number; // $Alert | ||
| 98 | + function(): number; // $ Alert | ||
| 99 | 99 | } & { | |
| 100 | 100 | other(): string; | |
| 101 | 101 | }; | |
@@ -107,13 +107,13 @@ type Union = { | |||
| 107 | 107 | }; | |
| 108 | 108 | ||
| 109 | 109 | type Union2 = { | |
| 110 | - constructor(): number; // $Alert | ||
| 110 | + constructor(): number; // $ Alert | ||
| 111 | 111 | } | { | |
| 112 | 112 | valid(): string; | |
| 113 | 113 | }; | |
| 114 | 114 | ||
| 115 | 115 | type Intersection2 = { | |
| 116 | - constructor(): number; // $Alert | ||
| 116 | + constructor(): number; // $ Alert | ||
| 117 | 117 | } & { | |
| 118 | 118 | other(): string; | |
| 119 | 119 | }; | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -1,7 +1,7 @@ | |||
| 1 | 1 | function test() { | |
| 2 | 2 | { | |
| 3 | 3 | const stream = getStream(); | |
| 4 | - stream.pipe(destination).on("error", e); // $Alert | ||
| 4 | + stream.pipe(destination).on("error", e); // $ Alert | ||
| 5 | 5 | } | |
| 6 | 6 | { | |
| 7 | 7 | const stream = getStream(); | |
@@ -16,7 +16,7 @@ function test() { | |||
| 16 | 16 | { | |
| 17 | 17 | const stream = getStream(); | |
| 18 | 18 | const s2 = stream; | |
| 19 | - s2.pipe(dest).on("error", e); // $Alert | ||
| 19 | + s2.pipe(dest).on("error", e); // $ Alert | ||
| 20 | 20 | } | |
| 21 | 21 | { | |
| 22 | 22 | const stream = getStream(); | |
@@ -33,7 +33,7 @@ function test() { | |||
| 33 | 33 | { | |
| 34 | 34 | const s = getStream().on('error', handler); | |
| 35 | 35 | const d = getDest(); | |
| 36 | - s.pipe(d); | ||
| 36 | + s.pipe(d); | ||
| 37 | 37 | } | |
| 38 | 38 | { | |
| 39 | 39 | getStream().on('error', handler).pipe(dest); | |
@@ -42,12 +42,12 @@ function test() { | |||
| 42 | 42 | const stream = getStream(); | |
| 43 | 43 | stream.on('error', handleError); | |
| 44 | 44 | const stream2 = stream.pipe(destination); | |
| 45 | - stream2.pipe(destination2).on("error", e); // $Alert | ||
| 45 | + stream2.pipe(destination2).on("error", e); // $ Alert | ||
| 46 | 46 | } | |
| 47 | 47 | { | |
| 48 | 48 | const stream = getStream(); | |
| 49 | 49 | stream.on('error', handleError); | |
| 50 | - const destination = getDest(); | ||
| 50 | + const destination = getDest(); | ||
| 51 | 51 | destination.on('error', handleError); | |
| 52 | 52 | const stream2 = stream.pipe(destination); | |
| 53 | 53 | const s3 = stream2; | |
@@ -57,13 +57,13 @@ function test() { | |||
| 57 | 57 | const stream = getStream(); | |
| 58 | 58 | stream.on('error', handleError); | |
| 59 | 59 | const stream2 = stream.pipe(destination); | |
| 60 | - stream2.pipe(destination2).on("error", e); // $Alert | ||
| 60 | + stream2.pipe(destination2).on("error", e); // $ Alert | ||
| 61 | 61 | } | |
| 62 | 62 | { // Error handler on destination instead of source | |
| 63 | 63 | const stream = getStream(); | |
| 64 | 64 | const dest = getDest(); | |
| 65 | 65 | dest.on('error', handler); | |
| 66 | - stream.pipe(dest).on("error", e); // $Alert | ||
| 66 | + stream.pipe(dest).on("error", e); // $ Alert | ||
| 67 | 67 | } | |
| 68 | 68 | { // Multiple aliases, error handler on one | |
| 69 | 69 | const stream = getStream(); | |
@@ -76,7 +76,7 @@ function test() { | |||
| 76 | 76 | const stream = getStream(); | |
| 77 | 77 | const s2 = stream.pipe(destination1); | |
| 78 | 78 | stream.on('error', handleError); | |
| 79 | - s2.pipe(destination2).on("error", e); // $Alert | ||
| 79 | + s2.pipe(destination2).on("error", e); // $ Alert | ||
| 80 | 80 | } | |
| 81 | 81 | { // Handler registered via .once | |
| 82 | 82 | const stream = getStream(); | |
@@ -91,32 +91,32 @@ function test() { | |||
| 91 | 91 | { // Handler registered for unrelated event | |
| 92 | 92 | const stream = getStream(); | |
| 93 | 93 | stream.on('close', handleClose); | |
| 94 | - stream.pipe(dest).on("error", e); // $Alert | ||
| 94 | + stream.pipe(dest).on("error", e); // $ Alert | ||
| 95 | 95 | } | |
| 96 | 96 | { // Error handler registered after pipe, but before error | |
| 97 | 97 | const stream = getStream(); | |
| 98 | 98 | stream.pipe(dest); | |
| 99 | - setTimeout(() => stream.on('error', handleError), 8000); // $MISSING:Alert | ||
| 99 | + setTimeout(() => stream.on('error', handleError), 8000); // $ MISSING:Alert | ||
| 100 | 100 | } | |
| 101 | 101 | { // Pipe in a function, error handler outside | |
| 102 | 102 | const stream = getStream(); | |
| 103 | - function doPipe(s) { s.pipe(dest); } | ||
| 103 | + function doPipe(s) { s.pipe(dest); } | ||
| 104 | 104 | stream.on('error', handleError); | |
| 105 | 105 | doPipe(stream); | |
| 106 | 106 | } | |
| 107 | 107 | { // Pipe in a function, error handler not set | |
| 108 | 108 | const stream = getStream(); | |
| 109 | - function doPipe(s) { | ||
| 110 | - f = s.pipe(dest); // $Alert | ||
| 111 | - f.on("error", e); | ||
| 109 | + function doPipe(s) { | ||
| 110 | + f = s.pipe(dest); // $ Alert | ||
| 111 | + f.on("error", e); | ||
| 112 | 112 | } | |
| 113 | 113 | doPipe(stream); | |
| 114 | 114 | } | |
| 115 | 115 | { // Dynamic event assignment | |
| 116 | 116 | const stream = getStream(); | |
| 117 | 117 | const event = 'error'; | |
| 118 | 118 | stream.on(event, handleError); | |
| 119 | - stream.pipe(dest).on("error", e); // $SPURIOUS:Alert | ||
| 119 | + stream.pipe(dest).on("error", e); // $ SPURIOUS:Alert | ||
| 120 | 120 | } | |
| 121 | 121 | { // Handler assigned via variable property | |
| 122 | 122 | const stream = getStream(); | |
@@ -125,7 +125,7 @@ function test() { | |||
| 125 | 125 | stream.pipe(dest); | |
| 126 | 126 | } | |
| 127 | 127 | { // Pipe with no intermediate variable, no error handler | |
| 128 | - getStream().pipe(dest).on("error", e); // $Alert | ||
| 128 | + getStream().pipe(dest).on("error", e); // $ Alert | ||
| 129 | 129 | } | |
| 130 | 130 | { // Handler set via .addListener synonym | |
| 131 | 131 | const stream = getStream(); | |
@@ -143,7 +143,7 @@ function test() { | |||
| 143 | 143 | } | |
| 144 | 144 | { // Long chained pipe without error handler | |
| 145 | 145 | const stream = getStream(); | |
| 146 | - stream.pause().setEncoding('utf8').resume().pipe(writable).on("error", e); // $Alert | ||
| 146 | + stream.pause().setEncoding('utf8').resume().pipe(writable).on("error", e); // $ Alert | ||
| 147 | 147 | } | |
| 148 | 148 | { // Long chained pipe without error handler | |
| 149 | 149 | const stream = getStream(); | |
@@ -157,13 +157,13 @@ function test() { | |||
| 157 | 157 | const notStream = getNotAStream(); | |
| 158 | 158 | const result = notStream.pipe(writable); | |
| 159 | 159 | const dealWithResult = (result) => { result.subscribe(); }; | |
| 160 | - dealWithResult(result); | ||
| 160 | + dealWithResult(result); | ||
| 161 | 161 | } | |
| 162 | 162 | { // Non-stream with pipe method that returns subscribable object (Streams do not have subscribe method) | |
| 163 | 163 | const notStream = getNotAStream(); | |
| 164 | 164 | const pipeIt = (someVariable) => { return someVariable.pipe(something); }; | |
| 165 | 165 | let x = pipeIt(notStream); | |
| 166 | - x.subscribe(); | ||
| 166 | + x.subscribe(); | ||
| 167 | 167 | } | |
| 168 | 168 | { // Calling custom pipe method with no arguments | |
| 169 | 169 | const notStream = getNotAStream(); | |
@@ -179,7 +179,7 @@ function test() { | |||
| 179 | 179 | } | |
| 180 | 180 | { // Member access on a stream after pipe | |
| 181 | 181 | const notStream = getNotAStream(); | |
| 182 | - const val = notStream.pipe(writable).on("error", e).readable; // $Alert | ||
| 182 | + const val = notStream.pipe(writable).on("error", e).readable; // $ Alert | ||
| 183 | 183 | } | |
| 184 | 184 | { // Method access on a non-stream after pipe | |
| 185 | 185 | const notStream = getNotAStream(); | |
@@ -189,14 +189,14 @@ function test() { | |||
| 189 | 189 | const fs = require('fs'); | |
| 190 | 190 | const stream = fs.createReadStream('file.txt'); | |
| 191 | 191 | const copyStream = stream; | |
| 192 | - copyStream.pipe(destination).on("error", e); // $Alert | ||
| 192 | + copyStream.pipe(destination).on("error", e); // $ Alert | ||
| 193 | 193 | } | |
| 194 | 194 | { | |
| 195 | 195 | const notStream = getNotAStream(); | |
| 196 | 196 | const something = notStream.someNotStreamPropertyAccess; | |
| 197 | 197 | const val = notStream.pipe(writable); | |
| 198 | 198 | } | |
| 199 | - { | ||
| 199 | + { | ||
| 200 | 200 | const notStream = getNotAStream(); | |
| 201 | 201 | const something = notStream.someNotStreamPropertyAccess(); | |
| 202 | 202 | const val = notStream.pipe(writable); | |
@@ -207,7 +207,7 @@ function test() { | |||
| 207 | 207 | } | |
| 208 | 208 | { | |
| 209 | 209 | const notStream = getNotAStream(); | |
| 210 | - notStream.pipe(()=>{}); | ||
| 210 | + notStream.pipe(() => { }); | ||
| 211 | 211 | } | |
| 212 | 212 | { | |
| 213 | 213 | const plumber = require('gulp-plumber'); | |
@@ -230,6 +230,6 @@ function test() { | |||
| 230 | 230 | } | |
| 231 | 231 | { | |
| 232 | 232 | const notStream = getNotAStream(); | |
| 233 | - notStream.pipe(getStream(),()=>{}); | ||
| 233 | + notStream.pipe(getStream(), () => { }); | ||
| 234 | 234 | } | |
| 235 | 235 | } | |
| Back | FazBrowse Home | New Git URL |
0 commit comments