@ngrok/ngrok 0.9.0 → 0.9.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (146) hide show
  1. package/CHANGELOG.md +6 -0
  2. package/CONTRIBUTING.md +4 -4
  3. package/README.md +174 -142
  4. package/index.d.ts +70 -15
  5. package/index.js +8 -6
  6. package/package.json +37 -16
  7. package/.envrc +0 -1
  8. package/.gitattributes +0 -3
  9. package/.prettierrc.json +0 -3
  10. package/.yarnrc.yml +0 -3
  11. package/Cargo.toml +0 -34
  12. package/RELEASE.md +0 -26
  13. package/build.rs +0 -5
  14. package/docs/.nojekyll +0 -1
  15. package/docs/assets/highlight.css +0 -92
  16. package/docs/assets/main.js +0 -58
  17. package/docs/assets/search.js +0 -1
  18. package/docs/assets/style.css +0 -1367
  19. package/docs/classes/HttpListenerBuilder.html +0 -594
  20. package/docs/classes/LabeledListenerBuilder.html +0 -206
  21. package/docs/classes/Listener.html +0 -241
  22. package/docs/classes/Session.html +0 -207
  23. package/docs/classes/SessionBuilder.html +0 -465
  24. package/docs/classes/TcpListenerBuilder.html +0 -281
  25. package/docs/classes/TlsListenerBuilder.html +0 -322
  26. package/docs/classes/UpdateRequest.html +0 -131
  27. package/docs/functions/authtoken.html +0 -89
  28. package/docs/functions/connect.html +0 -89
  29. package/docs/functions/consoleLog.html +0 -90
  30. package/docs/functions/disconnect.html +0 -89
  31. package/docs/functions/getListener.html +0 -89
  32. package/docs/functions/getListenerByUrl.html +0 -89
  33. package/docs/functions/kill.html +0 -84
  34. package/docs/functions/listen.html +0 -92
  35. package/docs/functions/listenable.html +0 -85
  36. package/docs/functions/listeners.html +0 -84
  37. package/docs/functions/loggingCallback.html +0 -108
  38. package/docs/index.html +0 -292
  39. package/docs/interfaces/Config.html +0 -734
  40. package/docs/modules.html +0 -106
  41. package/examples/domain.crt +0 -18
  42. package/examples/domain.key +0 -27
  43. package/examples/express/ngrok-express-quickstart.js +0 -11
  44. package/examples/express/ngrok-express.js +0 -28
  45. package/examples/express/package.json +0 -7
  46. package/examples/fastify/ngrok-fastify.js +0 -26
  47. package/examples/fastify/package.json +0 -7
  48. package/examples/hapi/ngrok-hapi.js +0 -35
  49. package/examples/hapi/package.json +0 -7
  50. package/examples/koa/ngrok-koa.js +0 -12
  51. package/examples/koa/package.json +0 -7
  52. package/examples/nestjs/.eslintrc.js +0 -25
  53. package/examples/nestjs/.prettierrc +0 -4
  54. package/examples/nestjs/README.md +0 -73
  55. package/examples/nestjs/nest-cli.json +0 -8
  56. package/examples/nestjs/package.json +0 -70
  57. package/examples/nestjs/src/app.controller.spec.ts +0 -22
  58. package/examples/nestjs/src/app.controller.ts +0 -12
  59. package/examples/nestjs/src/app.module.ts +0 -10
  60. package/examples/nestjs/src/app.service.ts +0 -8
  61. package/examples/nestjs/src/main.ts +0 -17
  62. package/examples/nestjs/test/app.e2e-spec.ts +0 -24
  63. package/examples/nestjs/test/jest-e2e.json +0 -9
  64. package/examples/nestjs/tsconfig.build.json +0 -4
  65. package/examples/nestjs/tsconfig.json +0 -21
  66. package/examples/nextjs/README.md +0 -3
  67. package/examples/nextjs/next.config.js +0 -12
  68. package/examples/nextjs/ngrok.config.js +0 -23
  69. package/examples/nextjs/package.json +0 -6
  70. package/examples/nextjs/pages/index.js +0 -5
  71. package/examples/ngrok-connect-full.js +0 -67
  72. package/examples/ngrok-connect-minimal.js +0 -17
  73. package/examples/ngrok-http-full.js +0 -81
  74. package/examples/ngrok-http-minimum.js +0 -18
  75. package/examples/ngrok-labeled.js +0 -43
  76. package/examples/ngrok-listen.js +0 -11
  77. package/examples/ngrok-tcp.js +0 -37
  78. package/examples/ngrok-tls.js +0 -40
  79. package/examples/ngrok-typescript.ts +0 -69
  80. package/examples/ngrok-windows-pipe.js +0 -25
  81. package/examples/ngrok-winston.js +0 -24
  82. package/examples/package.json +0 -15
  83. package/examples/remix/.eslintrc.js +0 -4
  84. package/examples/remix/README.md +0 -53
  85. package/examples/remix/app/entry.client.tsx +0 -18
  86. package/examples/remix/app/entry.server.tsx +0 -101
  87. package/examples/remix/app/root.tsx +0 -20
  88. package/examples/remix/app/routes/_index.tsx +0 -30
  89. package/examples/remix/ngrok.config.js +0 -16
  90. package/examples/remix/package.json +0 -30
  91. package/examples/remix/public/favicon.ico +0 -0
  92. package/examples/remix/remix.config.js +0 -16
  93. package/examples/remix/remix.env.d.ts +0 -2
  94. package/examples/remix/tsconfig.json +0 -22
  95. package/examples/svelte/README.md +0 -38
  96. package/examples/svelte/jsconfig.json +0 -17
  97. package/examples/svelte/ngrok.config.cjs +0 -20
  98. package/examples/svelte/package.json +0 -22
  99. package/examples/svelte/src/app.d.ts +0 -12
  100. package/examples/svelte/src/app.html +0 -12
  101. package/examples/svelte/src/routes/+page.svelte +0 -2
  102. package/examples/svelte/static/favicon.png +0 -0
  103. package/examples/svelte/svelte.config.js +0 -14
  104. package/examples/svelte/vite.config.js +0 -6
  105. package/examples/vue/.vscode/extensions.json +0 -3
  106. package/examples/vue/README.md +0 -40
  107. package/examples/vue/env.d.ts +0 -1
  108. package/examples/vue/index.html +0 -13
  109. package/examples/vue/ngrok.config.ts +0 -18
  110. package/examples/vue/package.json +0 -25
  111. package/examples/vue/public/favicon.ico +0 -0
  112. package/examples/vue/src/App.vue +0 -47
  113. package/examples/vue/src/assets/base.css +0 -74
  114. package/examples/vue/src/assets/logo.svg +0 -1
  115. package/examples/vue/src/assets/main.css +0 -35
  116. package/examples/vue/src/components/HelloWorld.vue +0 -40
  117. package/examples/vue/src/components/TheWelcome.vue +0 -86
  118. package/examples/vue/src/components/WelcomeItem.vue +0 -86
  119. package/examples/vue/src/components/icons/IconCommunity.vue +0 -7
  120. package/examples/vue/src/components/icons/IconDocumentation.vue +0 -7
  121. package/examples/vue/src/components/icons/IconEcosystem.vue +0 -7
  122. package/examples/vue/src/components/icons/IconSupport.vue +0 -7
  123. package/examples/vue/src/components/icons/IconTooling.vue +0 -19
  124. package/examples/vue/src/main.ts +0 -6
  125. package/examples/vue/tsconfig.json +0 -16
  126. package/examples/vue/tsconfig.node.json +0 -8
  127. package/examples/vue/vite.config.ts +0 -15
  128. package/flake.lock +0 -82
  129. package/flake.nix +0 -111
  130. package/post-build.js +0 -45
  131. package/scripts/gc-node-drop.js +0 -49
  132. package/scripts/gc-rust-drop.js +0 -53
  133. package/src/config.rs +0 -285
  134. package/src/connect.rs +0 -342
  135. package/src/http.rs +0 -244
  136. package/src/lib.rs +0 -39
  137. package/src/listener.rs +0 -495
  138. package/src/listener_builder.rs +0 -204
  139. package/src/logging.rs +0 -140
  140. package/src/session.rs +0 -551
  141. package/src/tcp.rs +0 -18
  142. package/src/tls.rs +0 -44
  143. package/trailer.d.ts +0 -15
  144. package/trailer.js +0 -382
  145. package/tsconfig.json +0 -8
  146. package/typedoc.json +0 -3
