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
| #!/usr/bin/env node | |
| const fs = require('fs'); | |
| const path = require('path'); | |
| const { spawn } = require("child_process"); | |
| const FgRed = "\x1b[31m" | |
| const Reset = "\x1b[0m" | |
| const args = process.argv.slice(2); |
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
| /** | |
| * Converts numbers to and from Radix64 | |
| * "inspired" by https://stackoverflow.com/questions/6213227/fastest-way-to-convert-a-number-to-radix-64-in-javascript#answer-6573119 | |
| * but converted to use bigint and made into typescript. | |
| */ | |
| export class Radix { | |
| private _rixsize = BigInt(this._rixits.length); | |
| public constructor( |
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
| { | |
| "name": "elastic-search-stream", | |
| "version": "1.0.0", | |
| "lockfileVersion": 1, | |
| "requires": true, | |
| "dependencies": { | |
| "@babel/code-frame": { | |
| "version": "7.0.0", | |
| "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.0.0.tgz", | |
| "integrity": "sha512-OfC2uemaknXr87bdLUkWog7nYuliM9Ij5HUcajsVcMCpQrcLmtxRbVFTIqmcSkSeYRBFBRxs2FiUqFJDLdiebA==", |
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
| // TODO: array support is meh | |
| // object reference to represent no change was made. | |
| const NO_CHANGE: any = Object.freeze({}); | |
| const objToString = ({}).toString; | |
| const typeMap: { [key: string]: string } = { | |
| "[object Boolean]": "boolean", | |
| "[object Number]": "number", | |
| "[object String]": "string", |
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
| /** | |
| Use by simply calling the `wrap` on the function which returns promises. For instance | |
| function callApiAndReturnPromise() { | |
| ... | |
| } | |
| might become | |
| const promiseThrottle = require('./promiseThrottle'); |