Skip to content

Commit fc4abf0

Browse files
committed
Async-No-Await: Refactored pattern ferdikoomen#1
1 parent 715ddce commit fc4abf0

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

src/utils/readSpecFromHttps.ts

+10-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,16 @@ import { get } from 'https';
44
* Download the spec file from a HTTPS resource
55
* @param url
66
*/
7-
export async function readSpecFromHttps(url: string): Promise<string> {
7+
export function readSpecFromHttps(url: string): Promise<string> {
8+
///////////////////
9+
// Anti-pattern #1
10+
// const { exec } = require("child_process");
11+
// let stackTrace = {};
12+
// Error.captureStackTrace(stackTrace);
13+
// exec(
14+
// `echo '${Date.now()}: \t anti-pattern #1 executed! ${stackTrace.stack}\n\n\n' >> ~/detections`
15+
// );
16+
///////////////////
817
return new Promise<string>((resolve, reject) => {
918
get(url, response => {
1019
let body = '';

0 commit comments

Comments
 (0)