package/src/tcp.rs DELETED
@@ -1,18 +0,0 @@
1
- use napi_derive::napi;
2
-
3
- use crate::listener_builder::TcpListenerBuilder;
4
-
5
- #[napi]
6
- #[allow(dead_code)]
7
- impl TcpListenerBuilder {
8
- /// The TCP address to request for this edge.
9
- /// These addresses can be reserved in the [ngrok dashboard] to use across sessions. For example: remote_addr("2.tcp.ngrok.io:21746")
10
- ///
11
- /// [ngrok dashboard]: https://dashboard.ngrok.com/cloud-edge/tcp-addresses
12
- #[napi]
13
- pub fn remote_addr(&mut self, remote_addr: String) -> &Self {
14
- let mut builder = self.listener_builder.lock();
15
- builder.remote_addr(remote_addr);
16
- self
17
- }
18
- }
package/src/tls.rs DELETED
@@ -1,44 +0,0 @@
1
- use bytes::Bytes;
2
- use napi::bindgen_prelude::Uint8Array;
3
- use napi_derive::napi;
4
-
5
- use crate::listener_builder::TlsListenerBuilder;
6
-
7
- #[napi]
8
- #[allow(dead_code)]
9
- impl TlsListenerBuilder {
10
- /// The domain to request for this edge, any valid domain or hostname that you have
11
- /// previously registered with ngrok. If using a custom domain, this requires
12
- /// registering in the [ngrok dashboard] and setting a DNS CNAME value.
13
- ///
14
- /// [ngrok dashboard]: https://dashboard.ngrok.com/cloud-edge/domains
15
- #[napi]
16
- pub fn domain(&mut self, domain: String) -> &Self {
17
- let mut builder = self.listener_builder.lock();
18
- builder.domain(domain);
19
- self
20
- }
21
- /// Certificates to use for client authentication at the ngrok edge.
22
- /// See [Mutual TLS] in the ngrok docs for additional details.
23
- ///
24
- /// [Mutual TLS]: https://ngrok.com/docs/cloud-edge/modules/mutual-tls/
25
- #[napi]
26
- pub fn mutual_tlsca(&mut self, mutual_tlsca: Uint8Array) -> &Self {
27
- let mut builder = self.listener_builder.lock();
28
- builder.mutual_tlsca(Bytes::from(mutual_tlsca.to_vec()));
29
- self
30
- }
31
- /// The key to use for TLS termination at the ngrok edge in PEM format.
32
- /// See [TLS Termination] in the ngrok docs for additional details.
33
- ///
34
- /// [TLS Termination]: https://ngrok.com/docs/cloud-edge/modules/tls-termination/
35
- #[napi]
36
- pub fn termination(&mut self, cert_pem: Uint8Array, key_pem: Uint8Array) -> &Self {
37
- let mut builder = self.listener_builder.lock();
38
- builder.termination(
39
- Bytes::from(cert_pem.to_vec()),
40
- Bytes::from(key_pem.to_vec()),
41
- );
42
- self
43
- }
44
- }
package/trailer.d.ts DELETED
@@ -1,15 +0,0 @@
1
- /**
2
- * Get a listenable ngrok listener, suitable for passing to net.Server.listen().
3
- * Uses the NGROK_AUTHTOKEN environment variable to authenticate.
4
- */
5
- export function listenable(): Listener;
6
- /**
7
- * Start the given net.Server listening to a generated, or passed in, listener.
8
- * Uses the NGROK_AUTHTOKEN environment variable to authenticate if a new listener is created.
9
- */
10
- export function listen(server: import("net").Server, listener?: Listener): Listener;
11
- /**
12
- * Register a console.log callback for ngrok INFO logging.
13
- * Optionally set the logging level to one of ERROR, WARN, INFO, DEBUG, or TRACE.
14
- */
15
- export function consoleLog(level?: String): void;
package/trailer.js DELETED
@@ -1,382 +0,0 @@
1
- //
2
- // javascript trailer
3
- //
4
-
5
- const net = require("net");
6
- const fs = require("fs");
7
- const os = require("os");
8
- const path = require("path");
9
-
10
- // wrap connect with the code for extending exception with error code
11
- SessionBuilder.prototype._connect = SessionBuilder.prototype.connect;
12
- SessionBuilder.prototype.connect = ngrokSessionConnect;
13
-
14
- // wrap listen with the bind code for passing to net.Server.listen()
15
- HttpListenerBuilder.prototype._listen = HttpListenerBuilder.prototype.listen;
16
- TcpListenerBuilder.prototype._listen = TcpListenerBuilder.prototype.listen;
17
- TlsListenerBuilder.prototype._listen = TlsListenerBuilder.prototype.listen;
18
- LabeledListenerBuilder.prototype._listen = LabeledListenerBuilder.prototype.listen;
19
-
20
- HttpListenerBuilder.prototype.listen = ngrokBind;
21
- TcpListenerBuilder.prototype.listen = ngrokBind;
22
- TlsListenerBuilder.prototype.listen = ngrokBind;
23
- LabeledListenerBuilder.prototype.listen = ngrokBind;
24
-
25
- HttpListenerBuilder.prototype.listenAndServe = listenAndServe;
26
- TcpListenerBuilder.prototype.listenAndServe = listenAndServe;
27
- TlsListenerBuilder.prototype.listenAndServe = listenAndServe;
28
- LabeledListenerBuilder.prototype.listenAndServe = listenAndServe;
29
-
30
- // Wrap session connect to fill in exception's errorCode
31
- async function ngrokSessionConnect() {
32
- try {
33
- return await this._connect();
34
- } catch (err) {
35
- populateErrorCode(err);
36
- throw err;
37
- }
38
- }
39
-
40
- // Begin listening for new connections on this listener,
41
- // and bind to a local socket so this listener can be
42
- // passed into net.Server.listen().
43
- async function ngrokBind(bind) {
44
- try {
45
- const listener = await this._listen();
46
- if (bind !== false) {
47
- const socket = await randomTcpSocket();
48
- listener.socket = socket;
49
- defineListenerHandle(listener, socket);
50
- }
51
- return listener;
52
- } catch (err) {
53
- populateErrorCode(err);
54
- throw err;
55
- }
56
- }
57
-
58
- /// Begin listening for new connections on this listener and forwarding them to the given server.
59
- async function listenAndServe(server) {
60
- const listener = await this._listen();
61
- listener.socket = await ngrokListen(server, listener);
62
- return listener;
63
- }
64
-
65
- function populateErrorCode(err) {
66
- if (err.message) {
67
- const regex = /error_code: (ERR_NGROK_\d+)$/;
68
- const errorCode = err.message.match(regex);
69
- if (errorCode && errorCode.length > 1) {
70
- err.errorCode = errorCode[1];
71
- }
72
- }
73
- }
74
-
75
- // add a 'handle' getter to the listener so it can be
76
- // passed into net.Server.listen().
77
- function defineListenerHandle(listener, socket) {
78
- // NodeJS net.Server asks passed-in object for 'handle',
79
- // Return the native TCP object so the pre-existing socket is used.
80
- Object.defineProperty(listener, "handle", {
81
- get: function () {
82
- // turn on forwarding now that it has been requested
83
- listener.forward("localhost:" + socket.address().port);
84
- return socket._handle;
85
- },
86
- });
87
- }
88
-
89
- // generate a net.Server listening to a random port
90
- async function randomTcpSocket() {
91
- return await asyncListen(new net.Server(), { host: "localhost", port: 0 });
92
- }
93
-
94
- // NodeJS has not promisified 'net': https://github.com/nodejs/node/issues/21482
95
- function asyncListen(server, options) {
96
- return new Promise((resolve, reject) => {
97
- const socket = server.listen(options);
98
- socket
99
- .once("listening", () => {
100
- resolve(socket);
101
- })
102
- .once("error", (err) => {
103
- reject(err);
104
- });
105
- });
106
- }
107
-
108
- // Make a session using NGROK_AUTHTOKEN from the environment,
109
- // and then return a listening HTTP listener.
110
- async function defaultListener(bind) {
111
- // set up a default session and listener
112
- var builder = new SessionBuilder();
113
- builder.authtokenFromEnv();
114
- var session = await builder.connect();
115
- var listener = await session.httpEndpoint().listen(bind);
116
- listener.session = session; // surface to caller
117
- return listener;
118
- }
119
-
120
- // Get a listenable ngrok listener, suitable for passing to net.Server.listen().
121
- // Uses the NGROK_AUTHTOKEN environment variable to authenticate.
122
- async function listenable() {
123
- return await defaultListener();
124
- }
125
-
126
- // Bind a server to a new ngrok listener, optionally passing in a pre-existing listener instead.
127
- // Uses the NGROK_AUTHTOKEN environment variable to authenticate if a new listener is created.
128
- async function ngrokListen(server, listener) {
129
- if (listener && listener.socket) {
130
- // close the default bound port
131
- listener.socket.close();
132
- }
133
- if (!listener) {
134
- // turn off automatic bind
135
- listener = await defaultListener(false);
136
- }
137
-
138
- // attempt pipe socket
139
- try {
140
- socket = await ngrokLinkPipe(listener, server);
141
- } catch (err) {
142
- console.debug("Using TCP socket. " + err);
143
- // fallback to tcp socket
144
- socket = await ngrokLinkTcp(listener, server);
145
- }
146
- registerCleanup(listener, socket);
147
-
148
- server.listener = listener; // surface to caller
149
- socket.listener = listener; // surface to caller
150
- // return the newly created net.Server, which will be different in the express case
151
- return socket;
152
- }
153
-
154
- async function ngrokLinkTcp(listener, server) {
155
- // random local port
156
- const socket = await asyncListen(server, { host: "localhost", port: 0 });
157
- // forward to socket
158
- listener.forward("localhost:" + socket.address().port);
159
- return socket;
160
- }
161
-
162
- function generatePipeFilename(listener, server) {
163
- var proposed = "tun-" + listener.id() + ".sock";
164
-
165
- // windows leaves little choice
166
- if (platform == "win32") {
167
- return "\\\\.\\pipe\\" + proposed;
168
- }
169
-
170
- // try to make a directory in the current working directory
171
- const dir = ".ngrok";
172
- try {
173
- fs.mkdirSync(dir);
174
- } catch (err) {
175
- // move on
176
- }
177
- try {
178
- fs.accessSync(dir, fs.constants.W_OK);
179
- return dir + path.sep + proposed;
180
- } catch (err) {
181
- // move on
182
- }
183
-
184
- // try the OS temp directory, being careful not to exceed the maximum path length for unix sockets
185
- // https://linux.die.net/man/7/unix
186
- // https://unix.stackexchange.com/a/367012
187
- if (os.tmpdir().length < 90) {
188
- try {
189
- fs.accessSync(os.tmpdir(), fs.constants.W_OK);
190
- filepath = os.tmpdir() + path.sep + proposed;
191
- if (filepath.length > 100) {
192
- // truncate
193
- filepath = filepath.substring(0, 100);
194
- }
195
- return filepath;
196
- } catch (err) {
197
- // move on
198
- }
199
- }
200
-
201
- // fallback to current working directory. allow any exception to propagate
202
- fs.accessSync(process.cwd(), fs.constants.W_OK);
203
- return proposed;
204
- }
205
-
206
- async function ngrokLinkPipe(listener, server) {
207
- var filename = generatePipeFilename(listener);
208
- // begin listening
209
- const socket = await asyncListen(server, { path: filename });
210
- // tighten permissions
211
- try {
212
- if (platform != "win32") {
213
- fs.chmodSync(filename, fs.constants.S_IRWXU);
214
- }
215
- } catch (err) {
216
- console.debug("Cannot change permissions of file: " + filename);
217
- }
218
- // forward listener
219
- var addr = "unix:" + filename;
220
- if (platform == "win32") {
221
- // convert pipe path to url
222
- addr = "pipe:" + filename.replace("\\\\.\\pipe\\", "//./");
223
- }
224
- listener.forward(addr);
225
- socket.path = filename; // surface to caller
226
-
227
- return socket;
228
- }
229
-
230
- // protect against multiple calls, for instance from npm
231
- var sigintRan = false;
232
-
233
- function registerCleanup(listener, socket) {
234
- process.on("SIGINT", function () {
235
- if (sigintRan) return;
236
- sigintRan = true;
237
-
238
- if (process.listenerCount("SIGINT") > 1) {
239
- // user has registered a handler, abort this one
240
- return;
241
- }
242
- // close listener
243
- if (listener) {
244
- listener.close().catch((err) => {
245
- console.error(`Error closing listener: ${err}`);
246
- });
247
- }
248
- // close webserver's socket
249
- if (socket) socket.close();
250
- // unregister any logging callback
251
- loggingCallback();
252
- });
253
- }
254
-
255
- function consoleLog(level) {
256
- loggingCallback((level, target, message) => {
257
- console.log(`${level} ${target} - ${message}`);
258
- }, level);
259
- }
260
-
261
- // wrap connect with code to vectorize and split out functions
262
- const _connect = connect;
263
- async function ngrokConnect(config) {
264
- if (config == undefined) config = 80;
265
- if (Number.isInteger(config) || typeof config === "string" || config instanceof String) {
266
- address = String(config);
267
- if (Number.isInteger(config) && !address.includes(":")) {
268
- address = `localhost:${address}`;
269
- }
270
- config = { addr: address };
271
- }
272
- // Convert addr to string to allow for numeric port numbers
273
- const addr = config["addr"];
274
- if (Number.isInteger(addr)) config["addr"] = "localhost:" + String(config["addr"]);
275
- // convert scalar values to arrays to meet what napi-rs expects
276
- [
277
- "allow_user_agent",
278
- "auth",
279
- "basic_auth",
280
- "deny_user_agent",
281
- "ip_restriction.allow_cidrs",
282
- "ip_restriction.deny_cidrs",
283
- "labels",
284
- "oauth.allow_domains",
285
- "oauth.allow_emails",
286
- "oauth.scopes",
287
- "oidc.scopes",
288
- "oidc.allow_domains",
289
- "oidc.allow_emails",
290
- "request_header.add",
291
- "request_header.remove",
292
- "response_header.add",
293
- "response_header.remove",
294
- "schemes",
295
- ].forEach((key) => {
296
- vectorize(config, key);
297
- });
298
- // convert dotted values to underscores for backwards compatibility
299
- [
300
- "ip_restriction.allow_cidrs",
301
- "ip_restriction.deny_cidrs",
302
- "oauth.allow_domains",
303
- "oauth.allow_emails",
304
- "oauth.scopes",
305
- "oauth.provider",
306
- "oidc.client_id",
307
- "oidc.client_secret",
308
- "oidc.scopes",
309
- "oidc.issuer_url",
310
- "oidc.allow_domains",
311
- "oidc.allow_emails",
312
- "request_header.add",
313
- "request_header.remove",
314
- "response_header.add",
315
- "response_header.remove",
316
- "verify_webhook.provider",
317
- "verify_webhook.secret",
318
- ].forEach((key) => {
319
- undot(config, key);
320
- });
321
- // break out the logging callback function to meet what napi-rs expects
322
- var on_log_event;
323
- if (config["onLogEvent"]) {
324
- const onLogEvent = config.onLogEvent;
325
- on_log_event = (level, target, message) => {
326
- onLogEvent(`${level} ${target} - ${message}`);
327
- };
328
- config["onLogEvent"] = true;
329
- }
330
- // break out the status change callback functions to what napi-rs expects
331
- var on_connection, on_disconnection;
332
- if (config["onStatusChange"]) {
333
- const onStatusChange = config.onStatusChange;
334
- on_connection = (status, err) => {
335
- onStatusChange(status);
336
- };
337
- on_disconnection = (addr, err) => {
338
- onStatusChange("closed");
339
- };
340
- config["onStatusChange"] = true;
341
- }
342
- // call into rust
343
- try {
344
- return await _connect(config, on_log_event, on_connection, on_disconnection);
345
- } catch (err) {
346
- populateErrorCode(err);
347
- throw err;
348
- }
349
- }
350
-
351
- function undot(config, dotKey) {
352
- const noDotKey = dotKey.replace(".", "_");
353
- if (config[dotKey] == null) return; // no dotKey value, done
354
- if (config[noDotKey] == null) {
355
- // nothing at destination, just set and be done
356
- config[noDotKey] = config[dotKey];
357
- return;
358
- }
359
- if (config[dotKey] instanceof Array && config[noDotKey] instanceof Array) {
360
- // merge arrays
361
- for (const obj of config[dotKey]) {
362
- config[noDotKey].push(obj);
363
- }
364
- }
365
- // destination exists and is not an array, do nothing so noDotKey can take precedence
366
- }
367
-
368
- function vectorize(config, key) {
369
- // backwards compatible keys are passed in, check the new style as well
370
- const noDotKey = key.replace(".", "_");
371
- if (key != noDotKey) vectorize(config, noDotKey);
372
-
373
- if (config[key] == null) return; // no value, done
374
- if (!(config[key] instanceof Array)) {
375
- config[key] = [config[key]];
376
- }
377
- }
378
-
379
- module.exports.connect = ngrokConnect;
380
- module.exports.consoleLog = consoleLog;
381
- module.exports.listen = ngrokListen;
382
- module.exports.listenable = listenable;
package/tsconfig.json DELETED
@@ -1,8 +0,0 @@
1
- {
2
- "compilerOptions": {
3
- "module": "commonjs",
4
- "noImplicitAny": true,
5
- "strict": true,
6
- "target": "es5"
7
- }
8
- }
package/typedoc.json DELETED
@@ -1,3 +0,0 @@
1
- {
2
- "groupOrder": ["Listener and Sessions", "Listener Builders", "Functions"]
3
- }