├── .github └── workflows │ └── main.yml ├── .gitignore ├── LICENSE ├── README.md ├── action.yml ├── node_modules ├── @actions │ └── core │ │ ├── README.md │ │ ├── lib │ │ ├── command.d.ts │ │ ├── command.js │ │ ├── command.js.map │ │ ├── core.d.ts │ │ ├── core.js │ │ └── core.js.map │ │ └── package.json ├── badgen │ ├── LICENSE.md │ ├── README.md │ ├── dist │ │ ├── calc-text-width.d.ts │ │ ├── color-presets.d.ts │ │ ├── index.d.ts │ │ ├── index.js │ │ └── index.js.map │ ├── package.json │ └── tsconfig.json ├── balanced-match │ ├── .npmignore │ ├── LICENSE.md │ ├── README.md │ ├── index.js │ └── package.json ├── brace-expansion │ ├── LICENSE │ ├── README.md │ ├── index.js │ └── package.json ├── concat-map │ ├── .travis.yml │ ├── LICENSE │ ├── README.markdown │ ├── example │ │ └── map.js │ ├── index.js │ ├── package.json │ └── test │ │ └── map.js ├── fs.realpath │ ├── LICENSE │ ├── README.md │ ├── index.js │ ├── old.js │ └── package.json ├── glob-gitignore │ ├── HISTORY.md │ ├── LICENSE │ ├── README.md │ ├── package.json │ └── src │ │ ├── glob.js │ │ ├── index.js │ │ ├── sync.js │ │ └── util.js ├── glob │ ├── LICENSE │ ├── README.md │ ├── changelog.md │ ├── common.js │ ├── glob.js │ ├── package.json │ └── sync.js ├── ignore │ ├── CHANGELOG.md │ ├── LICENSE-MIT │ ├── README.md │ ├── index.d.ts │ ├── index.js │ ├── legacy.js │ └── package.json ├── inflight │ ├── LICENSE │ ├── README.md │ ├── inflight.js │ └── package.json ├── inherits │ ├── LICENSE │ ├── README.md │ ├── inherits.js │ ├── inherits_browser.js │ └── package.json ├── lodash.difference │ ├── LICENSE │ ├── README.md │ ├── index.js │ └── package.json ├── lodash.union │ ├── LICENSE │ ├── README.md │ ├── index.js │ └── package.json ├── make-array │ ├── README.md │ ├── index.js │ └── package.json ├── minimatch │ ├── LICENSE │ ├── README.md │ ├── minimatch.js │ └── package.json ├── once │ ├── LICENSE │ ├── README.md │ ├── once.js │ └── package.json ├── path-is-absolute │ ├── index.js │ ├── license │ ├── package.json │ └── readme.md ├── util.inherits │ ├── HISTORY.md │ ├── README.md │ ├── index.js │ └── package.json └── wrappy │ ├── LICENSE │ ├── README.md │ ├── package.json │ └── wrappy.js ├── package-lock.json ├── package.json └── src └── index.js /.github/workflows/main.yml: -------------------------------------------------------------------------------- 1 | on: [push] 2 | name: Run Test 3 | 4 | jobs: 5 | hello_world_job: 6 | runs-on: ubuntu-latest 7 | name: Test Run 8 | steps: 9 | - name: Checkout 10 | uses: actions/checkout@v4 11 | 12 | - name: Launch the local action 13 | uses: ./ # Uses an action in the root directory 14 | id: badge 15 | with: 16 | debug: true 17 | directory: ./ 18 | badge: ./output/badge.svg 19 | ignore: 'node_modules/|README' 20 | 21 | - name: Print the output 22 | run: | 23 | echo "Scanned: ${{ steps.badge.outputs.counted_files }}"; 24 | echo "Line Count: ${{ steps.badge.outputs.total_lines }}"; 25 | 26 | - name: Deploy to image-data branch 27 | uses: peaceiris/actions-gh-pages@v3 28 | with: 29 | publish_dir: ./output 30 | publish_branch: image-data 31 | github_token: ${{ secrets.GITHUB_TOKEN }} 32 | user_name: 'github-actions[bot]' 33 | user_email: 'github-actions[bot]@users.noreply.github.com' 34 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Logs 2 | logs 3 | *.log 4 | *.svg 5 | npm-debug.log* 6 | yarn-debug.log* 7 | yarn-error.log* 8 | lerna-debug.log* 9 | .idea/ 10 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2020 Mike 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # LoC-Badge ![Generated Button](https://raw.githubusercontent.com/shadowmoose/GHA-LoC-Badge/image-data/badge.svg) 2 | Count project Lines of Code & generate a badge for display. 3 | 4 | ## To use: 5 | In a Github Action, download your project and run this action: 6 | 7 | ```yaml 8 | - name: Make Code Badge 9 | uses: shadowmoose/GHA-LoC-Badge@1.0.0 10 | id: badge 11 | with: 12 | debug: true 13 | directory: ./ 14 | badge: ./output/badge.svg 15 | patterns: '*.js' # Patterns in the format of a '.gitignore' file, separated by pipes. 16 | ignore: 'node_modules' 17 | ``` 18 | 19 | Once the badge has been generated, use whatever tool you prefer to upload it somewhere. 20 | I personally prefer to push the badges to another branch of the project, where they can be linked easily. 21 | 22 | You can [see a full example file that does this here.](./.github/workflows/main.yml) 23 | 24 | The output badge can be customized. [Check out the input options here.](./action.yml) 25 | -------------------------------------------------------------------------------- /action.yml: -------------------------------------------------------------------------------- 1 | name: 'Lines of Code Badge' 2 | description: 'Generate a badge to display total Lines of Code' 3 | inputs: 4 | directory: 5 | description: 'The directory to scan.' 6 | required: false 7 | default: './' 8 | badge: 9 | description: 'The output path to save the badge svg - including extension!' 10 | required: false 11 | default: './badge.svg' 12 | patterns: 13 | description: 'The file patterns to search for, separated by pipes ("|").' 14 | required: false 15 | default: "**" 16 | ignore: 17 | description: 'The file patterns to ignore, even if they matched "patterns", separated by pipes ("|").' 18 | required: false 19 | default: "node_modules" 20 | badge_label: 21 | description: "The label to use for the badge." 22 | required: false 23 | default: "Lines of Code" 24 | badge_color: 25 | description: "The color to use for the badge." 26 | required: false 27 | default: "blue" 28 | badge_style: 29 | description: "The body style to use for the badge. ('flat' or 'classic')" 30 | required: false 31 | default: "classic" 32 | badge_scale: 33 | description: "The scale to resize this badge" 34 | required: false 35 | default: "1" 36 | badge_labelcolor: 37 | description: "The color to use for this badge label." 38 | required: false 39 | default: "555" 40 | debug: 41 | description: 'Enable debug logging' 42 | required: false 43 | default: 'false' 44 | 45 | 46 | outputs: 47 | total_lines: 48 | description: 'The total line count.' 49 | counted_files: 50 | description: 'A count of all files that were included in the total.' 51 | elapsed_ms: 52 | description: 'The time that this scan took.' 53 | output_path: 54 | description: 'The absolute path to the SVG that was generated.' 55 | output_dir: 56 | description: 'The absolute path to the directory that contains the output svg.' 57 | 58 | runs: 59 | using: 'node12' 60 | main: './src/index.js' 61 | 62 | branding: 63 | icon: 'award' 64 | color: 'green' 65 | -------------------------------------------------------------------------------- /node_modules/@actions/core/README.md: -------------------------------------------------------------------------------- 1 | # `@actions/core` 2 | 3 | > Core functions for setting results, logging, registering secrets and exporting variables across actions 4 | 5 | ## Usage 6 | 7 | ### Import the package 8 | 9 | ```js 10 | // javascript 11 | const core = require('@actions/core'); 12 | 13 | // typescript 14 | import * as core from '@actions/core'; 15 | ``` 16 | 17 | #### Inputs/Outputs 18 | 19 | Action inputs can be read with `getInput`. Outputs can be set with `setOutput` which makes them available to be mapped into inputs of other actions to ensure they are decoupled. 20 | 21 | ```js 22 | const myInput = core.getInput('inputName', { required: true }); 23 | 24 | core.setOutput('outputKey', 'outputVal'); 25 | ``` 26 | 27 | #### Exporting variables 28 | 29 | Since each step runs in a separate process, you can use `exportVariable` to add it to this step and future steps environment blocks. 30 | 31 | ```js 32 | core.exportVariable('envVar', 'Val'); 33 | ``` 34 | 35 | #### Setting a secret 36 | 37 | Setting a secret registers the secret with the runner to ensure it is masked in logs. 38 | 39 | ```js 40 | core.setSecret('myPassword'); 41 | ``` 42 | 43 | #### PATH Manipulation 44 | 45 | To make a tool's path available in the path for the remainder of the job (without altering the machine or containers state), use `addPath`. The runner will prepend the path given to the jobs PATH. 46 | 47 | ```js 48 | core.addPath('/path/to/mytool'); 49 | ``` 50 | 51 | #### Exit codes 52 | 53 | You should use this library to set the failing exit code for your action. If status is not set and the script runs to completion, that will lead to a success. 54 | 55 | ```js 56 | const core = require('@actions/core'); 57 | 58 | try { 59 | // Do stuff 60 | } 61 | catch (err) { 62 | // setFailed logs the message and sets a failing exit code 63 | core.setFailed(`Action failed with error ${err}`); 64 | } 65 | 66 | Note that `setNeutral` is not yet implemented in actions V2 but equivalent functionality is being planned. 67 | 68 | ``` 69 | 70 | #### Logging 71 | 72 | Finally, this library provides some utilities for logging. Note that debug logging is hidden from the logs by default. This behavior can be toggled by enabling the [Step Debug Logs](../../docs/action-debugging.md#step-debug-logs). 73 | 74 | ```js 75 | const core = require('@actions/core'); 76 | 77 | const myInput = core.getInput('input'); 78 | try { 79 | core.debug('Inside try block'); 80 | 81 | if (!myInput) { 82 | core.warning('myInput was not set'); 83 | } 84 | 85 | if (core.isDebug()) { 86 | // curl -v https://github.com 87 | } else { 88 | // curl https://github.com 89 | } 90 | 91 | // Do stuff 92 | } 93 | catch (err) { 94 | core.error(`Error ${err}, action may still succeed though`); 95 | } 96 | ``` 97 | 98 | This library can also wrap chunks of output in foldable groups. 99 | 100 | ```js 101 | const core = require('@actions/core') 102 | 103 | // Manually wrap output 104 | core.startGroup('Do some function') 105 | doSomeFunction() 106 | core.endGroup() 107 | 108 | // Wrap an asynchronous function call 109 | const result = await core.group('Do something async', async () => { 110 | const response = await doSomeHTTPRequest() 111 | return response 112 | }) 113 | ``` 114 | 115 | #### Action state 116 | 117 | You can use this library to save state and get state for sharing information between a given wrapper action: 118 | 119 | **action.yml** 120 | ```yaml 121 | name: 'Wrapper action sample' 122 | inputs: 123 | name: 124 | default: 'GitHub' 125 | runs: 126 | using: 'node12' 127 | main: 'main.js' 128 | post: 'cleanup.js' 129 | ``` 130 | 131 | In action's `main.js`: 132 | 133 | ```js 134 | const core = require('@actions/core'); 135 | 136 | core.saveState("pidToKill", 12345); 137 | ``` 138 | 139 | In action's `cleanup.js`: 140 | ```js 141 | const core = require('@actions/core'); 142 | 143 | var pid = core.getState("pidToKill"); 144 | 145 | process.kill(pid); 146 | ``` -------------------------------------------------------------------------------- /node_modules/@actions/core/lib/command.d.ts: -------------------------------------------------------------------------------- 1 | interface CommandProperties { 2 | [key: string]: string; 3 | } 4 | /** 5 | * Commands 6 | * 7 | * Command Format: 8 | * ::name key=value,key=value::message 9 | * 10 | * Examples: 11 | * ::warning::This is the message 12 | * ::set-env name=MY_VAR::some value 13 | */ 14 | export declare function issueCommand(command: string, properties: CommandProperties, message: string): void; 15 | export declare function issue(name: string, message?: string): void; 16 | export {}; 17 | -------------------------------------------------------------------------------- /node_modules/@actions/core/lib/command.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | var __importStar = (this && this.__importStar) || function (mod) { 3 | if (mod && mod.__esModule) return mod; 4 | var result = {}; 5 | if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k]; 6 | result["default"] = mod; 7 | return result; 8 | }; 9 | Object.defineProperty(exports, "__esModule", { value: true }); 10 | const os = __importStar(require("os")); 11 | /** 12 | * Commands 13 | * 14 | * Command Format: 15 | * ::name key=value,key=value::message 16 | * 17 | * Examples: 18 | * ::warning::This is the message 19 | * ::set-env name=MY_VAR::some value 20 | */ 21 | function issueCommand(command, properties, message) { 22 | const cmd = new Command(command, properties, message); 23 | process.stdout.write(cmd.toString() + os.EOL); 24 | } 25 | exports.issueCommand = issueCommand; 26 | function issue(name, message = '') { 27 | issueCommand(name, {}, message); 28 | } 29 | exports.issue = issue; 30 | const CMD_STRING = '::'; 31 | class Command { 32 | constructor(command, properties, message) { 33 | if (!command) { 34 | command = 'missing.command'; 35 | } 36 | this.command = command; 37 | this.properties = properties; 38 | this.message = message; 39 | } 40 | toString() { 41 | let cmdStr = CMD_STRING + this.command; 42 | if (this.properties && Object.keys(this.properties).length > 0) { 43 | cmdStr += ' '; 44 | let first = true; 45 | for (const key in this.properties) { 46 | if (this.properties.hasOwnProperty(key)) { 47 | const val = this.properties[key]; 48 | if (val) { 49 | if (first) { 50 | first = false; 51 | } 52 | else { 53 | cmdStr += ','; 54 | } 55 | cmdStr += `${key}=${escapeProperty(val)}`; 56 | } 57 | } 58 | } 59 | } 60 | cmdStr += `${CMD_STRING}${escapeData(this.message)}`; 61 | return cmdStr; 62 | } 63 | } 64 | function escapeData(s) { 65 | return (s || '') 66 | .replace(/%/g, '%25') 67 | .replace(/\r/g, '%0D') 68 | .replace(/\n/g, '%0A'); 69 | } 70 | function escapeProperty(s) { 71 | return (s || '') 72 | .replace(/%/g, '%25') 73 | .replace(/\r/g, '%0D') 74 | .replace(/\n/g, '%0A') 75 | .replace(/:/g, '%3A') 76 | .replace(/,/g, '%2C'); 77 | } 78 | //# sourceMappingURL=command.js.map -------------------------------------------------------------------------------- /node_modules/@actions/core/lib/command.js.map: -------------------------------------------------------------------------------- 1 | {"version":3,"file":"command.js","sourceRoot":"","sources":["../src/command.ts"],"names":[],"mappings":";;;;;;;;;AAAA,uCAAwB;AAQxB;;;;;;;;;GASG;AACH,SAAgB,YAAY,CAC1B,OAAe,EACf,UAA6B,EAC7B,OAAe;IAEf,MAAM,GAAG,GAAG,IAAI,OAAO,CAAC,OAAO,EAAE,UAAU,EAAE,OAAO,CAAC,CAAA;IACrD,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,GAAG,CAAC,QAAQ,EAAE,GAAG,EAAE,CAAC,GAAG,CAAC,CAAA;AAC/C,CAAC;AAPD,oCAOC;AAED,SAAgB,KAAK,CAAC,IAAY,EAAE,UAAkB,EAAE;IACtD,YAAY,CAAC,IAAI,EAAE,EAAE,EAAE,OAAO,CAAC,CAAA;AACjC,CAAC;AAFD,sBAEC;AAED,MAAM,UAAU,GAAG,IAAI,CAAA;AAEvB,MAAM,OAAO;IAKX,YAAY,OAAe,EAAE,UAA6B,EAAE,OAAe;QACzE,IAAI,CAAC,OAAO,EAAE;YACZ,OAAO,GAAG,iBAAiB,CAAA;SAC5B;QAED,IAAI,CAAC,OAAO,GAAG,OAAO,CAAA;QACtB,IAAI,CAAC,UAAU,GAAG,UAAU,CAAA;QAC5B,IAAI,CAAC,OAAO,GAAG,OAAO,CAAA;IACxB,CAAC;IAED,QAAQ;QACN,IAAI,MAAM,GAAG,UAAU,GAAG,IAAI,CAAC,OAAO,CAAA;QAEtC,IAAI,IAAI,CAAC,UAAU,IAAI,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC,MAAM,GAAG,CAAC,EAAE;YAC9D,MAAM,IAAI,GAAG,CAAA;YACb,IAAI,KAAK,GAAG,IAAI,CAAA;YAChB,KAAK,MAAM,GAAG,IAAI,IAAI,CAAC,UAAU,EAAE;gBACjC,IAAI,IAAI,CAAC,UAAU,CAAC,cAAc,CAAC,GAAG,CAAC,EAAE;oBACvC,MAAM,GAAG,GAAG,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC,CAAA;oBAChC,IAAI,GAAG,EAAE;wBACP,IAAI,KAAK,EAAE;4BACT,KAAK,GAAG,KAAK,CAAA;yBACd;6BAAM;4BACL,MAAM,IAAI,GAAG,CAAA;yBACd;wBAED,MAAM,IAAI,GAAG,GAAG,IAAI,cAAc,CAAC,GAAG,CAAC,EAAE,CAAA;qBAC1C;iBACF;aACF;SACF;QAED,MAAM,IAAI,GAAG,UAAU,GAAG,UAAU,CAAC,IAAI,CAAC,OAAO,CAAC,EAAE,CAAA;QACpD,OAAO,MAAM,CAAA;IACf,CAAC;CACF;AAED,SAAS,UAAU,CAAC,CAAS;IAC3B,OAAO,CAAC,CAAC,IAAI,EAAE,CAAC;SACb,OAAO,CAAC,IAAI,EAAE,KAAK,CAAC;SACpB,OAAO,CAAC,KAAK,EAAE,KAAK,CAAC;SACrB,OAAO,CAAC,KAAK,EAAE,KAAK,CAAC,CAAA;AAC1B,CAAC;AAED,SAAS,cAAc,CAAC,CAAS;IAC/B,OAAO,CAAC,CAAC,IAAI,EAAE,CAAC;SACb,OAAO,CAAC,IAAI,EAAE,KAAK,CAAC;SACpB,OAAO,CAAC,KAAK,EAAE,KAAK,CAAC;SACrB,OAAO,CAAC,KAAK,EAAE,KAAK,CAAC;SACrB,OAAO,CAAC,IAAI,EAAE,KAAK,CAAC;SACpB,OAAO,CAAC,IAAI,EAAE,KAAK,CAAC,CAAA;AACzB,CAAC"} -------------------------------------------------------------------------------- /node_modules/@actions/core/lib/core.d.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * Interface for getInput options 3 | */ 4 | export interface InputOptions { 5 | /** Optional. Whether the input is required. If required and not present, will throw. Defaults to false */ 6 | required?: boolean; 7 | } 8 | /** 9 | * The code to exit an action 10 | */ 11 | export declare enum ExitCode { 12 | /** 13 | * A code indicating that the action was successful 14 | */ 15 | Success = 0, 16 | /** 17 | * A code indicating that the action was a failure 18 | */ 19 | Failure = 1 20 | } 21 | /** 22 | * Sets env variable for this action and future actions in the job 23 | * @param name the name of the variable to set 24 | * @param val the value of the variable 25 | */ 26 | export declare function exportVariable(name: string, val: string): void; 27 | /** 28 | * Registers a secret which will get masked from logs 29 | * @param secret value of the secret 30 | */ 31 | export declare function setSecret(secret: string): void; 32 | /** 33 | * Prepends inputPath to the PATH (for this action and future actions) 34 | * @param inputPath 35 | */ 36 | export declare function addPath(inputPath: string): void; 37 | /** 38 | * Gets the value of an input. The value is also trimmed. 39 | * 40 | * @param name name of the input to get 41 | * @param options optional. See InputOptions. 42 | * @returns string 43 | */ 44 | export declare function getInput(name: string, options?: InputOptions): string; 45 | /** 46 | * Sets the value of an output. 47 | * 48 | * @param name name of the output to set 49 | * @param value value to store 50 | */ 51 | export declare function setOutput(name: string, value: string): void; 52 | /** 53 | * Sets the action status to failed. 54 | * When the action exits it will be with an exit code of 1 55 | * @param message add error issue message 56 | */ 57 | export declare function setFailed(message: string): void; 58 | /** 59 | * Gets whether Actions Step Debug is on or not 60 | */ 61 | export declare function isDebug(): boolean; 62 | /** 63 | * Writes debug message to user log 64 | * @param message debug message 65 | */ 66 | export declare function debug(message: string): void; 67 | /** 68 | * Adds an error issue 69 | * @param message error issue message 70 | */ 71 | export declare function error(message: string): void; 72 | /** 73 | * Adds an warning issue 74 | * @param message warning issue message 75 | */ 76 | export declare function warning(message: string): void; 77 | /** 78 | * Writes info to log with console.log. 79 | * @param message info message 80 | */ 81 | export declare function info(message: string): void; 82 | /** 83 | * Begin an output group. 84 | * 85 | * Output until the next `groupEnd` will be foldable in this group 86 | * 87 | * @param name The name of the output group 88 | */ 89 | export declare function startGroup(name: string): void; 90 | /** 91 | * End an output group. 92 | */ 93 | export declare function endGroup(): void; 94 | /** 95 | * Wrap an asynchronous function call in a group. 96 | * 97 | * Returns the same type as the function itself. 98 | * 99 | * @param name The name of the group 100 | * @param fn The function to wrap in the group 101 | */ 102 | export declare function group(name: string, fn: () => Promise): Promise; 103 | /** 104 | * Saves state for current action, the state can only be retrieved by this action's post job execution. 105 | * 106 | * @param name name of the state to store 107 | * @param value value to store 108 | */ 109 | export declare function saveState(name: string, value: string): void; 110 | /** 111 | * Gets the value of an state set by this action's main execution. 112 | * 113 | * @param name name of the state to get 114 | * @returns string 115 | */ 116 | export declare function getState(name: string): string; 117 | -------------------------------------------------------------------------------- /node_modules/@actions/core/lib/core.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { 3 | function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } 4 | return new (P || (P = Promise))(function (resolve, reject) { 5 | function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } 6 | function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } 7 | function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } 8 | step((generator = generator.apply(thisArg, _arguments || [])).next()); 9 | }); 10 | }; 11 | var __importStar = (this && this.__importStar) || function (mod) { 12 | if (mod && mod.__esModule) return mod; 13 | var result = {}; 14 | if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k]; 15 | result["default"] = mod; 16 | return result; 17 | }; 18 | Object.defineProperty(exports, "__esModule", { value: true }); 19 | const command_1 = require("./command"); 20 | const os = __importStar(require("os")); 21 | const path = __importStar(require("path")); 22 | /** 23 | * The code to exit an action 24 | */ 25 | var ExitCode; 26 | (function (ExitCode) { 27 | /** 28 | * A code indicating that the action was successful 29 | */ 30 | ExitCode[ExitCode["Success"] = 0] = "Success"; 31 | /** 32 | * A code indicating that the action was a failure 33 | */ 34 | ExitCode[ExitCode["Failure"] = 1] = "Failure"; 35 | })(ExitCode = exports.ExitCode || (exports.ExitCode = {})); 36 | //----------------------------------------------------------------------- 37 | // Variables 38 | //----------------------------------------------------------------------- 39 | /** 40 | * Sets env variable for this action and future actions in the job 41 | * @param name the name of the variable to set 42 | * @param val the value of the variable 43 | */ 44 | function exportVariable(name, val) { 45 | process.env[name] = val; 46 | command_1.issueCommand('set-env', { name }, val); 47 | } 48 | exports.exportVariable = exportVariable; 49 | /** 50 | * Registers a secret which will get masked from logs 51 | * @param secret value of the secret 52 | */ 53 | function setSecret(secret) { 54 | command_1.issueCommand('add-mask', {}, secret); 55 | } 56 | exports.setSecret = setSecret; 57 | /** 58 | * Prepends inputPath to the PATH (for this action and future actions) 59 | * @param inputPath 60 | */ 61 | function addPath(inputPath) { 62 | command_1.issueCommand('add-path', {}, inputPath); 63 | process.env['PATH'] = `${inputPath}${path.delimiter}${process.env['PATH']}`; 64 | } 65 | exports.addPath = addPath; 66 | /** 67 | * Gets the value of an input. The value is also trimmed. 68 | * 69 | * @param name name of the input to get 70 | * @param options optional. See InputOptions. 71 | * @returns string 72 | */ 73 | function getInput(name, options) { 74 | const val = process.env[`INPUT_${name.replace(/ /g, '_').toUpperCase()}`] || ''; 75 | if (options && options.required && !val) { 76 | throw new Error(`Input required and not supplied: ${name}`); 77 | } 78 | return val.trim(); 79 | } 80 | exports.getInput = getInput; 81 | /** 82 | * Sets the value of an output. 83 | * 84 | * @param name name of the output to set 85 | * @param value value to store 86 | */ 87 | function setOutput(name, value) { 88 | command_1.issueCommand('set-output', { name }, value); 89 | } 90 | exports.setOutput = setOutput; 91 | //----------------------------------------------------------------------- 92 | // Results 93 | //----------------------------------------------------------------------- 94 | /** 95 | * Sets the action status to failed. 96 | * When the action exits it will be with an exit code of 1 97 | * @param message add error issue message 98 | */ 99 | function setFailed(message) { 100 | process.exitCode = ExitCode.Failure; 101 | error(message); 102 | } 103 | exports.setFailed = setFailed; 104 | //----------------------------------------------------------------------- 105 | // Logging Commands 106 | //----------------------------------------------------------------------- 107 | /** 108 | * Gets whether Actions Step Debug is on or not 109 | */ 110 | function isDebug() { 111 | return process.env['RUNNER_DEBUG'] === '1'; 112 | } 113 | exports.isDebug = isDebug; 114 | /** 115 | * Writes debug message to user log 116 | * @param message debug message 117 | */ 118 | function debug(message) { 119 | command_1.issueCommand('debug', {}, message); 120 | } 121 | exports.debug = debug; 122 | /** 123 | * Adds an error issue 124 | * @param message error issue message 125 | */ 126 | function error(message) { 127 | command_1.issue('error', message); 128 | } 129 | exports.error = error; 130 | /** 131 | * Adds an warning issue 132 | * @param message warning issue message 133 | */ 134 | function warning(message) { 135 | command_1.issue('warning', message); 136 | } 137 | exports.warning = warning; 138 | /** 139 | * Writes info to log with console.log. 140 | * @param message info message 141 | */ 142 | function info(message) { 143 | process.stdout.write(message + os.EOL); 144 | } 145 | exports.info = info; 146 | /** 147 | * Begin an output group. 148 | * 149 | * Output until the next `groupEnd` will be foldable in this group 150 | * 151 | * @param name The name of the output group 152 | */ 153 | function startGroup(name) { 154 | command_1.issue('group', name); 155 | } 156 | exports.startGroup = startGroup; 157 | /** 158 | * End an output group. 159 | */ 160 | function endGroup() { 161 | command_1.issue('endgroup'); 162 | } 163 | exports.endGroup = endGroup; 164 | /** 165 | * Wrap an asynchronous function call in a group. 166 | * 167 | * Returns the same type as the function itself. 168 | * 169 | * @param name The name of the group 170 | * @param fn The function to wrap in the group 171 | */ 172 | function group(name, fn) { 173 | return __awaiter(this, void 0, void 0, function* () { 174 | startGroup(name); 175 | let result; 176 | try { 177 | result = yield fn(); 178 | } 179 | finally { 180 | endGroup(); 181 | } 182 | return result; 183 | }); 184 | } 185 | exports.group = group; 186 | //----------------------------------------------------------------------- 187 | // Wrapper action state 188 | //----------------------------------------------------------------------- 189 | /** 190 | * Saves state for current action, the state can only be retrieved by this action's post job execution. 191 | * 192 | * @param name name of the state to store 193 | * @param value value to store 194 | */ 195 | function saveState(name, value) { 196 | command_1.issueCommand('save-state', { name }, value); 197 | } 198 | exports.saveState = saveState; 199 | /** 200 | * Gets the value of an state set by this action's main execution. 201 | * 202 | * @param name name of the state to get 203 | * @returns string 204 | */ 205 | function getState(name) { 206 | return process.env[`STATE_${name}`] || ''; 207 | } 208 | exports.getState = getState; 209 | //# sourceMappingURL=core.js.map -------------------------------------------------------------------------------- /node_modules/@actions/core/lib/core.js.map: -------------------------------------------------------------------------------- 1 | {"version":3,"file":"core.js","sourceRoot":"","sources":["../src/core.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;AAAA,uCAA6C;AAE7C,uCAAwB;AACxB,2CAA4B;AAU5B;;GAEG;AACH,IAAY,QAUX;AAVD,WAAY,QAAQ;IAClB;;OAEG;IACH,6CAAW,CAAA;IAEX;;OAEG;IACH,6CAAW,CAAA;AACb,CAAC,EAVW,QAAQ,GAAR,gBAAQ,KAAR,gBAAQ,QAUnB;AAED,yEAAyE;AACzE,YAAY;AACZ,yEAAyE;AAEzE;;;;GAIG;AACH,SAAgB,cAAc,CAAC,IAAY,EAAE,GAAW;IACtD,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC,GAAG,GAAG,CAAA;IACvB,sBAAY,CAAC,SAAS,EAAE,EAAC,IAAI,EAAC,EAAE,GAAG,CAAC,CAAA;AACtC,CAAC;AAHD,wCAGC;AAED;;;GAGG;AACH,SAAgB,SAAS,CAAC,MAAc;IACtC,sBAAY,CAAC,UAAU,EAAE,EAAE,EAAE,MAAM,CAAC,CAAA;AACtC,CAAC;AAFD,8BAEC;AAED;;;GAGG;AACH,SAAgB,OAAO,CAAC,SAAiB;IACvC,sBAAY,CAAC,UAAU,EAAE,EAAE,EAAE,SAAS,CAAC,CAAA;IACvC,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC,GAAG,GAAG,SAAS,GAAG,IAAI,CAAC,SAAS,GAAG,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC,EAAE,CAAA;AAC7E,CAAC;AAHD,0BAGC;AAED;;;;;;GAMG;AACH,SAAgB,QAAQ,CAAC,IAAY,EAAE,OAAsB;IAC3D,MAAM,GAAG,GACP,OAAO,CAAC,GAAG,CAAC,SAAS,IAAI,CAAC,OAAO,CAAC,IAAI,EAAE,GAAG,CAAC,CAAC,WAAW,EAAE,EAAE,CAAC,IAAI,EAAE,CAAA;IACrE,IAAI,OAAO,IAAI,OAAO,CAAC,QAAQ,IAAI,CAAC,GAAG,EAAE;QACvC,MAAM,IAAI,KAAK,CAAC,oCAAoC,IAAI,EAAE,CAAC,CAAA;KAC5D;IAED,OAAO,GAAG,CAAC,IAAI,EAAE,CAAA;AACnB,CAAC;AARD,4BAQC;AAED;;;;;GAKG;AACH,SAAgB,SAAS,CAAC,IAAY,EAAE,KAAa;IACnD,sBAAY,CAAC,YAAY,EAAE,EAAC,IAAI,EAAC,EAAE,KAAK,CAAC,CAAA;AAC3C,CAAC;AAFD,8BAEC;AAED,yEAAyE;AACzE,UAAU;AACV,yEAAyE;AAEzE;;;;GAIG;AACH,SAAgB,SAAS,CAAC,OAAe;IACvC,OAAO,CAAC,QAAQ,GAAG,QAAQ,CAAC,OAAO,CAAA;IACnC,KAAK,CAAC,OAAO,CAAC,CAAA;AAChB,CAAC;AAHD,8BAGC;AAED,yEAAyE;AACzE,mBAAmB;AACnB,yEAAyE;AAEzE;;GAEG;AACH,SAAgB,OAAO;IACrB,OAAO,OAAO,CAAC,GAAG,CAAC,cAAc,CAAC,KAAK,GAAG,CAAA;AAC5C,CAAC;AAFD,0BAEC;AAED;;;GAGG;AACH,SAAgB,KAAK,CAAC,OAAe;IACnC,sBAAY,CAAC,OAAO,EAAE,EAAE,EAAE,OAAO,CAAC,CAAA;AACpC,CAAC;AAFD,sBAEC;AAED;;;GAGG;AACH,SAAgB,KAAK,CAAC,OAAe;IACnC,eAAK,CAAC,OAAO,EAAE,OAAO,CAAC,CAAA;AACzB,CAAC;AAFD,sBAEC;AAED;;;GAGG;AACH,SAAgB,OAAO,CAAC,OAAe;IACrC,eAAK,CAAC,SAAS,EAAE,OAAO,CAAC,CAAA;AAC3B,CAAC;AAFD,0BAEC;AAED;;;GAGG;AACH,SAAgB,IAAI,CAAC,OAAe;IAClC,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,OAAO,GAAG,EAAE,CAAC,GAAG,CAAC,CAAA;AACxC,CAAC;AAFD,oBAEC;AAED;;;;;;GAMG;AACH,SAAgB,UAAU,CAAC,IAAY;IACrC,eAAK,CAAC,OAAO,EAAE,IAAI,CAAC,CAAA;AACtB,CAAC;AAFD,gCAEC;AAED;;GAEG;AACH,SAAgB,QAAQ;IACtB,eAAK,CAAC,UAAU,CAAC,CAAA;AACnB,CAAC;AAFD,4BAEC;AAED;;;;;;;GAOG;AACH,SAAsB,KAAK,CAAI,IAAY,EAAE,EAAoB;;QAC/D,UAAU,CAAC,IAAI,CAAC,CAAA;QAEhB,IAAI,MAAS,CAAA;QAEb,IAAI;YACF,MAAM,GAAG,MAAM,EAAE,EAAE,CAAA;SACpB;gBAAS;YACR,QAAQ,EAAE,CAAA;SACX;QAED,OAAO,MAAM,CAAA;IACf,CAAC;CAAA;AAZD,sBAYC;AAED,yEAAyE;AACzE,uBAAuB;AACvB,yEAAyE;AAEzE;;;;;GAKG;AACH,SAAgB,SAAS,CAAC,IAAY,EAAE,KAAa;IACnD,sBAAY,CAAC,YAAY,EAAE,EAAC,IAAI,EAAC,EAAE,KAAK,CAAC,CAAA;AAC3C,CAAC;AAFD,8BAEC;AAED;;;;;GAKG;AACH,SAAgB,QAAQ,CAAC,IAAY;IACnC,OAAO,OAAO,CAAC,GAAG,CAAC,SAAS,IAAI,EAAE,CAAC,IAAI,EAAE,CAAA;AAC3C,CAAC;AAFD,4BAEC"} -------------------------------------------------------------------------------- /node_modules/@actions/core/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "_from": "@actions/core", 3 | "_id": "@actions/core@1.2.3", 4 | "_inBundle": false, 5 | "_integrity": "sha512-Wp4xnyokakM45Uuj4WLUxdsa8fJjKVl1fDTsPbTEcTcuu0Nb26IPQbOtjmnfaCPGcaoPOOqId8H9NapZ8gii4w==", 6 | "_location": "/@actions/core", 7 | "_phantomChildren": {}, 8 | "_requested": { 9 | "type": "tag", 10 | "registry": true, 11 | "raw": "@actions/core", 12 | "name": "@actions/core", 13 | "escapedName": "@actions%2fcore", 14 | "scope": "@actions", 15 | "rawSpec": "", 16 | "saveSpec": null, 17 | "fetchSpec": "latest" 18 | }, 19 | "_requiredBy": [ 20 | "#USER", 21 | "/" 22 | ], 23 | "_resolved": "https://registry.npmjs.org/@actions/core/-/core-1.2.3.tgz", 24 | "_shasum": "e844b4fa0820e206075445079130868f95bfca95", 25 | "_spec": "@actions/core", 26 | "_where": "C:\\Users\\ShadowMoose\\Documents\\Git\\LoC-Badge", 27 | "bugs": { 28 | "url": "https://github.com/actions/toolkit/issues" 29 | }, 30 | "bundleDependencies": false, 31 | "deprecated": false, 32 | "description": "Actions core lib", 33 | "devDependencies": { 34 | "@types/node": "^12.0.2" 35 | }, 36 | "directories": { 37 | "lib": "lib", 38 | "test": "__tests__" 39 | }, 40 | "files": [ 41 | "lib" 42 | ], 43 | "homepage": "https://github.com/actions/toolkit/tree/master/packages/core", 44 | "keywords": [ 45 | "github", 46 | "actions", 47 | "core" 48 | ], 49 | "license": "MIT", 50 | "main": "lib/core.js", 51 | "name": "@actions/core", 52 | "publishConfig": { 53 | "access": "public" 54 | }, 55 | "repository": { 56 | "type": "git", 57 | "url": "git+https://github.com/actions/toolkit.git", 58 | "directory": "packages/core" 59 | }, 60 | "scripts": { 61 | "audit-moderate": "npm install && npm audit --audit-level=moderate", 62 | "test": "echo \"Error: run tests from root\" && exit 1", 63 | "tsc": "tsc" 64 | }, 65 | "types": "lib/core.d.ts", 66 | "version": "1.2.3" 67 | } 68 | -------------------------------------------------------------------------------- /node_modules/badgen/LICENSE.md: -------------------------------------------------------------------------------- 1 | Copyright 2018 Amio 2 | 3 | Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. 4 | 5 | THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 6 | -------------------------------------------------------------------------------- /node_modules/badgen/README.md: -------------------------------------------------------------------------------- 1 | # badgen 2 | 3 | [![npm version][npm-src]][npm-href] 4 | [![Coverage Status][coveralls-src]][coveralls-href] 5 | [![Bundle size][bundlephobia-src]][bundlephobia-href] 6 | [![License][license-src]][license-href] 7 | 8 | Fast handcraft svg badge generator. Used on [badgen.net](https://badgen.net). 9 | 10 | - 🌀 Zero dependency 11 | - ⚡️ Fast by design (see [benchmarks](#benchmarks)) 12 | - 👯‍ Running in node & browser 13 | 14 | ## Usage 15 | 16 | `npm install badgen` 17 | 18 | ```javascript 19 | const { badgen } = require('badgen') 20 | 21 | // only `status` is required. 22 | const svgString = badgen({ 23 | label: 'npm', // 24 | labelColor: 'ADF' // or (default: '555') 25 | status: 'v1.2.3', // , required 26 | color: 'blue', // or (default: 'blue') 27 | style: 'flat', // 'flat' or 'classic' (default: 'classic') 28 | icon: 'data:image/svg+xml;base64,...', // Use icon (default: undefined) 29 | iconWidth: 13, // Set this if icon is not square (default: 13) 30 | scale: 1 // Set badge scale (default: 1) 31 | }) 32 | ``` 33 | 34 | Available color names: 35 | 36 | ![](https://badgen.net/badge/color/blue/blue) 37 | ![](https://badgen.net/badge/color/cyan/cyan) 38 | ![](https://badgen.net/badge/color/green/green) 39 | ![](https://badgen.net/badge/color/yellow/yellow) 40 | ![](https://badgen.net/badge/color/orange/orange) 41 | ![](https://badgen.net/badge/color/red/red) 42 | ![](https://badgen.net/badge/color/pink/pink) 43 | ![](https://badgen.net/badge/color/purple/purple) 44 | ![](https://badgen.net/badge/color/grey/grey) 45 | ![](https://badgen.net/badge/color/black/black) 46 | 47 | ### In browser 48 | 49 | ```html 50 | 51 | 54 | ``` 55 | 56 | ## Benchmarks 57 | 58 | `npm run bench` on iMac 5K (Late 2014), 3.5G i5, with Node.js 12.11.0: 59 | 60 | ```bash 61 | [classic] style, long params x 985,898 ops/sec ±0.37% (94 runs sampled) 62 | [classic] style, full params x 1,284,886 ops/sec ±0.42% (95 runs sampled) 63 | [classic] style, with emoji x 1,291,768 ops/sec ±0.28% (95 runs sampled) 64 | [classic] style, with icon x 1,177,120 ops/sec ±0.94% (95 runs sampled) 65 | [flat] style, long params x 780,504 ops/sec ±0.39% (94 runs sampled) 66 | [flat] style, full params x 1,012,111 ops/sec ±0.40% (97 runs sampled) 67 | [flat] style, with emoji x 1,013,695 ops/sec ±0.91% (95 runs sampled) 68 | [flat] style, with icon x 994,481 ops/sec ±0.30% (94 runs sampled) 69 | ``` 70 | 71 | ## See Also 72 | 73 | - [gradient-badge][gradient-badge] - Badge generator with color gradient support 74 | 75 | [npm-src]: https://badgen.net/npm/v/badgen 76 | [npm-href]: https://www.npmjs.com/package/badgen 77 | [bundlephobia-src]: https://badgen.net/bundlephobia/minzip/badgen 78 | [bundlephobia-href]: https://bundlephobia.com/result?p=badgen 79 | [coveralls-src]: https://badgen.net/coveralls/c/github/amio/badgen/master 80 | [coveralls-href]: https://coveralls.io/github/amio/badgen?branch=master 81 | [license-src]: https://badgen.net/github/license/amio/badgen 82 | [license-href]: LICENSE.md 83 | [gradient-badge]: https://github.com/bokub/gradient-badge 84 | -------------------------------------------------------------------------------- /node_modules/badgen/dist/calc-text-width.d.ts: -------------------------------------------------------------------------------- 1 | export declare const Verdana110: ([...text]: Iterable) => number; 2 | -------------------------------------------------------------------------------- /node_modules/badgen/dist/color-presets.d.ts: -------------------------------------------------------------------------------- 1 | declare const _default: { 2 | green: string; 3 | blue: string; 4 | red: string; 5 | yellow: string; 6 | orange: string; 7 | purple: string; 8 | pink: string; 9 | grey: string; 10 | gray: string; 11 | cyan: string; 12 | black: string; 13 | }; 14 | export default _default; 15 | -------------------------------------------------------------------------------- /node_modules/badgen/dist/index.d.ts: -------------------------------------------------------------------------------- 1 | export { Verdana110 as calcWidth } from './calc-text-width'; 2 | declare type StyleOption = 'flat' | 'classic'; 3 | interface BadgenOptions { 4 | status: string; 5 | subject?: string; 6 | color?: string; 7 | label?: string; 8 | labelColor?: string; 9 | style?: StyleOption; 10 | icon?: string; 11 | iconWidth?: number; 12 | scale?: number; 13 | } 14 | export declare function badgen({ label, subject, status, color, style, icon, iconWidth, labelColor, scale }: BadgenOptions): string; 15 | declare global { 16 | interface Window { 17 | badgen: typeof badgen; 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /node_modules/badgen/dist/index.js.map: -------------------------------------------------------------------------------- 1 | "{\"version\":3,\"sources\":[\"/webpack/bootstrap\",\"../src/color-presets.ts\",\"../src/index.ts\",\"../src/calc-text-width.ts\"],\"names\":[\"installedModules\",\"__webpack_require__\",\"moduleId\",\"exports\",\"module\",\"i\",\"l\",\"modules\",\"call\",\"ab\",\"__dirname\",\"startup\",\"default\",\"green\",\"blue\",\"red\",\"yellow\",\"orange\",\"purple\",\"pink\",\"grey\",\"gray\",\"cyan\",\"black\",\"calc_text_width_1\",\"calcWidth\",\"Verdana110\",\"calc_text_width_2\",\"color_presets_1\",\"badgen\",\"label\",\"subject\",\"status\",\"color\",\"style\",\"icon\",\"iconWidth\",\"labelColor\",\"scale\",\"typeAssert\",\"undefined\",\"bare\",\"iconSpanWidth\",\"length\",\"sbTextStart\",\"sbTextWidth\",\"stTextWidth\",\"sbRectWidth\",\"stRectWidth\",\"width\",\"xlink\",\"sanitize\",\"str\",\"replace\",\"assertion\",\"message\",\"TypeError\",\"window\",\"widthsVerdana110\",\"charWidthTable\",\"fallbackWidth\",\"text\",\"total\",\"charWidth\",\"charCodeAt\"],\"mappings\":\"0CACA,IAAAA,EAAA,GAGA,SAAAC,oBAAAC,GAGA,GAAAF,EAAAE,GAAA,CACA,OAAAF,EAAAE,GAAAC,QAGA,IAAAC,EAAAJ,EAAAE,GAAA,CACAG,EAAAH,EACAI,EAAA,MACAH,QAAA,IAIAI,EAAAL,GAAAM,KAAAJ,EAAAD,QAAAC,EAAAA,EAAAD,QAAAF,qBAGAG,EAAAE,EAAA,KAGA,OAAAF,EAAAD,QAIAF,oBAAAQ,GAAAC,UAAA,IAGA,SAAAC,UAEA,OAAAV,oBAAA,KAIA,OAAAU,8FCrCAR,EAAAS,QAAe,CACbC,MAAO,MACPC,KAAM,MACNC,IAAK,MACLC,OAAQ,MACRC,OAAQ,MACRC,OAAQ,MACRC,KAAM,MACNC,KAAM,MACNC,KAAM,MACNC,KAAM,MACNC,MAAO,+2yBCXT,IAAAC,EAAAvB,EAAA,KAASE,EAAAsB,UAAAD,EAAAE,WACT,MAAAC,EAAA1B,EAAA,KACA,MAAA2B,EAAA3B,EAAA,KAgBA,SAAgB4B,QAAQC,MACtBA,EAAKC,QACLA,EAAOC,OACPA,EAAMC,MACNA,EAAQ,OAAMC,MACdA,EAAKC,KACLA,EAAIC,UACJA,EAAY,GAAEC,WACdA,EAAa,MAAKC,MAClBA,EAAQ,IAERC,kBAAkBP,IAAW,SAAU,2BAEvCF,EAAQA,IAAUU,UAAYT,EAAUD,EACxC,IAAKA,IAAUK,EAAM,CACnB,OAAOM,KAAK,CAAET,OAAAA,EAAQC,MAAAA,EAAOC,MAAAA,IAG/BD,EAAQL,EAAAhB,QAAaqB,IAAUA,EAC/BI,EAAaT,EAAAhB,QAAayB,IAAeA,EACzCD,EAAYA,EAAY,GAExB,MAAMM,EAAgBP,EAAQL,EAAMa,OAASP,EAAY,GAAKA,EAAY,GAAM,EAChF,MAAMQ,EAAcT,EAAQO,EAAgB,GAAM,GAClD,MAAMG,EAAclB,EAAAD,WAAUI,GAC9B,MAAMgB,EAAcnB,EAAAD,WAAUM,GAC9B,MAAMe,EAAcF,EAAc,IAAMH,EACxC,MAAMM,EAAcF,EAAc,IAClC,MAAMG,EAAQF,EAAcC,EAC5B,MAAME,EAAQf,EAAO,8CAAgD,GAErEL,EAAQqB,SAASrB,GACjBE,EAASmB,SAASnB,GAElB,GAAIE,IAAU,OAAQ,CACpB,qBAAsBI,EAAQW,EAAQ,eAAeX,EAAQ,oBAAoBW,4CAAgDC,+BAElHb,aAAsBU,uCACtBd,SAAac,aAAuBC,+IAGxCJ,EAAc,2BAA2BC,gCAA0Cf,0BACnFc,0BAAoCC,MAAgBf,0BACpDiB,EAAc,2BAA2BD,gCAA0Cd,0BACnFe,EAAc,2BAA2BD,MAAgBd,uBAEpEG,iCAAsCC,+BAAuCD,OAAY,aAI3F,qBAAsBG,EAAQW,EAAQ,eAAeX,EAAQ,oBAAoBW,4CAAgDC,0MAKrGD,wFAEXF,0BAAoCV,0BACpCW,0BAAoCf,SAAac,0BACjDE,8JAGJL,EAAc,2BAA2BC,iCAA2Cf,0BACpFc,0BAAoCC,MAAgBf,0BACpDiB,EAAc,2BAA2BD,iCAA2Cd,0BACpFe,EAAc,2BAA2BD,MAAgBd,uBAEpEG,iCAAsCC,+BAAuCD,OAAY,aAnE7FhC,EAAA0B,OAAAA,OAuEA,SAASY,MAAMT,OAAEA,EAAMC,MAAEA,EAAKC,MAAEA,IAC9BK,kBAAkBP,IAAW,SAAU,2BACvCC,EAAQL,EAAAhB,QAAaqB,IAAUA,GAASL,EAAAhB,QAAaE,KAErD,MAAMgC,EAAcnB,EAAAD,WAAUM,GAC9B,MAAMgB,EAAcF,EAAc,IAElCd,EAASmB,SAASnB,GAElB,GAAIE,IAAU,OAAQ,CACpB,qBAAsBc,EAAc,gCAAgCA,uEAErDf,mBAAuBe,uKAGHF,gCAA0Cd,kDAC1Cc,MAAgBd,2BAKrD,qBAAsBgB,EAAc,gCAAgCA,kPAKxCA,wFAEXA,0BAAoCf,gCACpCe,sLAGoBF,iCAA2Cd,kDAC3Cc,MAAgBd,2BAKvD,SAASmB,SAAUC,GACjB,OAAOA,EAAIC,QAAQ,UAAW,SAASA,QAAQ,UAAW,QAG5D,SAASd,WAAYe,EAAoBC,GACvC,IAAKD,EAAW,MAAM,IAAIE,UAAUD,GAStC,UAAWE,SAAW,SAAU,CAC9BA,OAAO5B,OAASA,6FC5IlB,MAAM6B,EAAmBzD,EAAQ,KAEjC,MAAMwB,EAAakC,IACjB,MAAMC,EAAgBD,EAAe,IAErC,MAAO,KAAKE,MACV,IAAIC,EAAQ,EACZ,IAAIC,EAAY,EAChB,IAAI1D,EAAIwD,EAAKlB,OACb,MAAOtC,IAAK,CACV0D,EAAYJ,EAAeE,EAAKxD,GAAG2D,cACnCF,GAASC,IAAcvB,UAAYoB,EAAgBG,EAErD,OAAOD,IAIE3D,EAAAuB,WAAaD,EAAUiC\",\"file\":\"index.js\",\"sourcesContent\":[\" \\t// The module cache\\n \\tvar installedModules = {};\\n\\n \\t// The require function\\n \\tfunction __webpack_require__(moduleId) {\\n\\n \\t\\t// Check if module is in cache\\n \\t\\tif(installedModules[moduleId]) {\\n \\t\\t\\treturn installedModules[moduleId].exports;\\n \\t\\t}\\n \\t\\t// Create a new module (and put it into the cache)\\n \\t\\tvar module = installedModules[moduleId] = {\\n \\t\\t\\ti: moduleId,\\n \\t\\t\\tl: false,\\n \\t\\t\\texports: {}\\n \\t\\t};\\n\\n \\t\\t// Execute the module function\\n \\t\\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\\n\\n \\t\\t// Flag the module as loaded\\n \\t\\tmodule.l = true;\\n\\n \\t\\t// Return the exports of the module\\n \\t\\treturn module.exports;\\n \\t}\\n\\n\\n \\t__webpack_require__.ab = __dirname + \\\"/\\\";\\n\\n \\t// the startup function\\n \\tfunction startup() {\\n \\t\\t// Load entry module and return exports\\n \\t\\treturn __webpack_require__(325);\\n \\t};\\n\\n \\t// run startup\\n \\treturn startup();\\n\",\"export default {\\n green: '3C1',\\n blue: '08C',\\n red: 'E43',\\n yellow: 'DB1',\\n orange: 'F73',\\n purple: '94E',\\n pink: 'E5B',\\n grey: '999',\\n gray: '999',\\n cyan: '1BC',\\n black: '2A2A2A'\\n}\\n\",\"export { Verdana110 as calcWidth } from './calc-text-width'\\nimport { Verdana110 as calcWidth } from './calc-text-width'\\nimport colorPresets from './color-presets'\\n\\ntype StyleOption = 'flat' | 'classic'\\n\\ninterface BadgenOptions {\\n status: string;\\n subject?: string;\\n color?: string;\\n label?: string;\\n labelColor?: string\\n style?: StyleOption;\\n icon?: string;\\n iconWidth?: number;\\n scale?: number\\n}\\n\\nexport function badgen ({\\n label,\\n subject,\\n status,\\n color = 'blue',\\n style,\\n icon,\\n iconWidth = 13,\\n labelColor = '555',\\n scale = 1\\n}: BadgenOptions) {\\n typeAssert(typeof status === 'string', ' must be string')\\n\\n label = label === undefined ? subject : label // subject is deprecated\\n if (!label && !icon) {\\n return bare({ status, color, style })\\n }\\n\\n color = colorPresets[color] || color\\n labelColor = colorPresets[labelColor] || labelColor\\n iconWidth = iconWidth * 10\\n\\n const iconSpanWidth = icon ? (label.length ? iconWidth + 30 : iconWidth - 18) : 0\\n const sbTextStart = icon ? (iconSpanWidth + 50) : 50\\n const sbTextWidth = calcWidth(label)\\n const stTextWidth = calcWidth(status)\\n const sbRectWidth = sbTextWidth + 100 + iconSpanWidth\\n const stRectWidth = stTextWidth + 100\\n const width = sbRectWidth + stRectWidth\\n const xlink = icon ? ' xmlns:xlink=\\\"http://www.w3.org/1999/xlink\\\"' : ''\\n\\n label = sanitize(label)\\n status = sanitize(status)\\n\\n if (style === 'flat') {\\n return `\\n \\n \\n \\n \\n \\n ${label}\\n ${label}\\n ${status}\\n ${status}\\n \\n ${icon ? `` : ''}\\n`\\n }\\n\\n return `\\n \\n \\n \\n \\n \\n \\n \\n \\n \\n \\n \\n ${label}\\n ${label}\\n ${status}\\n ${status}\\n \\n ${icon ? `` : ''}\\n`\\n}\\n\\nfunction bare ({ status, color, style }) {\\n typeAssert(typeof status === 'string', ' must be string')\\n color = colorPresets[color] || color || colorPresets.blue\\n\\n const stTextWidth = calcWidth(status)\\n const stRectWidth = stTextWidth + 115\\n\\n status = sanitize(status)\\n\\n if (style === 'flat') {\\n return `\\n \\n \\n \\n \\n ${status}\\n ${status}\\n \\n`\\n }\\n\\n return `\\n \\n \\n \\n \\n \\n \\n \\n \\n \\n \\n ${status}\\n ${status}\\n \\n`\\n}\\n\\nfunction sanitize (str: string): string {\\n return str.replace(/\\\\u0026/g, '&').replace(/\\\\u003C/g, '<')\\n}\\n\\nfunction typeAssert (assertion: boolean, message: string): void {\\n if (!assertion) throw new TypeError(message)\\n}\\n\\ndeclare global {\\n interface Window {\\n badgen: typeof badgen;\\n }\\n}\\n\\nif (typeof window === 'object') {\\n window.badgen = badgen\\n}\\n\",\"// import widthsVerdana110 from './widths-verdana-110.json'\\n// @ts-ignore\\nconst widthsVerdana110 = require('./widths-verdana-110.json')\\n\\nconst calcWidth = (charWidthTable) => {\\n const fallbackWidth = charWidthTable[64] // Width as \\\"@\\\" for overflows\\n\\n return ([...text]) => {\\n let total = 0\\n let charWidth = 0\\n let i = text.length\\n while (i--) {\\n charWidth = charWidthTable[text[i].charCodeAt()]\\n total += charWidth === undefined ? fallbackWidth : charWidth\\n }\\n return total\\n }\\n}\\n\\nexport const Verdana110 = calcWidth(widthsVerdana110)\\n\"]}" -------------------------------------------------------------------------------- /node_modules/badgen/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "_from": "badgen@^3.0.1", 3 | "_id": "badgen@3.0.1", 4 | "_inBundle": false, 5 | "_integrity": "sha512-ANQ8b2/zOvqLUMJ5fLgUCO7xRmOqFx9+ZOta9p3Taudd9c/gHEAh+5Ivnr2zFgj9kguTzXKkEzfI48hDwGWNcA==", 6 | "_location": "/badgen", 7 | "_phantomChildren": {}, 8 | "_requested": { 9 | "type": "range", 10 | "registry": true, 11 | "raw": "badgen@^3.0.1", 12 | "name": "badgen", 13 | "escapedName": "badgen", 14 | "rawSpec": "^3.0.1", 15 | "saveSpec": null, 16 | "fetchSpec": "^3.0.1" 17 | }, 18 | "_requiredBy": [ 19 | "#USER", 20 | "/" 21 | ], 22 | "_resolved": "https://registry.npmjs.org/badgen/-/badgen-3.0.1.tgz", 23 | "_shasum": "1d57d1241c61b0c9c19a502fda71ef0364ccf9c9", 24 | "_spec": "badgen@^3.0.1", 25 | "_where": "C:\\Users\\ShadowMoose\\Documents\\Git\\LoC-Badge", 26 | "author": { 27 | "name": "Amio", 28 | "email": "amio.cn@gmail.com" 29 | }, 30 | "bugs": { 31 | "url": "https://github.com/amio/badgen/issues" 32 | }, 33 | "bundleDependencies": false, 34 | "deprecated": false, 35 | "description": "Fast svg badge generator.", 36 | "devDependencies": { 37 | "@types/node": "^12.7.9", 38 | "@zeit/ncc": "^0.20.5", 39 | "benchmark": "^2.1.4", 40 | "serve-marked": "^2.0.2", 41 | "standard": "^14.3.1", 42 | "tap": "^14.6.9", 43 | "typescript": "^3.7.0-beta" 44 | }, 45 | "homepage": "https://github.com/amio/badgen#readme", 46 | "license": "MIT", 47 | "main": "dist/index.js", 48 | "name": "badgen", 49 | "repository": { 50 | "type": "git", 51 | "url": "git+https://github.com/amio/badgen.git" 52 | }, 53 | "scripts": { 54 | "bench": "node bench/index.js", 55 | "build": "ncc -s -m --no-source-map-register build src/index.ts", 56 | "prebuild": "rm -rf dist", 57 | "prepack": "npm run build", 58 | "pretest": "npm run build", 59 | "preview": "node preview/serve.js", 60 | "snaptests": "TAP_SNAPSHOT=1 npm test", 61 | "test": "tap test/*.spec.ts" 62 | }, 63 | "types": "dist/index.d.ts", 64 | "version": "3.0.1" 65 | } 66 | -------------------------------------------------------------------------------- /node_modules/badgen/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "target": "es2017", 4 | "module": "commonjs", 5 | "lib": ["esnext", "dom"], 6 | 7 | "rootDir": "src", 8 | "outDir": "dist", 9 | 10 | "sourceMap":true, 11 | "declaration": true, 12 | 13 | "resolveJsonModule": true, 14 | "experimentalDecorators": true, 15 | "allowSyntheticDefaultImports": true 16 | }, 17 | "include": ["src"] 18 | } 19 | -------------------------------------------------------------------------------- /node_modules/balanced-match/.npmignore: -------------------------------------------------------------------------------- 1 | test 2 | .gitignore 3 | .travis.yml 4 | Makefile 5 | example.js 6 | -------------------------------------------------------------------------------- /node_modules/balanced-match/LICENSE.md: -------------------------------------------------------------------------------- 1 | (MIT) 2 | 3 | Copyright (c) 2013 Julian Gruber <julian@juliangruber.com> 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy of 6 | this software and associated documentation files (the "Software"), to deal in 7 | the Software without restriction, including without limitation the rights to 8 | use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies 9 | of the Software, and to permit persons to whom the Software is furnished to do 10 | so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /node_modules/balanced-match/README.md: -------------------------------------------------------------------------------- 1 | # balanced-match 2 | 3 | Match balanced string pairs, like `{` and `}` or `` and ``. Supports regular expressions as well! 4 | 5 | [![build status](https://secure.travis-ci.org/juliangruber/balanced-match.svg)](http://travis-ci.org/juliangruber/balanced-match) 6 | [![downloads](https://img.shields.io/npm/dm/balanced-match.svg)](https://www.npmjs.org/package/balanced-match) 7 | 8 | [![testling badge](https://ci.testling.com/juliangruber/balanced-match.png)](https://ci.testling.com/juliangruber/balanced-match) 9 | 10 | ## Example 11 | 12 | Get the first matching pair of braces: 13 | 14 | ```js 15 | var balanced = require('balanced-match'); 16 | 17 | console.log(balanced('{', '}', 'pre{in{nested}}post')); 18 | console.log(balanced('{', '}', 'pre{first}between{second}post')); 19 | console.log(balanced(/\s+\{\s+/, /\s+\}\s+/, 'pre { in{nest} } post')); 20 | ``` 21 | 22 | The matches are: 23 | 24 | ```bash 25 | $ node example.js 26 | { start: 3, end: 14, pre: 'pre', body: 'in{nested}', post: 'post' } 27 | { start: 3, 28 | end: 9, 29 | pre: 'pre', 30 | body: 'first', 31 | post: 'between{second}post' } 32 | { start: 3, end: 17, pre: 'pre', body: 'in{nest}', post: 'post' } 33 | ``` 34 | 35 | ## API 36 | 37 | ### var m = balanced(a, b, str) 38 | 39 | For the first non-nested matching pair of `a` and `b` in `str`, return an 40 | object with those keys: 41 | 42 | * **start** the index of the first match of `a` 43 | * **end** the index of the matching `b` 44 | * **pre** the preamble, `a` and `b` not included 45 | * **body** the match, `a` and `b` not included 46 | * **post** the postscript, `a` and `b` not included 47 | 48 | If there's no match, `undefined` will be returned. 49 | 50 | If the `str` contains more `a` than `b` / there are unmatched pairs, the first match that was closed will be used. For example, `{{a}` will match `['{', 'a', '']` and `{a}}` will match `['', 'a', '}']`. 51 | 52 | ### var r = balanced.range(a, b, str) 53 | 54 | For the first non-nested matching pair of `a` and `b` in `str`, return an 55 | array with indexes: `[ , ]`. 56 | 57 | If there's no match, `undefined` will be returned. 58 | 59 | If the `str` contains more `a` than `b` / there are unmatched pairs, the first match that was closed will be used. For example, `{{a}` will match `[ 1, 3 ]` and `{a}}` will match `[0, 2]`. 60 | 61 | ## Installation 62 | 63 | With [npm](https://npmjs.org) do: 64 | 65 | ```bash 66 | npm install balanced-match 67 | ``` 68 | 69 | ## License 70 | 71 | (MIT) 72 | 73 | Copyright (c) 2013 Julian Gruber <julian@juliangruber.com> 74 | 75 | Permission is hereby granted, free of charge, to any person obtaining a copy of 76 | this software and associated documentation files (the "Software"), to deal in 77 | the Software without restriction, including without limitation the rights to 78 | use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies 79 | of the Software, and to permit persons to whom the Software is furnished to do 80 | so, subject to the following conditions: 81 | 82 | The above copyright notice and this permission notice shall be included in all 83 | copies or substantial portions of the Software. 84 | 85 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 86 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 87 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 88 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 89 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 90 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 91 | SOFTWARE. 92 | -------------------------------------------------------------------------------- /node_modules/balanced-match/index.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | module.exports = balanced; 3 | function balanced(a, b, str) { 4 | if (a instanceof RegExp) a = maybeMatch(a, str); 5 | if (b instanceof RegExp) b = maybeMatch(b, str); 6 | 7 | var r = range(a, b, str); 8 | 9 | return r && { 10 | start: r[0], 11 | end: r[1], 12 | pre: str.slice(0, r[0]), 13 | body: str.slice(r[0] + a.length, r[1]), 14 | post: str.slice(r[1] + b.length) 15 | }; 16 | } 17 | 18 | function maybeMatch(reg, str) { 19 | var m = str.match(reg); 20 | return m ? m[0] : null; 21 | } 22 | 23 | balanced.range = range; 24 | function range(a, b, str) { 25 | var begs, beg, left, right, result; 26 | var ai = str.indexOf(a); 27 | var bi = str.indexOf(b, ai + 1); 28 | var i = ai; 29 | 30 | if (ai >= 0 && bi > 0) { 31 | begs = []; 32 | left = str.length; 33 | 34 | while (i >= 0 && !result) { 35 | if (i == ai) { 36 | begs.push(i); 37 | ai = str.indexOf(a, i + 1); 38 | } else if (begs.length == 1) { 39 | result = [ begs.pop(), bi ]; 40 | } else { 41 | beg = begs.pop(); 42 | if (beg < left) { 43 | left = beg; 44 | right = bi; 45 | } 46 | 47 | bi = str.indexOf(b, i + 1); 48 | } 49 | 50 | i = ai < bi && ai >= 0 ? ai : bi; 51 | } 52 | 53 | if (begs.length) { 54 | result = [ left, right ]; 55 | } 56 | } 57 | 58 | return result; 59 | } 60 | -------------------------------------------------------------------------------- /node_modules/balanced-match/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "_from": "balanced-match@^1.0.0", 3 | "_id": "balanced-match@1.0.0", 4 | "_inBundle": false, 5 | "_integrity": "sha1-ibTRmasr7kneFk6gK4nORi1xt2c=", 6 | "_location": "/balanced-match", 7 | "_phantomChildren": {}, 8 | "_requested": { 9 | "type": "range", 10 | "registry": true, 11 | "raw": "balanced-match@^1.0.0", 12 | "name": "balanced-match", 13 | "escapedName": "balanced-match", 14 | "rawSpec": "^1.0.0", 15 | "saveSpec": null, 16 | "fetchSpec": "^1.0.0" 17 | }, 18 | "_requiredBy": [ 19 | "/brace-expansion" 20 | ], 21 | "_resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.0.tgz", 22 | "_shasum": "89b4d199ab2bee49de164ea02b89ce462d71b767", 23 | "_spec": "balanced-match@^1.0.0", 24 | "_where": "C:\\Users\\ShadowMoose\\Documents\\Git\\LoC-Badge\\node_modules\\brace-expansion", 25 | "author": { 26 | "name": "Julian Gruber", 27 | "email": "mail@juliangruber.com", 28 | "url": "http://juliangruber.com" 29 | }, 30 | "bugs": { 31 | "url": "https://github.com/juliangruber/balanced-match/issues" 32 | }, 33 | "bundleDependencies": false, 34 | "dependencies": {}, 35 | "deprecated": false, 36 | "description": "Match balanced character pairs, like \"{\" and \"}\"", 37 | "devDependencies": { 38 | "matcha": "^0.7.0", 39 | "tape": "^4.6.0" 40 | }, 41 | "homepage": "https://github.com/juliangruber/balanced-match", 42 | "keywords": [ 43 | "match", 44 | "regexp", 45 | "test", 46 | "balanced", 47 | "parse" 48 | ], 49 | "license": "MIT", 50 | "main": "index.js", 51 | "name": "balanced-match", 52 | "repository": { 53 | "type": "git", 54 | "url": "git://github.com/juliangruber/balanced-match.git" 55 | }, 56 | "scripts": { 57 | "bench": "make bench", 58 | "test": "make test" 59 | }, 60 | "testling": { 61 | "files": "test/*.js", 62 | "browsers": [ 63 | "ie/8..latest", 64 | "firefox/20..latest", 65 | "firefox/nightly", 66 | "chrome/25..latest", 67 | "chrome/canary", 68 | "opera/12..latest", 69 | "opera/next", 70 | "safari/5.1..latest", 71 | "ipad/6.0..latest", 72 | "iphone/6.0..latest", 73 | "android-browser/4.2..latest" 74 | ] 75 | }, 76 | "version": "1.0.0" 77 | } 78 | -------------------------------------------------------------------------------- /node_modules/brace-expansion/LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2013 Julian Gruber 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /node_modules/brace-expansion/README.md: -------------------------------------------------------------------------------- 1 | # brace-expansion 2 | 3 | [Brace expansion](https://www.gnu.org/software/bash/manual/html_node/Brace-Expansion.html), 4 | as known from sh/bash, in JavaScript. 5 | 6 | [![build status](https://secure.travis-ci.org/juliangruber/brace-expansion.svg)](http://travis-ci.org/juliangruber/brace-expansion) 7 | [![downloads](https://img.shields.io/npm/dm/brace-expansion.svg)](https://www.npmjs.org/package/brace-expansion) 8 | [![Greenkeeper badge](https://badges.greenkeeper.io/juliangruber/brace-expansion.svg)](https://greenkeeper.io/) 9 | 10 | [![testling badge](https://ci.testling.com/juliangruber/brace-expansion.png)](https://ci.testling.com/juliangruber/brace-expansion) 11 | 12 | ## Example 13 | 14 | ```js 15 | var expand = require('brace-expansion'); 16 | 17 | expand('file-{a,b,c}.jpg') 18 | // => ['file-a.jpg', 'file-b.jpg', 'file-c.jpg'] 19 | 20 | expand('-v{,,}') 21 | // => ['-v', '-v', '-v'] 22 | 23 | expand('file{0..2}.jpg') 24 | // => ['file0.jpg', 'file1.jpg', 'file2.jpg'] 25 | 26 | expand('file-{a..c}.jpg') 27 | // => ['file-a.jpg', 'file-b.jpg', 'file-c.jpg'] 28 | 29 | expand('file{2..0}.jpg') 30 | // => ['file2.jpg', 'file1.jpg', 'file0.jpg'] 31 | 32 | expand('file{0..4..2}.jpg') 33 | // => ['file0.jpg', 'file2.jpg', 'file4.jpg'] 34 | 35 | expand('file-{a..e..2}.jpg') 36 | // => ['file-a.jpg', 'file-c.jpg', 'file-e.jpg'] 37 | 38 | expand('file{00..10..5}.jpg') 39 | // => ['file00.jpg', 'file05.jpg', 'file10.jpg'] 40 | 41 | expand('{{A..C},{a..c}}') 42 | // => ['A', 'B', 'C', 'a', 'b', 'c'] 43 | 44 | expand('ppp{,config,oe{,conf}}') 45 | // => ['ppp', 'pppconfig', 'pppoe', 'pppoeconf'] 46 | ``` 47 | 48 | ## API 49 | 50 | ```js 51 | var expand = require('brace-expansion'); 52 | ``` 53 | 54 | ### var expanded = expand(str) 55 | 56 | Return an array of all possible and valid expansions of `str`. If none are 57 | found, `[str]` is returned. 58 | 59 | Valid expansions are: 60 | 61 | ```js 62 | /^(.*,)+(.+)?$/ 63 | // {a,b,...} 64 | ``` 65 | 66 | A comma separated list of options, like `{a,b}` or `{a,{b,c}}` or `{,a,}`. 67 | 68 | ```js 69 | /^-?\d+\.\.-?\d+(\.\.-?\d+)?$/ 70 | // {x..y[..incr]} 71 | ``` 72 | 73 | A numeric sequence from `x` to `y` inclusive, with optional increment. 74 | If `x` or `y` start with a leading `0`, all the numbers will be padded 75 | to have equal length. Negative numbers and backwards iteration work too. 76 | 77 | ```js 78 | /^-?\d+\.\.-?\d+(\.\.-?\d+)?$/ 79 | // {x..y[..incr]} 80 | ``` 81 | 82 | An alphabetic sequence from `x` to `y` inclusive, with optional increment. 83 | `x` and `y` must be exactly one character, and if given, `incr` must be a 84 | number. 85 | 86 | For compatibility reasons, the string `${` is not eligible for brace expansion. 87 | 88 | ## Installation 89 | 90 | With [npm](https://npmjs.org) do: 91 | 92 | ```bash 93 | npm install brace-expansion 94 | ``` 95 | 96 | ## Contributors 97 | 98 | - [Julian Gruber](https://github.com/juliangruber) 99 | - [Isaac Z. Schlueter](https://github.com/isaacs) 100 | 101 | ## Sponsors 102 | 103 | This module is proudly supported by my [Sponsors](https://github.com/juliangruber/sponsors)! 104 | 105 | Do you want to support modules like this to improve their quality, stability and weigh in on new features? Then please consider donating to my [Patreon](https://www.patreon.com/juliangruber). Not sure how much of my modules you're using? Try [feross/thanks](https://github.com/feross/thanks)! 106 | 107 | ## License 108 | 109 | (MIT) 110 | 111 | Copyright (c) 2013 Julian Gruber <julian@juliangruber.com> 112 | 113 | Permission is hereby granted, free of charge, to any person obtaining a copy of 114 | this software and associated documentation files (the "Software"), to deal in 115 | the Software without restriction, including without limitation the rights to 116 | use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies 117 | of the Software, and to permit persons to whom the Software is furnished to do 118 | so, subject to the following conditions: 119 | 120 | The above copyright notice and this permission notice shall be included in all 121 | copies or substantial portions of the Software. 122 | 123 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 124 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 125 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 126 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 127 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 128 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 129 | SOFTWARE. 130 | -------------------------------------------------------------------------------- /node_modules/brace-expansion/index.js: -------------------------------------------------------------------------------- 1 | var concatMap = require('concat-map'); 2 | var balanced = require('balanced-match'); 3 | 4 | module.exports = expandTop; 5 | 6 | var escSlash = '\0SLASH'+Math.random()+'\0'; 7 | var escOpen = '\0OPEN'+Math.random()+'\0'; 8 | var escClose = '\0CLOSE'+Math.random()+'\0'; 9 | var escComma = '\0COMMA'+Math.random()+'\0'; 10 | var escPeriod = '\0PERIOD'+Math.random()+'\0'; 11 | 12 | function numeric(str) { 13 | return parseInt(str, 10) == str 14 | ? parseInt(str, 10) 15 | : str.charCodeAt(0); 16 | } 17 | 18 | function escapeBraces(str) { 19 | return str.split('\\\\').join(escSlash) 20 | .split('\\{').join(escOpen) 21 | .split('\\}').join(escClose) 22 | .split('\\,').join(escComma) 23 | .split('\\.').join(escPeriod); 24 | } 25 | 26 | function unescapeBraces(str) { 27 | return str.split(escSlash).join('\\') 28 | .split(escOpen).join('{') 29 | .split(escClose).join('}') 30 | .split(escComma).join(',') 31 | .split(escPeriod).join('.'); 32 | } 33 | 34 | 35 | // Basically just str.split(","), but handling cases 36 | // where we have nested braced sections, which should be 37 | // treated as individual members, like {a,{b,c},d} 38 | function parseCommaParts(str) { 39 | if (!str) 40 | return ['']; 41 | 42 | var parts = []; 43 | var m = balanced('{', '}', str); 44 | 45 | if (!m) 46 | return str.split(','); 47 | 48 | var pre = m.pre; 49 | var body = m.body; 50 | var post = m.post; 51 | var p = pre.split(','); 52 | 53 | p[p.length-1] += '{' + body + '}'; 54 | var postParts = parseCommaParts(post); 55 | if (post.length) { 56 | p[p.length-1] += postParts.shift(); 57 | p.push.apply(p, postParts); 58 | } 59 | 60 | parts.push.apply(parts, p); 61 | 62 | return parts; 63 | } 64 | 65 | function expandTop(str) { 66 | if (!str) 67 | return []; 68 | 69 | // I don't know why Bash 4.3 does this, but it does. 70 | // Anything starting with {} will have the first two bytes preserved 71 | // but *only* at the top level, so {},a}b will not expand to anything, 72 | // but a{},b}c will be expanded to [a}c,abc]. 73 | // One could argue that this is a bug in Bash, but since the goal of 74 | // this module is to match Bash's rules, we escape a leading {} 75 | if (str.substr(0, 2) === '{}') { 76 | str = '\\{\\}' + str.substr(2); 77 | } 78 | 79 | return expand(escapeBraces(str), true).map(unescapeBraces); 80 | } 81 | 82 | function identity(e) { 83 | return e; 84 | } 85 | 86 | function embrace(str) { 87 | return '{' + str + '}'; 88 | } 89 | function isPadded(el) { 90 | return /^-?0\d/.test(el); 91 | } 92 | 93 | function lte(i, y) { 94 | return i <= y; 95 | } 96 | function gte(i, y) { 97 | return i >= y; 98 | } 99 | 100 | function expand(str, isTop) { 101 | var expansions = []; 102 | 103 | var m = balanced('{', '}', str); 104 | if (!m || /\$$/.test(m.pre)) return [str]; 105 | 106 | var isNumericSequence = /^-?\d+\.\.-?\d+(?:\.\.-?\d+)?$/.test(m.body); 107 | var isAlphaSequence = /^[a-zA-Z]\.\.[a-zA-Z](?:\.\.-?\d+)?$/.test(m.body); 108 | var isSequence = isNumericSequence || isAlphaSequence; 109 | var isOptions = m.body.indexOf(',') >= 0; 110 | if (!isSequence && !isOptions) { 111 | // {a},b} 112 | if (m.post.match(/,.*\}/)) { 113 | str = m.pre + '{' + m.body + escClose + m.post; 114 | return expand(str); 115 | } 116 | return [str]; 117 | } 118 | 119 | var n; 120 | if (isSequence) { 121 | n = m.body.split(/\.\./); 122 | } else { 123 | n = parseCommaParts(m.body); 124 | if (n.length === 1) { 125 | // x{{a,b}}y ==> x{a}y x{b}y 126 | n = expand(n[0], false).map(embrace); 127 | if (n.length === 1) { 128 | var post = m.post.length 129 | ? expand(m.post, false) 130 | : ['']; 131 | return post.map(function(p) { 132 | return m.pre + n[0] + p; 133 | }); 134 | } 135 | } 136 | } 137 | 138 | // at this point, n is the parts, and we know it's not a comma set 139 | // with a single entry. 140 | 141 | // no need to expand pre, since it is guaranteed to be free of brace-sets 142 | var pre = m.pre; 143 | var post = m.post.length 144 | ? expand(m.post, false) 145 | : ['']; 146 | 147 | var N; 148 | 149 | if (isSequence) { 150 | var x = numeric(n[0]); 151 | var y = numeric(n[1]); 152 | var width = Math.max(n[0].length, n[1].length) 153 | var incr = n.length == 3 154 | ? Math.abs(numeric(n[2])) 155 | : 1; 156 | var test = lte; 157 | var reverse = y < x; 158 | if (reverse) { 159 | incr *= -1; 160 | test = gte; 161 | } 162 | var pad = n.some(isPadded); 163 | 164 | N = []; 165 | 166 | for (var i = x; test(i, y); i += incr) { 167 | var c; 168 | if (isAlphaSequence) { 169 | c = String.fromCharCode(i); 170 | if (c === '\\') 171 | c = ''; 172 | } else { 173 | c = String(i); 174 | if (pad) { 175 | var need = width - c.length; 176 | if (need > 0) { 177 | var z = new Array(need + 1).join('0'); 178 | if (i < 0) 179 | c = '-' + z + c.slice(1); 180 | else 181 | c = z + c; 182 | } 183 | } 184 | } 185 | N.push(c); 186 | } 187 | } else { 188 | N = concatMap(n, function(el) { return expand(el, false) }); 189 | } 190 | 191 | for (var j = 0; j < N.length; j++) { 192 | for (var k = 0; k < post.length; k++) { 193 | var expansion = pre + N[j] + post[k]; 194 | if (!isTop || isSequence || expansion) 195 | expansions.push(expansion); 196 | } 197 | } 198 | 199 | return expansions; 200 | } 201 | 202 | -------------------------------------------------------------------------------- /node_modules/brace-expansion/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "_from": "brace-expansion@^1.1.7", 3 | "_id": "brace-expansion@1.1.11", 4 | "_inBundle": false, 5 | "_integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", 6 | "_location": "/brace-expansion", 7 | "_phantomChildren": {}, 8 | "_requested": { 9 | "type": "range", 10 | "registry": true, 11 | "raw": "brace-expansion@^1.1.7", 12 | "name": "brace-expansion", 13 | "escapedName": "brace-expansion", 14 | "rawSpec": "^1.1.7", 15 | "saveSpec": null, 16 | "fetchSpec": "^1.1.7" 17 | }, 18 | "_requiredBy": [ 19 | "/minimatch" 20 | ], 21 | "_resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", 22 | "_shasum": "3c7fcbf529d87226f3d2f52b966ff5271eb441dd", 23 | "_spec": "brace-expansion@^1.1.7", 24 | "_where": "C:\\Users\\ShadowMoose\\Documents\\Git\\LoC-Badge\\node_modules\\minimatch", 25 | "author": { 26 | "name": "Julian Gruber", 27 | "email": "mail@juliangruber.com", 28 | "url": "http://juliangruber.com" 29 | }, 30 | "bugs": { 31 | "url": "https://github.com/juliangruber/brace-expansion/issues" 32 | }, 33 | "bundleDependencies": false, 34 | "dependencies": { 35 | "balanced-match": "^1.0.0", 36 | "concat-map": "0.0.1" 37 | }, 38 | "deprecated": false, 39 | "description": "Brace expansion as known from sh/bash", 40 | "devDependencies": { 41 | "matcha": "^0.7.0", 42 | "tape": "^4.6.0" 43 | }, 44 | "homepage": "https://github.com/juliangruber/brace-expansion", 45 | "keywords": [], 46 | "license": "MIT", 47 | "main": "index.js", 48 | "name": "brace-expansion", 49 | "repository": { 50 | "type": "git", 51 | "url": "git://github.com/juliangruber/brace-expansion.git" 52 | }, 53 | "scripts": { 54 | "bench": "matcha test/perf/bench.js", 55 | "gentest": "bash test/generate.sh", 56 | "test": "tape test/*.js" 57 | }, 58 | "testling": { 59 | "files": "test/*.js", 60 | "browsers": [ 61 | "ie/8..latest", 62 | "firefox/20..latest", 63 | "firefox/nightly", 64 | "chrome/25..latest", 65 | "chrome/canary", 66 | "opera/12..latest", 67 | "opera/next", 68 | "safari/5.1..latest", 69 | "ipad/6.0..latest", 70 | "iphone/6.0..latest", 71 | "android-browser/4.2..latest" 72 | ] 73 | }, 74 | "version": "1.1.11" 75 | } 76 | -------------------------------------------------------------------------------- /node_modules/concat-map/.travis.yml: -------------------------------------------------------------------------------- 1 | language: node_js 2 | node_js: 3 | - 0.4 4 | - 0.6 5 | -------------------------------------------------------------------------------- /node_modules/concat-map/LICENSE: -------------------------------------------------------------------------------- 1 | This software is released under the MIT license: 2 | 3 | Permission is hereby granted, free of charge, to any person obtaining a copy of 4 | this software and associated documentation files (the "Software"), to deal in 5 | the Software without restriction, including without limitation the rights to 6 | use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of 7 | the Software, and to permit persons to whom the Software is furnished to do so, 8 | subject to the following conditions: 9 | 10 | The above copyright notice and this permission notice shall be included in all 11 | copies or substantial portions of the Software. 12 | 13 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS 15 | FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 16 | COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER 17 | IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 18 | CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 19 | -------------------------------------------------------------------------------- /node_modules/concat-map/README.markdown: -------------------------------------------------------------------------------- 1 | concat-map 2 | ========== 3 | 4 | Concatenative mapdashery. 5 | 6 | [![browser support](http://ci.testling.com/substack/node-concat-map.png)](http://ci.testling.com/substack/node-concat-map) 7 | 8 | [![build status](https://secure.travis-ci.org/substack/node-concat-map.png)](http://travis-ci.org/substack/node-concat-map) 9 | 10 | example 11 | ======= 12 | 13 | ``` js 14 | var concatMap = require('concat-map'); 15 | var xs = [ 1, 2, 3, 4, 5, 6 ]; 16 | var ys = concatMap(xs, function (x) { 17 | return x % 2 ? [ x - 0.1, x, x + 0.1 ] : []; 18 | }); 19 | console.dir(ys); 20 | ``` 21 | 22 | *** 23 | 24 | ``` 25 | [ 0.9, 1, 1.1, 2.9, 3, 3.1, 4.9, 5, 5.1 ] 26 | ``` 27 | 28 | methods 29 | ======= 30 | 31 | ``` js 32 | var concatMap = require('concat-map') 33 | ``` 34 | 35 | concatMap(xs, fn) 36 | ----------------- 37 | 38 | Return an array of concatenated elements by calling `fn(x, i)` for each element 39 | `x` and each index `i` in the array `xs`. 40 | 41 | When `fn(x, i)` returns an array, its result will be concatenated with the 42 | result array. If `fn(x, i)` returns anything else, that value will be pushed 43 | onto the end of the result array. 44 | 45 | install 46 | ======= 47 | 48 | With [npm](http://npmjs.org) do: 49 | 50 | ``` 51 | npm install concat-map 52 | ``` 53 | 54 | license 55 | ======= 56 | 57 | MIT 58 | 59 | notes 60 | ===== 61 | 62 | This module was written while sitting high above the ground in a tree. 63 | -------------------------------------------------------------------------------- /node_modules/concat-map/example/map.js: -------------------------------------------------------------------------------- 1 | var concatMap = require('../'); 2 | var xs = [ 1, 2, 3, 4, 5, 6 ]; 3 | var ys = concatMap(xs, function (x) { 4 | return x % 2 ? [ x - 0.1, x, x + 0.1 ] : []; 5 | }); 6 | console.dir(ys); 7 | -------------------------------------------------------------------------------- /node_modules/concat-map/index.js: -------------------------------------------------------------------------------- 1 | module.exports = function (xs, fn) { 2 | var res = []; 3 | for (var i = 0; i < xs.length; i++) { 4 | var x = fn(xs[i], i); 5 | if (isArray(x)) res.push.apply(res, x); 6 | else res.push(x); 7 | } 8 | return res; 9 | }; 10 | 11 | var isArray = Array.isArray || function (xs) { 12 | return Object.prototype.toString.call(xs) === '[object Array]'; 13 | }; 14 | -------------------------------------------------------------------------------- /node_modules/concat-map/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "_from": "concat-map@0.0.1", 3 | "_id": "concat-map@0.0.1", 4 | "_inBundle": false, 5 | "_integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=", 6 | "_location": "/concat-map", 7 | "_phantomChildren": {}, 8 | "_requested": { 9 | "type": "version", 10 | "registry": true, 11 | "raw": "concat-map@0.0.1", 12 | "name": "concat-map", 13 | "escapedName": "concat-map", 14 | "rawSpec": "0.0.1", 15 | "saveSpec": null, 16 | "fetchSpec": "0.0.1" 17 | }, 18 | "_requiredBy": [ 19 | "/brace-expansion" 20 | ], 21 | "_resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", 22 | "_shasum": "d8a96bd77fd68df7793a73036a3ba0d5405d477b", 23 | "_spec": "concat-map@0.0.1", 24 | "_where": "C:\\Users\\ShadowMoose\\Documents\\Git\\LoC-Badge\\node_modules\\brace-expansion", 25 | "author": { 26 | "name": "James Halliday", 27 | "email": "mail@substack.net", 28 | "url": "http://substack.net" 29 | }, 30 | "bugs": { 31 | "url": "https://github.com/substack/node-concat-map/issues" 32 | }, 33 | "bundleDependencies": false, 34 | "deprecated": false, 35 | "description": "concatenative mapdashery", 36 | "devDependencies": { 37 | "tape": "~2.4.0" 38 | }, 39 | "directories": { 40 | "example": "example", 41 | "test": "test" 42 | }, 43 | "homepage": "https://github.com/substack/node-concat-map#readme", 44 | "keywords": [ 45 | "concat", 46 | "concatMap", 47 | "map", 48 | "functional", 49 | "higher-order" 50 | ], 51 | "license": "MIT", 52 | "main": "index.js", 53 | "name": "concat-map", 54 | "repository": { 55 | "type": "git", 56 | "url": "git://github.com/substack/node-concat-map.git" 57 | }, 58 | "scripts": { 59 | "test": "tape test/*.js" 60 | }, 61 | "testling": { 62 | "files": "test/*.js", 63 | "browsers": { 64 | "ie": [ 65 | 6, 66 | 7, 67 | 8, 68 | 9 69 | ], 70 | "ff": [ 71 | 3.5, 72 | 10, 73 | 15 74 | ], 75 | "chrome": [ 76 | 10, 77 | 22 78 | ], 79 | "safari": [ 80 | 5.1 81 | ], 82 | "opera": [ 83 | 12 84 | ] 85 | } 86 | }, 87 | "version": "0.0.1" 88 | } 89 | -------------------------------------------------------------------------------- /node_modules/concat-map/test/map.js: -------------------------------------------------------------------------------- 1 | var concatMap = require('../'); 2 | var test = require('tape'); 3 | 4 | test('empty or not', function (t) { 5 | var xs = [ 1, 2, 3, 4, 5, 6 ]; 6 | var ixes = []; 7 | var ys = concatMap(xs, function (x, ix) { 8 | ixes.push(ix); 9 | return x % 2 ? [ x - 0.1, x, x + 0.1 ] : []; 10 | }); 11 | t.same(ys, [ 0.9, 1, 1.1, 2.9, 3, 3.1, 4.9, 5, 5.1 ]); 12 | t.same(ixes, [ 0, 1, 2, 3, 4, 5 ]); 13 | t.end(); 14 | }); 15 | 16 | test('always something', function (t) { 17 | var xs = [ 'a', 'b', 'c', 'd' ]; 18 | var ys = concatMap(xs, function (x) { 19 | return x === 'b' ? [ 'B', 'B', 'B' ] : [ x ]; 20 | }); 21 | t.same(ys, [ 'a', 'B', 'B', 'B', 'c', 'd' ]); 22 | t.end(); 23 | }); 24 | 25 | test('scalars', function (t) { 26 | var xs = [ 'a', 'b', 'c', 'd' ]; 27 | var ys = concatMap(xs, function (x) { 28 | return x === 'b' ? [ 'B', 'B', 'B' ] : x; 29 | }); 30 | t.same(ys, [ 'a', 'B', 'B', 'B', 'c', 'd' ]); 31 | t.end(); 32 | }); 33 | 34 | test('undefs', function (t) { 35 | var xs = [ 'a', 'b', 'c', 'd' ]; 36 | var ys = concatMap(xs, function () {}); 37 | t.same(ys, [ undefined, undefined, undefined, undefined ]); 38 | t.end(); 39 | }); 40 | -------------------------------------------------------------------------------- /node_modules/fs.realpath/LICENSE: -------------------------------------------------------------------------------- 1 | The ISC License 2 | 3 | Copyright (c) Isaac Z. Schlueter and Contributors 4 | 5 | Permission to use, copy, modify, and/or distribute this software for any 6 | purpose with or without fee is hereby granted, provided that the above 7 | copyright notice and this permission notice appear in all copies. 8 | 9 | THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES 10 | WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF 11 | MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR 12 | ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES 13 | WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN 14 | ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR 15 | IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 16 | 17 | ---- 18 | 19 | This library bundles a version of the `fs.realpath` and `fs.realpathSync` 20 | methods from Node.js v0.10 under the terms of the Node.js MIT license. 21 | 22 | Node's license follows, also included at the header of `old.js` which contains 23 | the licensed code: 24 | 25 | Copyright Joyent, Inc. and other Node contributors. 26 | 27 | Permission is hereby granted, free of charge, to any person obtaining a 28 | copy of this software and associated documentation files (the "Software"), 29 | to deal in the Software without restriction, including without limitation 30 | the rights to use, copy, modify, merge, publish, distribute, sublicense, 31 | and/or sell copies of the Software, and to permit persons to whom the 32 | Software is furnished to do so, subject to the following conditions: 33 | 34 | The above copyright notice and this permission notice shall be included in 35 | all copies or substantial portions of the Software. 36 | 37 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 38 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 39 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 40 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 41 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 42 | FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 43 | DEALINGS IN THE SOFTWARE. 44 | -------------------------------------------------------------------------------- /node_modules/fs.realpath/README.md: -------------------------------------------------------------------------------- 1 | # fs.realpath 2 | 3 | A backwards-compatible fs.realpath for Node v6 and above 4 | 5 | In Node v6, the JavaScript implementation of fs.realpath was replaced 6 | with a faster (but less resilient) native implementation. That raises 7 | new and platform-specific errors and cannot handle long or excessively 8 | symlink-looping paths. 9 | 10 | This module handles those cases by detecting the new errors and 11 | falling back to the JavaScript implementation. On versions of Node 12 | prior to v6, it has no effect. 13 | 14 | ## USAGE 15 | 16 | ```js 17 | var rp = require('fs.realpath') 18 | 19 | // async version 20 | rp.realpath(someLongAndLoopingPath, function (er, real) { 21 | // the ELOOP was handled, but it was a bit slower 22 | }) 23 | 24 | // sync version 25 | var real = rp.realpathSync(someLongAndLoopingPath) 26 | 27 | // monkeypatch at your own risk! 28 | // This replaces the fs.realpath/fs.realpathSync builtins 29 | rp.monkeypatch() 30 | 31 | // un-do the monkeypatching 32 | rp.unmonkeypatch() 33 | ``` 34 | -------------------------------------------------------------------------------- /node_modules/fs.realpath/index.js: -------------------------------------------------------------------------------- 1 | module.exports = realpath 2 | realpath.realpath = realpath 3 | realpath.sync = realpathSync 4 | realpath.realpathSync = realpathSync 5 | realpath.monkeypatch = monkeypatch 6 | realpath.unmonkeypatch = unmonkeypatch 7 | 8 | var fs = require('fs') 9 | var origRealpath = fs.realpath 10 | var origRealpathSync = fs.realpathSync 11 | 12 | var version = process.version 13 | var ok = /^v[0-5]\./.test(version) 14 | var old = require('./old.js') 15 | 16 | function newError (er) { 17 | return er && er.syscall === 'realpath' && ( 18 | er.code === 'ELOOP' || 19 | er.code === 'ENOMEM' || 20 | er.code === 'ENAMETOOLONG' 21 | ) 22 | } 23 | 24 | function realpath (p, cache, cb) { 25 | if (ok) { 26 | return origRealpath(p, cache, cb) 27 | } 28 | 29 | if (typeof cache === 'function') { 30 | cb = cache 31 | cache = null 32 | } 33 | origRealpath(p, cache, function (er, result) { 34 | if (newError(er)) { 35 | old.realpath(p, cache, cb) 36 | } else { 37 | cb(er, result) 38 | } 39 | }) 40 | } 41 | 42 | function realpathSync (p, cache) { 43 | if (ok) { 44 | return origRealpathSync(p, cache) 45 | } 46 | 47 | try { 48 | return origRealpathSync(p, cache) 49 | } catch (er) { 50 | if (newError(er)) { 51 | return old.realpathSync(p, cache) 52 | } else { 53 | throw er 54 | } 55 | } 56 | } 57 | 58 | function monkeypatch () { 59 | fs.realpath = realpath 60 | fs.realpathSync = realpathSync 61 | } 62 | 63 | function unmonkeypatch () { 64 | fs.realpath = origRealpath 65 | fs.realpathSync = origRealpathSync 66 | } 67 | -------------------------------------------------------------------------------- /node_modules/fs.realpath/old.js: -------------------------------------------------------------------------------- 1 | // Copyright Joyent, Inc. and other Node contributors. 2 | // 3 | // Permission is hereby granted, free of charge, to any person obtaining a 4 | // copy of this software and associated documentation files (the 5 | // "Software"), to deal in the Software without restriction, including 6 | // without limitation the rights to use, copy, modify, merge, publish, 7 | // distribute, sublicense, and/or sell copies of the Software, and to permit 8 | // persons to whom the Software is furnished to do so, subject to the 9 | // following conditions: 10 | // 11 | // The above copyright notice and this permission notice shall be included 12 | // in all copies or substantial portions of the Software. 13 | // 14 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS 15 | // OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 16 | // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN 17 | // NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, 18 | // DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR 19 | // OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE 20 | // USE OR OTHER DEALINGS IN THE SOFTWARE. 21 | 22 | var pathModule = require('path'); 23 | var isWindows = process.platform === 'win32'; 24 | var fs = require('fs'); 25 | 26 | // JavaScript implementation of realpath, ported from node pre-v6 27 | 28 | var DEBUG = process.env.NODE_DEBUG && /fs/.test(process.env.NODE_DEBUG); 29 | 30 | function rethrow() { 31 | // Only enable in debug mode. A backtrace uses ~1000 bytes of heap space and 32 | // is fairly slow to generate. 33 | var callback; 34 | if (DEBUG) { 35 | var backtrace = new Error; 36 | callback = debugCallback; 37 | } else 38 | callback = missingCallback; 39 | 40 | return callback; 41 | 42 | function debugCallback(err) { 43 | if (err) { 44 | backtrace.message = err.message; 45 | err = backtrace; 46 | missingCallback(err); 47 | } 48 | } 49 | 50 | function missingCallback(err) { 51 | if (err) { 52 | if (process.throwDeprecation) 53 | throw err; // Forgot a callback but don't know where? Use NODE_DEBUG=fs 54 | else if (!process.noDeprecation) { 55 | var msg = 'fs: missing callback ' + (err.stack || err.message); 56 | if (process.traceDeprecation) 57 | console.trace(msg); 58 | else 59 | console.error(msg); 60 | } 61 | } 62 | } 63 | } 64 | 65 | function maybeCallback(cb) { 66 | return typeof cb === 'function' ? cb : rethrow(); 67 | } 68 | 69 | var normalize = pathModule.normalize; 70 | 71 | // Regexp that finds the next partion of a (partial) path 72 | // result is [base_with_slash, base], e.g. ['somedir/', 'somedir'] 73 | if (isWindows) { 74 | var nextPartRe = /(.*?)(?:[\/\\]+|$)/g; 75 | } else { 76 | var nextPartRe = /(.*?)(?:[\/]+|$)/g; 77 | } 78 | 79 | // Regex to find the device root, including trailing slash. E.g. 'c:\\'. 80 | if (isWindows) { 81 | var splitRootRe = /^(?:[a-zA-Z]:|[\\\/]{2}[^\\\/]+[\\\/][^\\\/]+)?[\\\/]*/; 82 | } else { 83 | var splitRootRe = /^[\/]*/; 84 | } 85 | 86 | exports.realpathSync = function realpathSync(p, cache) { 87 | // make p is absolute 88 | p = pathModule.resolve(p); 89 | 90 | if (cache && Object.prototype.hasOwnProperty.call(cache, p)) { 91 | return cache[p]; 92 | } 93 | 94 | var original = p, 95 | seenLinks = {}, 96 | knownHard = {}; 97 | 98 | // current character position in p 99 | var pos; 100 | // the partial path so far, including a trailing slash if any 101 | var current; 102 | // the partial path without a trailing slash (except when pointing at a root) 103 | var base; 104 | // the partial path scanned in the previous round, with slash 105 | var previous; 106 | 107 | start(); 108 | 109 | function start() { 110 | // Skip over roots 111 | var m = splitRootRe.exec(p); 112 | pos = m[0].length; 113 | current = m[0]; 114 | base = m[0]; 115 | previous = ''; 116 | 117 | // On windows, check that the root exists. On unix there is no need. 118 | if (isWindows && !knownHard[base]) { 119 | fs.lstatSync(base); 120 | knownHard[base] = true; 121 | } 122 | } 123 | 124 | // walk down the path, swapping out linked pathparts for their real 125 | // values 126 | // NB: p.length changes. 127 | while (pos < p.length) { 128 | // find the next part 129 | nextPartRe.lastIndex = pos; 130 | var result = nextPartRe.exec(p); 131 | previous = current; 132 | current += result[0]; 133 | base = previous + result[1]; 134 | pos = nextPartRe.lastIndex; 135 | 136 | // continue if not a symlink 137 | if (knownHard[base] || (cache && cache[base] === base)) { 138 | continue; 139 | } 140 | 141 | var resolvedLink; 142 | if (cache && Object.prototype.hasOwnProperty.call(cache, base)) { 143 | // some known symbolic link. no need to stat again. 144 | resolvedLink = cache[base]; 145 | } else { 146 | var stat = fs.lstatSync(base); 147 | if (!stat.isSymbolicLink()) { 148 | knownHard[base] = true; 149 | if (cache) cache[base] = base; 150 | continue; 151 | } 152 | 153 | // read the link if it wasn't read before 154 | // dev/ino always return 0 on windows, so skip the check. 155 | var linkTarget = null; 156 | if (!isWindows) { 157 | var id = stat.dev.toString(32) + ':' + stat.ino.toString(32); 158 | if (seenLinks.hasOwnProperty(id)) { 159 | linkTarget = seenLinks[id]; 160 | } 161 | } 162 | if (linkTarget === null) { 163 | fs.statSync(base); 164 | linkTarget = fs.readlinkSync(base); 165 | } 166 | resolvedLink = pathModule.resolve(previous, linkTarget); 167 | // track this, if given a cache. 168 | if (cache) cache[base] = resolvedLink; 169 | if (!isWindows) seenLinks[id] = linkTarget; 170 | } 171 | 172 | // resolve the link, then start over 173 | p = pathModule.resolve(resolvedLink, p.slice(pos)); 174 | start(); 175 | } 176 | 177 | if (cache) cache[original] = p; 178 | 179 | return p; 180 | }; 181 | 182 | 183 | exports.realpath = function realpath(p, cache, cb) { 184 | if (typeof cb !== 'function') { 185 | cb = maybeCallback(cache); 186 | cache = null; 187 | } 188 | 189 | // make p is absolute 190 | p = pathModule.resolve(p); 191 | 192 | if (cache && Object.prototype.hasOwnProperty.call(cache, p)) { 193 | return process.nextTick(cb.bind(null, null, cache[p])); 194 | } 195 | 196 | var original = p, 197 | seenLinks = {}, 198 | knownHard = {}; 199 | 200 | // current character position in p 201 | var pos; 202 | // the partial path so far, including a trailing slash if any 203 | var current; 204 | // the partial path without a trailing slash (except when pointing at a root) 205 | var base; 206 | // the partial path scanned in the previous round, with slash 207 | var previous; 208 | 209 | start(); 210 | 211 | function start() { 212 | // Skip over roots 213 | var m = splitRootRe.exec(p); 214 | pos = m[0].length; 215 | current = m[0]; 216 | base = m[0]; 217 | previous = ''; 218 | 219 | // On windows, check that the root exists. On unix there is no need. 220 | if (isWindows && !knownHard[base]) { 221 | fs.lstat(base, function(err) { 222 | if (err) return cb(err); 223 | knownHard[base] = true; 224 | LOOP(); 225 | }); 226 | } else { 227 | process.nextTick(LOOP); 228 | } 229 | } 230 | 231 | // walk down the path, swapping out linked pathparts for their real 232 | // values 233 | function LOOP() { 234 | // stop if scanned past end of path 235 | if (pos >= p.length) { 236 | if (cache) cache[original] = p; 237 | return cb(null, p); 238 | } 239 | 240 | // find the next part 241 | nextPartRe.lastIndex = pos; 242 | var result = nextPartRe.exec(p); 243 | previous = current; 244 | current += result[0]; 245 | base = previous + result[1]; 246 | pos = nextPartRe.lastIndex; 247 | 248 | // continue if not a symlink 249 | if (knownHard[base] || (cache && cache[base] === base)) { 250 | return process.nextTick(LOOP); 251 | } 252 | 253 | if (cache && Object.prototype.hasOwnProperty.call(cache, base)) { 254 | // known symbolic link. no need to stat again. 255 | return gotResolvedLink(cache[base]); 256 | } 257 | 258 | return fs.lstat(base, gotStat); 259 | } 260 | 261 | function gotStat(err, stat) { 262 | if (err) return cb(err); 263 | 264 | // if not a symlink, skip to the next path part 265 | if (!stat.isSymbolicLink()) { 266 | knownHard[base] = true; 267 | if (cache) cache[base] = base; 268 | return process.nextTick(LOOP); 269 | } 270 | 271 | // stat & read the link if not read before 272 | // call gotTarget as soon as the link target is known 273 | // dev/ino always return 0 on windows, so skip the check. 274 | if (!isWindows) { 275 | var id = stat.dev.toString(32) + ':' + stat.ino.toString(32); 276 | if (seenLinks.hasOwnProperty(id)) { 277 | return gotTarget(null, seenLinks[id], base); 278 | } 279 | } 280 | fs.stat(base, function(err) { 281 | if (err) return cb(err); 282 | 283 | fs.readlink(base, function(err, target) { 284 | if (!isWindows) seenLinks[id] = target; 285 | gotTarget(err, target); 286 | }); 287 | }); 288 | } 289 | 290 | function gotTarget(err, target, base) { 291 | if (err) return cb(err); 292 | 293 | var resolvedLink = pathModule.resolve(previous, target); 294 | if (cache) cache[base] = resolvedLink; 295 | gotResolvedLink(resolvedLink); 296 | } 297 | 298 | function gotResolvedLink(resolvedLink) { 299 | // resolve the link, then start over 300 | p = pathModule.resolve(resolvedLink, p.slice(pos)); 301 | start(); 302 | } 303 | }; 304 | -------------------------------------------------------------------------------- /node_modules/fs.realpath/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "_from": "fs.realpath@^1.0.0", 3 | "_id": "fs.realpath@1.0.0", 4 | "_inBundle": false, 5 | "_integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8=", 6 | "_location": "/fs.realpath", 7 | "_phantomChildren": {}, 8 | "_requested": { 9 | "type": "range", 10 | "registry": true, 11 | "raw": "fs.realpath@^1.0.0", 12 | "name": "fs.realpath", 13 | "escapedName": "fs.realpath", 14 | "rawSpec": "^1.0.0", 15 | "saveSpec": null, 16 | "fetchSpec": "^1.0.0" 17 | }, 18 | "_requiredBy": [ 19 | "/glob" 20 | ], 21 | "_resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", 22 | "_shasum": "1504ad2523158caa40db4a2787cb01411994ea4f", 23 | "_spec": "fs.realpath@^1.0.0", 24 | "_where": "C:\\Users\\ShadowMoose\\Documents\\Git\\LoC-Badge\\node_modules\\glob", 25 | "author": { 26 | "name": "Isaac Z. Schlueter", 27 | "email": "i@izs.me", 28 | "url": "http://blog.izs.me/" 29 | }, 30 | "bugs": { 31 | "url": "https://github.com/isaacs/fs.realpath/issues" 32 | }, 33 | "bundleDependencies": false, 34 | "dependencies": {}, 35 | "deprecated": false, 36 | "description": "Use node's fs.realpath, but fall back to the JS implementation if the native one fails", 37 | "devDependencies": {}, 38 | "files": [ 39 | "old.js", 40 | "index.js" 41 | ], 42 | "homepage": "https://github.com/isaacs/fs.realpath#readme", 43 | "keywords": [ 44 | "realpath", 45 | "fs", 46 | "polyfill" 47 | ], 48 | "license": "ISC", 49 | "main": "index.js", 50 | "name": "fs.realpath", 51 | "repository": { 52 | "type": "git", 53 | "url": "git+https://github.com/isaacs/fs.realpath.git" 54 | }, 55 | "scripts": { 56 | "test": "tap test/*.js --cov" 57 | }, 58 | "version": "1.0.0" 59 | } 60 | -------------------------------------------------------------------------------- /node_modules/glob-gitignore/HISTORY.md: -------------------------------------------------------------------------------- 1 | # History 2 | -------------------------------------------------------------------------------- /node_modules/glob-gitignore/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2013 kaelzhang , contributors 2 | http://kael.me/ 3 | 4 | Permission is hereby granted, free of charge, to any person obtaining 5 | a copy of this software and associated documentation files (the 6 | "Software"), to deal in the Software without restriction, including 7 | without limitation the rights to use, copy, modify, merge, publish, 8 | distribute, sublicense, and/or sell copies of the Software, and to 9 | permit persons to whom the Software is furnished to do so, subject to 10 | the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be 13 | included in all copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 16 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 17 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 18 | NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE 19 | LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION 20 | OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION 21 | WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -------------------------------------------------------------------------------- /node_modules/glob-gitignore/README.md: -------------------------------------------------------------------------------- 1 | [![Build Status](https://travis-ci.org/kaelzhang/node-glob-gitignore.svg?branch=master)](https://travis-ci.org/kaelzhang/node-glob-gitignore) 2 | 5 | 8 | 11 | 14 | 15 | # glob-gitignore 16 | 17 | Extends [`glob`](https://www.npmjs.com/package/glob) with support for filtering files according to gitignore rules and exposes an optional Promise API, based on [`node-ignore`](https://www.npmjs.com/package/ignore). 18 | 19 | This module is built to solve performance issues, see [Why](#why). 20 | 21 | ## Install 22 | 23 | ```sh 24 | $ npm i glob-gitignore --save 25 | ``` 26 | 27 | ## Usage 28 | 29 | ```js 30 | import { 31 | glob, 32 | sync, 33 | hasMagic 34 | } from 'glob-gitignore' 35 | 36 | // The usage of glob-gitignore is much the same as `node-glob`, 37 | // and it supports an array of patterns to be matched 38 | glob(['**'], { 39 | cwd: '/path/to', 40 | 41 | // Except that options.ignore accepts an array of gitignore rules, 42 | // or a gitignore rule, 43 | // or an `ignore` instance. 44 | ignore: '*.bak' 45 | }) 46 | // And glob-gitignore returns a promise 47 | .then(files => { 48 | console.log(files) 49 | }) 50 | 51 | // A string of pattern is also supported. 52 | glob('**', options) 53 | 54 | // To glob things synchronously, use `sync` 55 | const files = sync('**', {ignore: '*.bak'}) 56 | 57 | hasMagic('a/{b/c,x/y}') // true 58 | ``` 59 | 60 | ## Why 61 | 62 | 1. The `options.ignore` of `node-glob` does not support gitignore rules. 63 | 64 | 2. It is better **NOT** to glob things then filter them by gitignore rules. Because by doing this, there will be so much unnecessary harddisk traversing, and cause performance issues, especially if there are tremendous files and directories inside the working directory. For the situation, you'd better to use this module. 65 | 66 | `glob-gitignore` does the filtering at the very process of each decending down. 67 | 68 | ## glob(patterns, options) 69 | 70 | Returns a `Promise` 71 | 72 | - **patterns** `String|Array.` The pattern or array of patterns to be matched. 73 | 74 | And negative patterns (each of which starts with an `!`) are supported, although negative patterns are **NOT** recommended. You'd better to use `options.ignore`. 75 | 76 | ```js 77 | glob(['*.js', 'a/**', '!a/**/*.png']).then(console.log) 78 | ``` 79 | 80 | - **options** `Object` the [glob options](https://www.npmjs.com/package/glob#options) except for `options.ignore` 81 | 82 | ### `options.ignore` 83 | 84 | Could be a `String`, an array of `String`s, or an instance of [node-`ignore`](https://www.npmjs.com/package/ignore) 85 | 86 | Not setting this is kind of silly, since that's the whole purpose of this lib, but it is optional though. 87 | 88 | ```js 89 | glob('**', {ignore: '*.js'}) 90 | glob('**', {ignore: ['*.css', '*.styl']}) 91 | 92 | import ignore from 'ignore' 93 | glob('**', { 94 | ignore: ignore().add('*.js') 95 | }) 96 | ``` 97 | 98 | ## sync(patterns, options) 99 | 100 | The synchronous globber, which returns an `Array.`. 101 | 102 | ## hasMagic(patterns, [options]) 103 | 104 | This method extends `glob.hasMagic(pattern)` and supports an array of patterns. 105 | 106 | Returns 107 | 108 | - `true` if there are any special characters in the pattern, or there is any of a pattern in the array has special characters. 109 | - `false` otherwise. 110 | 111 | ```js 112 | hasMagic('a/{b/c,x/y}') // true 113 | hasMagic(['a/{b/c,x/y}', 'a']) // true 114 | hasMagic(['a']) // false 115 | ``` 116 | 117 | Note that the options affect the results. If `noext:true` is set in the options object, then `+(a|b)` will not be considered a magic pattern. If the pattern has a brace expansion, like `a/{b/c,x/y}` then that is considered magical, unless `nobrace:true` is set in the options. 118 | 119 | ## License 120 | 121 | MIT 122 | -------------------------------------------------------------------------------- /node_modules/glob-gitignore/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "_from": "glob-gitignore", 3 | "_id": "glob-gitignore@1.0.14", 4 | "_inBundle": false, 5 | "_integrity": "sha512-YuAEPqL58bOQDqDF2kMv009rIjSAtPs+WPzyGbwRWK+wD0UWQVRoP34Pz6yJ6ivco65C9tZnaIt0I3JCuQ8NZQ==", 6 | "_location": "/glob-gitignore", 7 | "_phantomChildren": {}, 8 | "_requested": { 9 | "type": "tag", 10 | "registry": true, 11 | "raw": "glob-gitignore", 12 | "name": "glob-gitignore", 13 | "escapedName": "glob-gitignore", 14 | "rawSpec": "", 15 | "saveSpec": null, 16 | "fetchSpec": "latest" 17 | }, 18 | "_requiredBy": [ 19 | "#USER", 20 | "/" 21 | ], 22 | "_resolved": "https://registry.npmjs.org/glob-gitignore/-/glob-gitignore-1.0.14.tgz", 23 | "_shasum": "8b708cb029e73bd388d22f7f935213aa93a1e7c2", 24 | "_spec": "glob-gitignore", 25 | "_where": "C:\\Users\\ShadowMoose\\Documents\\Git\\LoC-Badge", 26 | "author": { 27 | "name": "kaelzhang" 28 | }, 29 | "ava": { 30 | "babel": false 31 | }, 32 | "bugs": { 33 | "url": "https://github.com/kaelzhang/node-glob-gitignore/issues" 34 | }, 35 | "bundleDependencies": false, 36 | "dependencies": { 37 | "glob": "^7.1.3", 38 | "ignore": "^5.0.5", 39 | "lodash.difference": "^4.5.0", 40 | "lodash.union": "^4.6.0", 41 | "make-array": "^1.0.5", 42 | "util.inherits": "^1.0.3" 43 | }, 44 | "deprecated": false, 45 | "description": "Extends `glob` with support for filtering files according to gitignore rules and exposes an optional Promise API with NO performance issues", 46 | "devDependencies": { 47 | "ava": "^1.2.1", 48 | "codecov": "^3.2.0", 49 | "eslint": "^5.14.1", 50 | "eslint-config-ostai": "^1.4.0", 51 | "eslint-plugin-import": "^2.16.0", 52 | "nyc": "^13.3.0" 53 | }, 54 | "engines": { 55 | "node": ">= 6" 56 | }, 57 | "files": [ 58 | "src/" 59 | ], 60 | "homepage": "https://github.com/kaelzhang/node-glob-gitignore#readme", 61 | "keywords": [ 62 | "glob-gitignore", 63 | "glob", 64 | "gitignore", 65 | "ignore", 66 | "globby", 67 | "promise", 68 | "module", 69 | "es-module" 70 | ], 71 | "license": "MIT", 72 | "main": "src/index.js", 73 | "name": "glob-gitignore", 74 | "repository": { 75 | "type": "git", 76 | "url": "git://github.com/kaelzhang/node-glob-gitignore.git" 77 | }, 78 | "scripts": { 79 | "lint": "eslint .", 80 | "posttest": "nyc report --reporter=text-lcov > coverage.lcov && codecov", 81 | "test": "nyc ava --timeout=10s", 82 | "test-no-report": "NODE_DEBUG=ignore-nested nyc ava --timeout=10s --verbose" 83 | }, 84 | "version": "1.0.14" 85 | } 86 | -------------------------------------------------------------------------------- /node_modules/glob-gitignore/src/glob.js: -------------------------------------------------------------------------------- 1 | const {Glob} = require('glob') 2 | const inherits = require('util.inherits') 3 | const { 4 | IGNORE, 5 | createTasks 6 | } = require('./util') 7 | const {sync} = require('./sync') 8 | 9 | // Subclass of `glob.GlobSync` 10 | // @param {string} pattern Pattern to be matched. 11 | // @param {Object} options `options` for `glob` 12 | // @param {function()} shouldIgnore Method to check whether a directory should be ignored. 13 | // @constructor 14 | function _Glob (pattern, options, callback, shouldIgnore) { 15 | // We don't put this thing to argument `options` to avoid 16 | // further problems, such as `options` validation. 17 | 18 | // Use `Symbol` as much as possible to avoid confliction. 19 | this[IGNORE] = shouldIgnore 20 | Glob.call(this, pattern, options, callback) 21 | } 22 | 23 | inherits(_Glob, Glob) 24 | 25 | _Glob.prototype._readdir = function _readdir (abs, inGlobStar, cb) { 26 | const marked = this._mark(abs) 27 | 28 | if (this[IGNORE] && this[IGNORE](marked)) { 29 | return cb() 30 | } 31 | 32 | return Glob.prototype._readdir.call(this, abs, inGlobStar, cb) 33 | } 34 | 35 | function globOne (pattern, opts, ignore) { 36 | return new Promise((resolve, reject) => { 37 | new _Glob(pattern, opts, (err, files) => { 38 | if (err) { 39 | return reject(err) 40 | } 41 | 42 | resolve(files) 43 | }, ignore) 44 | }) 45 | } 46 | 47 | exports.glob = (_patterns, options = {}) => { 48 | if (options.sync) { 49 | return sync(_patterns, options) 50 | } 51 | 52 | const { 53 | patterns, 54 | ignores, 55 | join, 56 | opts, 57 | result 58 | } = createTasks(_patterns, options) 59 | 60 | if (result) { 61 | return Promise.resolve(result) 62 | } 63 | 64 | return Promise.all( 65 | patterns.map(pattern => globOne(pattern, opts, ignores)) 66 | ) 67 | .then(join) 68 | } 69 | -------------------------------------------------------------------------------- /node_modules/glob-gitignore/src/index.js: -------------------------------------------------------------------------------- 1 | const make_array = require('make-array') 2 | const vanilla = require('glob') 3 | 4 | const {sync} = require('./sync') 5 | const {glob} = require('./glob') 6 | 7 | const hasMagic = (patterns, options) => 8 | make_array(patterns) 9 | .some(pattern => vanilla.hasMagic(pattern, options)) 10 | 11 | module.exports = { 12 | sync, 13 | glob, 14 | hasMagic 15 | } 16 | -------------------------------------------------------------------------------- /node_modules/glob-gitignore/src/sync.js: -------------------------------------------------------------------------------- 1 | const {GlobSync} = require('glob') 2 | const inherits = require('util.inherits') 3 | const { 4 | IGNORE, 5 | createTasks 6 | } = require('./util') 7 | 8 | function _GlobSync (pattern, options, shouldIgnore) { 9 | this[IGNORE] = shouldIgnore 10 | GlobSync.call(this, pattern, options) 11 | } 12 | 13 | inherits(_GlobSync, GlobSync) 14 | 15 | _GlobSync.prototype._readdir = function _readdir (abs, inGlobStar) { 16 | // `options.nodir` makes `options.mark` as `true`. 17 | // Mark `abs` first 18 | // to make sure `'node_modules'` will be ignored immediately 19 | // with ignore pattern `'node_modules/'`. 20 | 21 | // There is a built-in cache about marked `File.Stat` in `glob`, 22 | // so that we could not worry about the extra invocation of `this._mark()` 23 | const marked = this._mark(abs) 24 | 25 | if (this[IGNORE] && this[IGNORE](marked)) { 26 | return null 27 | } 28 | 29 | return GlobSync.prototype._readdir.call(this, abs, inGlobStar) 30 | } 31 | 32 | exports.sync = (_patterns, options = {}) => { 33 | const { 34 | join, 35 | patterns, 36 | ignores, 37 | opts, 38 | result 39 | } = createTasks(_patterns, options) 40 | 41 | if (result) { 42 | return result 43 | } 44 | 45 | const groups = patterns.map( 46 | pattern => new _GlobSync(pattern, opts, ignores).found 47 | ) 48 | 49 | return join(groups) 50 | } 51 | -------------------------------------------------------------------------------- /node_modules/glob-gitignore/src/util.js: -------------------------------------------------------------------------------- 1 | const ignore = require('ignore') 2 | const path = require('path') 3 | const difference = require('lodash.difference') 4 | const union = require('lodash.union') 5 | const make_array = require('make-array') 6 | 7 | const IGNORE = typeof Symbol === 'function' 8 | ? Symbol('ignore') 9 | : '_shouldIgnore' 10 | 11 | const relative = (abs, cwd) => path.relative(cwd, abs) 12 | 13 | const createShouldIgnore = options => { 14 | const opts = Object.assign({ 15 | cache: Object.create(null), 16 | statCache: Object.create(null), 17 | realpathCache: Object.create(null), 18 | symlinks: Object.create(null) 19 | }, options) 20 | 21 | const { 22 | ignore: ignores, 23 | cwd = process.cwd() 24 | } = opts 25 | 26 | delete opts.ignore 27 | 28 | if (!ignores) { 29 | return { 30 | ignore: () => false, 31 | filter: () => true, 32 | opts 33 | } 34 | } 35 | 36 | const ig = ignore().add(ignores) 37 | const _filter = ig.createFilter() 38 | 39 | const filterABS = f => { 40 | const filepath = relative(f, cwd) 41 | if (!filepath) { 42 | return true 43 | } 44 | 45 | return _filter(filepath) 46 | } 47 | 48 | const filter = options.absolute 49 | ? filterABS 50 | : _filter 51 | 52 | return { 53 | // Check directories during traversing 54 | ignores: f => !filterABS(f), 55 | // Filter result 56 | filter, 57 | opts 58 | } 59 | } 60 | 61 | const isNegative = pattern => pattern[0] === '!' 62 | const isPattern = subject => subject && typeof subject === 'string' 63 | 64 | const createTasks = (patterns, options) => { 65 | patterns = make_array(patterns) 66 | 67 | if (!patterns.length || !patterns.every(isPattern)) { 68 | throw new TypeError('patterns must be a string or an array of strings') 69 | } 70 | 71 | const negativeFlags = [] 72 | let positivesCount = 0 73 | patterns = patterns.map((pattern, i) => { 74 | if (isNegative(pattern)) { 75 | negativeFlags[i] = true 76 | return pattern.slice(1) 77 | } 78 | 79 | positivesCount ++ 80 | return pattern 81 | }) 82 | 83 | // or only provide a negative pattern 84 | if (positivesCount === 0) { 85 | return { 86 | result: [] 87 | } 88 | } 89 | 90 | const { 91 | opts, 92 | filter, 93 | ignores 94 | } = createShouldIgnore(options) 95 | 96 | // Only one positive pattern 97 | if (positivesCount === 1) { 98 | return { 99 | join ([files]) { 100 | // _GlobSync only filters _readdir, 101 | // so glob results should be filtered again. 102 | return files.filter(filter) 103 | }, 104 | 105 | patterns, 106 | opts, 107 | ignores 108 | } 109 | } 110 | 111 | return { 112 | join (fileGroups) { 113 | const positives = [] 114 | const negatives = [] 115 | 116 | fileGroups.forEach((files, i) => { 117 | /* eslint no-unused-expressions: 'off' */ 118 | negativeFlags[i] 119 | ? negatives.push(files) 120 | : positives.push(files) 121 | }) 122 | 123 | return difference(union(...positives), ...negatives) 124 | // The same reason as above 125 | .filter(filter) 126 | }, 127 | 128 | patterns, 129 | opts, 130 | ignore 131 | } 132 | } 133 | 134 | module.exports = { 135 | IGNORE, 136 | createTasks 137 | } 138 | -------------------------------------------------------------------------------- /node_modules/glob/LICENSE: -------------------------------------------------------------------------------- 1 | The ISC License 2 | 3 | Copyright (c) Isaac Z. Schlueter and Contributors 4 | 5 | Permission to use, copy, modify, and/or distribute this software for any 6 | purpose with or without fee is hereby granted, provided that the above 7 | copyright notice and this permission notice appear in all copies. 8 | 9 | THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES 10 | WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF 11 | MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR 12 | ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES 13 | WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN 14 | ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR 15 | IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 16 | 17 | ## Glob Logo 18 | 19 | Glob's logo created by Tanya Brassie , licensed 20 | under a Creative Commons Attribution-ShareAlike 4.0 International License 21 | https://creativecommons.org/licenses/by-sa/4.0/ 22 | -------------------------------------------------------------------------------- /node_modules/glob/changelog.md: -------------------------------------------------------------------------------- 1 | ## 7.0 2 | 3 | - Raise error if `options.cwd` is specified, and not a directory 4 | 5 | ## 6.0 6 | 7 | - Remove comment and negation pattern support 8 | - Ignore patterns are always in `dot:true` mode 9 | 10 | ## 5.0 11 | 12 | - Deprecate comment and negation patterns 13 | - Fix regression in `mark` and `nodir` options from making all cache 14 | keys absolute path. 15 | - Abort if `fs.readdir` returns an error that's unexpected 16 | - Don't emit `match` events for ignored items 17 | - Treat ENOTSUP like ENOTDIR in readdir 18 | 19 | ## 4.5 20 | 21 | - Add `options.follow` to always follow directory symlinks in globstar 22 | - Add `options.realpath` to call `fs.realpath` on all results 23 | - Always cache based on absolute path 24 | 25 | ## 4.4 26 | 27 | - Add `options.ignore` 28 | - Fix handling of broken symlinks 29 | 30 | ## 4.3 31 | 32 | - Bump minimatch to 2.x 33 | - Pass all tests on Windows 34 | 35 | ## 4.2 36 | 37 | - Add `glob.hasMagic` function 38 | - Add `options.nodir` flag 39 | 40 | ## 4.1 41 | 42 | - Refactor sync and async implementations for performance 43 | - Throw if callback provided to sync glob function 44 | - Treat symbolic links in globstar results the same as Bash 4.3 45 | 46 | ## 4.0 47 | 48 | - Use `^` for dependency versions (bumped major because this breaks 49 | older npm versions) 50 | - Ensure callbacks are only ever called once 51 | - switch to ISC license 52 | 53 | ## 3.x 54 | 55 | - Rewrite in JavaScript 56 | - Add support for setting root, cwd, and windows support 57 | - Cache many fs calls 58 | - Add globstar support 59 | - emit match events 60 | 61 | ## 2.x 62 | 63 | - Use `glob.h` and `fnmatch.h` from NetBSD 64 | 65 | ## 1.x 66 | 67 | - `glob.h` static binding. 68 | -------------------------------------------------------------------------------- /node_modules/glob/common.js: -------------------------------------------------------------------------------- 1 | exports.alphasort = alphasort 2 | exports.alphasorti = alphasorti 3 | exports.setopts = setopts 4 | exports.ownProp = ownProp 5 | exports.makeAbs = makeAbs 6 | exports.finish = finish 7 | exports.mark = mark 8 | exports.isIgnored = isIgnored 9 | exports.childrenIgnored = childrenIgnored 10 | 11 | function ownProp (obj, field) { 12 | return Object.prototype.hasOwnProperty.call(obj, field) 13 | } 14 | 15 | var path = require("path") 16 | var minimatch = require("minimatch") 17 | var isAbsolute = require("path-is-absolute") 18 | var Minimatch = minimatch.Minimatch 19 | 20 | function alphasorti (a, b) { 21 | return a.toLowerCase().localeCompare(b.toLowerCase()) 22 | } 23 | 24 | function alphasort (a, b) { 25 | return a.localeCompare(b) 26 | } 27 | 28 | function setupIgnores (self, options) { 29 | self.ignore = options.ignore || [] 30 | 31 | if (!Array.isArray(self.ignore)) 32 | self.ignore = [self.ignore] 33 | 34 | if (self.ignore.length) { 35 | self.ignore = self.ignore.map(ignoreMap) 36 | } 37 | } 38 | 39 | // ignore patterns are always in dot:true mode. 40 | function ignoreMap (pattern) { 41 | var gmatcher = null 42 | if (pattern.slice(-3) === '/**') { 43 | var gpattern = pattern.replace(/(\/\*\*)+$/, '') 44 | gmatcher = new Minimatch(gpattern, { dot: true }) 45 | } 46 | 47 | return { 48 | matcher: new Minimatch(pattern, { dot: true }), 49 | gmatcher: gmatcher 50 | } 51 | } 52 | 53 | function setopts (self, pattern, options) { 54 | if (!options) 55 | options = {} 56 | 57 | // base-matching: just use globstar for that. 58 | if (options.matchBase && -1 === pattern.indexOf("/")) { 59 | if (options.noglobstar) { 60 | throw new Error("base matching requires globstar") 61 | } 62 | pattern = "**/" + pattern 63 | } 64 | 65 | self.silent = !!options.silent 66 | self.pattern = pattern 67 | self.strict = options.strict !== false 68 | self.realpath = !!options.realpath 69 | self.realpathCache = options.realpathCache || Object.create(null) 70 | self.follow = !!options.follow 71 | self.dot = !!options.dot 72 | self.mark = !!options.mark 73 | self.nodir = !!options.nodir 74 | if (self.nodir) 75 | self.mark = true 76 | self.sync = !!options.sync 77 | self.nounique = !!options.nounique 78 | self.nonull = !!options.nonull 79 | self.nosort = !!options.nosort 80 | self.nocase = !!options.nocase 81 | self.stat = !!options.stat 82 | self.noprocess = !!options.noprocess 83 | self.absolute = !!options.absolute 84 | 85 | self.maxLength = options.maxLength || Infinity 86 | self.cache = options.cache || Object.create(null) 87 | self.statCache = options.statCache || Object.create(null) 88 | self.symlinks = options.symlinks || Object.create(null) 89 | 90 | setupIgnores(self, options) 91 | 92 | self.changedCwd = false 93 | var cwd = process.cwd() 94 | if (!ownProp(options, "cwd")) 95 | self.cwd = cwd 96 | else { 97 | self.cwd = path.resolve(options.cwd) 98 | self.changedCwd = self.cwd !== cwd 99 | } 100 | 101 | self.root = options.root || path.resolve(self.cwd, "/") 102 | self.root = path.resolve(self.root) 103 | if (process.platform === "win32") 104 | self.root = self.root.replace(/\\/g, "/") 105 | 106 | // TODO: is an absolute `cwd` supposed to be resolved against `root`? 107 | // e.g. { cwd: '/test', root: __dirname } === path.join(__dirname, '/test') 108 | self.cwdAbs = isAbsolute(self.cwd) ? self.cwd : makeAbs(self, self.cwd) 109 | if (process.platform === "win32") 110 | self.cwdAbs = self.cwdAbs.replace(/\\/g, "/") 111 | self.nomount = !!options.nomount 112 | 113 | // disable comments and negation in Minimatch. 114 | // Note that they are not supported in Glob itself anyway. 115 | options.nonegate = true 116 | options.nocomment = true 117 | 118 | self.minimatch = new Minimatch(pattern, options) 119 | self.options = self.minimatch.options 120 | } 121 | 122 | function finish (self) { 123 | var nou = self.nounique 124 | var all = nou ? [] : Object.create(null) 125 | 126 | for (var i = 0, l = self.matches.length; i < l; i ++) { 127 | var matches = self.matches[i] 128 | if (!matches || Object.keys(matches).length === 0) { 129 | if (self.nonull) { 130 | // do like the shell, and spit out the literal glob 131 | var literal = self.minimatch.globSet[i] 132 | if (nou) 133 | all.push(literal) 134 | else 135 | all[literal] = true 136 | } 137 | } else { 138 | // had matches 139 | var m = Object.keys(matches) 140 | if (nou) 141 | all.push.apply(all, m) 142 | else 143 | m.forEach(function (m) { 144 | all[m] = true 145 | }) 146 | } 147 | } 148 | 149 | if (!nou) 150 | all = Object.keys(all) 151 | 152 | if (!self.nosort) 153 | all = all.sort(self.nocase ? alphasorti : alphasort) 154 | 155 | // at *some* point we statted all of these 156 | if (self.mark) { 157 | for (var i = 0; i < all.length; i++) { 158 | all[i] = self._mark(all[i]) 159 | } 160 | if (self.nodir) { 161 | all = all.filter(function (e) { 162 | var notDir = !(/\/$/.test(e)) 163 | var c = self.cache[e] || self.cache[makeAbs(self, e)] 164 | if (notDir && c) 165 | notDir = c !== 'DIR' && !Array.isArray(c) 166 | return notDir 167 | }) 168 | } 169 | } 170 | 171 | if (self.ignore.length) 172 | all = all.filter(function(m) { 173 | return !isIgnored(self, m) 174 | }) 175 | 176 | self.found = all 177 | } 178 | 179 | function mark (self, p) { 180 | var abs = makeAbs(self, p) 181 | var c = self.cache[abs] 182 | var m = p 183 | if (c) { 184 | var isDir = c === 'DIR' || Array.isArray(c) 185 | var slash = p.slice(-1) === '/' 186 | 187 | if (isDir && !slash) 188 | m += '/' 189 | else if (!isDir && slash) 190 | m = m.slice(0, -1) 191 | 192 | if (m !== p) { 193 | var mabs = makeAbs(self, m) 194 | self.statCache[mabs] = self.statCache[abs] 195 | self.cache[mabs] = self.cache[abs] 196 | } 197 | } 198 | 199 | return m 200 | } 201 | 202 | // lotta situps... 203 | function makeAbs (self, f) { 204 | var abs = f 205 | if (f.charAt(0) === '/') { 206 | abs = path.join(self.root, f) 207 | } else if (isAbsolute(f) || f === '') { 208 | abs = f 209 | } else if (self.changedCwd) { 210 | abs = path.resolve(self.cwd, f) 211 | } else { 212 | abs = path.resolve(f) 213 | } 214 | 215 | if (process.platform === 'win32') 216 | abs = abs.replace(/\\/g, '/') 217 | 218 | return abs 219 | } 220 | 221 | 222 | // Return true, if pattern ends with globstar '**', for the accompanying parent directory. 223 | // Ex:- If node_modules/** is the pattern, add 'node_modules' to ignore list along with it's contents 224 | function isIgnored (self, path) { 225 | if (!self.ignore.length) 226 | return false 227 | 228 | return self.ignore.some(function(item) { 229 | return item.matcher.match(path) || !!(item.gmatcher && item.gmatcher.match(path)) 230 | }) 231 | } 232 | 233 | function childrenIgnored (self, path) { 234 | if (!self.ignore.length) 235 | return false 236 | 237 | return self.ignore.some(function(item) { 238 | return !!(item.gmatcher && item.gmatcher.match(path)) 239 | }) 240 | } 241 | -------------------------------------------------------------------------------- /node_modules/glob/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "_from": "glob", 3 | "_id": "glob@7.1.6", 4 | "_inBundle": false, 5 | "_integrity": "sha512-LwaxwyZ72Lk7vZINtNNrywX0ZuLyStrdDtabefZKAY5ZGJhVtgdznluResxNmPitE0SAO+O26sWTHeKSI2wMBA==", 6 | "_location": "/glob", 7 | "_phantomChildren": {}, 8 | "_requested": { 9 | "type": "tag", 10 | "registry": true, 11 | "raw": "glob", 12 | "name": "glob", 13 | "escapedName": "glob", 14 | "rawSpec": "", 15 | "saveSpec": null, 16 | "fetchSpec": "latest" 17 | }, 18 | "_requiredBy": [ 19 | "#USER", 20 | "/" 21 | ], 22 | "_resolved": "https://registry.npmjs.org/glob/-/glob-7.1.6.tgz", 23 | "_shasum": "141f33b81a7c2492e125594307480c46679278a6", 24 | "_spec": "glob", 25 | "_where": "C:\\Users\\ShadowMoose\\Documents\\Git\\LoC-Badge", 26 | "author": { 27 | "name": "Isaac Z. Schlueter", 28 | "email": "i@izs.me", 29 | "url": "http://blog.izs.me/" 30 | }, 31 | "bugs": { 32 | "url": "https://github.com/isaacs/node-glob/issues" 33 | }, 34 | "bundleDependencies": false, 35 | "dependencies": { 36 | "fs.realpath": "^1.0.0", 37 | "inflight": "^1.0.4", 38 | "inherits": "2", 39 | "minimatch": "^3.0.4", 40 | "once": "^1.3.0", 41 | "path-is-absolute": "^1.0.0" 42 | }, 43 | "deprecated": false, 44 | "description": "a little globber", 45 | "devDependencies": { 46 | "mkdirp": "0", 47 | "rimraf": "^2.2.8", 48 | "tap": "^12.0.1", 49 | "tick": "0.0.6" 50 | }, 51 | "engines": { 52 | "node": "*" 53 | }, 54 | "files": [ 55 | "glob.js", 56 | "sync.js", 57 | "common.js" 58 | ], 59 | "funding": { 60 | "url": "https://github.com/sponsors/isaacs" 61 | }, 62 | "homepage": "https://github.com/isaacs/node-glob#readme", 63 | "license": "ISC", 64 | "main": "glob.js", 65 | "name": "glob", 66 | "repository": { 67 | "type": "git", 68 | "url": "git://github.com/isaacs/node-glob.git" 69 | }, 70 | "scripts": { 71 | "bench": "bash benchmark.sh", 72 | "benchclean": "node benchclean.js", 73 | "prepublish": "npm run benchclean", 74 | "prof": "bash prof.sh && cat profile.txt", 75 | "profclean": "rm -f v8.log profile.txt", 76 | "test": "tap test/*.js --cov", 77 | "test-regen": "npm run profclean && TEST_REGEN=1 node test/00-setup.js" 78 | }, 79 | "version": "7.1.6" 80 | } 81 | -------------------------------------------------------------------------------- /node_modules/ignore/CHANGELOG.md: -------------------------------------------------------------------------------- 1 | # `node-ignore` 5 ChangeLog 2 | 3 | # 5.x 4 | 5 | ## 2018-08-14, Version 5.0.1 6 | 7 | - **PATCH**: fixes for windows. 8 | - **PATCH**: improves tests for typescript and windows. 9 | 10 | ## 2018-08-13, Version 5.0.0 11 | 12 | - **SEMVER-MAJOR**: [#20](https://github.com/kaelzhang/node-ignore/issues/20): it will throw if an invalid pathname passes into `.ignores(pathname)`, see [Upgrade 4.x -> 5.x](https://github.com/kaelzhang/node-ignore#upgrade-4x---5x). 13 | - **FEATURE**: [#31](https://github.com/kaelzhang/node-ignore/issues/31): adds a new method [`.test(pathname)`](https://github.com/kaelzhang/node-ignore#testpathname-pathname-since-500). 14 | - **BENCHMARK**: improves performance by 26%. 15 | 16 | # 4.x 17 | 18 | ## 2018-08-12, Version 4.0.6 19 | 20 | - **PATCH**: `Object.prototype` methods will not ruin the result any more. 21 | 22 | ## ~ 2018-08-09, Version 4.0.1 - 4.0.5 23 | 24 | - **PATCH**: updates README.md about frequent asked quesions from github issues. 25 | 26 | ## 2018-06-22, Version 4.0.0 27 | 28 | - **SEMVER-MAJOR**: Drop support for node < 6 by default. 29 | - **FEATURE**: supports the missing character ranges and sets, such as `*.[a-z]` and `*.[jJ][pP][gG]` 30 | - **FEATURE**: new option: `ignorecase` to make `ignore` case insensitive. 31 | - **FEATURE**: supports question mark which matches a single character. 32 | - **PATCH**: fixes typescript declaration. 33 | -------------------------------------------------------------------------------- /node_modules/ignore/LICENSE-MIT: -------------------------------------------------------------------------------- 1 | Copyright (c) 2013 Kael Zhang , contributors 2 | http://kael.me/ 3 | 4 | Permission is hereby granted, free of charge, to any person obtaining 5 | a copy of this software and associated documentation files (the 6 | "Software"), to deal in the Software without restriction, including 7 | without limitation the rights to use, copy, modify, merge, publish, 8 | distribute, sublicense, and/or sell copies of the Software, and to 9 | permit persons to whom the Software is furnished to do so, subject to 10 | the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be 13 | included in all copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 16 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 17 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 18 | NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE 19 | LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION 20 | OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION 21 | WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -------------------------------------------------------------------------------- /node_modules/ignore/README.md: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 16 | 22 | 28 | 34 |
LinuxOS XWindowsCoverageDownloads
11 | 12 | Build Status 15 | 17 | 18 | Windows Build Status 21 | 23 | 24 | Coverage Status 27 | 29 | 30 | npm module downloads per month 33 |
35 | 36 | # ignore 37 | 38 | `ignore` is a manager, filter and parser which implemented in pure JavaScript according to the .gitignore [spec](http://git-scm.com/docs/gitignore). 39 | 40 | `ignore` is used by eslint, gitbook and [many others](https://www.npmjs.com/browse/depended/ignore). 41 | 42 | Pay attention that [`minimatch`](https://www.npmjs.org/package/minimatch) does not work in the gitignore way. To filter filenames according to .gitignore file, I recommend this module. 43 | 44 | ### Tested on 45 | 46 | `ignore` is fully tested, and has more than **five hundreds** of unit tests. 47 | 48 | - Linux + Node: `0.8` - `7.x` 49 | - Windows + Node: `0.10` - `7.x`, node < `0.10` is not tested due to the lack of support of appveyor. 50 | 51 | Actually, `ignore` does not rely on any versions of node specially. 52 | 53 | Since `4.0.0`, ignore will no longer support `node < 6` by default, to use in node < 6, `require('ignore/legacy')`. For details, see [CHANGELOG](https://github.com/kaelzhang/node-ignore/blob/master/CHANGELOG.md). 54 | 55 | ## Table Of Main Contents 56 | 57 | - [Usage](#usage) 58 | - [`Pathname` Conventions](#pathname-conventions) 59 | - See Also: 60 | - [`glob-gitignore`](https://www.npmjs.com/package/glob-gitignore) matches files using patterns and filters them according to gitignore rules. 61 | - [Upgrade Guide](#upgrade-guide) 62 | 63 | ## Install 64 | 65 | ```sh 66 | npm i ignore 67 | ``` 68 | 69 | ## Usage 70 | 71 | ```js 72 | import ignore from 'ignore' 73 | const ig = ignore().add(['.abc/*', '!.abc/d/']) 74 | ``` 75 | 76 | ### Filter the given paths 77 | 78 | ```js 79 | const paths = [ 80 | '.abc/a.js', // filtered out 81 | '.abc/d/e.js' // included 82 | ] 83 | 84 | ig.filter(paths) // ['.abc/d/e.js'] 85 | ig.ignores('.abc/a.js') // true 86 | ``` 87 | 88 | ### As the filter function 89 | 90 | ```js 91 | paths.filter(ig.createFilter()); // ['.abc/d/e.js'] 92 | ``` 93 | 94 | ### Win32 paths will be handled 95 | 96 | ```js 97 | ig.filter(['.abc\\a.js', '.abc\\d\\e.js']) 98 | // if the code above runs on windows, the result will be 99 | // ['.abc\\d\\e.js'] 100 | ``` 101 | 102 | ## Why another ignore? 103 | 104 | - `ignore` is a standalone module, and is much simpler so that it could easy work with other programs, unlike [isaacs](https://npmjs.org/~isaacs)'s [fstream-ignore](https://npmjs.org/package/fstream-ignore) which must work with the modules of the fstream family. 105 | 106 | - `ignore` only contains utility methods to filter paths according to the specified ignore rules, so 107 | - `ignore` never try to find out ignore rules by traversing directories or fetching from git configurations. 108 | - `ignore` don't cares about sub-modules of git projects. 109 | 110 | - Exactly according to [gitignore man page](http://git-scm.com/docs/gitignore), fixes some known matching issues of fstream-ignore, such as: 111 | - '`/*.js`' should only match '`a.js`', but not '`abc/a.js`'. 112 | - '`**/foo`' should match '`foo`' anywhere. 113 | - Prevent re-including a file if a parent directory of that file is excluded. 114 | - Handle trailing whitespaces: 115 | - `'a '`(one space) should not match `'a '`(two spaces). 116 | - `'a \ '` matches `'a '` 117 | - All test cases are verified with the result of `git check-ignore`. 118 | 119 | # Methods 120 | 121 | ## .add(pattern: string | Ignore): this 122 | ## .add(patterns: Array): this 123 | 124 | - **pattern** `String | Ignore` An ignore pattern string, or the `Ignore` instance 125 | - **patterns** `Array` Array of ignore patterns. 126 | 127 | Adds a rule or several rules to the current manager. 128 | 129 | Returns `this` 130 | 131 | Notice that a line starting with `'#'`(hash) is treated as a comment. Put a backslash (`'\'`) in front of the first hash for patterns that begin with a hash, if you want to ignore a file with a hash at the beginning of the filename. 132 | 133 | ```js 134 | ignore().add('#abc').ignores('#abc') // false 135 | ignore().add('\#abc').ignores('#abc') // true 136 | ``` 137 | 138 | `pattern` could either be a line of ignore pattern or a string of multiple ignore patterns, which means we could just `ignore().add()` the content of a ignore file: 139 | 140 | ```js 141 | ignore() 142 | .add(fs.readFileSync(filenameOfGitignore).toString()) 143 | .filter(filenames) 144 | ``` 145 | 146 | `pattern` could also be an `ignore` instance, so that we could easily inherit the rules of another `Ignore` instance. 147 | 148 | ## .addIgnoreFile(path) 149 | 150 | REMOVED in `3.x` for now. 151 | 152 | To upgrade `ignore@2.x` up to `3.x`, use 153 | 154 | ```js 155 | import fs from 'fs' 156 | 157 | if (fs.existsSync(filename)) { 158 | ignore().add(fs.readFileSync(filename).toString()) 159 | } 160 | ``` 161 | 162 | instead. 163 | 164 | ## .filter(paths: Array<Pathname>): Array<Pathname> 165 | 166 | ```ts 167 | type Pathname = string 168 | ``` 169 | 170 | Filters the given array of pathnames, and returns the filtered array. 171 | 172 | - **paths** `Array.` The array of `pathname`s to be filtered. 173 | 174 | ### `Pathname` Conventions: 175 | 176 | #### 1. `Pathname` should be a `path.relative()`d pathname 177 | 178 | `Pathname` should be a string that have been `path.join()`ed, or the return value of `path.relative()` to the current directory, 179 | 180 | ```js 181 | // WRONG, an error will be thrown 182 | ig.ignores('./abc') 183 | 184 | // WRONG, for it will never happen, and an error will be thrown 185 | // If the gitignore rule locates at the root directory, 186 | // `'/abc'` should be changed to `'abc'`. 187 | // ``` 188 | // path.relative('/', '/abc') -> 'abc' 189 | // ``` 190 | ig.ignores('/abc') 191 | 192 | // WRONG, that it is an absolute path on Windows, an error will be thrown 193 | ig.ignores('C:\\abc') 194 | 195 | // Right 196 | ig.ignores('abc') 197 | 198 | // Right 199 | ig.ignores(path.join('./abc')) // path.join('./abc') -> 'abc' 200 | ``` 201 | 202 | In other words, each `Pathname` here should be a relative path to the directory of the gitignore rules. 203 | 204 | Suppose the dir structure is: 205 | 206 | ``` 207 | /path/to/your/repo 208 | |-- a 209 | | |-- a.js 210 | | 211 | |-- .b 212 | | 213 | |-- .c 214 | |-- .DS_store 215 | ``` 216 | 217 | Then the `paths` might be like this: 218 | 219 | ```js 220 | [ 221 | 'a/a.js' 222 | '.b', 223 | '.c/.DS_store' 224 | ] 225 | ``` 226 | 227 | #### 2. filenames and dirnames 228 | 229 | `node-ignore` does NO `fs.stat` during path matching, so for the example below: 230 | 231 | ```js 232 | // First, we add a ignore pattern to ignore a directory 233 | ig.add('config/') 234 | 235 | // `ig` does NOT know if 'config', in the real world, 236 | // is a normal file, directory or something. 237 | 238 | ig.ignores('config') 239 | // `ig` treats `config` as a file, so it returns `false` 240 | 241 | ig.ignores('config/') 242 | // returns `true` 243 | ``` 244 | 245 | Specially for people who develop some library based on `node-ignore`, it is important to understand that. 246 | 247 | Usually, you could use [`glob`](http://npmjs.org/package/glob) with `option.mark = true` to fetch the structure of the current directory: 248 | 249 | ```js 250 | import glob from 'glob' 251 | 252 | glob('**', { 253 | // Adds a / character to directory matches. 254 | mark: true 255 | }, (err, files) => { 256 | if (err) { 257 | return console.error(err) 258 | } 259 | 260 | let filtered = ignore().add(patterns).filter(files) 261 | console.log(filtered) 262 | }) 263 | ``` 264 | 265 | ## .ignores(pathname: Pathname): boolean 266 | 267 | > new in 3.2.0 268 | 269 | Returns `Boolean` whether `pathname` should be ignored. 270 | 271 | ```js 272 | ig.ignores('.abc/a.js') // true 273 | ``` 274 | 275 | ## .createFilter() 276 | 277 | Creates a filter function which could filter an array of paths with `Array.prototype.filter`. 278 | 279 | Returns `function(path)` the filter function. 280 | 281 | ## .test(pathname: Pathname) since 5.0.0 282 | 283 | Returns `TestResult` 284 | 285 | ```ts 286 | interface TestResult { 287 | ignored: boolean 288 | // true if the `pathname` is finally unignored by some negative pattern 289 | unignored: boolean 290 | } 291 | ``` 292 | 293 | - `{ignored: true, unignored: false}`: the `pathname` is ignored 294 | - `{ignored: false, unignored: true}`: the `pathname` is unignored 295 | - `{ignored: false, unignored: false}`: the `pathname` is never matched by any ignore rules. 296 | 297 | ## `options.ignorecase` since 4.0.0 298 | 299 | Similar as the `core.ignorecase` option of [git-config](https://git-scm.com/docs/git-config), `node-ignore` will be case insensitive if `options.ignorecase` is set to `true` (the default value), otherwise case sensitive. 300 | 301 | ```js 302 | const ig = ignore({ 303 | ignorecase: false 304 | }) 305 | 306 | ig.add('*.png') 307 | 308 | ig.ignores('*.PNG') // false 309 | ``` 310 | 311 | ## static `ignore.isPathValid(pathname): boolean` since 5.0.0 312 | 313 | Check whether the `pathname` is valid according to the [convention](#1-pathname-should-be-a-pathrelatived-pathname). 314 | 315 | ```js 316 | ignore.isPathValid('./foo') // false 317 | ``` 318 | 319 | **** 320 | 321 | # Upgrade Guide 322 | 323 | ## Upgrade 4.x -> 5.x 324 | 325 | Since `5.0.0`, if an invalid `Pathname` passed into `ig.ignores()`, an error will be thrown, while `ignore < 5.0.0` did not make sure what the return value was, as well as 326 | 327 | ```ts 328 | .ignores(pathname: Pathname): boolean 329 | 330 | .filter(pathnames: Array): Array 331 | 332 | .createFilter(): (pathname: Pathname) => boolean 333 | 334 | .test(pathname: Pathname): {ignored: boolean, unignored: boolean} 335 | ``` 336 | 337 | See the convention [here](#1-pathname-should-be-a-pathrelatived-pathname) for details. 338 | 339 | If there are invalid pathnames, the conversion and filtration should be done by users. 340 | 341 | ```js 342 | import {isPathValid} from 'ignore' // introduced in 5.0.0 343 | 344 | const paths = [ 345 | // invalid 346 | ////////////////// 347 | '', 348 | false, 349 | '../foo', 350 | '.', 351 | ////////////////// 352 | 353 | // valid 354 | 'foo' 355 | ] 356 | .filter(isValidPath) 357 | 358 | ig.filter(paths) 359 | ``` 360 | 361 | ## Upgrade 3.x -> 4.x 362 | 363 | Since `4.0.0`, `ignore` will no longer support node < 6, to use `ignore` in node < 6: 364 | 365 | ```js 366 | var ignore = require('ignore/legacy') 367 | ``` 368 | 369 | ## Upgrade 2.x -> 3.x 370 | 371 | - All `options` of 2.x are unnecessary and removed, so just remove them. 372 | - `ignore()` instance is no longer an [`EventEmitter`](nodejs.org/api/events.html), and all events are unnecessary and removed. 373 | - `.addIgnoreFile()` is removed, see the [.addIgnoreFile](#addignorefilepath) section for details. 374 | 375 | **** 376 | 377 | # Collaborators 378 | 379 | - [@whitecolor](https://github.com/whitecolor) *Alex* 380 | - [@SamyPesse](https://github.com/SamyPesse) *Samy Pessé* 381 | - [@azproduction](https://github.com/azproduction) *Mikhail Davydov* 382 | - [@TrySound](https://github.com/TrySound) *Bogdan Chadkin* 383 | - [@JanMattner](https://github.com/JanMattner) *Jan Mattner* 384 | - [@ntwb](https://github.com/ntwb) *Stephen Edgar* 385 | - [@kasperisager](https://github.com/kasperisager) *Kasper Isager* 386 | - [@sandersn](https://github.com/sandersn) *Nathan Shively-Sanders* 387 | -------------------------------------------------------------------------------- /node_modules/ignore/index.d.ts: -------------------------------------------------------------------------------- 1 | type Pathname = string 2 | 3 | interface TestResult { 4 | ignored: boolean 5 | unignored: boolean 6 | } 7 | 8 | export interface Ignore { 9 | /** 10 | * Adds a rule rules to the current manager. 11 | * @param {string | Ignore} pattern 12 | * @returns IgnoreBase 13 | */ 14 | add(pattern: string | Ignore): this 15 | /** 16 | * Adds several rules to the current manager. 17 | * @param {string[]} patterns 18 | * @returns IgnoreBase 19 | */ 20 | add(patterns: (string | Ignore)[]): this 21 | 22 | /** 23 | * Filters the given array of pathnames, and returns the filtered array. 24 | * NOTICE that each path here should be a relative path to the root of your repository. 25 | * @param paths the array of paths to be filtered. 26 | * @returns The filtered array of paths 27 | */ 28 | filter(pathnames: Pathname[]): Pathname[] 29 | /** 30 | * Creates a filter function which could filter 31 | * an array of paths with Array.prototype.filter. 32 | */ 33 | createFilter(): (pathname: Pathname) => boolean 34 | 35 | /** 36 | * Returns Boolean whether pathname should be ignored. 37 | * @param {string} pathname a path to check 38 | * @returns boolean 39 | */ 40 | ignores(pathname: Pathname): boolean 41 | 42 | /** 43 | * Returns whether pathname should be ignored or unignored 44 | * @param {string} pathname a path to check 45 | * @returns TestResult 46 | */ 47 | test(pathname: Pathname): TestResult 48 | } 49 | 50 | interface Options { 51 | ignorecase?: boolean 52 | } 53 | 54 | /** 55 | * Creates new ignore manager. 56 | */ 57 | declare function ignore(options?: Options): Ignore 58 | 59 | declare namespace ignore { 60 | export function isPathValid (pathname: string): boolean 61 | } 62 | 63 | export default ignore 64 | -------------------------------------------------------------------------------- /node_modules/ignore/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "_from": "ignore@^5.0.5", 3 | "_id": "ignore@5.1.4", 4 | "_inBundle": false, 5 | "_integrity": "sha512-MzbUSahkTW1u7JpKKjY7LCARd1fU5W2rLdxlM4kdkayuCwZImjkpluF9CM1aLewYJguPDqewLam18Y6AU69A8A==", 6 | "_location": "/ignore", 7 | "_phantomChildren": {}, 8 | "_requested": { 9 | "type": "range", 10 | "registry": true, 11 | "raw": "ignore@^5.0.5", 12 | "name": "ignore", 13 | "escapedName": "ignore", 14 | "rawSpec": "^5.0.5", 15 | "saveSpec": null, 16 | "fetchSpec": "^5.0.5" 17 | }, 18 | "_requiredBy": [ 19 | "/glob-gitignore" 20 | ], 21 | "_resolved": "https://registry.npmjs.org/ignore/-/ignore-5.1.4.tgz", 22 | "_shasum": "84b7b3dbe64552b6ef0eca99f6743dbec6d97adf", 23 | "_spec": "ignore@^5.0.5", 24 | "_where": "C:\\Users\\ShadowMoose\\Documents\\Git\\LoC-Badge\\node_modules\\glob-gitignore", 25 | "author": { 26 | "name": "kael" 27 | }, 28 | "bugs": { 29 | "url": "https://github.com/kaelzhang/node-ignore/issues" 30 | }, 31 | "bundleDependencies": false, 32 | "deprecated": false, 33 | "description": "Ignore is a manager and filter for .gitignore rules, the one used by eslint, gitbook and many others.", 34 | "devDependencies": { 35 | "@babel/cli": "^7.5.5", 36 | "@babel/core": "^7.5.5", 37 | "@babel/preset-env": "^7.5.5", 38 | "codecov": "^3.5.0", 39 | "debug": "^4.1.1", 40 | "eslint": "^6.1.0", 41 | "eslint-config-ostai": "^3.0.0", 42 | "eslint-plugin-import": "^2.18.2", 43 | "mkdirp": "^0.5.1", 44 | "pre-suf": "^1.1.1", 45 | "rimraf": "^2.7.0", 46 | "spawn-sync": "^2.0.0", 47 | "tap": "^14.6.1", 48 | "tmp": "0.1.0", 49 | "typescript": "^3.5.3" 50 | }, 51 | "engines": { 52 | "node": ">= 4" 53 | }, 54 | "files": [ 55 | "legacy.js", 56 | "index.js", 57 | "index.d.ts", 58 | "LICENSE-MIT" 59 | ], 60 | "homepage": "https://github.com/kaelzhang/node-ignore#readme", 61 | "keywords": [ 62 | "ignore", 63 | ".gitignore", 64 | "gitignore", 65 | "npmignore", 66 | "rules", 67 | "manager", 68 | "filter", 69 | "regexp", 70 | "regex", 71 | "fnmatch", 72 | "glob", 73 | "asterisks", 74 | "regular-expression" 75 | ], 76 | "license": "MIT", 77 | "name": "ignore", 78 | "repository": { 79 | "type": "git", 80 | "url": "git+ssh://git@github.com/kaelzhang/node-ignore.git" 81 | }, 82 | "scripts": { 83 | "build": "babel -o legacy.js index.js", 84 | "posttest": "tap --coverage-report=html && codecov", 85 | "prepublishOnly": "npm run build", 86 | "test": "npm run test:only", 87 | "test:cases": "tap test/*.js --coverage", 88 | "test:git": "tap test/git-check-ignore.js", 89 | "test:ignore": "tap test/ignore.js", 90 | "test:lint": "eslint .", 91 | "test:only": "npm run test:lint && npm run test:tsc && npm run test:ts && npm run test:cases", 92 | "test:others": "tap test/others.js", 93 | "test:ts": "node ./test/ts/simple.js", 94 | "test:tsc": "tsc ./test/ts/simple.ts --lib ES6", 95 | "test:win32": "IGNORE_TEST_WIN32=1 npm run test" 96 | }, 97 | "version": "5.1.4" 98 | } 99 | -------------------------------------------------------------------------------- /node_modules/inflight/LICENSE: -------------------------------------------------------------------------------- 1 | The ISC License 2 | 3 | Copyright (c) Isaac Z. Schlueter 4 | 5 | Permission to use, copy, modify, and/or distribute this software for any 6 | purpose with or without fee is hereby granted, provided that the above 7 | copyright notice and this permission notice appear in all copies. 8 | 9 | THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES 10 | WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF 11 | MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR 12 | ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES 13 | WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN 14 | ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR 15 | IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 16 | -------------------------------------------------------------------------------- /node_modules/inflight/README.md: -------------------------------------------------------------------------------- 1 | # inflight 2 | 3 | Add callbacks to requests in flight to avoid async duplication 4 | 5 | ## USAGE 6 | 7 | ```javascript 8 | var inflight = require('inflight') 9 | 10 | // some request that does some stuff 11 | function req(key, callback) { 12 | // key is any random string. like a url or filename or whatever. 13 | // 14 | // will return either a falsey value, indicating that the 15 | // request for this key is already in flight, or a new callback 16 | // which when called will call all callbacks passed to inflightk 17 | // with the same key 18 | callback = inflight(key, callback) 19 | 20 | // If we got a falsey value back, then there's already a req going 21 | if (!callback) return 22 | 23 | // this is where you'd fetch the url or whatever 24 | // callback is also once()-ified, so it can safely be assigned 25 | // to multiple events etc. First call wins. 26 | setTimeout(function() { 27 | callback(null, key) 28 | }, 100) 29 | } 30 | 31 | // only assigns a single setTimeout 32 | // when it dings, all cbs get called 33 | req('foo', cb1) 34 | req('foo', cb2) 35 | req('foo', cb3) 36 | req('foo', cb4) 37 | ``` 38 | -------------------------------------------------------------------------------- /node_modules/inflight/inflight.js: -------------------------------------------------------------------------------- 1 | var wrappy = require('wrappy') 2 | var reqs = Object.create(null) 3 | var once = require('once') 4 | 5 | module.exports = wrappy(inflight) 6 | 7 | function inflight (key, cb) { 8 | if (reqs[key]) { 9 | reqs[key].push(cb) 10 | return null 11 | } else { 12 | reqs[key] = [cb] 13 | return makeres(key) 14 | } 15 | } 16 | 17 | function makeres (key) { 18 | return once(function RES () { 19 | var cbs = reqs[key] 20 | var len = cbs.length 21 | var args = slice(arguments) 22 | 23 | // XXX It's somewhat ambiguous whether a new callback added in this 24 | // pass should be queued for later execution if something in the 25 | // list of callbacks throws, or if it should just be discarded. 26 | // However, it's such an edge case that it hardly matters, and either 27 | // choice is likely as surprising as the other. 28 | // As it happens, we do go ahead and schedule it for later execution. 29 | try { 30 | for (var i = 0; i < len; i++) { 31 | cbs[i].apply(null, args) 32 | } 33 | } finally { 34 | if (cbs.length > len) { 35 | // added more in the interim. 36 | // de-zalgo, just in case, but don't call again. 37 | cbs.splice(0, len) 38 | process.nextTick(function () { 39 | RES.apply(null, args) 40 | }) 41 | } else { 42 | delete reqs[key] 43 | } 44 | } 45 | }) 46 | } 47 | 48 | function slice (args) { 49 | var length = args.length 50 | var array = [] 51 | 52 | for (var i = 0; i < length; i++) array[i] = args[i] 53 | return array 54 | } 55 | -------------------------------------------------------------------------------- /node_modules/inflight/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "_from": "inflight@^1.0.4", 3 | "_id": "inflight@1.0.6", 4 | "_inBundle": false, 5 | "_integrity": "sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk=", 6 | "_location": "/inflight", 7 | "_phantomChildren": {}, 8 | "_requested": { 9 | "type": "range", 10 | "registry": true, 11 | "raw": "inflight@^1.0.4", 12 | "name": "inflight", 13 | "escapedName": "inflight", 14 | "rawSpec": "^1.0.4", 15 | "saveSpec": null, 16 | "fetchSpec": "^1.0.4" 17 | }, 18 | "_requiredBy": [ 19 | "/glob" 20 | ], 21 | "_resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", 22 | "_shasum": "49bd6331d7d02d0c09bc910a1075ba8165b56df9", 23 | "_spec": "inflight@^1.0.4", 24 | "_where": "C:\\Users\\ShadowMoose\\Documents\\Git\\LoC-Badge\\node_modules\\glob", 25 | "author": { 26 | "name": "Isaac Z. Schlueter", 27 | "email": "i@izs.me", 28 | "url": "http://blog.izs.me/" 29 | }, 30 | "bugs": { 31 | "url": "https://github.com/isaacs/inflight/issues" 32 | }, 33 | "bundleDependencies": false, 34 | "dependencies": { 35 | "once": "^1.3.0", 36 | "wrappy": "1" 37 | }, 38 | "deprecated": false, 39 | "description": "Add callbacks to requests in flight to avoid async duplication", 40 | "devDependencies": { 41 | "tap": "^7.1.2" 42 | }, 43 | "files": [ 44 | "inflight.js" 45 | ], 46 | "homepage": "https://github.com/isaacs/inflight", 47 | "license": "ISC", 48 | "main": "inflight.js", 49 | "name": "inflight", 50 | "repository": { 51 | "type": "git", 52 | "url": "git+https://github.com/npm/inflight.git" 53 | }, 54 | "scripts": { 55 | "test": "tap test.js --100" 56 | }, 57 | "version": "1.0.6" 58 | } 59 | -------------------------------------------------------------------------------- /node_modules/inherits/LICENSE: -------------------------------------------------------------------------------- 1 | The ISC License 2 | 3 | Copyright (c) Isaac Z. Schlueter 4 | 5 | Permission to use, copy, modify, and/or distribute this software for any 6 | purpose with or without fee is hereby granted, provided that the above 7 | copyright notice and this permission notice appear in all copies. 8 | 9 | THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH 10 | REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND 11 | FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, 12 | INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM 13 | LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR 14 | OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR 15 | PERFORMANCE OF THIS SOFTWARE. 16 | 17 | -------------------------------------------------------------------------------- /node_modules/inherits/README.md: -------------------------------------------------------------------------------- 1 | Browser-friendly inheritance fully compatible with standard node.js 2 | [inherits](http://nodejs.org/api/util.html#util_util_inherits_constructor_superconstructor). 3 | 4 | This package exports standard `inherits` from node.js `util` module in 5 | node environment, but also provides alternative browser-friendly 6 | implementation through [browser 7 | field](https://gist.github.com/shtylman/4339901). Alternative 8 | implementation is a literal copy of standard one located in standalone 9 | module to avoid requiring of `util`. It also has a shim for old 10 | browsers with no `Object.create` support. 11 | 12 | While keeping you sure you are using standard `inherits` 13 | implementation in node.js environment, it allows bundlers such as 14 | [browserify](https://github.com/substack/node-browserify) to not 15 | include full `util` package to your client code if all you need is 16 | just `inherits` function. It worth, because browser shim for `util` 17 | package is large and `inherits` is often the single function you need 18 | from it. 19 | 20 | It's recommended to use this package instead of 21 | `require('util').inherits` for any code that has chances to be used 22 | not only in node.js but in browser too. 23 | 24 | ## usage 25 | 26 | ```js 27 | var inherits = require('inherits'); 28 | // then use exactly as the standard one 29 | ``` 30 | 31 | ## note on version ~1.0 32 | 33 | Version ~1.0 had completely different motivation and is not compatible 34 | neither with 2.0 nor with standard node.js `inherits`. 35 | 36 | If you are using version ~1.0 and planning to switch to ~2.0, be 37 | careful: 38 | 39 | * new version uses `super_` instead of `super` for referencing 40 | superclass 41 | * new version overwrites current prototype while old one preserves any 42 | existing fields on it 43 | -------------------------------------------------------------------------------- /node_modules/inherits/inherits.js: -------------------------------------------------------------------------------- 1 | try { 2 | var util = require('util'); 3 | /* istanbul ignore next */ 4 | if (typeof util.inherits !== 'function') throw ''; 5 | module.exports = util.inherits; 6 | } catch (e) { 7 | /* istanbul ignore next */ 8 | module.exports = require('./inherits_browser.js'); 9 | } 10 | -------------------------------------------------------------------------------- /node_modules/inherits/inherits_browser.js: -------------------------------------------------------------------------------- 1 | if (typeof Object.create === 'function') { 2 | // implementation from standard node.js 'util' module 3 | module.exports = function inherits(ctor, superCtor) { 4 | if (superCtor) { 5 | ctor.super_ = superCtor 6 | ctor.prototype = Object.create(superCtor.prototype, { 7 | constructor: { 8 | value: ctor, 9 | enumerable: false, 10 | writable: true, 11 | configurable: true 12 | } 13 | }) 14 | } 15 | }; 16 | } else { 17 | // old school shim for old browsers 18 | module.exports = function inherits(ctor, superCtor) { 19 | if (superCtor) { 20 | ctor.super_ = superCtor 21 | var TempCtor = function () {} 22 | TempCtor.prototype = superCtor.prototype 23 | ctor.prototype = new TempCtor() 24 | ctor.prototype.constructor = ctor 25 | } 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /node_modules/inherits/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "_from": "inherits@2", 3 | "_id": "inherits@2.0.4", 4 | "_inBundle": false, 5 | "_integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==", 6 | "_location": "/inherits", 7 | "_phantomChildren": {}, 8 | "_requested": { 9 | "type": "range", 10 | "registry": true, 11 | "raw": "inherits@2", 12 | "name": "inherits", 13 | "escapedName": "inherits", 14 | "rawSpec": "2", 15 | "saveSpec": null, 16 | "fetchSpec": "2" 17 | }, 18 | "_requiredBy": [ 19 | "/glob" 20 | ], 21 | "_resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", 22 | "_shasum": "0fa2c64f932917c3433a0ded55363aae37416b7c", 23 | "_spec": "inherits@2", 24 | "_where": "C:\\Users\\ShadowMoose\\Documents\\Git\\LoC-Badge\\node_modules\\glob", 25 | "browser": "./inherits_browser.js", 26 | "bugs": { 27 | "url": "https://github.com/isaacs/inherits/issues" 28 | }, 29 | "bundleDependencies": false, 30 | "deprecated": false, 31 | "description": "Browser-friendly inheritance fully compatible with standard node.js inherits()", 32 | "devDependencies": { 33 | "tap": "^14.2.4" 34 | }, 35 | "files": [ 36 | "inherits.js", 37 | "inherits_browser.js" 38 | ], 39 | "homepage": "https://github.com/isaacs/inherits#readme", 40 | "keywords": [ 41 | "inheritance", 42 | "class", 43 | "klass", 44 | "oop", 45 | "object-oriented", 46 | "inherits", 47 | "browser", 48 | "browserify" 49 | ], 50 | "license": "ISC", 51 | "main": "./inherits.js", 52 | "name": "inherits", 53 | "repository": { 54 | "type": "git", 55 | "url": "git://github.com/isaacs/inherits.git" 56 | }, 57 | "scripts": { 58 | "test": "tap" 59 | }, 60 | "version": "2.0.4" 61 | } 62 | -------------------------------------------------------------------------------- /node_modules/lodash.difference/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright jQuery Foundation and other contributors 2 | 3 | Based on Underscore.js, copyright Jeremy Ashkenas, 4 | DocumentCloud and Investigative Reporters & Editors 5 | 6 | This software consists of voluntary contributions made by many 7 | individuals. For exact contribution history, see the revision history 8 | available at https://github.com/lodash/lodash 9 | 10 | The following license applies to all parts of this software except as 11 | documented below: 12 | 13 | ==== 14 | 15 | Permission is hereby granted, free of charge, to any person obtaining 16 | a copy of this software and associated documentation files (the 17 | "Software"), to deal in the Software without restriction, including 18 | without limitation the rights to use, copy, modify, merge, publish, 19 | distribute, sublicense, and/or sell copies of the Software, and to 20 | permit persons to whom the Software is furnished to do so, subject to 21 | the following conditions: 22 | 23 | The above copyright notice and this permission notice shall be 24 | included in all copies or substantial portions of the Software. 25 | 26 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 27 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 28 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 29 | NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE 30 | LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION 31 | OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION 32 | WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 33 | 34 | ==== 35 | 36 | Copyright and related rights for sample code are waived via CC0. Sample 37 | code is defined as all source code displayed within the prose of the 38 | documentation. 39 | 40 | CC0: http://creativecommons.org/publicdomain/zero/1.0/ 41 | 42 | ==== 43 | 44 | Files located in the node_modules and vendor directories are externally 45 | maintained libraries used by this software which have their own 46 | licenses; we recommend you read them, as their terms may differ from the 47 | terms above. 48 | -------------------------------------------------------------------------------- /node_modules/lodash.difference/README.md: -------------------------------------------------------------------------------- 1 | # lodash.difference v4.5.0 2 | 3 | The [lodash](https://lodash.com/) method `_.difference` exported as a [Node.js](https://nodejs.org/) module. 4 | 5 | ## Installation 6 | 7 | Using npm: 8 | ```bash 9 | $ {sudo -H} npm i -g npm 10 | $ npm i --save lodash.difference 11 | ``` 12 | 13 | In Node.js: 14 | ```js 15 | var difference = require('lodash.difference'); 16 | ``` 17 | 18 | See the [documentation](https://lodash.com/docs#difference) or [package source](https://github.com/lodash/lodash/blob/4.5.0-npm-packages/lodash.difference) for more details. 19 | -------------------------------------------------------------------------------- /node_modules/lodash.difference/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "_from": "lodash.difference@^4.5.0", 3 | "_id": "lodash.difference@4.5.0", 4 | "_inBundle": false, 5 | "_integrity": "sha1-nMtOUF1Ia5FlE0V3KIWi3yf9AXw=", 6 | "_location": "/lodash.difference", 7 | "_phantomChildren": {}, 8 | "_requested": { 9 | "type": "range", 10 | "registry": true, 11 | "raw": "lodash.difference@^4.5.0", 12 | "name": "lodash.difference", 13 | "escapedName": "lodash.difference", 14 | "rawSpec": "^4.5.0", 15 | "saveSpec": null, 16 | "fetchSpec": "^4.5.0" 17 | }, 18 | "_requiredBy": [ 19 | "/glob-gitignore" 20 | ], 21 | "_resolved": "https://registry.npmjs.org/lodash.difference/-/lodash.difference-4.5.0.tgz", 22 | "_shasum": "9ccb4e505d486b91651345772885a2df27fd017c", 23 | "_spec": "lodash.difference@^4.5.0", 24 | "_where": "C:\\Users\\ShadowMoose\\Documents\\Git\\LoC-Badge\\node_modules\\glob-gitignore", 25 | "author": { 26 | "name": "John-David Dalton", 27 | "email": "john.david.dalton@gmail.com", 28 | "url": "http://allyoucanleet.com/" 29 | }, 30 | "bugs": { 31 | "url": "https://github.com/lodash/lodash/issues" 32 | }, 33 | "bundleDependencies": false, 34 | "contributors": [ 35 | { 36 | "name": "John-David Dalton", 37 | "email": "john.david.dalton@gmail.com", 38 | "url": "http://allyoucanleet.com/" 39 | }, 40 | { 41 | "name": "Blaine Bublitz", 42 | "email": "blaine.bublitz@gmail.com", 43 | "url": "https://github.com/phated" 44 | }, 45 | { 46 | "name": "Mathias Bynens", 47 | "email": "mathias@qiwi.be", 48 | "url": "https://mathiasbynens.be/" 49 | } 50 | ], 51 | "deprecated": false, 52 | "description": "The lodash method `_.difference` exported as a module.", 53 | "homepage": "https://lodash.com/", 54 | "icon": "https://lodash.com/icon.svg", 55 | "keywords": [ 56 | "lodash-modularized", 57 | "difference" 58 | ], 59 | "license": "MIT", 60 | "name": "lodash.difference", 61 | "repository": { 62 | "type": "git", 63 | "url": "git+https://github.com/lodash/lodash.git" 64 | }, 65 | "scripts": { 66 | "test": "echo \"See https://travis-ci.org/lodash/lodash-cli for testing details.\"" 67 | }, 68 | "version": "4.5.0" 69 | } 70 | -------------------------------------------------------------------------------- /node_modules/lodash.union/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright jQuery Foundation and other contributors 2 | 3 | Based on Underscore.js, copyright Jeremy Ashkenas, 4 | DocumentCloud and Investigative Reporters & Editors 5 | 6 | This software consists of voluntary contributions made by many 7 | individuals. For exact contribution history, see the revision history 8 | available at https://github.com/lodash/lodash 9 | 10 | The following license applies to all parts of this software except as 11 | documented below: 12 | 13 | ==== 14 | 15 | Permission is hereby granted, free of charge, to any person obtaining 16 | a copy of this software and associated documentation files (the 17 | "Software"), to deal in the Software without restriction, including 18 | without limitation the rights to use, copy, modify, merge, publish, 19 | distribute, sublicense, and/or sell copies of the Software, and to 20 | permit persons to whom the Software is furnished to do so, subject to 21 | the following conditions: 22 | 23 | The above copyright notice and this permission notice shall be 24 | included in all copies or substantial portions of the Software. 25 | 26 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 27 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 28 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 29 | NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE 30 | LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION 31 | OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION 32 | WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 33 | 34 | ==== 35 | 36 | Copyright and related rights for sample code are waived via CC0. Sample 37 | code is defined as all source code displayed within the prose of the 38 | documentation. 39 | 40 | CC0: http://creativecommons.org/publicdomain/zero/1.0/ 41 | 42 | ==== 43 | 44 | Files located in the node_modules and vendor directories are externally 45 | maintained libraries used by this software which have their own 46 | licenses; we recommend you read them, as their terms may differ from the 47 | terms above. 48 | -------------------------------------------------------------------------------- /node_modules/lodash.union/README.md: -------------------------------------------------------------------------------- 1 | # lodash.union v4.6.0 2 | 3 | The [lodash](https://lodash.com/) method `_.union` exported as a [Node.js](https://nodejs.org/) module. 4 | 5 | ## Installation 6 | 7 | Using npm: 8 | ```bash 9 | $ {sudo -H} npm i -g npm 10 | $ npm i --save lodash.union 11 | ``` 12 | 13 | In Node.js: 14 | ```js 15 | var union = require('lodash.union'); 16 | ``` 17 | 18 | See the [documentation](https://lodash.com/docs#union) or [package source](https://github.com/lodash/lodash/blob/4.6.0-npm-packages/lodash.union) for more details. 19 | -------------------------------------------------------------------------------- /node_modules/lodash.union/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "_from": "lodash.union@^4.6.0", 3 | "_id": "lodash.union@4.6.0", 4 | "_inBundle": false, 5 | "_integrity": "sha1-SLtQiECfFvGCFmZkHETdGqrjzYg=", 6 | "_location": "/lodash.union", 7 | "_phantomChildren": {}, 8 | "_requested": { 9 | "type": "range", 10 | "registry": true, 11 | "raw": "lodash.union@^4.6.0", 12 | "name": "lodash.union", 13 | "escapedName": "lodash.union", 14 | "rawSpec": "^4.6.0", 15 | "saveSpec": null, 16 | "fetchSpec": "^4.6.0" 17 | }, 18 | "_requiredBy": [ 19 | "/glob-gitignore" 20 | ], 21 | "_resolved": "https://registry.npmjs.org/lodash.union/-/lodash.union-4.6.0.tgz", 22 | "_shasum": "48bb5088409f16f1821666641c44dd1aaae3cd88", 23 | "_spec": "lodash.union@^4.6.0", 24 | "_where": "C:\\Users\\ShadowMoose\\Documents\\Git\\LoC-Badge\\node_modules\\glob-gitignore", 25 | "author": { 26 | "name": "John-David Dalton", 27 | "email": "john.david.dalton@gmail.com", 28 | "url": "http://allyoucanleet.com/" 29 | }, 30 | "bugs": { 31 | "url": "https://github.com/lodash/lodash/issues" 32 | }, 33 | "bundleDependencies": false, 34 | "contributors": [ 35 | { 36 | "name": "John-David Dalton", 37 | "email": "john.david.dalton@gmail.com", 38 | "url": "http://allyoucanleet.com/" 39 | }, 40 | { 41 | "name": "Blaine Bublitz", 42 | "email": "blaine.bublitz@gmail.com", 43 | "url": "https://github.com/phated" 44 | }, 45 | { 46 | "name": "Mathias Bynens", 47 | "email": "mathias@qiwi.be", 48 | "url": "https://mathiasbynens.be/" 49 | } 50 | ], 51 | "deprecated": false, 52 | "description": "The lodash method `_.union` exported as a module.", 53 | "homepage": "https://lodash.com/", 54 | "icon": "https://lodash.com/icon.svg", 55 | "keywords": [ 56 | "lodash-modularized", 57 | "union" 58 | ], 59 | "license": "MIT", 60 | "name": "lodash.union", 61 | "repository": { 62 | "type": "git", 63 | "url": "git+https://github.com/lodash/lodash.git" 64 | }, 65 | "scripts": { 66 | "test": "echo \"See https://travis-ci.org/lodash/lodash-cli for testing details.\"" 67 | }, 68 | "version": "4.6.0" 69 | } 70 | -------------------------------------------------------------------------------- /node_modules/make-array/README.md: -------------------------------------------------------------------------------- 1 | [![NPM version](https://badge.fury.io/js/make-array.svg)](http://badge.fury.io/js/make-array) 2 | [![Build Status](https://travis-ci.org/kaelzhang/make-array.svg?branch=master)](https://travis-ci.org/kaelzhang/make-array) 3 | 4 | # make-array 5 | 6 | Creates a real Array from almost anything. 7 | 8 | ## Install 9 | 10 | ```bash 11 | $ npm i make-array --save 12 | ``` 13 | 14 | ## Usage 15 | 16 | ```js 17 | var makeArray = require('make-array'); 18 | makeArray(); // [] 19 | makeArray(undefined); // [] 20 | makeArray(null); // [] 21 | makeArray(1); // [1] 22 | makeArray([1, 2]); // [1, 2] 23 | makeArray({ 24 | '0': 1, 25 | '1': 2, 26 | length: 2 27 | }); // [1, 2] 28 | 29 | function foo (){ 30 | return makeArray(arguments); 31 | } 32 | 33 | foo(1, 2, 3); // [1, 2, 3] 34 | ``` 35 | 36 | ### makeArray(subject, [host]) 37 | 38 | - subject `mixed` things you want to make it an array 39 | - host `Array=` if `host` is specified, the newly-created array will append to the end of the `host` 40 | 41 | Returns `Array`. If `host` is specified, it will return the `host` itself. 42 | 43 | ```js 44 | var host = [1, 2]; 45 | function foo(){ 46 | return arguments; 47 | } 48 | 49 | var result = makeArray(foo({}, []), host); 50 | result; // [1, 2, {}, []]; 51 | result === host; // true 52 | ``` 53 | 54 | ## Changelog 55 | 56 | **1.0.0**: bump version to mark it as stable. 57 | 58 | ## License 59 | 60 | MIT 61 | 62 | -------------------------------------------------------------------------------- /node_modules/make-array/index.js: -------------------------------------------------------------------------------- 1 | // @param {all} subject 2 | // if nodelist, returns an array which generated from the nodelist 3 | // if Array, returns the array itself 4 | // otherwise, returns an array contains the subject 5 | // @param {Array=} host 6 | module.exports = function (subject, host) { 7 | // false -> [false] 8 | // null -> [] 9 | // undefined -> makeArray() -> [] 10 | if (subject === undefined || subject === null) { 11 | return host || [] 12 | } 13 | 14 | // if is already an array 15 | if (isArray(subject)) { 16 | return host 17 | ? host.concat(subject) 18 | : subject 19 | } 20 | 21 | host || (host = []) 22 | if (isArrayLikeObject(subject)) { 23 | // IE fails on collections and ) 24 | // use subject clone instead of Array.prototype.slice 25 | clonePureArray(subject, host) 26 | 27 | } else { 28 | host.push(subject) 29 | } 30 | 31 | return host 32 | } 33 | 34 | var toString = Object.prototype.toString 35 | function isArray (subject) { 36 | return toString.call(subject) === '[object Array]' 37 | } 38 | 39 | // altered from jQuery 40 | function isArrayLikeObject (subject) { 41 | var length = subject.length 42 | 43 | if ( 44 | typeof subject === 'function' 45 | || Object(subject) !== subject 46 | || typeof length !== 'number' 47 | // `window` already has a property `length` 48 | || 'setInterval' in subject 49 | ) { 50 | return false 51 | } 52 | 53 | return length === 0 54 | || length > 0 && (length - 1) in subject 55 | } 56 | 57 | /** 58 | * clone an object as a pure subject, and ignore non-number properties 59 | * @param {Array} subject 60 | * @param {Array|Object} host required, receiver which the subject be cloned to 61 | */ 62 | function clonePureArray (subject, host) { 63 | var i = subject.length 64 | var start = host.length 65 | 66 | while (i --) { 67 | host[start + i] = subject[i] 68 | } 69 | 70 | return host 71 | } 72 | -------------------------------------------------------------------------------- /node_modules/make-array/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "_from": "make-array@^1.0.5", 3 | "_id": "make-array@1.0.5", 4 | "_inBundle": false, 5 | "_integrity": "sha512-sgK2SAzxT19rWU+qxKUcn6PAh/swiIiz2F8C2cZjLc1z4iwYIfdoihqFIDQ8BDzAGtWPYJ6Sr13K1j/DXynDLA==", 6 | "_location": "/make-array", 7 | "_phantomChildren": {}, 8 | "_requested": { 9 | "type": "range", 10 | "registry": true, 11 | "raw": "make-array@^1.0.5", 12 | "name": "make-array", 13 | "escapedName": "make-array", 14 | "rawSpec": "^1.0.5", 15 | "saveSpec": null, 16 | "fetchSpec": "^1.0.5" 17 | }, 18 | "_requiredBy": [ 19 | "/glob-gitignore" 20 | ], 21 | "_resolved": "https://registry.npmjs.org/make-array/-/make-array-1.0.5.tgz", 22 | "_shasum": "326a7635c756a9f61ce0b2a6fdd5cc3460419bcb", 23 | "_spec": "make-array@^1.0.5", 24 | "_where": "C:\\Users\\ShadowMoose\\Documents\\Git\\LoC-Badge\\node_modules\\glob-gitignore", 25 | "author": { 26 | "name": "kael" 27 | }, 28 | "bugs": { 29 | "url": "https://github.com/kaelzhang/make-array/issues" 30 | }, 31 | "bundleDependencies": false, 32 | "cortex": { 33 | "devDependencies": { 34 | "chai": "*" 35 | } 36 | }, 37 | "deprecated": false, 38 | "description": "Creates a real Array from almost anything.", 39 | "devDependencies": { 40 | "chai": "*", 41 | "mocha": "*" 42 | }, 43 | "engines": { 44 | "node": ">=0.10.0" 45 | }, 46 | "files": [ 47 | "index.js" 48 | ], 49 | "homepage": "https://github.com/kaelzhang/make-array#readme", 50 | "keywords": [ 51 | "make-array", 52 | "to-array", 53 | "makearray", 54 | "toarray", 55 | "array", 56 | "iterate" 57 | ], 58 | "license": "MIT", 59 | "main": "index.js", 60 | "name": "make-array", 61 | "repository": { 62 | "type": "git", 63 | "url": "git://github.com/kaelzhang/make-array.git" 64 | }, 65 | "scripts": { 66 | "test": "sh test.sh" 67 | }, 68 | "version": "1.0.5" 69 | } 70 | -------------------------------------------------------------------------------- /node_modules/minimatch/LICENSE: -------------------------------------------------------------------------------- 1 | The ISC License 2 | 3 | Copyright (c) Isaac Z. Schlueter and Contributors 4 | 5 | Permission to use, copy, modify, and/or distribute this software for any 6 | purpose with or without fee is hereby granted, provided that the above 7 | copyright notice and this permission notice appear in all copies. 8 | 9 | THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES 10 | WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF 11 | MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR 12 | ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES 13 | WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN 14 | ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR 15 | IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 16 | -------------------------------------------------------------------------------- /node_modules/minimatch/README.md: -------------------------------------------------------------------------------- 1 | # minimatch 2 | 3 | A minimal matching utility. 4 | 5 | [![Build Status](https://secure.travis-ci.org/isaacs/minimatch.svg)](http://travis-ci.org/isaacs/minimatch) 6 | 7 | 8 | This is the matching library used internally by npm. 9 | 10 | It works by converting glob expressions into JavaScript `RegExp` 11 | objects. 12 | 13 | ## Usage 14 | 15 | ```javascript 16 | var minimatch = require("minimatch") 17 | 18 | minimatch("bar.foo", "*.foo") // true! 19 | minimatch("bar.foo", "*.bar") // false! 20 | minimatch("bar.foo", "*.+(bar|foo)", { debug: true }) // true, and noisy! 21 | ``` 22 | 23 | ## Features 24 | 25 | Supports these glob features: 26 | 27 | * Brace Expansion 28 | * Extended glob matching 29 | * "Globstar" `**` matching 30 | 31 | See: 32 | 33 | * `man sh` 34 | * `man bash` 35 | * `man 3 fnmatch` 36 | * `man 5 gitignore` 37 | 38 | ## Minimatch Class 39 | 40 | Create a minimatch object by instantiating the `minimatch.Minimatch` class. 41 | 42 | ```javascript 43 | var Minimatch = require("minimatch").Minimatch 44 | var mm = new Minimatch(pattern, options) 45 | ``` 46 | 47 | ### Properties 48 | 49 | * `pattern` The original pattern the minimatch object represents. 50 | * `options` The options supplied to the constructor. 51 | * `set` A 2-dimensional array of regexp or string expressions. 52 | Each row in the 53 | array corresponds to a brace-expanded pattern. Each item in the row 54 | corresponds to a single path-part. For example, the pattern 55 | `{a,b/c}/d` would expand to a set of patterns like: 56 | 57 | [ [ a, d ] 58 | , [ b, c, d ] ] 59 | 60 | If a portion of the pattern doesn't have any "magic" in it 61 | (that is, it's something like `"foo"` rather than `fo*o?`), then it 62 | will be left as a string rather than converted to a regular 63 | expression. 64 | 65 | * `regexp` Created by the `makeRe` method. A single regular expression 66 | expressing the entire pattern. This is useful in cases where you wish 67 | to use the pattern somewhat like `fnmatch(3)` with `FNM_PATH` enabled. 68 | * `negate` True if the pattern is negated. 69 | * `comment` True if the pattern is a comment. 70 | * `empty` True if the pattern is `""`. 71 | 72 | ### Methods 73 | 74 | * `makeRe` Generate the `regexp` member if necessary, and return it. 75 | Will return `false` if the pattern is invalid. 76 | * `match(fname)` Return true if the filename matches the pattern, or 77 | false otherwise. 78 | * `matchOne(fileArray, patternArray, partial)` Take a `/`-split 79 | filename, and match it against a single row in the `regExpSet`. This 80 | method is mainly for internal use, but is exposed so that it can be 81 | used by a glob-walker that needs to avoid excessive filesystem calls. 82 | 83 | All other methods are internal, and will be called as necessary. 84 | 85 | ### minimatch(path, pattern, options) 86 | 87 | Main export. Tests a path against the pattern using the options. 88 | 89 | ```javascript 90 | var isJS = minimatch(file, "*.js", { matchBase: true }) 91 | ``` 92 | 93 | ### minimatch.filter(pattern, options) 94 | 95 | Returns a function that tests its 96 | supplied argument, suitable for use with `Array.filter`. Example: 97 | 98 | ```javascript 99 | var javascripts = fileList.filter(minimatch.filter("*.js", {matchBase: true})) 100 | ``` 101 | 102 | ### minimatch.match(list, pattern, options) 103 | 104 | Match against the list of 105 | files, in the style of fnmatch or glob. If nothing is matched, and 106 | options.nonull is set, then return a list containing the pattern itself. 107 | 108 | ```javascript 109 | var javascripts = minimatch.match(fileList, "*.js", {matchBase: true})) 110 | ``` 111 | 112 | ### minimatch.makeRe(pattern, options) 113 | 114 | Make a regular expression object from the pattern. 115 | 116 | ## Options 117 | 118 | All options are `false` by default. 119 | 120 | ### debug 121 | 122 | Dump a ton of stuff to stderr. 123 | 124 | ### nobrace 125 | 126 | Do not expand `{a,b}` and `{1..3}` brace sets. 127 | 128 | ### noglobstar 129 | 130 | Disable `**` matching against multiple folder names. 131 | 132 | ### dot 133 | 134 | Allow patterns to match filenames starting with a period, even if 135 | the pattern does not explicitly have a period in that spot. 136 | 137 | Note that by default, `a/**/b` will **not** match `a/.d/b`, unless `dot` 138 | is set. 139 | 140 | ### noext 141 | 142 | Disable "extglob" style patterns like `+(a|b)`. 143 | 144 | ### nocase 145 | 146 | Perform a case-insensitive match. 147 | 148 | ### nonull 149 | 150 | When a match is not found by `minimatch.match`, return a list containing 151 | the pattern itself if this option is set. When not set, an empty list 152 | is returned if there are no matches. 153 | 154 | ### matchBase 155 | 156 | If set, then patterns without slashes will be matched 157 | against the basename of the path if it contains slashes. For example, 158 | `a?b` would match the path `/xyz/123/acb`, but not `/xyz/acb/123`. 159 | 160 | ### nocomment 161 | 162 | Suppress the behavior of treating `#` at the start of a pattern as a 163 | comment. 164 | 165 | ### nonegate 166 | 167 | Suppress the behavior of treating a leading `!` character as negation. 168 | 169 | ### flipNegate 170 | 171 | Returns from negate expressions the same as if they were not negated. 172 | (Ie, true on a hit, false on a miss.) 173 | 174 | 175 | ## Comparisons to other fnmatch/glob implementations 176 | 177 | While strict compliance with the existing standards is a worthwhile 178 | goal, some discrepancies exist between minimatch and other 179 | implementations, and are intentional. 180 | 181 | If the pattern starts with a `!` character, then it is negated. Set the 182 | `nonegate` flag to suppress this behavior, and treat leading `!` 183 | characters normally. This is perhaps relevant if you wish to start the 184 | pattern with a negative extglob pattern like `!(a|B)`. Multiple `!` 185 | characters at the start of a pattern will negate the pattern multiple 186 | times. 187 | 188 | If a pattern starts with `#`, then it is treated as a comment, and 189 | will not match anything. Use `\#` to match a literal `#` at the 190 | start of a line, or set the `nocomment` flag to suppress this behavior. 191 | 192 | The double-star character `**` is supported by default, unless the 193 | `noglobstar` flag is set. This is supported in the manner of bsdglob 194 | and bash 4.1, where `**` only has special significance if it is the only 195 | thing in a path part. That is, `a/**/b` will match `a/x/y/b`, but 196 | `a/**b` will not. 197 | 198 | If an escaped pattern has no matches, and the `nonull` flag is set, 199 | then minimatch.match returns the pattern as-provided, rather than 200 | interpreting the character escapes. For example, 201 | `minimatch.match([], "\\*a\\?")` will return `"\\*a\\?"` rather than 202 | `"*a?"`. This is akin to setting the `nullglob` option in bash, except 203 | that it does not resolve escaped pattern characters. 204 | 205 | If brace expansion is not disabled, then it is performed before any 206 | other interpretation of the glob pattern. Thus, a pattern like 207 | `+(a|{b),c)}`, which would not be valid in bash or zsh, is expanded 208 | **first** into the set of `+(a|b)` and `+(a|c)`, and those patterns are 209 | checked for validity. Since those two are valid, matching proceeds. 210 | -------------------------------------------------------------------------------- /node_modules/minimatch/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "_from": "minimatch@^3.0.4", 3 | "_id": "minimatch@3.0.4", 4 | "_inBundle": false, 5 | "_integrity": "sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==", 6 | "_location": "/minimatch", 7 | "_phantomChildren": {}, 8 | "_requested": { 9 | "type": "range", 10 | "registry": true, 11 | "raw": "minimatch@^3.0.4", 12 | "name": "minimatch", 13 | "escapedName": "minimatch", 14 | "rawSpec": "^3.0.4", 15 | "saveSpec": null, 16 | "fetchSpec": "^3.0.4" 17 | }, 18 | "_requiredBy": [ 19 | "/glob" 20 | ], 21 | "_resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz", 22 | "_shasum": "5166e286457f03306064be5497e8dbb0c3d32083", 23 | "_spec": "minimatch@^3.0.4", 24 | "_where": "C:\\Users\\ShadowMoose\\Documents\\Git\\LoC-Badge\\node_modules\\glob", 25 | "author": { 26 | "name": "Isaac Z. Schlueter", 27 | "email": "i@izs.me", 28 | "url": "http://blog.izs.me" 29 | }, 30 | "bugs": { 31 | "url": "https://github.com/isaacs/minimatch/issues" 32 | }, 33 | "bundleDependencies": false, 34 | "dependencies": { 35 | "brace-expansion": "^1.1.7" 36 | }, 37 | "deprecated": false, 38 | "description": "a glob matcher in javascript", 39 | "devDependencies": { 40 | "tap": "^10.3.2" 41 | }, 42 | "engines": { 43 | "node": "*" 44 | }, 45 | "files": [ 46 | "minimatch.js" 47 | ], 48 | "homepage": "https://github.com/isaacs/minimatch#readme", 49 | "license": "ISC", 50 | "main": "minimatch.js", 51 | "name": "minimatch", 52 | "repository": { 53 | "type": "git", 54 | "url": "git://github.com/isaacs/minimatch.git" 55 | }, 56 | "scripts": { 57 | "postpublish": "git push origin --all; git push origin --tags", 58 | "postversion": "npm publish", 59 | "preversion": "npm test", 60 | "test": "tap test/*.js --cov" 61 | }, 62 | "version": "3.0.4" 63 | } 64 | -------------------------------------------------------------------------------- /node_modules/once/LICENSE: -------------------------------------------------------------------------------- 1 | The ISC License 2 | 3 | Copyright (c) Isaac Z. Schlueter and Contributors 4 | 5 | Permission to use, copy, modify, and/or distribute this software for any 6 | purpose with or without fee is hereby granted, provided that the above 7 | copyright notice and this permission notice appear in all copies. 8 | 9 | THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES 10 | WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF 11 | MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR 12 | ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES 13 | WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN 14 | ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR 15 | IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 16 | -------------------------------------------------------------------------------- /node_modules/once/README.md: -------------------------------------------------------------------------------- 1 | # once 2 | 3 | Only call a function once. 4 | 5 | ## usage 6 | 7 | ```javascript 8 | var once = require('once') 9 | 10 | function load (file, cb) { 11 | cb = once(cb) 12 | loader.load('file') 13 | loader.once('load', cb) 14 | loader.once('error', cb) 15 | } 16 | ``` 17 | 18 | Or add to the Function.prototype in a responsible way: 19 | 20 | ```javascript 21 | // only has to be done once 22 | require('once').proto() 23 | 24 | function load (file, cb) { 25 | cb = cb.once() 26 | loader.load('file') 27 | loader.once('load', cb) 28 | loader.once('error', cb) 29 | } 30 | ``` 31 | 32 | Ironically, the prototype feature makes this module twice as 33 | complicated as necessary. 34 | 35 | To check whether you function has been called, use `fn.called`. Once the 36 | function is called for the first time the return value of the original 37 | function is saved in `fn.value` and subsequent calls will continue to 38 | return this value. 39 | 40 | ```javascript 41 | var once = require('once') 42 | 43 | function load (cb) { 44 | cb = once(cb) 45 | var stream = createStream() 46 | stream.once('data', cb) 47 | stream.once('end', function () { 48 | if (!cb.called) cb(new Error('not found')) 49 | }) 50 | } 51 | ``` 52 | 53 | ## `once.strict(func)` 54 | 55 | Throw an error if the function is called twice. 56 | 57 | Some functions are expected to be called only once. Using `once` for them would 58 | potentially hide logical errors. 59 | 60 | In the example below, the `greet` function has to call the callback only once: 61 | 62 | ```javascript 63 | function greet (name, cb) { 64 | // return is missing from the if statement 65 | // when no name is passed, the callback is called twice 66 | if (!name) cb('Hello anonymous') 67 | cb('Hello ' + name) 68 | } 69 | 70 | function log (msg) { 71 | console.log(msg) 72 | } 73 | 74 | // this will print 'Hello anonymous' but the logical error will be missed 75 | greet(null, once(msg)) 76 | 77 | // once.strict will print 'Hello anonymous' and throw an error when the callback will be called the second time 78 | greet(null, once.strict(msg)) 79 | ``` 80 | -------------------------------------------------------------------------------- /node_modules/once/once.js: -------------------------------------------------------------------------------- 1 | var wrappy = require('wrappy') 2 | module.exports = wrappy(once) 3 | module.exports.strict = wrappy(onceStrict) 4 | 5 | once.proto = once(function () { 6 | Object.defineProperty(Function.prototype, 'once', { 7 | value: function () { 8 | return once(this) 9 | }, 10 | configurable: true 11 | }) 12 | 13 | Object.defineProperty(Function.prototype, 'onceStrict', { 14 | value: function () { 15 | return onceStrict(this) 16 | }, 17 | configurable: true 18 | }) 19 | }) 20 | 21 | function once (fn) { 22 | var f = function () { 23 | if (f.called) return f.value 24 | f.called = true 25 | return f.value = fn.apply(this, arguments) 26 | } 27 | f.called = false 28 | return f 29 | } 30 | 31 | function onceStrict (fn) { 32 | var f = function () { 33 | if (f.called) 34 | throw new Error(f.onceError) 35 | f.called = true 36 | return f.value = fn.apply(this, arguments) 37 | } 38 | var name = fn.name || 'Function wrapped with `once`' 39 | f.onceError = name + " shouldn't be called more than once" 40 | f.called = false 41 | return f 42 | } 43 | -------------------------------------------------------------------------------- /node_modules/once/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "_from": "once@^1.3.0", 3 | "_id": "once@1.4.0", 4 | "_inBundle": false, 5 | "_integrity": "sha1-WDsap3WWHUsROsF9nFC6753Xa9E=", 6 | "_location": "/once", 7 | "_phantomChildren": {}, 8 | "_requested": { 9 | "type": "range", 10 | "registry": true, 11 | "raw": "once@^1.3.0", 12 | "name": "once", 13 | "escapedName": "once", 14 | "rawSpec": "^1.3.0", 15 | "saveSpec": null, 16 | "fetchSpec": "^1.3.0" 17 | }, 18 | "_requiredBy": [ 19 | "/glob", 20 | "/inflight" 21 | ], 22 | "_resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", 23 | "_shasum": "583b1aa775961d4b113ac17d9c50baef9dd76bd1", 24 | "_spec": "once@^1.3.0", 25 | "_where": "C:\\Users\\ShadowMoose\\Documents\\Git\\LoC-Badge\\node_modules\\glob", 26 | "author": { 27 | "name": "Isaac Z. Schlueter", 28 | "email": "i@izs.me", 29 | "url": "http://blog.izs.me/" 30 | }, 31 | "bugs": { 32 | "url": "https://github.com/isaacs/once/issues" 33 | }, 34 | "bundleDependencies": false, 35 | "dependencies": { 36 | "wrappy": "1" 37 | }, 38 | "deprecated": false, 39 | "description": "Run a function exactly one time", 40 | "devDependencies": { 41 | "tap": "^7.0.1" 42 | }, 43 | "directories": { 44 | "test": "test" 45 | }, 46 | "files": [ 47 | "once.js" 48 | ], 49 | "homepage": "https://github.com/isaacs/once#readme", 50 | "keywords": [ 51 | "once", 52 | "function", 53 | "one", 54 | "single" 55 | ], 56 | "license": "ISC", 57 | "main": "once.js", 58 | "name": "once", 59 | "repository": { 60 | "type": "git", 61 | "url": "git://github.com/isaacs/once.git" 62 | }, 63 | "scripts": { 64 | "test": "tap test/*.js" 65 | }, 66 | "version": "1.4.0" 67 | } 68 | -------------------------------------------------------------------------------- /node_modules/path-is-absolute/index.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | function posix(path) { 4 | return path.charAt(0) === '/'; 5 | } 6 | 7 | function win32(path) { 8 | // https://github.com/nodejs/node/blob/b3fcc245fb25539909ef1d5eaa01dbf92e168633/lib/path.js#L56 9 | var splitDeviceRe = /^([a-zA-Z]:|[\\\/]{2}[^\\\/]+[\\\/]+[^\\\/]+)?([\\\/])?([\s\S]*?)$/; 10 | var result = splitDeviceRe.exec(path); 11 | var device = result[1] || ''; 12 | var isUnc = Boolean(device && device.charAt(1) !== ':'); 13 | 14 | // UNC paths are always absolute 15 | return Boolean(result[2] || isUnc); 16 | } 17 | 18 | module.exports = process.platform === 'win32' ? win32 : posix; 19 | module.exports.posix = posix; 20 | module.exports.win32 = win32; 21 | -------------------------------------------------------------------------------- /node_modules/path-is-absolute/license: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) Sindre Sorhus (sindresorhus.com) 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in 13 | all copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 21 | THE SOFTWARE. 22 | -------------------------------------------------------------------------------- /node_modules/path-is-absolute/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "_from": "path-is-absolute@^1.0.0", 3 | "_id": "path-is-absolute@1.0.1", 4 | "_inBundle": false, 5 | "_integrity": "sha1-F0uSaHNVNP+8es5r9TpanhtcX18=", 6 | "_location": "/path-is-absolute", 7 | "_phantomChildren": {}, 8 | "_requested": { 9 | "type": "range", 10 | "registry": true, 11 | "raw": "path-is-absolute@^1.0.0", 12 | "name": "path-is-absolute", 13 | "escapedName": "path-is-absolute", 14 | "rawSpec": "^1.0.0", 15 | "saveSpec": null, 16 | "fetchSpec": "^1.0.0" 17 | }, 18 | "_requiredBy": [ 19 | "/glob" 20 | ], 21 | "_resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", 22 | "_shasum": "174b9268735534ffbc7ace6bf53a5a9e1b5c5f5f", 23 | "_spec": "path-is-absolute@^1.0.0", 24 | "_where": "C:\\Users\\ShadowMoose\\Documents\\Git\\LoC-Badge\\node_modules\\glob", 25 | "author": { 26 | "name": "Sindre Sorhus", 27 | "email": "sindresorhus@gmail.com", 28 | "url": "sindresorhus.com" 29 | }, 30 | "bugs": { 31 | "url": "https://github.com/sindresorhus/path-is-absolute/issues" 32 | }, 33 | "bundleDependencies": false, 34 | "deprecated": false, 35 | "description": "Node.js 0.12 path.isAbsolute() ponyfill", 36 | "devDependencies": { 37 | "xo": "^0.16.0" 38 | }, 39 | "engines": { 40 | "node": ">=0.10.0" 41 | }, 42 | "files": [ 43 | "index.js" 44 | ], 45 | "homepage": "https://github.com/sindresorhus/path-is-absolute#readme", 46 | "keywords": [ 47 | "path", 48 | "paths", 49 | "file", 50 | "dir", 51 | "absolute", 52 | "isabsolute", 53 | "is-absolute", 54 | "built-in", 55 | "util", 56 | "utils", 57 | "core", 58 | "ponyfill", 59 | "polyfill", 60 | "shim", 61 | "is", 62 | "detect", 63 | "check" 64 | ], 65 | "license": "MIT", 66 | "name": "path-is-absolute", 67 | "repository": { 68 | "type": "git", 69 | "url": "git+https://github.com/sindresorhus/path-is-absolute.git" 70 | }, 71 | "scripts": { 72 | "test": "xo && node test.js" 73 | }, 74 | "version": "1.0.1" 75 | } 76 | -------------------------------------------------------------------------------- /node_modules/path-is-absolute/readme.md: -------------------------------------------------------------------------------- 1 | # path-is-absolute [![Build Status](https://travis-ci.org/sindresorhus/path-is-absolute.svg?branch=master)](https://travis-ci.org/sindresorhus/path-is-absolute) 2 | 3 | > Node.js 0.12 [`path.isAbsolute()`](http://nodejs.org/api/path.html#path_path_isabsolute_path) [ponyfill](https://ponyfill.com) 4 | 5 | 6 | ## Install 7 | 8 | ``` 9 | $ npm install --save path-is-absolute 10 | ``` 11 | 12 | 13 | ## Usage 14 | 15 | ```js 16 | const pathIsAbsolute = require('path-is-absolute'); 17 | 18 | // Running on Linux 19 | pathIsAbsolute('/home/foo'); 20 | //=> true 21 | pathIsAbsolute('C:/Users/foo'); 22 | //=> false 23 | 24 | // Running on Windows 25 | pathIsAbsolute('C:/Users/foo'); 26 | //=> true 27 | pathIsAbsolute('/home/foo'); 28 | //=> false 29 | 30 | // Running on any OS 31 | pathIsAbsolute.posix('/home/foo'); 32 | //=> true 33 | pathIsAbsolute.posix('C:/Users/foo'); 34 | //=> false 35 | pathIsAbsolute.win32('C:/Users/foo'); 36 | //=> true 37 | pathIsAbsolute.win32('/home/foo'); 38 | //=> false 39 | ``` 40 | 41 | 42 | ## API 43 | 44 | See the [`path.isAbsolute()` docs](http://nodejs.org/api/path.html#path_path_isabsolute_path). 45 | 46 | ### pathIsAbsolute(path) 47 | 48 | ### pathIsAbsolute.posix(path) 49 | 50 | POSIX specific version. 51 | 52 | ### pathIsAbsolute.win32(path) 53 | 54 | Windows specific version. 55 | 56 | 57 | ## License 58 | 59 | MIT © [Sindre Sorhus](https://sindresorhus.com) 60 | -------------------------------------------------------------------------------- /node_modules/util.inherits/HISTORY.md: -------------------------------------------------------------------------------- 1 | # History 2 | -------------------------------------------------------------------------------- /node_modules/util.inherits/README.md: -------------------------------------------------------------------------------- 1 | [![Build Status](https://travis-ci.org/kaelzhang/node-util-inherits.svg?branch=master)](https://travis-ci.org/kaelzhang/node-util-inherits) 2 | 5 | 8 | 11 | 14 | 15 | # util-inherits 16 | 17 | util.inherits with compatibility. 18 | 19 | `util-inherits` will try use `Object.setPrototypeOf`, if `Object.setPrototypeOf` is not supported, then `Object.create`, or manipulate prototype. 20 | 21 | - Browser friendly. 22 | - Does not rely on node utilities 23 | 24 | ## Install 25 | 26 | ```sh 27 | $ npm install util.inherits --save 28 | ``` 29 | 30 | ## Usage 31 | 32 | ```js 33 | const inherits = require('util.inherits') 34 | const {EventEmitter} = require('events') 35 | 36 | function MyClass () { 37 | // code ... 38 | } 39 | 40 | inherits(MyClass, EventEmitter) 41 | ``` 42 | 43 | ## License 44 | 45 | MIT 46 | -------------------------------------------------------------------------------- /node_modules/util.inherits/index.js: -------------------------------------------------------------------------------- 1 | const inherits = typeof Object.setPrototypeOf === 'function' 2 | ? function (ctor, superCtor) { 3 | ctor.super_ = superCtor 4 | Object.setPrototypeOf(ctor.prototype, superCtor.prototype) 5 | } 6 | 7 | : typeof Object.create === 'function' 8 | ? function (ctor, superCtor) { 9 | ctor.super_ = superCtor; 10 | ctor.prototype = Object.create(superCtor.prototype, { 11 | constructor: { 12 | value: ctor, 13 | enumerable: false, 14 | writable: true, 15 | configurable: true 16 | } 17 | }) 18 | } 19 | 20 | : function (ctor, superCtor) { 21 | ctor.super_ = superCtor 22 | function F () {} 23 | F.prototype = superCtor.prototype 24 | ctor.prototype = new F 25 | ctor.prototype.constructor = ctor 26 | } 27 | 28 | 29 | module.exports = function (ctor, superCtor) { 30 | 31 | if (ctor === undefined || ctor === null) { 32 | throw new TypeError('The constructor to "inherits" must not be ' + 33 | 'null or undefined') 34 | } 35 | 36 | if (superCtor === undefined || superCtor === null) { 37 | throw new TypeError('The super constructor to "inherits" must not ' + 38 | 'be null or undefined') 39 | } 40 | 41 | if (superCtor.prototype === undefined) { 42 | throw new TypeError('The super constructor to "inherits" must ' + 43 | 'have a prototype') 44 | } 45 | 46 | inherits(ctor, superCtor) 47 | } 48 | -------------------------------------------------------------------------------- /node_modules/util.inherits/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "_from": "util.inherits@^1.0.3", 3 | "_id": "util.inherits@1.0.3", 4 | "_inBundle": false, 5 | "_integrity": "sha1-qcYmoNBtNIKdR7pWyrEnjXRfnOY=", 6 | "_location": "/util.inherits", 7 | "_phantomChildren": {}, 8 | "_requested": { 9 | "type": "range", 10 | "registry": true, 11 | "raw": "util.inherits@^1.0.3", 12 | "name": "util.inherits", 13 | "escapedName": "util.inherits", 14 | "rawSpec": "^1.0.3", 15 | "saveSpec": null, 16 | "fetchSpec": "^1.0.3" 17 | }, 18 | "_requiredBy": [ 19 | "/glob-gitignore" 20 | ], 21 | "_resolved": "https://registry.npmjs.org/util.inherits/-/util.inherits-1.0.3.tgz", 22 | "_shasum": "a9c626a0d06d34829d47ba56cab1278d745f9ce6", 23 | "_spec": "util.inherits@^1.0.3", 24 | "_where": "C:\\Users\\ShadowMoose\\Documents\\Git\\LoC-Badge\\node_modules\\glob-gitignore", 25 | "author": { 26 | "name": "kaelzhang" 27 | }, 28 | "ava": { 29 | "require": "babel-register", 30 | "babel": { 31 | "babelrc": true 32 | }, 33 | "files": [ 34 | "test.js" 35 | ] 36 | }, 37 | "bugs": { 38 | "url": "https://github.com/kaelzhang/node-util-inherits/issues" 39 | }, 40 | "bundleDependencies": false, 41 | "deprecated": false, 42 | "description": "util.inherits with compatibility", 43 | "devDependencies": { 44 | "ava": "^0.16.0", 45 | "babel-plugin-syntax-trailing-function-commas": "^6.13.0", 46 | "babel-plugin-transform-async-to-generator": "^6.22.0", 47 | "babel-plugin-transform-class-properties": "^6.16.0", 48 | "babel-plugin-transform-es2015-modules-commonjs": "^6.16.0", 49 | "babel-plugin-transform-exponentiation-operator": "^6.8.0", 50 | "babel-plugin-transform-inline-environment-variables": "^6.8.0", 51 | "babel-plugin-transform-object-rest-spread": "^6.16.0", 52 | "babel-plugin-transform-runtime": "^6.23.0", 53 | "babel-preset-es2015": "^6.16.0", 54 | "babel-register": "^6.24.1" 55 | }, 56 | "engines": { 57 | "node": ">=4" 58 | }, 59 | "files": [ 60 | "index.js" 61 | ], 62 | "homepage": "https://github.com/kaelzhang/node-util-inherits#readme", 63 | "keywords": [ 64 | "util-inherits", 65 | "inherits", 66 | "class-extends", 67 | "extend", 68 | "legacy" 69 | ], 70 | "license": "MIT", 71 | "main": "index.js", 72 | "name": "util.inherits", 73 | "repository": { 74 | "type": "git", 75 | "url": "git://github.com/kaelzhang/node-util-inherits.git" 76 | }, 77 | "scripts": { 78 | "test": "node --harmony ./node_modules/.bin/ava --verbose --timeout=10s" 79 | }, 80 | "version": "1.0.3" 81 | } 82 | -------------------------------------------------------------------------------- /node_modules/wrappy/LICENSE: -------------------------------------------------------------------------------- 1 | The ISC License 2 | 3 | Copyright (c) Isaac Z. Schlueter and Contributors 4 | 5 | Permission to use, copy, modify, and/or distribute this software for any 6 | purpose with or without fee is hereby granted, provided that the above 7 | copyright notice and this permission notice appear in all copies. 8 | 9 | THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES 10 | WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF 11 | MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR 12 | ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES 13 | WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN 14 | ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR 15 | IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 16 | -------------------------------------------------------------------------------- /node_modules/wrappy/README.md: -------------------------------------------------------------------------------- 1 | # wrappy 2 | 3 | Callback wrapping utility 4 | 5 | ## USAGE 6 | 7 | ```javascript 8 | var wrappy = require("wrappy") 9 | 10 | // var wrapper = wrappy(wrapperFunction) 11 | 12 | // make sure a cb is called only once 13 | // See also: http://npm.im/once for this specific use case 14 | var once = wrappy(function (cb) { 15 | var called = false 16 | return function () { 17 | if (called) return 18 | called = true 19 | return cb.apply(this, arguments) 20 | } 21 | }) 22 | 23 | function printBoo () { 24 | console.log('boo') 25 | } 26 | // has some rando property 27 | printBoo.iAmBooPrinter = true 28 | 29 | var onlyPrintOnce = once(printBoo) 30 | 31 | onlyPrintOnce() // prints 'boo' 32 | onlyPrintOnce() // does nothing 33 | 34 | // random property is retained! 35 | assert.equal(onlyPrintOnce.iAmBooPrinter, true) 36 | ``` 37 | -------------------------------------------------------------------------------- /node_modules/wrappy/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "_from": "wrappy@1", 3 | "_id": "wrappy@1.0.2", 4 | "_inBundle": false, 5 | "_integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=", 6 | "_location": "/wrappy", 7 | "_phantomChildren": {}, 8 | "_requested": { 9 | "type": "range", 10 | "registry": true, 11 | "raw": "wrappy@1", 12 | "name": "wrappy", 13 | "escapedName": "wrappy", 14 | "rawSpec": "1", 15 | "saveSpec": null, 16 | "fetchSpec": "1" 17 | }, 18 | "_requiredBy": [ 19 | "/inflight", 20 | "/once" 21 | ], 22 | "_resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", 23 | "_shasum": "b5243d8f3ec1aa35f1364605bc0d1036e30ab69f", 24 | "_spec": "wrappy@1", 25 | "_where": "C:\\Users\\ShadowMoose\\Documents\\Git\\LoC-Badge\\node_modules\\inflight", 26 | "author": { 27 | "name": "Isaac Z. Schlueter", 28 | "email": "i@izs.me", 29 | "url": "http://blog.izs.me/" 30 | }, 31 | "bugs": { 32 | "url": "https://github.com/npm/wrappy/issues" 33 | }, 34 | "bundleDependencies": false, 35 | "dependencies": {}, 36 | "deprecated": false, 37 | "description": "Callback wrapping utility", 38 | "devDependencies": { 39 | "tap": "^2.3.1" 40 | }, 41 | "directories": { 42 | "test": "test" 43 | }, 44 | "files": [ 45 | "wrappy.js" 46 | ], 47 | "homepage": "https://github.com/npm/wrappy", 48 | "license": "ISC", 49 | "main": "wrappy.js", 50 | "name": "wrappy", 51 | "repository": { 52 | "type": "git", 53 | "url": "git+https://github.com/npm/wrappy.git" 54 | }, 55 | "scripts": { 56 | "test": "tap --coverage test/*.js" 57 | }, 58 | "version": "1.0.2" 59 | } 60 | -------------------------------------------------------------------------------- /node_modules/wrappy/wrappy.js: -------------------------------------------------------------------------------- 1 | // Returns a wrapper function that returns a wrapped callback 2 | // The wrapper function should do some stuff, and return a 3 | // presumably different callback function. 4 | // This makes sure that own properties are retained, so that 5 | // decorations and such are not lost along the way. 6 | module.exports = wrappy 7 | function wrappy (fn, cb) { 8 | if (fn && cb) return wrappy(fn)(cb) 9 | 10 | if (typeof fn !== 'function') 11 | throw new TypeError('need wrapper function') 12 | 13 | Object.keys(fn).forEach(function (k) { 14 | wrapper[k] = fn[k] 15 | }) 16 | 17 | return wrapper 18 | 19 | function wrapper() { 20 | var args = new Array(arguments.length) 21 | for (var i = 0; i < args.length; i++) { 22 | args[i] = arguments[i] 23 | } 24 | var ret = fn.apply(this, args) 25 | var cb = args[args.length-1] 26 | if (typeof ret === 'function' && ret !== cb) { 27 | Object.keys(cb).forEach(function (k) { 28 | ret[k] = cb[k] 29 | }) 30 | } 31 | return ret 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /package-lock.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "gha-loc-badge", 3 | "version": "1.0.0", 4 | "lockfileVersion": 1, 5 | "requires": true, 6 | "dependencies": { 7 | "@actions/core": { 8 | "version": "1.2.3", 9 | "resolved": "https://registry.npmjs.org/@actions/core/-/core-1.2.3.tgz", 10 | "integrity": "sha512-Wp4xnyokakM45Uuj4WLUxdsa8fJjKVl1fDTsPbTEcTcuu0Nb26IPQbOtjmnfaCPGcaoPOOqId8H9NapZ8gii4w==" 11 | }, 12 | "badgen": { 13 | "version": "3.0.1", 14 | "resolved": "https://registry.npmjs.org/badgen/-/badgen-3.0.1.tgz", 15 | "integrity": "sha512-ANQ8b2/zOvqLUMJ5fLgUCO7xRmOqFx9+ZOta9p3Taudd9c/gHEAh+5Ivnr2zFgj9kguTzXKkEzfI48hDwGWNcA==" 16 | }, 17 | "balanced-match": { 18 | "version": "1.0.0", 19 | "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.0.tgz", 20 | "integrity": "sha1-ibTRmasr7kneFk6gK4nORi1xt2c=" 21 | }, 22 | "brace-expansion": { 23 | "version": "1.1.11", 24 | "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", 25 | "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", 26 | "requires": { 27 | "balanced-match": "^1.0.0", 28 | "concat-map": "0.0.1" 29 | } 30 | }, 31 | "concat-map": { 32 | "version": "0.0.1", 33 | "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", 34 | "integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=" 35 | }, 36 | "fs.realpath": { 37 | "version": "1.0.0", 38 | "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", 39 | "integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8=" 40 | }, 41 | "glob": { 42 | "version": "7.1.6", 43 | "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.6.tgz", 44 | "integrity": "sha512-LwaxwyZ72Lk7vZINtNNrywX0ZuLyStrdDtabefZKAY5ZGJhVtgdznluResxNmPitE0SAO+O26sWTHeKSI2wMBA==", 45 | "requires": { 46 | "fs.realpath": "^1.0.0", 47 | "inflight": "^1.0.4", 48 | "inherits": "2", 49 | "minimatch": "^3.0.4", 50 | "once": "^1.3.0", 51 | "path-is-absolute": "^1.0.0" 52 | } 53 | }, 54 | "glob-gitignore": { 55 | "version": "1.0.14", 56 | "resolved": "https://registry.npmjs.org/glob-gitignore/-/glob-gitignore-1.0.14.tgz", 57 | "integrity": "sha512-YuAEPqL58bOQDqDF2kMv009rIjSAtPs+WPzyGbwRWK+wD0UWQVRoP34Pz6yJ6ivco65C9tZnaIt0I3JCuQ8NZQ==", 58 | "requires": { 59 | "glob": "^7.1.3", 60 | "ignore": "^5.0.5", 61 | "lodash.difference": "^4.5.0", 62 | "lodash.union": "^4.6.0", 63 | "make-array": "^1.0.5", 64 | "util.inherits": "^1.0.3" 65 | } 66 | }, 67 | "ignore": { 68 | "version": "5.1.4", 69 | "resolved": "https://registry.npmjs.org/ignore/-/ignore-5.1.4.tgz", 70 | "integrity": "sha512-MzbUSahkTW1u7JpKKjY7LCARd1fU5W2rLdxlM4kdkayuCwZImjkpluF9CM1aLewYJguPDqewLam18Y6AU69A8A==" 71 | }, 72 | "inflight": { 73 | "version": "1.0.6", 74 | "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", 75 | "integrity": "sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk=", 76 | "requires": { 77 | "once": "^1.3.0", 78 | "wrappy": "1" 79 | } 80 | }, 81 | "inherits": { 82 | "version": "2.0.4", 83 | "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", 84 | "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==" 85 | }, 86 | "lodash.difference": { 87 | "version": "4.5.0", 88 | "resolved": "https://registry.npmjs.org/lodash.difference/-/lodash.difference-4.5.0.tgz", 89 | "integrity": "sha1-nMtOUF1Ia5FlE0V3KIWi3yf9AXw=" 90 | }, 91 | "lodash.union": { 92 | "version": "4.6.0", 93 | "resolved": "https://registry.npmjs.org/lodash.union/-/lodash.union-4.6.0.tgz", 94 | "integrity": "sha1-SLtQiECfFvGCFmZkHETdGqrjzYg=" 95 | }, 96 | "make-array": { 97 | "version": "1.0.5", 98 | "resolved": "https://registry.npmjs.org/make-array/-/make-array-1.0.5.tgz", 99 | "integrity": "sha512-sgK2SAzxT19rWU+qxKUcn6PAh/swiIiz2F8C2cZjLc1z4iwYIfdoihqFIDQ8BDzAGtWPYJ6Sr13K1j/DXynDLA==" 100 | }, 101 | "minimatch": { 102 | "version": "3.0.4", 103 | "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz", 104 | "integrity": "sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==", 105 | "requires": { 106 | "brace-expansion": "^1.1.7" 107 | } 108 | }, 109 | "once": { 110 | "version": "1.4.0", 111 | "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", 112 | "integrity": "sha1-WDsap3WWHUsROsF9nFC6753Xa9E=", 113 | "requires": { 114 | "wrappy": "1" 115 | } 116 | }, 117 | "path-is-absolute": { 118 | "version": "1.0.1", 119 | "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", 120 | "integrity": "sha1-F0uSaHNVNP+8es5r9TpanhtcX18=" 121 | }, 122 | "util.inherits": { 123 | "version": "1.0.3", 124 | "resolved": "https://registry.npmjs.org/util.inherits/-/util.inherits-1.0.3.tgz", 125 | "integrity": "sha1-qcYmoNBtNIKdR7pWyrEnjXRfnOY=" 126 | }, 127 | "wrappy": { 128 | "version": "1.0.2", 129 | "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", 130 | "integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=" 131 | } 132 | } 133 | } 134 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "gha-loc-badge", 3 | "version": "1.0.0", 4 | "license": "MIT", 5 | "repository": "https://github.com/shadowmoose/GHA-LoC-Badge", 6 | "dependencies": { 7 | "@actions/core": "^1.2.3", 8 | "badgen": "^3.0.1", 9 | "glob-gitignore": "^1.0.14" 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /src/index.js: -------------------------------------------------------------------------------- 1 | const { badgen } = require('badgen'); 2 | const fs = require('fs').promises; 3 | const path = require('path'); 4 | const core = require('@actions/core'); 5 | const { glob } = require('glob-gitignore'); 6 | 7 | 8 | const st = Date.now(); 9 | const dir = core.getInput('directory') || './'; 10 | const debug = core.getInput('debug') === 'true'; 11 | const badge = core.getInput('badge') || './badge.svg'; 12 | const patterns = (core.getInput('patterns')||'').split('|').map(s => s.trim()).filter(s=>s); 13 | const ignore = (core.getInput('ignore') || '').split('|').map(s => s.trim()).filter(s=>s); 14 | 15 | const badgeOpts = {}; 16 | for (const en of Object.keys(process.env)) { 17 | if (en.startsWith('INPUT_BADGE_')) { 18 | badgeOpts[en.replace('INPUT_BADGE_', '').toLowerCase()] = process.env[en] 19 | } 20 | } 21 | 22 | if (debug) core.info('Debugging enabled.'); 23 | 24 | 25 | async function countLines(fullPath) { 26 | return new Promise((res, rej) => { 27 | let count = 1; 28 | require('fs').createReadStream(fullPath) 29 | .on('data', function(chunk) { 30 | let index = -1; 31 | while((index = chunk.indexOf(10, index + 1)) > -1) count++ 32 | }) 33 | .on('end', function() { 34 | res(count); 35 | }) 36 | .on('error', function(err) { 37 | rej(err) 38 | }); 39 | }) 40 | } 41 | 42 | const countThrottled = throttle(countLines, 10); 43 | 44 | /** 45 | * Recursively count the lines in all matching files within the given directory. 46 | * 47 | * @param dir {string} The path to check. 48 | * @param patterns {string[]} array of patterns to match against. 49 | * @param negative {string[]} array of patterns to NOT match against. 50 | * @return {Promise<{ignored: number, lines: number, counted: number}>} An array of all files located, as absolute paths. 51 | */ 52 | async function getFiles (dir, patterns = [], negative = []) { 53 | let lines = 0, ignored=0, counted=0; 54 | 55 | await glob(patterns, { 56 | cwd: dir, 57 | ignore: negative, 58 | nodir: true 59 | }).then(files => { 60 | counted = files.length; 61 | return Promise.all(files.map( async f => { 62 | try { 63 | if (debug) core.info(`Counting: ${f}`); 64 | return await countThrottled(f); 65 | } catch (err) { 66 | core.error(err); 67 | return 0; 68 | } 69 | })) 70 | }).then(res => res.map(r => lines += r)); 71 | 72 | return { lines, ignored, counted }; 73 | } 74 | 75 | function throttle(callback, limit=5) { 76 | let idx = 0; 77 | const queue = new Array(limit); 78 | 79 | return async (...args) => { 80 | const offset = idx++ % limit; 81 | const blocker = queue[offset]; 82 | let cb = null; 83 | queue[offset] = new Promise((res) => cb = res); // Next call waits for this call's resolution. 84 | 85 | if (blocker) await blocker; 86 | try { 87 | return await callback.apply(this, args); 88 | } finally { 89 | cb(); 90 | } 91 | } 92 | } 93 | 94 | 95 | function makeBadge(text, config) { 96 | let { label, color, style, scale, labelcolor } = (config || {}); 97 | label = label || 'Lines of Code'; 98 | color = color || 'blue'; 99 | labelcolor = labelcolor || '555'; 100 | style = style || 'classic'; 101 | scale = scale? parseInt(scale) : 1; 102 | 103 | // only `status` is required. 104 | return badgen({ 105 | label: `${label}`, // 106 | labelcolor, // or (default: '555') 107 | status: `${text}`, // , required 108 | color, // or (default: 'blue') 109 | style, // 'flat' or 'classic' (default: 'classic') 110 | scale // Set badge scale (default: 1) 111 | }); 112 | } 113 | 114 | 115 | getFiles(dir, patterns, ignore).then( async ret => { 116 | core.info(`Counted ${ret.lines} Lines from ${ret.counted} Files, ignoring ${ret.ignored} Files.`) 117 | core.info(`Took: ${Date.now() - st}`); 118 | 119 | core.setOutput("total_lines", `${ret.lines}`); 120 | core.setOutput("ignored_files", `${ret.ignored}`); 121 | core.setOutput("counted_files", `${ret.counted}`); 122 | core.setOutput("elapsed_ms", `${Date.now() - st}`); 123 | core.setOutput("output_path", `${path.resolve(badge)}`); 124 | core.setOutput("output_dir", `${path.resolve(path.dirname(badge))}`); 125 | 126 | await fs.mkdir(path.dirname(badge), { recursive: true }) 127 | 128 | await fs.writeFile(badge, makeBadge(ret.lines.toLocaleString(), badgeOpts)); 129 | }) 130 | --------------------------------------------------------------------------------