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: Caching npm packages | |
| on: push | |
| jobs: | |
| build: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v2 |
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 paths defined in tsconfig.json to the format of | |
| * moduleNameMapper in jest.config.js. | |
| * | |
| * For example, {'@alias/*': [ 'path/to/alias/*' ]} | |
| * Becomes {'@alias/(.*)': [ '<rootDir>/path/to/alias/$1' ]} | |
| * | |
| * @param {string} srcPath | |
| * @param {string} tsconfigPath | |
| */ |
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 readline = require('readline') | |
| const blank = '\n'.repeat(process.stdout.rows) | |
| console.log(blank) | |
| readline.cursorTo(process.stdout, 0, 0) | |
| readline.clearScreenDown(process.stdout) |
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 strict"; | |
| var stackTrace = (new Error()).stack; // Only tested in latest FF and Chrome | |
| var callerName = stackTrace.replace(/^Error\s+/, ''); // Sanitize Chrome | |
| callerName = callerName.split("\n")[1]; // 1st item is this, 2nd item is caller | |
| callerName = callerName.replace(/^\s+at Object./, ''); // Sanitize Chrome | |
| callerName = callerName.replace(/ \(.+\)$/, ''); // Sanitize Chrome | |
| callerName = callerName.replace(/\@.+/, ''); // Sanitize Firefox | |
| console.log(callerName) |