├── .babelrc ├── .github ├── dependabot.yml └── workflows │ └── main.yml ├── .gitignore ├── LICENSE ├── README.md ├── jest.config.js ├── jsr.json ├── package-lock.json ├── package.json ├── src ├── __tests__ │ └── index.test.ts └── index.ts └── tsconfig.json /.babelrc: -------------------------------------------------------------------------------- 1 | { 2 | "presets": [ 3 | "@babel/preset-env" 4 | ], 5 | "plugins": [ 6 | "add-module-exports" 7 | ] 8 | } 9 | -------------------------------------------------------------------------------- /.github/dependabot.yml: -------------------------------------------------------------------------------- 1 | version: 2 2 | updates: 3 | - package-ecosystem: npm 4 | directory: "/" 5 | schedule: 6 | interval: monthly 7 | time: "12:00" 8 | timezone: Etc/UTC 9 | -------------------------------------------------------------------------------- /.github/workflows/main.yml: -------------------------------------------------------------------------------- 1 | name: Node CI 2 | 3 | on: [push, pull_request] 4 | 5 | jobs: 6 | build: 7 | runs-on: ubuntu-latest 8 | 9 | strategy: 10 | matrix: 11 | node-version: [16.x, 17.x] 12 | 13 | steps: 14 | - uses: actions/checkout@v2 15 | 16 | - name: Use Node.js ${{ matrix.node-version }} 17 | uses: actions/setup-node@v2 18 | with: 19 | node-version: ${{ matrix.node-version }} 20 | cache: "npm" 21 | 22 | - name: npm install, build, test and generate coverage 23 | run: | 24 | npm install 25 | npm run build 26 | npm run coverage 27 | env: 28 | CI: true 29 | 30 | - name: Upload coverage 31 | if: success() 32 | run: bash <(curl -s https://codecov.io/bash) -t $TOKEN -B $REF 33 | env: 34 | TOKEN: "${{ secrets.CODECOV_TOKEN }}" 35 | REF: "${{ github.ref }}" 36 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | node_modules/ 2 | coverage/ 3 | pkg/ 4 | *.log 5 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2019, Atrox 2 | All rights reserved. 3 | 4 | Redistribution and use in source and binary forms, with or without 5 | modification, are permitted provided that the following conditions are met: 6 | 7 | * Redistributions of source code must retain the above copyright notice, this 8 | list of conditions and the following disclaimer. 9 | 10 | * Redistributions in binary form must reproduce the above copyright notice, 11 | this list of conditions and the following disclaimer in the documentation 12 | and/or other materials provided with the distribution. 13 | 14 | * Neither the name of [project] nor the names of its 15 | contributors may be used to endorse or promote products derived from 16 | this software without specific prior written permission. 17 | 18 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 19 | AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 20 | IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 21 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE 22 | FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 23 | DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 24 | SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 25 | CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 26 | OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 27 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # HaikunatorJS 2 | 3 | [![Build Status](https://img.shields.io/endpoint.svg?url=https%3A%2F%2Factions-badge.atrox.dev%2Fatrox%2Fhaikunatorjs%2Fbadge&style=flat-square)](https://actions-badge.atrox.dev/atrox/haikunatorjs/goto) 4 | [![Latest Version](https://img.shields.io/npm/v/haikunator.svg?style=flat-square)](https://www.npmjs.com/package/haikunator) 5 | [![JSR Version](https://img.shields.io/jsr/v/%40atrox/haikunator?style=flat-square)](https://jsr.io/@atrox/haikunator) 6 | [![Coverage Status](https://img.shields.io/codecov/c/github/Atrox/haikunatorjs.svg?style=flat-square)](https://codecov.io/gh/Atrox/haikunatorjs) 7 | 8 | Generate Heroku-like random names to use in your node applications. 9 | 10 | ## Installation 11 | 12 | ``` 13 | npm install --save haikunator 14 | ``` 15 | 16 | ``` 17 | deno add @atrox/haikunator 18 | ``` 19 | 20 | ## Usage 21 | 22 | Haikunator is pretty simple. 23 | 24 | ```javascript 25 | import Haikunator from 'haikunator' 26 | 27 | // Instantiate Haikunator without options 28 | var haikunator = new Haikunator() 29 | 30 | // Instantiate Haikunator with default options 31 | var customHaikunator = new Haikunator({ 32 | adjectives: ['custom', 'adjectives'], 33 | nouns: ['custom', 'nouns'], 34 | seed: 'custom-seed', 35 | 36 | // class defaults 37 | defaults: { 38 | tokenLength: 8, 39 | tokenChars: 'HAIKUNATOR', 40 | // ... 41 | }, 42 | }) 43 | 44 | // default usage 45 | haikunator.haikunate() // => "wispy-dust-1337" 46 | 47 | // custom length (default=4) 48 | haikunator.haikunate({ tokenLength: 6 }) // => "patient-king-887265" 49 | 50 | // use hex instead of numbers 51 | haikunator.haikunate({ tokenHex: true }) // => "purple-breeze-98e1" 52 | 53 | // use custom chars instead of numbers/hex 54 | haikunator.haikunate({ tokenChars: 'HAIKUNATE' }) // => "summer-atom-IHEA" 55 | 56 | // don't include a token 57 | haikunator.haikunate({ tokenLength: 0 }) // => "cold-wildflower" 58 | 59 | // use a different delimiter 60 | haikunator.haikunate({ delimiter: '.' }) // => "restless.sea.7976" 61 | 62 | // no token, space delimiter 63 | haikunator.haikunate({ tokenLength: 0, delimiter: ' ' }) // => "delicate haze" 64 | 65 | // no token, empty delimiter 66 | haikunator.haikunate({ tokenLength: 0, delimiter: '' }) // => "billowingleaf" 67 | ``` 68 | 69 | ## Options 70 | 71 | The following options are available: 72 | 73 | ```javascript 74 | import Haikunator from 'haikunator' 75 | 76 | var haikunator = new Haikunator({ 77 | adjectives: ['custom', 'adjectives'], 78 | nouns: ['custom', 'nouns'], 79 | seed: 'custom-seed', // Custom seed 80 | 81 | // Class wide defaults, can get overridden by haikunate(options) 82 | defaults: { 83 | delimiter: '-', 84 | tokenLength: 4, 85 | tokenHex: false, 86 | tokenChars: '0123456789', 87 | }, 88 | }) 89 | 90 | // Same options are also available on the haikunate method 91 | haikunator.haikunate({ 92 | delimiter: '-', 93 | tokenLength: 4, 94 | tokenHex: false, 95 | tokenChars: '0123456789', 96 | }) 97 | ``` 98 | 99 | _If `tokenHex` is true, any tokens specified in `tokenChars` are ignored_ 100 | 101 | ## Contributing 102 | 103 | Everyone is encouraged to help improve this project. Here are a few ways you can help: 104 | 105 | - [Report bugs](https://github.com/atrox/haikunatorjs/issues) 106 | - Fix bugs and [submit pull requests](https://github.com/atrox/haikunatorjs/pulls) 107 | - Write, clarify, or fix documentation 108 | - Suggest or add new features 109 | 110 | ## Other Languages 111 | 112 | Haikunator is also available in other languages. Check them out: 113 | 114 | - .NET: https://github.com/Atrox/haikunator.net 115 | - Python: https://github.com/Atrox/haikunatorpy 116 | - PHP: https://github.com/Atrox/haikunatorphp 117 | - Java: https://github.com/Atrox/haikunatorjava 118 | - Go: https://github.com/Atrox/haikunatorgo 119 | - Perl: https://github.com/Atrox/haikunatorperl 120 | - Dart: https://github.com/Atrox/haikunatordart 121 | - Ruby: https://github.com/usmanbashir/haikunator 122 | - Rust: https://github.com/nishanths/rust-haikunator 123 | -------------------------------------------------------------------------------- /jest.config.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | roots: [ 3 | '/src' 4 | ], 5 | collectCoverage: false, 6 | coverageDirectory: './coverage/', 7 | collectCoverageFrom: ['/src/**/*.ts'], 8 | transform: { 9 | '^.+\\.tsx?$': 'ts-jest' 10 | }, 11 | testRegex: '(/__tests__/.*|(\\.|/)(test|spec))\\.tsx?$', 12 | moduleFileExtensions: [ 13 | 'ts', 14 | 'tsx', 15 | 'js', 16 | 'jsx', 17 | 'json', 18 | 'node' 19 | ] 20 | } 21 | -------------------------------------------------------------------------------- /jsr.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "@atrox/haikunator", 3 | "version": "2.1.2", 4 | "exports": "./src/index.ts", 5 | "publish": { 6 | "include": ["LICENSE", "README.md", "jsr.json", "src/**/*.ts"] 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "haikunator", 3 | "description": "Generate Heroku-like random names to use in your node applications.", 4 | "version": "2.1.2", 5 | "author": "Atrox ", 6 | "homepage": "https://github.com/Atrox/haikunatorjs", 7 | "keywords": [ 8 | "generator", 9 | "haikunate", 10 | "haikunator", 11 | "heroku", 12 | "heroku-like", 13 | "names", 14 | "random" 15 | ], 16 | "license": "BSD-3-Clause", 17 | "repository": { 18 | "type": "git", 19 | "url": "https://github.com/Atrox/haikunatorjs" 20 | }, 21 | "bugs": { 22 | "url": "https://github.com/Atrox/haikunatorjs/issues" 23 | }, 24 | "scripts": { 25 | "build": "pika build", 26 | "test": "jest", 27 | "coverage": "jest --coverage" 28 | }, 29 | "dependencies": { 30 | "@types/random-seed": "^0.3.3", 31 | "lodash.defaults": "^4.2.0", 32 | "random-seed": "^0.3.0" 33 | }, 34 | "devDependencies": { 35 | "@pika/pack": "^0.5.0", 36 | "@pika/plugin-build-node": "^0.9.2", 37 | "@pika/plugin-build-types": "^0.9.2", 38 | "@pika/plugin-build-web": "^0.9.2", 39 | "@pika/plugin-bundle-web": "^0.9.2", 40 | "@pika/plugin-standard-pkg": "^0.9.2", 41 | "@types/jest": "^29.5.10", 42 | "@types/lodash.defaults": "^4.2.5", 43 | "babel-plugin-add-module-exports": "^1.0.0", 44 | "jest": "^29.7.0", 45 | "standard": "^17.0.0", 46 | "ts-jest": "^29.1.1", 47 | "tslint": "^6.0.0", 48 | "typescript": "^5.3.2" 49 | }, 50 | "@pika/pack": { 51 | "pipeline": [ 52 | [ 53 | "@pika/plugin-standard-pkg", 54 | { 55 | "exclude": [ 56 | "__tests__/**/*" 57 | ] 58 | } 59 | ], 60 | [ 61 | "@pika/plugin-build-types" 62 | ], 63 | [ 64 | "@pika/plugin-build-node" 65 | ], 66 | [ 67 | "@pika/plugin-build-web" 68 | ], 69 | [ 70 | "@pika/plugin-bundle-web" 71 | ] 72 | ] 73 | } 74 | } 75 | -------------------------------------------------------------------------------- /src/__tests__/index.test.ts: -------------------------------------------------------------------------------- 1 | import Haikunator from '../index' 2 | 3 | const haikunator = new Haikunator() 4 | 5 | test('general functionality', () => { 6 | const tests = [ 7 | [{}, /[a-z]+-[a-z]+-[0-9]{4}$/], 8 | [{ tokenHex: true }, /[a-z]+-[a-z]+-[0-f]{4}$/], 9 | [{ tokenLength: 9 }, /[a-z]+-[a-z]+-[0-9]{9}$/], 10 | [{ tokenLength: 9, tokenHex: true }, /[a-z]+-[a-z]+-[0-f]{9}$/], 11 | [{ tokenLength: 0 }, /[a-z]+-[a-z]+$/], 12 | [{ delimiter: '.' }, /[a-z]+.[a-z]+.[0-9]{4}$/], 13 | [{ tokenLength: 0, delimiter: ' ' }, /[a-z]+ [a-z]+/], 14 | [{ tokenLength: 0, delimiter: '' }, /[a-z]+$/], 15 | [{ tokenChars: 'xyz' }, /[a-z]+-[a-z]+-[x-z]{4}$/] 16 | ] 17 | 18 | tests.forEach(test => { 19 | const options = test[0] 20 | const regex = test[1] 21 | 22 | // @ts-ignore 23 | expect(haikunator.haikunate(options)).toMatch(regex) 24 | }) 25 | }) 26 | 27 | test('wont return the same name for subsequent calls', () => { 28 | const tests = [new Haikunator(), new Haikunator()] 29 | 30 | tests.forEach(h1 => { 31 | tests.forEach(h2 => { 32 | expect(h1.haikunate()).not.toBe(h2.haikunate()) 33 | }) 34 | }) 35 | }) 36 | 37 | test('returns the same name if seed is provided', () => { 38 | const seed = 'definitively random seed' 39 | 40 | const h1 = new Haikunator({ seed: seed }) 41 | const h2 = new Haikunator({ seed: seed }) 42 | 43 | expect(h1.haikunate()).toBe(h2.haikunate()) 44 | expect(h1.haikunate()).toBe(h2.haikunate()) 45 | }) 46 | 47 | test('class wide defaults', () => { 48 | const wordHaikunator = new Haikunator({ 49 | defaults: { 50 | tokenLength: 0, 51 | delimiter: '' 52 | } 53 | }) 54 | 55 | expect(wordHaikunator.haikunate()).toMatch(/((?:[a-z][a-z]+))$/i) 56 | }) 57 | 58 | test('class wide defaults can get overridden by function parameters', () => { 59 | const wordHaikunator = new Haikunator({ 60 | defaults: { 61 | tokenLength: 0, 62 | delimiter: '' 63 | } 64 | }) 65 | 66 | const opts = { 67 | delimiter: '.' 68 | } 69 | 70 | expect(wordHaikunator.haikunate()).toMatch(/[a-z]+$/) 71 | expect(wordHaikunator.haikunate(opts)).toMatch(/[a-z]+.[a-z]+$/) 72 | }) 73 | 74 | test('custom adjectives & nouns', () => { 75 | const customHaikunator = new Haikunator({ 76 | adjectives: ['adjective'], 77 | nouns: ['noun'] 78 | }) 79 | 80 | expect(customHaikunator.haikunate()).toMatch(/adjective-noun-\d{4}$/) 81 | }) 82 | -------------------------------------------------------------------------------- /src/index.ts: -------------------------------------------------------------------------------- 1 | import RandomGenerator, { RandomSeed } from 'random-seed' 2 | import setDefaults from 'lodash.defaults' 3 | 4 | /** 5 | * Adjectives used by haikunator 6 | */ 7 | const defaultAdjectives = [ 8 | 'aged', 'ancient', 'autumn', 'billowing', 'bitter', 'black', 'blue', 'bold', 9 | 'broad', 'broken', 'calm', 'cold', 'cool', 'crimson', 'curly', 'damp', 10 | 'dark', 'dawn', 'delicate', 'divine', 'dry', 'empty', 'falling', 'fancy', 11 | 'flat', 'floral', 'fragrant', 'frosty', 'gentle', 'green', 'hidden', 'holy', 12 | 'icy', 'jolly', 'late', 'lingering', 'little', 'lively', 'long', 'lucky', 13 | 'misty', 'morning', 'muddy', 'mute', 'nameless', 'noisy', 'odd', 'old', 14 | 'orange', 'patient', 'plain', 'polished', 'proud', 'purple', 'quiet', 'rapid', 15 | 'raspy', 'red', 'restless', 'rough', 'round', 'royal', 'shiny', 'shrill', 16 | 'shy', 'silent', 'small', 'snowy', 'soft', 'solitary', 'sparkling', 'spring', 17 | 'square', 'steep', 'still', 'summer', 'super', 'sweet', 'throbbing', 'tight', 18 | 'tiny', 'twilight', 'wandering', 'weathered', 'white', 'wild', 'winter', 'wispy', 19 | 'withered', 'yellow', 'young' 20 | ] 21 | 22 | /** 23 | * Nouns used by haikunator 24 | */ 25 | const defaultNouns = [ 26 | 'art', 'band', 'bar', 'base', 'bird', 'block', 'boat', 'bonus', 27 | 'bread', 'breeze', 'brook', 'bush', 'butterfly', 'cake', 'cell', 'cherry', 28 | 'cloud', 'credit', 'darkness', 'dawn', 'dew', 'disk', 'dream', 'dust', 29 | 'feather', 'field', 'fire', 'firefly', 'flower', 'fog', 'forest', 'frog', 30 | 'frost', 'glade', 'glitter', 'grass', 'hall', 'hat', 'haze', 'heart', 31 | 'hill', 'king', 'lab', 'lake', 'leaf', 'limit', 'math', 'meadow', 32 | 'mode', 'moon', 'morning', 'mountain', 'mouse', 'mud', 'night', 'paper', 33 | 'pine', 'poetry', 'pond', 'queen', 'rain', 'recipe', 'resonance', 'rice', 34 | 'river', 'salad', 'scene', 'sea', 'shadow', 'shape', 'silence', 'sky', 35 | 'smoke', 'snow', 'snowflake', 'sound', 'star', 'sun', 'sun', 'sunset', 36 | 'surf', 'term', 'thunder', 'tooth', 'tree', 'truth', 'union', 'unit', 37 | 'violet', 'voice', 'water', 'waterfall', 'wave', 'wildflower', 'wind', 'wood' 38 | ] 39 | 40 | export type Options = { 41 | defaults?: Config 42 | adjectives?: string[] 43 | nouns?: string[] 44 | seed?: string 45 | } 46 | 47 | export type Config = { 48 | delimiter?: string 49 | tokenLength?: number 50 | tokenHex?: boolean 51 | tokenChars?: string 52 | } 53 | 54 | /** 55 | * Default options used by haikunate method 56 | */ 57 | const defaultOptions: Config = { 58 | delimiter: '-', 59 | tokenLength: 4, 60 | tokenHex: false, 61 | tokenChars: '0123456789' 62 | } 63 | 64 | export default class Haikunator { 65 | adjectives: string[] 66 | nouns: string[] 67 | 68 | random: RandomSeed 69 | config: Config 70 | 71 | /** 72 | * Initialize new haikunator 73 | */ 74 | constructor(options: Options = {}) { 75 | this.adjectives = options.adjectives || defaultAdjectives 76 | this.nouns = options.nouns || defaultNouns 77 | 78 | this.random = RandomGenerator.create(options.seed) 79 | this.config = setDefaults(options.defaults, defaultOptions) 80 | } 81 | 82 | /** 83 | * Generate heroku-like random names 84 | */ 85 | haikunate(options?: Config): string { 86 | // set specified options 87 | const config = setDefaults(options, this.config) 88 | 89 | // set tokenChars if tokenHex is set 90 | if (config.tokenHex === true) { 91 | config.tokenChars = '0123456789abcdef' 92 | } 93 | 94 | // pick adjective and noun 95 | const adjective = this._randomElement(this.adjectives) 96 | const noun = this._randomElement(this.nouns) 97 | 98 | // create random token 99 | if (!config.tokenLength) config.tokenLength = 0 100 | 101 | let token = '' 102 | for (let i = 0; i < config.tokenLength; i++) { 103 | token += this._randomElement(config.tokenChars) 104 | } 105 | 106 | // create result and return 107 | const sections = [adjective, noun, token] 108 | return sections.filter(e => { 109 | return !!e 110 | }).join(config.delimiter) 111 | } 112 | 113 | /** 114 | * Get a random element from an array/string 115 | * @param {(string|Array)} array 116 | * @returns {*} 117 | * @private 118 | */ 119 | _randomElement(array: (string | Array | undefined)): (string | undefined) { 120 | if (!array) return undefined 121 | return array[this.random(array.length)] 122 | } 123 | } 124 | -------------------------------------------------------------------------------- /tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | /* Basic Options */ 4 | "target": "es2018", /* Specify ECMAScript target version: 'ES3' (default), 'ES5', 'ES2015', 'ES2016', 'ES2017','ES2018' or 'ESNEXT'. */ 5 | "module": "esnext", /* Specify module code generation: 'none', 'commonjs', 'amd', 'system', 'umd', 'es2015', or 'ESNext'. */ 6 | // "lib": [], /* Specify library files to be included in the compilation. */ 7 | "allowJs": false, /* Allow javascript files to be compiled. */ 8 | // "checkJs": true, /* Report errors in .js files. */ 9 | // "jsx": "react", /* Specify JSX code generation: 'preserve', 'react-native', or 'react'. */ 10 | // "declaration": true, /* Generates corresponding '.d.ts' file. */ 11 | // "declarationMap": true, /* Generates a sourcemap for each corresponding '.d.ts' file. */ 12 | "sourceMap": true, /* Generates corresponding '.map' file. */ 13 | // "outFile": "./", /* Concatenate and emit output to single file. */ 14 | // "outDir": "./", /* Redirect output structure to the directory. */ 15 | // "rootDir": "./", /* Specify the root directory of input files. Use to control the output directory structure with --outDir. */ 16 | // "composite": true, /* Enable project compilation */ 17 | // "removeComments": true, /* Do not emit comments to output. */ 18 | // "noEmit": true, /* Do not emit outputs. */ 19 | // "importHelpers": true, /* Import emit helpers from 'tslib'. */ 20 | // "downlevelIteration": true, /* Provide full support for iterables in 'for-of', spread, and destructuring when targeting 'ES5' or 'ES3'. */ 21 | // "isolatedModules": true, /* Transpile each file as a separate module (similar to 'ts.transpileModule'). */ 22 | /* Strict Type-Checking Options */ 23 | "strict": true, /* Enable all strict type-checking options. */ 24 | "noImplicitAny": true, /* Raise error on expressions and declarations with an implied 'any' type. */ 25 | // "strictNullChecks": true, /* Enable strict null checks. */ 26 | // "strictFunctionTypes": true, /* Enable strict checking of function types. */ 27 | // "strictPropertyInitialization": true, /* Enable strict checking of property initialization in classes. */ 28 | // "noImplicitThis": true, /* Raise error on 'this' expressions with an implied 'any' type. */ 29 | // "alwaysStrict": true, /* Parse in strict mode and emit "use strict" for each source file. */ 30 | /* Additional Checks */ 31 | // "noUnusedLocals": true, /* Report errors on unused locals. */ 32 | // "noUnusedParameters": true, /* Report errors on unused parameters. */ 33 | // "noImplicitReturns": true, /* Report error when not all code paths in function return a value. */ 34 | // "noFallthroughCasesInSwitch": true, /* Report errors for fallthrough cases in switch statement. */ 35 | /* Module Resolution Options */ 36 | "moduleResolution": "node", /* Specify module resolution strategy: 'node' (Node.js) or 'classic' (TypeScript pre-1.6). */ 37 | // "baseUrl": "./", /* Base directory to resolve non-absolute module names. */ 38 | // "paths": {}, /* A series of entries which re-map imports to lookup locations relative to the 'baseUrl'. */ 39 | // "rootDirs": [], /* List of root folders whose combined content represents the structure of the project at runtime. */ 40 | // "typeRoots": [], /* List of folders to include type definitions from. */ 41 | "types": [ 42 | "node", 43 | "jest" 44 | ], /* Type declaration files to be included in compilation. */ 45 | // "allowSyntheticDefaultImports": true, /* Allow default imports from modules with no default export. This does not affect code emit, just typechecking. */ 46 | "esModuleInterop": true, /* Enables emit interoperability between CommonJS and ES Modules via creation of namespace objects for all imports. Implies 'allowSyntheticDefaultImports'. */ 47 | // "preserveSymlinks": true, /* Do not resolve the real path of symlinks. */ 48 | /* Source Map Options */ 49 | // "sourceRoot": "", /* Specify the location where debugger should locate TypeScript files instead of source locations. */ 50 | // "mapRoot": "", /* Specify the location where debugger should locate map files instead of generated locations. */ 51 | // "inlineSourceMap": true, /* Emit a single file with source maps instead of having a separate file. */ 52 | // "inlineSources": true, /* Emit the source alongside the sourcemaps within a single file; requires '--inlineSourceMap' or '--sourceMap' to be set. */ 53 | /* Experimental Options */ 54 | "experimentalDecorators": true, /* Enables experimental support for ES7 decorators. */ 55 | "emitDecoratorMetadata": true /* Enables experimental support for emitting type metadata for decorators. */ 56 | }, 57 | "include": [ 58 | "src/**/*" 59 | ], 60 | "exclude": [ 61 | "node_modules", 62 | "**/__tests__/*" 63 | ] 64 | } 65 | --------------------------------------------------------------------------------