Standard escape codes are prefixed with Escape:
- Ctrl-Key:
^[ - Octal:
\033 - Unicode:
\u001b - Hexadecimal:
\x1B - Decimal:
27
| #!/usr/bin/env bash | |
| set -uo pipefail | |
| IFS=$'\n\t' | |
| # | |
| # Improvements from dahjelle/pre-commit.sh: | |
| # - does not lint deleted files, | |
| # - lints all staged files before exiting with an error code, | |
| # - handles spaces and other unusual chars in file names. | |
| # |
| /** | |
| * promiseFilter - Returns a Promise which resolves with a new Array, containing only values which passed the test. | |
| * @param {Array} array An Array from which to filter values into a new Array. | |
| * @param {callback} test A callback function which must return a Promise, which must resolve with a Boolean. | |
| * @callback test | |
| * @param {any} value The current value from `array`. | |
| * @param {Number} index The current index being used to access `array`. | |
| * @param {Array} array The Array being iterated through, `array`. | |
| * @returns {Promise} A Promise which resolves with a new Array containing values which passed the test. | |
| */ |