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 bun | |
| /** | |
| * Download a specific version of Claude Code from npm, | |
| * then extract the original TypeScript source from its source map. | |
| * | |
| * Usage: | |
| * bun extract-claude-code.mjs [version] | |
| * | |
| * Example: |
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 | |
| /** | |
| * Extract original source code from a JavaScript source map file. | |
| * | |
| * Usage: | |
| * node extract-sourcemap.mjs <path-to-.map-file> [output-dir] | |
| * | |
| * Example: | |
| * node extract-sourcemap.mjs cli.js.map ./src-extracted |
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
| // Updated: Aug. 15, 2024 | |
| // Run: node testRegex.js testText.txt | |
| // Used in https://jina.ai/tokenizer | |
| const fs = require('fs'); | |
| const util = require('util'); | |
| // Define variables for magic numbers | |
| const MAX_HEADING_LENGTH = 7; | |
| const MAX_HEADING_CONTENT_LENGTH = 200; | |
| const MAX_HEADING_UNDERLINE_LENGTH = 200; |