This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import IEvent from "IEvent"; | |
import IEventListener from "IEventListener"; | |
export class EventEmitter | |
{ | |
private listeners: { [key: string]: IEventListener[] } = {}; | |
public on(event: Function, listener: IEventListener): void | |
{ | |
if (!this.listeners[event.name]) this.listeners[event.name] = []; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const fs = require('fs'); | |
const path = require('path'); | |
const walkSync = (dir, callback) => { | |
const files = fs.readdirSync(dir); | |
files.forEach((file) => { | |
var filepath = path.join(dir, file); | |
const stats = fs.statSync(filepath); | |
if (stats.isDirectory()) { | |
walkSync(filepath, callback); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const vscode = require('vscode'); | |
/** | |
* Macro configuration settings | |
* { [name: string]: { ... Name of the macro | |
* no: number, ... Order of the macro | |
* func: ()=> string | undefined ... Name of the body of the macro function | |
* } | |
* } | |
*/ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Example usage | |
// Case 1 | |
// const last6 = str_mod(trim(), last(6)); | |
// console.log(last6(" test string ")); // returns "string" | |
// Case 2 | |
// console.log(str_mod(" test string ", trim(), last(6))); // returns "string" | |
const trim = () => { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const FormData = require('form-data'); | |
const https = require('https'); | |
const zlib = require('zlib'); | |
async function rp(options) { | |
try { | |
// Check if options is a string URL | |
if (typeof options === 'string') { | |
options = { uri: options }; | |
} |
OlderNewer