├── .gitignore ├── .idea ├── misc.xml ├── modules.xml ├── use-private-action.iml ├── vcs.xml └── workspace.xml ├── README.md ├── action.yml ├── build.sh ├── dist └── main.js ├── jest.config.js ├── node_modules ├── .bin │ └── js-yaml ├── @actions │ ├── core │ │ ├── README.md │ │ ├── lib │ │ │ ├── command.d.ts │ │ │ ├── command.js │ │ │ ├── command.js.map │ │ │ ├── core.d.ts │ │ │ ├── core.js │ │ │ └── core.js.map │ │ └── package.json │ ├── exec │ │ ├── LICENSE.md │ │ ├── README.md │ │ ├── lib │ │ │ ├── exec.d.ts │ │ │ ├── exec.js │ │ │ ├── exec.js.map │ │ │ ├── interfaces.d.ts │ │ │ ├── interfaces.js │ │ │ ├── interfaces.js.map │ │ │ ├── toolrunner.d.ts │ │ │ ├── toolrunner.js │ │ │ └── toolrunner.js.map │ │ └── package.json │ └── io │ │ ├── LICENSE.md │ │ ├── README.md │ │ ├── lib │ │ ├── io-util.d.ts │ │ ├── io-util.js │ │ ├── io-util.js.map │ │ ├── io.d.ts │ │ ├── io.js │ │ └── io.js.map │ │ └── package.json ├── argparse │ ├── CHANGELOG.md │ ├── LICENSE │ ├── README.md │ ├── index.js │ ├── lib │ │ ├── action.js │ │ ├── action │ │ │ ├── append.js │ │ │ ├── append │ │ │ │ └── constant.js │ │ │ ├── count.js │ │ │ ├── help.js │ │ │ ├── store.js │ │ │ ├── store │ │ │ │ ├── constant.js │ │ │ │ ├── false.js │ │ │ │ └── true.js │ │ │ ├── subparsers.js │ │ │ └── version.js │ │ ├── action_container.js │ │ ├── argparse.js │ │ ├── argument │ │ │ ├── error.js │ │ │ ├── exclusive.js │ │ │ └── group.js │ │ ├── argument_parser.js │ │ ├── const.js │ │ ├── help │ │ │ ├── added_formatters.js │ │ │ └── formatter.js │ │ ├── namespace.js │ │ └── utils.js │ └── package.json ├── js-yaml │ ├── CHANGELOG.md │ ├── LICENSE │ ├── README.md │ ├── bin │ │ └── js-yaml.js │ ├── dist │ │ ├── js-yaml.js │ │ └── js-yaml.min.js │ ├── index.js │ ├── lib │ │ ├── js-yaml.js │ │ └── js-yaml │ │ │ ├── common.js │ │ │ ├── dumper.js │ │ │ ├── exception.js │ │ │ ├── loader.js │ │ │ ├── mark.js │ │ │ ├── schema.js │ │ │ ├── schema │ │ │ ├── core.js │ │ │ ├── default_full.js │ │ │ ├── default_safe.js │ │ │ ├── failsafe.js │ │ │ └── json.js │ │ │ ├── type.js │ │ │ └── type │ │ │ ├── binary.js │ │ │ ├── bool.js │ │ │ ├── float.js │ │ │ ├── int.js │ │ │ ├── js │ │ │ ├── function.js │ │ │ ├── regexp.js │ │ │ └── undefined.js │ │ │ ├── map.js │ │ │ ├── merge.js │ │ │ ├── null.js │ │ │ ├── omap.js │ │ │ ├── pairs.js │ │ │ ├── seq.js │ │ │ ├── set.js │ │ │ ├── str.js │ │ │ └── timestamp.js │ ├── node_modules │ │ ├── .bin │ │ │ ├── esparse │ │ │ └── esvalidate │ │ └── esprima │ │ │ ├── ChangeLog │ │ │ ├── LICENSE.BSD │ │ │ ├── README.md │ │ │ ├── bin │ │ │ ├── esparse.js │ │ │ └── esvalidate.js │ │ │ ├── dist │ │ │ └── esprima.js │ │ │ └── package.json │ └── package.json └── sprintf-js │ ├── .npmignore │ ├── LICENSE │ ├── README.md │ ├── bower.json │ ├── demo │ └── angular.html │ ├── dist │ ├── angular-sprintf.min.js │ ├── angular-sprintf.min.js.map │ ├── angular-sprintf.min.map │ ├── sprintf.min.js │ ├── sprintf.min.js.map │ └── sprintf.min.map │ ├── gruntfile.js │ ├── package.json │ ├── src │ ├── angular-sprintf.js │ └── sprintf.js │ └── test │ └── test.js ├── package-lock.json ├── package.json ├── src └── main.ts └── tsconfig.json /.gitignore: -------------------------------------------------------------------------------- 1 | __tests__/runner/* 2 | 3 | # comment out in distribution branches 4 | node_modules/ 5 | 6 | # Rest pulled from https://github.com/github/gitignore/blob/master/Node.gitignore 7 | # Logs 8 | logs 9 | *.log 10 | npm-debug.log* 11 | yarn-debug.log* 12 | yarn-error.log* 13 | lerna-debug.log* 14 | 15 | # Diagnostic reports (https://nodejs.org/api/report.html) 16 | report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json 17 | 18 | # Runtime data 19 | pids 20 | *.pid 21 | *.seed 22 | *.pid.lock 23 | 24 | # Directory for instrumented libs generated by jscoverage/JSCover 25 | lib-cov 26 | 27 | # Coverage directory used by tools like istanbul 28 | coverage 29 | *.lcov 30 | 31 | # nyc test coverage 32 | .nyc_output 33 | 34 | # Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files) 35 | .grunt 36 | 37 | # Bower dependency directory (https://bower.io/) 38 | bower_components 39 | 40 | # node-waf configuration 41 | .lock-wscript 42 | 43 | # Compiled binary addons (https://nodejs.org/api/addons.html) 44 | build/Release 45 | 46 | # Dependency directories 47 | jspm_packages/ 48 | 49 | # TypeScript v1 declaration files 50 | typings/ 51 | 52 | # TypeScript cache 53 | *.tsbuildinfo 54 | 55 | # Optional npm cache directory 56 | .npm 57 | 58 | # Optional eslint cache 59 | .eslintcache 60 | 61 | # Optional REPL history 62 | .node_repl_history 63 | 64 | # Output of 'npm pack' 65 | *.tgz 66 | 67 | # Yarn Integrity file 68 | .yarn-integrity 69 | 70 | # dotenv environment variables file 71 | .env 72 | .env.test 73 | 74 | # parcel-bundler cache (https://parceljs.org/) 75 | .cache 76 | 77 | # next.js build output 78 | .next 79 | 80 | # nuxt.js build output 81 | .nuxt 82 | 83 | # vuepress build output 84 | .vuepress/dist 85 | 86 | # Serverless directories 87 | .serverless/ 88 | 89 | # FuseBox cache 90 | .fusebox/ 91 | 92 | # DynamoDB Local files 93 | .dynamodb/ 94 | -------------------------------------------------------------------------------- /.idea/misc.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /.idea/modules.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /.idea/use-private-action.iml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /.idea/vcs.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # `bagbyte/use-private-action` GitHub action 2 | 3 | This action allow to use custom actions in private GitHub repository. 4 | 5 | ## Usage 6 | 7 | ```yaml 8 | # .github/workflows/my-workflow.yml 9 | jobs: 10 | my_job: 11 | ... 12 | steps: 13 | - uses: bagbyte/use-private-action@v0.0.2 14 | with: 15 | private-action: 16 | private-action-token: ${{ secrets.PRIVATE_REPO_ACCESS_TOKEN }} 17 | - ... other steps 18 | ``` 19 | 20 | **Note:** both `private-action` and `private-action-token` are required fields. `private-action` has the same format as the value you can use in the `uses`: `{org}/{repo}[/path]@ref` 21 | 22 | ## Prerequisites 23 | 24 | ### Access Token 25 | 26 | To access private repositories, you need to create an access token. To create a new access token: 27 | 1. Access your Developer Settings on this [page](https://github.com/settings/tokens) 28 | 2. Click on `Generate new token` button 29 | 3. Enter your password to confirm your identity 30 | 4. Assign a name to this token (i.e. `Github actions private repository`) 31 | 5. Select `repo` (this allows this access token to access your repositories) 32 | 6. Copy the generated token (once you leave this page the value will not be accessible anymore, so take care of pasting somewhere) 33 | 34 | ### Secrets 35 | 36 | We need to create a Secret, in th repository where you will use this action. To do that: 37 | 1. Go to your repository `Settings > Secrets` 38 | 2. Click on `Add ay new secret` link 39 | 3. Choose a name for this secret (i.e. `PRIVATE_REPO_ACCESS_TOKEN`), and add the previously copied value of the token in the `Value` box 40 | 41 | 42 | ## Knowing issues and limitation 43 | 44 | ### Build your code 45 | 46 | In case your action is written in `Typescript`, the repository should contain the build folder. 47 | 48 | ### Commit your `node_modules` folder 49 | 50 | Your private repository must have `node_modules` folder committed. 51 | 52 | ### Expose your main activity function 53 | 54 | To allow this action to execute and run your code, you should export the main function in your private action main file. 55 | 56 | ```js 57 | // dist/main.js 58 | 59 | ... 60 | 61 | export function start() { 62 | ... 63 | } 64 | 65 | ... 66 | 67 | start(); 68 | ``` 69 | 70 | ### Actions supported 71 | 72 | Right now it supports only nodejs actions. 73 | -------------------------------------------------------------------------------- /action.yml: -------------------------------------------------------------------------------- 1 | name: 'bagbyte/use-private-action' 2 | description: 'This action allows the use of custom actions in private GitHub repositories.' 3 | author: 'bagbyte' 4 | branding: 5 | icon: 'external-link' 6 | color: 'gray-dark' 7 | inputs: 8 | private-action: 9 | description: 'Private action to execute, format: {org}/{repo}[/path]@ref' 10 | required: true 11 | private-action-token: 12 | description: 'Token to access the private repository' 13 | required: true 14 | runs: 15 | using: 'node12' 16 | main: 'dist/main.js' 17 | -------------------------------------------------------------------------------- /build.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | npm i 4 | npm run build 5 | npm prune --prod 6 | -------------------------------------------------------------------------------- /jest.config.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | clearMocks: true, 3 | moduleFileExtensions: ['js', 'ts'], 4 | testEnvironment: 'node', 5 | testMatch: ['**/*.test.ts'], 6 | testRunner: 'jest-circus/runner', 7 | transform: { 8 | '^.+\\.ts$': 'ts-jest' 9 | }, 10 | verbose: true 11 | } -------------------------------------------------------------------------------- /node_modules/.bin/js-yaml: -------------------------------------------------------------------------------- 1 | ../js-yaml/bin/js-yaml.js -------------------------------------------------------------------------------- /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 | // Do stuff 86 | } 87 | catch (err) { 88 | core.error(`Error ${err}, action may still succeed though`); 89 | } 90 | ``` 91 | 92 | This library can also wrap chunks of output in foldable groups. 93 | 94 | ```js 95 | const core = require('@actions/core') 96 | 97 | // Manually wrap output 98 | core.startGroup('Do some function') 99 | doSomeFunction() 100 | core.endGroup() 101 | 102 | // Wrap an asynchronous function call 103 | const result = await core.group('Do something async', async () => { 104 | const response = await doSomeHTTPRequest() 105 | return response 106 | }) 107 | ``` 108 | 109 | #### Action state 110 | 111 | You can use this library to save state and get state for sharing information between a given wrapper action: 112 | 113 | **action.yml** 114 | ```yaml 115 | name: 'Wrapper action sample' 116 | inputs: 117 | name: 118 | default: 'GitHub' 119 | runs: 120 | using: 'node12' 121 | main: 'main.js' 122 | post: 'cleanup.js' 123 | ``` 124 | 125 | In action's `main.js`: 126 | 127 | ```js 128 | const core = require('@actions/core'); 129 | 130 | core.saveState("pidToKill", 12345); 131 | ``` 132 | 133 | In action's `cleanup.js`: 134 | ```js 135 | const core = require('@actions/core'); 136 | 137 | var pid = core.getState("pidToKill"); 138 | 139 | process.kill(pid); 140 | ``` -------------------------------------------------------------------------------- /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 user warning message 12 | * ##[set-secret name=mypassword]definitelyNotAPassword! 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 | Object.defineProperty(exports, "__esModule", { value: true }); 3 | const os = require("os"); 4 | /** 5 | * Commands 6 | * 7 | * Command Format: 8 | * ##[name key=value;key=value]message 9 | * 10 | * Examples: 11 | * ##[warning]This is the user warning message 12 | * ##[set-secret name=mypassword]definitelyNotAPassword! 13 | */ 14 | function issueCommand(command, properties, message) { 15 | const cmd = new Command(command, properties, message); 16 | process.stdout.write(cmd.toString() + os.EOL); 17 | } 18 | exports.issueCommand = issueCommand; 19 | function issue(name, message = '') { 20 | issueCommand(name, {}, message); 21 | } 22 | exports.issue = issue; 23 | const CMD_STRING = '::'; 24 | class Command { 25 | constructor(command, properties, message) { 26 | if (!command) { 27 | command = 'missing.command'; 28 | } 29 | this.command = command; 30 | this.properties = properties; 31 | this.message = message; 32 | } 33 | toString() { 34 | let cmdStr = CMD_STRING + this.command; 35 | if (this.properties && Object.keys(this.properties).length > 0) { 36 | cmdStr += ' '; 37 | for (const key in this.properties) { 38 | if (this.properties.hasOwnProperty(key)) { 39 | const val = this.properties[key]; 40 | if (val) { 41 | // safely append the val - avoid blowing up when attempting to 42 | // call .replace() if message is not a string for some reason 43 | cmdStr += `${key}=${escape(`${val || ''}`)},`; 44 | } 45 | } 46 | } 47 | } 48 | cmdStr += CMD_STRING; 49 | // safely append the message - avoid blowing up when attempting to 50 | // call .replace() if message is not a string for some reason 51 | const message = `${this.message || ''}`; 52 | cmdStr += escapeData(message); 53 | return cmdStr; 54 | } 55 | } 56 | function escapeData(s) { 57 | return s.replace(/\r/g, '%0D').replace(/\n/g, '%0A'); 58 | } 59 | function escape(s) { 60 | return s 61 | .replace(/\r/g, '%0D') 62 | .replace(/\n/g, '%0A') 63 | .replace(/]/g, '%5D') 64 | .replace(/;/g, '%3B'); 65 | } 66 | //# 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,yBAAwB;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,CAA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AC,OAAO,CAAC,KAAK,EAAE,KAAK,CAAC,CAAA;AACtD,CAAC;AAED,SAAS,MAAM,CAAC,CAAS;IACvB,OAAO,CAAC;SACL,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 | * Writes debug message to user log 60 | * @param message debug message 61 | */ 62 | export declare function debug(message: string): void; 63 | /** 64 | * Adds an error issue 65 | * @param message error issue message 66 | */ 67 | export declare function error(message: string): void; 68 | /** 69 | * Adds an warning issue 70 | * @param message warning issue message 71 | */ 72 | export declare function warning(message: string): void; 73 | /** 74 | * Writes info to log with console.log. 75 | * @param message info message 76 | */ 77 | export declare function info(message: string): void; 78 | /** 79 | * Begin an output group. 80 | * 81 | * Output until the next `groupEnd` will be foldable in this group 82 | * 83 | * @param name The name of the output group 84 | */ 85 | export declare function startGroup(name: string): void; 86 | /** 87 | * End an output group. 88 | */ 89 | export declare function endGroup(): void; 90 | /** 91 | * Wrap an asynchronous function call in a group. 92 | * 93 | * Returns the same type as the function itself. 94 | * 95 | * @param name The name of the group 96 | * @param fn The function to wrap in the group 97 | */ 98 | export declare function group(name: string, fn: () => Promise): Promise; 99 | /** 100 | * Saves state for current action, the state can only be retrieved by this action's post job execution. 101 | * 102 | * @param name name of the state to store 103 | * @param value value to store 104 | */ 105 | export declare function saveState(name: string, value: string): void; 106 | /** 107 | * Gets the value of an state set by this action's main execution. 108 | * 109 | * @param name name of the state to get 110 | * @returns string 111 | */ 112 | export declare function getState(name: string): string; 113 | -------------------------------------------------------------------------------- /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 | Object.defineProperty(exports, "__esModule", { value: true }); 12 | const command_1 = require("./command"); 13 | const os = require("os"); 14 | const path = require("path"); 15 | /** 16 | * The code to exit an action 17 | */ 18 | var ExitCode; 19 | (function (ExitCode) { 20 | /** 21 | * A code indicating that the action was successful 22 | */ 23 | ExitCode[ExitCode["Success"] = 0] = "Success"; 24 | /** 25 | * A code indicating that the action was a failure 26 | */ 27 | ExitCode[ExitCode["Failure"] = 1] = "Failure"; 28 | })(ExitCode = exports.ExitCode || (exports.ExitCode = {})); 29 | //----------------------------------------------------------------------- 30 | // Variables 31 | //----------------------------------------------------------------------- 32 | /** 33 | * Sets env variable for this action and future actions in the job 34 | * @param name the name of the variable to set 35 | * @param val the value of the variable 36 | */ 37 | function exportVariable(name, val) { 38 | process.env[name] = val; 39 | command_1.issueCommand('set-env', { name }, val); 40 | } 41 | exports.exportVariable = exportVariable; 42 | /** 43 | * Registers a secret which will get masked from logs 44 | * @param secret value of the secret 45 | */ 46 | function setSecret(secret) { 47 | command_1.issueCommand('add-mask', {}, secret); 48 | } 49 | exports.setSecret = setSecret; 50 | /** 51 | * Prepends inputPath to the PATH (for this action and future actions) 52 | * @param inputPath 53 | */ 54 | function addPath(inputPath) { 55 | command_1.issueCommand('add-path', {}, inputPath); 56 | process.env['PATH'] = `${inputPath}${path.delimiter}${process.env['PATH']}`; 57 | } 58 | exports.addPath = addPath; 59 | /** 60 | * Gets the value of an input. The value is also trimmed. 61 | * 62 | * @param name name of the input to get 63 | * @param options optional. See InputOptions. 64 | * @returns string 65 | */ 66 | function getInput(name, options) { 67 | const val = process.env[`INPUT_${name.replace(/ /g, '_').toUpperCase()}`] || ''; 68 | if (options && options.required && !val) { 69 | throw new Error(`Input required and not supplied: ${name}`); 70 | } 71 | return val.trim(); 72 | } 73 | exports.getInput = getInput; 74 | /** 75 | * Sets the value of an output. 76 | * 77 | * @param name name of the output to set 78 | * @param value value to store 79 | */ 80 | function setOutput(name, value) { 81 | command_1.issueCommand('set-output', { name }, value); 82 | } 83 | exports.setOutput = setOutput; 84 | //----------------------------------------------------------------------- 85 | // Results 86 | //----------------------------------------------------------------------- 87 | /** 88 | * Sets the action status to failed. 89 | * When the action exits it will be with an exit code of 1 90 | * @param message add error issue message 91 | */ 92 | function setFailed(message) { 93 | process.exitCode = ExitCode.Failure; 94 | error(message); 95 | } 96 | exports.setFailed = setFailed; 97 | //----------------------------------------------------------------------- 98 | // Logging Commands 99 | //----------------------------------------------------------------------- 100 | /** 101 | * Writes debug message to user log 102 | * @param message debug message 103 | */ 104 | function debug(message) { 105 | command_1.issueCommand('debug', {}, message); 106 | } 107 | exports.debug = debug; 108 | /** 109 | * Adds an error issue 110 | * @param message error issue message 111 | */ 112 | function error(message) { 113 | command_1.issue('error', message); 114 | } 115 | exports.error = error; 116 | /** 117 | * Adds an warning issue 118 | * @param message warning issue message 119 | */ 120 | function warning(message) { 121 | command_1.issue('warning', message); 122 | } 123 | exports.warning = warning; 124 | /** 125 | * Writes info to log with console.log. 126 | * @param message info message 127 | */ 128 | function info(message) { 129 | process.stdout.write(message + os.EOL); 130 | } 131 | exports.info = info; 132 | /** 133 | * Begin an output group. 134 | * 135 | * Output until the next `groupEnd` will be foldable in this group 136 | * 137 | * @param name The name of the output group 138 | */ 139 | function startGroup(name) { 140 | command_1.issue('group', name); 141 | } 142 | exports.startGroup = startGroup; 143 | /** 144 | * End an output group. 145 | */ 146 | function endGroup() { 147 | command_1.issue('endgroup'); 148 | } 149 | exports.endGroup = endGroup; 150 | /** 151 | * Wrap an asynchronous function call in a group. 152 | * 153 | * Returns the same type as the function itself. 154 | * 155 | * @param name The name of the group 156 | * @param fn The function to wrap in the group 157 | */ 158 | function group(name, fn) { 159 | return __awaiter(this, void 0, void 0, function* () { 160 | startGroup(name); 161 | let result; 162 | try { 163 | result = yield fn(); 164 | } 165 | finally { 166 | endGroup(); 167 | } 168 | return result; 169 | }); 170 | } 171 | exports.group = group; 172 | //----------------------------------------------------------------------- 173 | // Wrapper action state 174 | //----------------------------------------------------------------------- 175 | /** 176 | * Saves state for current action, the state can only be retrieved by this action's post job execution. 177 | * 178 | * @param name name of the state to store 179 | * @param value value to store 180 | */ 181 | function saveState(name, value) { 182 | command_1.issueCommand('save-state', { name }, value); 183 | } 184 | exports.saveState = saveState; 185 | /** 186 | * Gets the value of an state set by this action's main execution. 187 | * 188 | * @param name name of the state to get 189 | * @returns string 190 | */ 191 | function getState(name) { 192 | return process.env[`STATE_${name}`] || ''; 193 | } 194 | exports.getState = getState; 195 | //# 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,yBAAwB;AACxB,6BAA4B;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,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I,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 | "_args": [ 3 | [ 4 | "@actions/core@1.2.0", 5 | "/Users/sabino/src/use-private-action" 6 | ] 7 | ], 8 | "_from": "@actions/core@1.2.0", 9 | "_id": "@actions/core@1.2.0", 10 | "_inBundle": false, 11 | "_integrity": "sha512-ZKdyhlSlyz38S6YFfPnyNgCDZuAF2T0Qv5eHflNWytPS8Qjvz39bZFMry9Bb/dpSnqWcNeav5yM2CTYpJeY+Dw==", 12 | "_location": "/@actions/core", 13 | "_phantomChildren": {}, 14 | "_requested": { 15 | "type": "version", 16 | "registry": true, 17 | "raw": "@actions/core@1.2.0", 18 | "name": "@actions/core", 19 | "escapedName": "@actions%2fcore", 20 | "scope": "@actions", 21 | "rawSpec": "1.2.0", 22 | "saveSpec": null, 23 | "fetchSpec": "1.2.0" 24 | }, 25 | "_requiredBy": [ 26 | "/" 27 | ], 28 | "_resolved": "https://registry.npmjs.org/@actions/core/-/core-1.2.0.tgz", 29 | "_spec": "1.2.0", 30 | "_where": "/Users/sabino/src/use-private-action", 31 | "bugs": { 32 | "url": "https://github.com/actions/toolkit/issues" 33 | }, 34 | "description": "Actions core lib", 35 | "devDependencies": { 36 | "@types/node": "^12.0.2" 37 | }, 38 | "directories": { 39 | "lib": "lib", 40 | "test": "__tests__" 41 | }, 42 | "files": [ 43 | "lib" 44 | ], 45 | "homepage": "https://github.com/actions/toolkit/tree/master/packages/core", 46 | "keywords": [ 47 | "github", 48 | "actions", 49 | "core" 50 | ], 51 | "license": "MIT", 52 | "main": "lib/core.js", 53 | "name": "@actions/core", 54 | "publishConfig": { 55 | "access": "public" 56 | }, 57 | "repository": { 58 | "type": "git", 59 | "url": "git+https://github.com/actions/toolkit.git", 60 | "directory": "packages/core" 61 | }, 62 | "scripts": { 63 | "test": "echo \"Error: run tests from root\" && exit 1", 64 | "tsc": "tsc" 65 | }, 66 | "version": "1.2.0" 67 | } 68 | -------------------------------------------------------------------------------- /node_modules/@actions/exec/LICENSE.md: -------------------------------------------------------------------------------- 1 | Copyright 2019 GitHub 2 | 3 | Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: 4 | 5 | The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. 6 | 7 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -------------------------------------------------------------------------------- /node_modules/@actions/exec/README.md: -------------------------------------------------------------------------------- 1 | # `@actions/exec` 2 | 3 | ## Usage 4 | 5 | #### Basic 6 | 7 | You can use this package to execute your tools on the command line in a cross platform way: 8 | 9 | ```js 10 | const exec = require('@actions/exec'); 11 | 12 | await exec.exec('node index.js'); 13 | ``` 14 | 15 | #### Args 16 | 17 | You can also pass in arg arrays: 18 | 19 | ```js 20 | const exec = require('@actions/exec'); 21 | 22 | await exec.exec('node', ['index.js', 'foo=bar']); 23 | ``` 24 | 25 | #### Output/options 26 | 27 | Capture output or specify [other options](https://github.com/actions/toolkit/blob/d9347d4ab99fd507c0b9104b2cf79fb44fcc827d/packages/exec/src/interfaces.ts#L5): 28 | 29 | ```js 30 | const exec = require('@actions/exec'); 31 | 32 | let myOutput = ''; 33 | let myError = ''; 34 | 35 | const options = {}; 36 | options.listeners = { 37 | stdout: (data: Buffer) => { 38 | myOutput += data.toString(); 39 | }, 40 | stderr: (data: Buffer) => { 41 | myError += data.toString(); 42 | } 43 | }; 44 | options.cwd = './lib'; 45 | 46 | await exec.exec('node', ['index.js', 'foo=bar'], options); 47 | ``` 48 | 49 | #### Exec tools not in the PATH 50 | 51 | You can use it in conjunction with the `which` function from `@actions/io` to execute tools that are not in the PATH: 52 | 53 | ```js 54 | const exec = require('@actions/exec'); 55 | const io = require('@actions/io'); 56 | 57 | const pythonPath: string = await io.which('python', true) 58 | 59 | await exec.exec(`"${pythonPath}"`, ['main.py']); 60 | ``` 61 | -------------------------------------------------------------------------------- /node_modules/@actions/exec/lib/exec.d.ts: -------------------------------------------------------------------------------- 1 | import * as im from './interfaces'; 2 | /** 3 | * Exec a command. 4 | * Output will be streamed to the live console. 5 | * Returns promise with return code 6 | * 7 | * @param commandLine command to execute (can include additional args). Must be correctly escaped. 8 | * @param args optional arguments for tool. Escaping is handled by the lib. 9 | * @param options optional exec options. See ExecOptions 10 | * @returns Promise exit code 11 | */ 12 | export declare function exec(commandLine: string, args?: string[], options?: im.ExecOptions): Promise; 13 | -------------------------------------------------------------------------------- /node_modules/@actions/exec/lib/exec.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 | Object.defineProperty(exports, "__esModule", { value: true }); 12 | const tr = require("./toolrunner"); 13 | /** 14 | * Exec a command. 15 | * Output will be streamed to the live console. 16 | * Returns promise with return code 17 | * 18 | * @param commandLine command to execute (can include additional args). Must be correctly escaped. 19 | * @param args optional arguments for tool. Escaping is handled by the lib. 20 | * @param options optional exec options. See ExecOptions 21 | * @returns Promise exit code 22 | */ 23 | function exec(commandLine, args, options) { 24 | return __awaiter(this, void 0, void 0, function* () { 25 | const commandArgs = tr.argStringToArray(commandLine); 26 | if (commandArgs.length === 0) { 27 | throw new Error(`Parameter 'commandLine' cannot be null or empty.`); 28 | } 29 | // Path to tool to execute should be first arg 30 | const toolPath = commandArgs[0]; 31 | args = commandArgs.slice(1).concat(args || []); 32 | const runner = new tr.ToolRunner(toolPath, args, options); 33 | return runner.exec(); 34 | }); 35 | } 36 | exports.exec = exec; 37 | //# sourceMappingURL=exec.js.map -------------------------------------------------------------------------------- /node_modules/@actions/exec/lib/exec.js.map: -------------------------------------------------------------------------------- 1 | {"version":3,"file":"exec.js","sourceRoot":"","sources":["../src/exec.ts"],"names":[],"mappings":";;;;;;;;;;;AACA,mCAAkC;AAElC;;;;;;;;;GASG;AACH,SAAsB,IAAI,CACxB,WAAmB,EACnB,IAAe,EACf,OAAwB;;QAExB,MAAM,WAAW,GAAG,EAAE,CAAC,gBAAgB,CAAC,WAAW,CAAC,CAAA;QACpD,IAAI,WAAW,CAAC,MAAM,KAAK,CAAC,EAAE;YAC5B,MAAM,IAAI,KAAK,CAAC,kDAAkD,CAAC,CAAA;SACpE;QACD,8CAA8C;QAC9C,MAAM,QAAQ,GAAG,WAAW,CAAC,CAAC,CAAC,CAAA;QAC/B,IAAI,GAAG,WAAW,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,IAAI,IAAI,EAAE,CAAC,CAAA;QAC9C,MAAM,MAAM,GAAkB,IAAI,EAAE,CAAC,UAAU,CAAC,QAAQ,EAAE,IAAI,EAAE,OAAO,CAAC,CAAA;QACxE,OAAO,MAAM,CAAC,IAAI,EAAE,CAAA;IACtB,CAAC;CAAA;AAdD,oBAcC"} -------------------------------------------------------------------------------- /node_modules/@actions/exec/lib/interfaces.d.ts: -------------------------------------------------------------------------------- 1 | /// 2 | import * as stream from 'stream'; 3 | /** 4 | * Interface for exec options 5 | */ 6 | export interface ExecOptions { 7 | /** optional working directory. defaults to current */ 8 | cwd?: string; 9 | /** optional envvar dictionary. defaults to current process's env */ 10 | env?: { 11 | [key: string]: string; 12 | }; 13 | /** optional. defaults to false */ 14 | silent?: boolean; 15 | /** optional out stream to use. Defaults to process.stdout */ 16 | outStream?: stream.Writable; 17 | /** optional err stream to use. Defaults to process.stderr */ 18 | errStream?: stream.Writable; 19 | /** optional. whether to skip quoting/escaping arguments if needed. defaults to false. */ 20 | windowsVerbatimArguments?: boolean; 21 | /** optional. whether to fail if output to stderr. defaults to false */ 22 | failOnStdErr?: boolean; 23 | /** optional. defaults to failing on non zero. ignore will not fail leaving it up to the caller */ 24 | ignoreReturnCode?: boolean; 25 | /** optional. How long in ms to wait for STDIO streams to close after the exit event of the process before terminating. defaults to 10000 */ 26 | delay?: number; 27 | /** optional. Listeners for output. Callback functions that will be called on these events */ 28 | listeners?: { 29 | stdout?: (data: Buffer) => void; 30 | stderr?: (data: Buffer) => void; 31 | stdline?: (data: string) => void; 32 | errline?: (data: string) => void; 33 | debug?: (data: string) => void; 34 | }; 35 | } 36 | -------------------------------------------------------------------------------- /node_modules/@actions/exec/lib/interfaces.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | Object.defineProperty(exports, "__esModule", { value: true }); 3 | //# sourceMappingURL=interfaces.js.map -------------------------------------------------------------------------------- /node_modules/@actions/exec/lib/interfaces.js.map: -------------------------------------------------------------------------------- 1 | {"version":3,"file":"interfaces.js","sourceRoot":"","sources":["../src/interfaces.ts"],"names":[],"mappings":""} -------------------------------------------------------------------------------- /node_modules/@actions/exec/lib/toolrunner.d.ts: -------------------------------------------------------------------------------- 1 | /// 2 | import * as events from 'events'; 3 | import * as im from './interfaces'; 4 | export declare class ToolRunner extends events.EventEmitter { 5 | constructor(toolPath: string, args?: string[], options?: im.ExecOptions); 6 | private toolPath; 7 | private args; 8 | private options; 9 | private _debug; 10 | private _getCommandString; 11 | private _processLineBuffer; 12 | private _getSpawnFileName; 13 | private _getSpawnArgs; 14 | private _endsWith; 15 | private _isCmdFile; 16 | private _windowsQuoteCmdArg; 17 | private _uvQuoteCmdArg; 18 | private _cloneExecOptions; 19 | private _getSpawnOptions; 20 | /** 21 | * Exec a tool. 22 | * Output will be streamed to the live console. 23 | * Returns promise with return code 24 | * 25 | * @param tool path to tool to exec 26 | * @param options optional exec options. See ExecOptions 27 | * @returns number 28 | */ 29 | exec(): Promise; 30 | } 31 | /** 32 | * Convert an arg string to an array of args. Handles escaping 33 | * 34 | * @param argString string of arguments 35 | * @returns string[] array of arguments 36 | */ 37 | export declare function argStringToArray(argString: string): string[]; 38 | -------------------------------------------------------------------------------- /node_modules/@actions/exec/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "_args": [ 3 | [ 4 | "@actions/exec@1.0.1", 5 | "/Users/sabino/src/use-private-action" 6 | ] 7 | ], 8 | "_from": "@actions/exec@1.0.1", 9 | "_id": "@actions/exec@1.0.1", 10 | "_inBundle": false, 11 | "_integrity": "sha512-nvFkxwiicvpzNiCBF4wFBDfnBvi7xp/as7LE1hBxBxKG2L29+gkIPBiLKMVORL+Hg3JNf07AKRfl0V5djoypjQ==", 12 | "_location": "/@actions/exec", 13 | "_phantomChildren": {}, 14 | "_requested": { 15 | "type": "version", 16 | "registry": true, 17 | "raw": "@actions/exec@1.0.1", 18 | "name": "@actions/exec", 19 | "escapedName": "@actions%2fexec", 20 | "scope": "@actions", 21 | "rawSpec": "1.0.1", 22 | "saveSpec": null, 23 | "fetchSpec": "1.0.1" 24 | }, 25 | "_requiredBy": [ 26 | "/" 27 | ], 28 | "_resolved": "https://registry.npmjs.org/@actions/exec/-/exec-1.0.1.tgz", 29 | "_spec": "1.0.1", 30 | "_where": "/Users/sabino/src/use-private-action", 31 | "bugs": { 32 | "url": "https://github.com/actions/toolkit/issues" 33 | }, 34 | "description": "Actions exec lib", 35 | "devDependencies": { 36 | "@actions/io": "^1.0.1" 37 | }, 38 | "directories": { 39 | "lib": "lib", 40 | "test": "__tests__" 41 | }, 42 | "files": [ 43 | "lib" 44 | ], 45 | "gitHead": "a2ab4bcf78e4f7080f0d45856e6eeba16f0bbc52", 46 | "homepage": "https://github.com/actions/toolkit/tree/master/packages/exec", 47 | "keywords": [ 48 | "github", 49 | "actions", 50 | "exec" 51 | ], 52 | "license": "MIT", 53 | "main": "lib/exec.js", 54 | "name": "@actions/exec", 55 | "publishConfig": { 56 | "access": "public" 57 | }, 58 | "repository": { 59 | "type": "git", 60 | "url": "git+https://github.com/actions/toolkit.git" 61 | }, 62 | "scripts": { 63 | "test": "echo \"Error: run tests from root\" && exit 1", 64 | "tsc": "tsc" 65 | }, 66 | "version": "1.0.1" 67 | } 68 | -------------------------------------------------------------------------------- /node_modules/@actions/io/LICENSE.md: -------------------------------------------------------------------------------- 1 | Copyright 2019 GitHub 2 | 3 | Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: 4 | 5 | The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. 6 | 7 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -------------------------------------------------------------------------------- /node_modules/@actions/io/README.md: -------------------------------------------------------------------------------- 1 | # `@actions/io` 2 | 3 | > Core functions for cli filesystem scenarios 4 | 5 | ## Usage 6 | 7 | #### mkdir -p 8 | 9 | Recursively make a directory. Follows rules specified in [man mkdir](https://linux.die.net/man/1/mkdir) with the `-p` option specified: 10 | 11 | ```js 12 | const io = require('@actions/io'); 13 | 14 | await io.mkdirP('path/to/make'); 15 | ``` 16 | 17 | #### cp/mv 18 | 19 | Copy or move files or folders. Follows rules specified in [man cp](https://linux.die.net/man/1/cp) and [man mv](https://linux.die.net/man/1/mv): 20 | 21 | ```js 22 | const io = require('@actions/io'); 23 | 24 | // Recursive must be true for directories 25 | const options = { recursive: true, force: false } 26 | 27 | await io.cp('path/to/directory', 'path/to/dest', options); 28 | await io.mv('path/to/file', 'path/to/dest'); 29 | ``` 30 | 31 | #### rm -rf 32 | 33 | Remove a file or folder recursively. Follows rules specified in [man rm](https://linux.die.net/man/1/rm) with the `-r` and `-f` rules specified. 34 | 35 | ```js 36 | const io = require('@actions/io'); 37 | 38 | await io.rmRF('path/to/directory'); 39 | await io.rmRF('path/to/file'); 40 | ``` 41 | 42 | #### which 43 | 44 | Get the path to a tool and resolves via paths. Follows the rules specified in [man which](https://linux.die.net/man/1/which). 45 | 46 | ```js 47 | const exec = require('@actions/exec'); 48 | const io = require('@actions/io'); 49 | 50 | const pythonPath: string = await io.which('python', true) 51 | 52 | await exec.exec(`"${pythonPath}"`, ['main.py']); 53 | ``` 54 | -------------------------------------------------------------------------------- /node_modules/@actions/io/lib/io-util.d.ts: -------------------------------------------------------------------------------- 1 | /// 2 | import * as fs from 'fs'; 3 | export declare const chmod: typeof fs.promises.chmod, copyFile: typeof fs.promises.copyFile, lstat: typeof fs.promises.lstat, mkdir: typeof fs.promises.mkdir, readdir: typeof fs.promises.readdir, readlink: typeof fs.promises.readlink, rename: typeof fs.promises.rename, rmdir: typeof fs.promises.rmdir, stat: typeof fs.promises.stat, symlink: typeof fs.promises.symlink, unlink: typeof fs.promises.unlink; 4 | export declare const IS_WINDOWS: boolean; 5 | export declare function exists(fsPath: string): Promise; 6 | export declare function isDirectory(fsPath: string, useStat?: boolean): Promise; 7 | /** 8 | * On OSX/Linux, true if path starts with '/'. On Windows, true for paths like: 9 | * \, \hello, \\hello\share, C:, and C:\hello (and corresponding alternate separator cases). 10 | */ 11 | export declare function isRooted(p: string): boolean; 12 | /** 13 | * Recursively create a directory at `fsPath`. 14 | * 15 | * This implementation is optimistic, meaning it attempts to create the full 16 | * path first, and backs up the path stack from there. 17 | * 18 | * @param fsPath The path to create 19 | * @param maxDepth The maximum recursion depth 20 | * @param depth The current recursion depth 21 | */ 22 | export declare function mkdirP(fsPath: string, maxDepth?: number, depth?: number): Promise; 23 | /** 24 | * Best effort attempt to determine whether a file exists and is executable. 25 | * @param filePath file path to check 26 | * @param extensions additional file extensions to try 27 | * @return if file exists and is executable, returns the file path. otherwise empty string. 28 | */ 29 | export declare function tryGetExecutablePath(filePath: string, extensions: string[]): Promise; 30 | -------------------------------------------------------------------------------- /node_modules/@actions/io/lib/io-util.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 _a; 12 | Object.defineProperty(exports, "__esModule", { value: true }); 13 | const assert_1 = require("assert"); 14 | const fs = require("fs"); 15 | const path = require("path"); 16 | _a = fs.promises, exports.chmod = _a.chmod, exports.copyFile = _a.copyFile, exports.lstat = _a.lstat, exports.mkdir = _a.mkdir, exports.readdir = _a.readdir, exports.readlink = _a.readlink, exports.rename = _a.rename, exports.rmdir = _a.rmdir, exports.stat = _a.stat, exports.symlink = _a.symlink, exports.unlink = _a.unlink; 17 | exports.IS_WINDOWS = process.platform === 'win32'; 18 | function exists(fsPath) { 19 | return __awaiter(this, void 0, void 0, function* () { 20 | try { 21 | yield exports.stat(fsPath); 22 | } 23 | catch (err) { 24 | if (err.code === 'ENOENT') { 25 | return false; 26 | } 27 | throw err; 28 | } 29 | return true; 30 | }); 31 | } 32 | exports.exists = exists; 33 | function isDirectory(fsPath, useStat = false) { 34 | return __awaiter(this, void 0, void 0, function* () { 35 | const stats = useStat ? yield exports.stat(fsPath) : yield exports.lstat(fsPath); 36 | return stats.isDirectory(); 37 | }); 38 | } 39 | exports.isDirectory = isDirectory; 40 | /** 41 | * On OSX/Linux, true if path starts with '/'. On Windows, true for paths like: 42 | * \, \hello, \\hello\share, C:, and C:\hello (and corresponding alternate separator cases). 43 | */ 44 | function isRooted(p) { 45 | p = normalizeSeparators(p); 46 | if (!p) { 47 | throw new Error('isRooted() parameter "p" cannot be empty'); 48 | } 49 | if (exports.IS_WINDOWS) { 50 | return (p.startsWith('\\') || /^[A-Z]:/i.test(p) // e.g. \ or \hello or \\hello 51 | ); // e.g. C: or C:\hello 52 | } 53 | return p.startsWith('/'); 54 | } 55 | exports.isRooted = isRooted; 56 | /** 57 | * Recursively create a directory at `fsPath`. 58 | * 59 | * This implementation is optimistic, meaning it attempts to create the full 60 | * path first, and backs up the path stack from there. 61 | * 62 | * @param fsPath The path to create 63 | * @param maxDepth The maximum recursion depth 64 | * @param depth The current recursion depth 65 | */ 66 | function mkdirP(fsPath, maxDepth = 1000, depth = 1) { 67 | return __awaiter(this, void 0, void 0, function* () { 68 | assert_1.ok(fsPath, 'a path argument must be provided'); 69 | fsPath = path.resolve(fsPath); 70 | if (depth >= maxDepth) 71 | return exports.mkdir(fsPath); 72 | try { 73 | yield exports.mkdir(fsPath); 74 | return; 75 | } 76 | catch (err) { 77 | switch (err.code) { 78 | case 'ENOENT': { 79 | yield mkdirP(path.dirname(fsPath), maxDepth, depth + 1); 80 | yield exports.mkdir(fsPath); 81 | return; 82 | } 83 | default: { 84 | let stats; 85 | try { 86 | stats = yield exports.stat(fsPath); 87 | } 88 | catch (err2) { 89 | throw err; 90 | } 91 | if (!stats.isDirectory()) 92 | throw err; 93 | } 94 | } 95 | } 96 | }); 97 | } 98 | exports.mkdirP = mkdirP; 99 | /** 100 | * Best effort attempt to determine whether a file exists and is executable. 101 | * @param filePath file path to check 102 | * @param extensions additional file extensions to try 103 | * @return if file exists and is executable, returns the file path. otherwise empty string. 104 | */ 105 | function tryGetExecutablePath(filePath, extensions) { 106 | return __awaiter(this, void 0, void 0, function* () { 107 | let stats = undefined; 108 | try { 109 | // test file exists 110 | stats = yield exports.stat(filePath); 111 | } 112 | catch (err) { 113 | if (err.code !== 'ENOENT') { 114 | // eslint-disable-next-line no-console 115 | console.log(`Unexpected error attempting to determine if executable file exists '${filePath}': ${err}`); 116 | } 117 | } 118 | if (stats && stats.isFile()) { 119 | if (exports.IS_WINDOWS) { 120 | // on Windows, test for valid extension 121 | const upperExt = path.extname(filePath).toUpperCase(); 122 | if (extensions.some(validExt => validExt.toUpperCase() === upperExt)) { 123 | return filePath; 124 | } 125 | } 126 | else { 127 | if (isUnixExecutable(stats)) { 128 | return filePath; 129 | } 130 | } 131 | } 132 | // try each extension 133 | const originalFilePath = filePath; 134 | for (const extension of extensions) { 135 | filePath = originalFilePath + extension; 136 | stats = undefined; 137 | try { 138 | stats = yield exports.stat(filePath); 139 | } 140 | catch (err) { 141 | if (err.code !== 'ENOENT') { 142 | // eslint-disable-next-line no-console 143 | console.log(`Unexpected error attempting to determine if executable file exists '${filePath}': ${err}`); 144 | } 145 | } 146 | if (stats && stats.isFile()) { 147 | if (exports.IS_WINDOWS) { 148 | // preserve the case of the actual file (since an extension was appended) 149 | try { 150 | const directory = path.dirname(filePath); 151 | const upperName = path.basename(filePath).toUpperCase(); 152 | for (const actualName of yield exports.readdir(directory)) { 153 | if (upperName === actualName.toUpperCase()) { 154 | filePath = path.join(directory, actualName); 155 | break; 156 | } 157 | } 158 | } 159 | catch (err) { 160 | // eslint-disable-next-line no-console 161 | console.log(`Unexpected error attempting to determine the actual case of the file '${filePath}': ${err}`); 162 | } 163 | return filePath; 164 | } 165 | else { 166 | if (isUnixExecutable(stats)) { 167 | return filePath; 168 | } 169 | } 170 | } 171 | } 172 | return ''; 173 | }); 174 | } 175 | exports.tryGetExecutablePath = tryGetExecutablePath; 176 | function normalizeSeparators(p) { 177 | p = p || ''; 178 | if (exports.IS_WINDOWS) { 179 | // convert slashes on Windows 180 | p = p.replace(/\//g, '\\'); 181 | // remove redundant slashes 182 | return p.replace(/\\\\+/g, '\\'); 183 | } 184 | // remove redundant slashes 185 | return p.replace(/\/\/+/g, '/'); 186 | } 187 | // on Mac/Linux, test the execute bit 188 | // R W X R W X R W X 189 | // 256 128 64 32 16 8 4 2 1 190 | function isUnixExecutable(stats) { 191 | return ((stats.mode & 1) > 0 || 192 | ((stats.mode & 8) > 0 && stats.gid === process.getgid()) || 193 | ((stats.mode & 64) > 0 && stats.uid === process.getuid())); 194 | } 195 | //# sourceMappingURL=io-util.js.map -------------------------------------------------------------------------------- /node_modules/@actions/io/lib/io-util.js.map: -------------------------------------------------------------------------------- 1 | {"version":3,"file":"io-util.js","sourceRoot":"","sources":["../src/io-util.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,mCAAyB;AACzB,yBAAwB;AACxB,6BAA4B;AAEf,gBAYE,qTAAA;AAEF,QAAA,UAAU,GAAG,OAAO,CAAC,QAAQ,KAAK,OAAO,CAAA;AAEtD,SAAsB,MAAM,CAAC,MAAc;;QACzC,IAAI;YACF,MAAM,YAAI,CAAC,MAAM,CAAC,CAAA;SACnB;QAAC,OAAO,GAAG,EAAE;YACZ,IAAI,GAAG,CAAC,IAAI,KAAK,QAAQ,EAAE;gBACzB,OAAO,KAAK,CAAA;aACb;YAED,MAAM,GAAG,CAAA;SACV;QAED,OAAO,IAAI,CAAA;IACb,CAAC;CAAA;AAZD,wBAYC;AAED,SAAsB,WAAW,CAC/B,MAAc,EACd,UAAmB,KAAK;;QAExB,MAAM,KAAK,GAAG,OAAO,CAAC,CAAC,CAAC,MAAM,YAAI,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,MAAM,aAAK,CAAC,MAAM,CAAC,CAAA;QAChE,OAAO,KAAK,CAAC,WAAW,EAAE,CAAA;IAC5B,CAAC;CAAA;A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,CAAC,QAAQ,EAAE,GAAG,CAAC,CAAA;AACjC,CAAC;AAED,qCAAqC;AACrC,6BAA6B;AAC7B,6BAA6B;AAC7B,SAAS,gBAAgB,CAAC,KAAe;IACvC,OAAO,CACL,CAAC,KAAK,CAAC,IAAI,GAAG,CAAC,CAAC,GAAG,CAAC;QACpB,CAAC,CAAC,KAAK,CAAC,IAAI,GAAG,CAAC,CAAC,GAAG,CAAC,IAAI,KAAK,CAAC,GAAG,KAAK,OAAO,CAAC,MAAM,EAAE,CAAC;QACxD,CAAC,CAAC,KAAK,CAAC,IAAI,GAAG,EAAE,CAAC,GAAG,CAAC,IAAI,KAAK,CAAC,GAAG,KAAK,OAAO,CAAC,MAAM,EAAE,CAAC,CAC1D,CAAA;AACH,CAAC"} -------------------------------------------------------------------------------- /node_modules/@actions/io/lib/io.d.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * Interface for cp/mv options 3 | */ 4 | export interface CopyOptions { 5 | /** Optional. Whether to recursively copy all subdirectories. Defaults to false */ 6 | recursive?: boolean; 7 | /** Optional. Whether to overwrite existing files in the destination. Defaults to true */ 8 | force?: boolean; 9 | } 10 | /** 11 | * Interface for cp/mv options 12 | */ 13 | export interface MoveOptions { 14 | /** Optional. Whether to overwrite existing files in the destination. Defaults to true */ 15 | force?: boolean; 16 | } 17 | /** 18 | * Copies a file or folder. 19 | * Based off of shelljs - https://github.com/shelljs/shelljs/blob/9237f66c52e5daa40458f94f9565e18e8132f5a6/src/cp.js 20 | * 21 | * @param source source path 22 | * @param dest destination path 23 | * @param options optional. See CopyOptions. 24 | */ 25 | export declare function cp(source: string, dest: string, options?: CopyOptions): Promise; 26 | /** 27 | * Moves a path. 28 | * 29 | * @param source source path 30 | * @param dest destination path 31 | * @param options optional. See MoveOptions. 32 | */ 33 | export declare function mv(source: string, dest: string, options?: MoveOptions): Promise; 34 | /** 35 | * Remove a path recursively with force 36 | * 37 | * @param inputPath path to remove 38 | */ 39 | export declare function rmRF(inputPath: string): Promise; 40 | /** 41 | * Make a directory. Creates the full path with folders in between 42 | * Will throw if it fails 43 | * 44 | * @param fsPath path to create 45 | * @returns Promise 46 | */ 47 | export declare function mkdirP(fsPath: string): Promise; 48 | /** 49 | * Returns path of a tool had the tool actually been invoked. Resolves via paths. 50 | * If you check and the tool does not exist, it will throw. 51 | * 52 | * @param tool name of the tool 53 | * @param check whether to check if tool exists 54 | * @returns Promise path to tool 55 | */ 56 | export declare function which(tool: string, check?: boolean): Promise; 57 | -------------------------------------------------------------------------------- /node_modules/@actions/io/lib/io.js.map: -------------------------------------------------------------------------------- 1 | {"version":3,"file":"io.js","sourceRoot":"","sources":["../src/io.ts"],"names":[],"mappings":";;;;;;;;;;;AAAA,8CAA6C;AAC7C,6BAA4B;AAC5B,+BAA8B;AAC9B,oCAAmC;AAEnC,MAAM,IAAI,GAAG,gBAAS,CAAC,YAAY,CAAC,IAAI,CAAC,CAAA;AAoBzC;;;;;;;GAOG;AACH,SAAsB,EAAE,CACtB,MAAc,EACd,IAAY,EACZ,UAAuB,EAAE;;QAEzB,MAAM,EAAC,KAAK,EAAE,SAAS,EAAC,GAAG,eAAe,CAAC,OAAO,CAAC,CAAA;QAEnD,MAAM,QAAQ,GAAG,CAAC,MAAM,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,MAAM,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,IAAI,CAAA;QAC7E,4CAA4C;QAC5C,IAAI,QAAQ,IAAI,QAAQ,CAAC,MAAM,EAAE,IAAI,CAAC,KAAK,EAAE;YAC3C,OAAM;SACP;QAED,wDAAwD;QACxD,MAAM,OAAO,GACX,QAAQ,IAAI,QAAQ,CAAC,WAAW,EAAE;YAChC,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,EAAE,IAAI,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC;YACxC,CAAC,CAAC,IAAI,CAAA;QAEV,IAAI,CAAC,CAAC,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C,CAAC,CAAC,cAAc,EAAE,EAAE;YAClD,oBAAoB;YACpB,IAAI;gBACF,MAAM,MAAM,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAA;gBAC5B,MAAM,MAAM,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAA;aAC9B;YAAC,OAAO,CAAC,EAAE;gBACV,kCAAkC;gBAClC,IAAI,CAAC,CAAC,IAAI,KAAK,OAAO,EAAE;oBACtB,MAAM,MAAM,CAAC,KAAK,CAAC,QAAQ,EAAE,MAAM,CAAC,CAAA;oBACpC,MAAM,MAAM,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAA;iBAC9B;gBACD,iDAAiD;aAClD;YAED,oBAAoB;YACpB,MAAM,WAAW,GAAW,MAAM,MAAM,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAA;YAC1D,MAAM,MAAM,CAAC,OAAO,CAClB,WAAW,EACX,QAAQ,EACR,MAAM,CAAC,UAAU,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,IAAI,CACtC,CAAA;SACF;aAAM,IAAI,CAAC,CAAC,MAAM,MAAM,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC,IAAI,KAAK,EAAE;YACpD,MAAM,MAAM,CAAC,QAAQ,CAAC,OAAO,EAAE,QAAQ,CAAC,CAAA;SACzC;IACH,CAAC;CAAA"} -------------------------------------------------------------------------------- /node_modules/@actions/io/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "_args": [ 3 | [ 4 | "@actions/io@1.0.1", 5 | "/Users/sabino/src/use-private-action" 6 | ] 7 | ], 8 | "_from": "@actions/io@1.0.1", 9 | "_id": "@actions/io@1.0.1", 10 | "_inBundle": false, 11 | "_integrity": "sha512-rhq+tfZukbtaus7xyUtwKfuiCRXd1hWSfmJNEpFgBQJ4woqPEpsBw04awicjwz9tyG2/MVhAEMfVn664Cri5zA==", 12 | "_location": "/@actions/io", 13 | "_phantomChildren": {}, 14 | "_requested": { 15 | "type": "version", 16 | "registry": true, 17 | "raw": "@actions/io@1.0.1", 18 | "name": "@actions/io", 19 | "escapedName": "@actions%2fio", 20 | "scope": "@actions", 21 | "rawSpec": "1.0.1", 22 | "saveSpec": null, 23 | "fetchSpec": "1.0.1" 24 | }, 25 | "_requiredBy": [ 26 | "/" 27 | ], 28 | "_resolved": "https://registry.npmjs.org/@actions/io/-/io-1.0.1.tgz", 29 | "_spec": "1.0.1", 30 | "_where": "/Users/sabino/src/use-private-action", 31 | "bugs": { 32 | "url": "https://github.com/actions/toolkit/issues" 33 | }, 34 | "description": "Actions io lib", 35 | "directories": { 36 | "lib": "lib", 37 | "test": "__tests__" 38 | }, 39 | "files": [ 40 | "lib" 41 | ], 42 | "gitHead": "a2ab4bcf78e4f7080f0d45856e6eeba16f0bbc52", 43 | "homepage": "https://github.com/actions/toolkit/tree/master/packages/io", 44 | "keywords": [ 45 | "github", 46 | "actions", 47 | "io" 48 | ], 49 | "license": "MIT", 50 | "main": "lib/io.js", 51 | "name": "@actions/io", 52 | "publishConfig": { 53 | "access": "public" 54 | }, 55 | "repository": { 56 | "type": "git", 57 | "url": "git+https://github.com/actions/toolkit.git" 58 | }, 59 | "scripts": { 60 | "test": "echo \"Error: run tests from root\" && exit 1", 61 | "tsc": "tsc" 62 | }, 63 | "version": "1.0.1" 64 | } 65 | -------------------------------------------------------------------------------- /node_modules/argparse/CHANGELOG.md: -------------------------------------------------------------------------------- 1 | 1.0.10 / 2018-02-15 2 | ------------------ 3 | 4 | - Use .concat instead of + for arrays, #122. 5 | 6 | 7 | 1.0.9 / 2016-09-29 8 | ------------------ 9 | 10 | - Rerelease after 1.0.8 - deps cleanup. 11 | 12 | 13 | 1.0.8 / 2016-09-29 14 | ------------------ 15 | 16 | - Maintenance (deps bump, fix node 6.5+ tests, coverage report). 17 | 18 | 19 | 1.0.7 / 2016-03-17 20 | ------------------ 21 | 22 | - Teach `addArgument` to accept string arg names. #97, @tomxtobin. 23 | 24 | 25 | 1.0.6 / 2016-02-06 26 | ------------------ 27 | 28 | - Maintenance: moved to eslint & updated CS. 29 | 30 | 31 | 1.0.5 / 2016-02-05 32 | ------------------ 33 | 34 | - Removed lodash dependency to significantly reduce install size. 35 | Thanks to @mourner. 36 | 37 | 38 | 1.0.4 / 2016-01-17 39 | ------------------ 40 | 41 | - Maintenance: lodash update to 4.0.0. 42 | 43 | 44 | 1.0.3 / 2015-10-27 45 | ------------------ 46 | 47 | - Fix parse `=` in args: `--examplepath="C:\myfolder\env=x64"`. #84, @CatWithApple. 48 | 49 | 50 | 1.0.2 / 2015-03-22 51 | ------------------ 52 | 53 | - Relaxed lodash version dependency. 54 | 55 | 56 | 1.0.1 / 2015-02-20 57 | ------------------ 58 | 59 | - Changed dependencies to be compatible with ancient nodejs. 60 | 61 | 62 | 1.0.0 / 2015-02-19 63 | ------------------ 64 | 65 | - Maintenance release. 66 | - Replaced `underscore` with `lodash`. 67 | - Bumped version to 1.0.0 to better reflect semver meaning. 68 | - HISTORY.md -> CHANGELOG.md 69 | 70 | 71 | 0.1.16 / 2013-12-01 72 | ------------------- 73 | 74 | - Maintenance release. Updated dependencies and docs. 75 | 76 | 77 | 0.1.15 / 2013-05-13 78 | ------------------- 79 | 80 | - Fixed #55, @trebor89 81 | 82 | 83 | 0.1.14 / 2013-05-12 84 | ------------------- 85 | 86 | - Fixed #62, @maxtaco 87 | 88 | 89 | 0.1.13 / 2013-04-08 90 | ------------------- 91 | 92 | - Added `.npmignore` to reduce package size 93 | 94 | 95 | 0.1.12 / 2013-02-10 96 | ------------------- 97 | 98 | - Fixed conflictHandler (#46), @hpaulj 99 | 100 | 101 | 0.1.11 / 2013-02-07 102 | ------------------- 103 | 104 | - Multiple bugfixes, @hpaulj 105 | - Added 70+ tests (ported from python), @hpaulj 106 | - Added conflictHandler, @applepicke 107 | - Added fromfilePrefixChar, @hpaulj 108 | 109 | 110 | 0.1.10 / 2012-12-30 111 | ------------------- 112 | 113 | - Added [mutual exclusion](http://docs.python.org/dev/library/argparse.html#mutual-exclusion) 114 | support, thanks to @hpaulj 115 | - Fixed options check for `storeConst` & `appendConst` actions, thanks to @hpaulj 116 | 117 | 118 | 0.1.9 / 2012-12-27 119 | ------------------ 120 | 121 | - Fixed option dest interferens with other options (issue #23), thanks to @hpaulj 122 | - Fixed default value behavior with `*` positionals, thanks to @hpaulj 123 | - Improve `getDefault()` behavior, thanks to @hpaulj 124 | - Imrove negative argument parsing, thanks to @hpaulj 125 | 126 | 127 | 0.1.8 / 2012-12-01 128 | ------------------ 129 | 130 | - Fixed parser parents (issue #19), thanks to @hpaulj 131 | - Fixed negative argument parse (issue #20), thanks to @hpaulj 132 | 133 | 134 | 0.1.7 / 2012-10-14 135 | ------------------ 136 | 137 | - Fixed 'choices' argument parse (issue #16) 138 | - Fixed stderr output (issue #15) 139 | 140 | 141 | 0.1.6 / 2012-09-09 142 | ------------------ 143 | 144 | - Fixed check for conflict of options (thanks to @tomxtobin) 145 | 146 | 147 | 0.1.5 / 2012-09-03 148 | ------------------ 149 | 150 | - Fix parser #setDefaults method (thanks to @tomxtobin) 151 | 152 | 153 | 0.1.4 / 2012-07-30 154 | ------------------ 155 | 156 | - Fixed pseudo-argument support (thanks to @CGamesPlay) 157 | - Fixed addHelp default (should be true), if not set (thanks to @benblank) 158 | 159 | 160 | 0.1.3 / 2012-06-27 161 | ------------------ 162 | 163 | - Fixed formatter api name: Formatter -> HelpFormatter 164 | 165 | 166 | 0.1.2 / 2012-05-29 167 | ------------------ 168 | 169 | - Added basic tests 170 | - Removed excess whitespace in help 171 | - Fixed error reporting, when parcer with subcommands 172 | called with empty arguments 173 | 174 | 175 | 0.1.1 / 2012-05-23 176 | ------------------ 177 | 178 | - Fixed line wrapping in help formatter 179 | - Added better error reporting on invalid arguments 180 | 181 | 182 | 0.1.0 / 2012-05-16 183 | ------------------ 184 | 185 | - First release. 186 | -------------------------------------------------------------------------------- /node_modules/argparse/LICENSE: -------------------------------------------------------------------------------- 1 | (The MIT License) 2 | 3 | Copyright (C) 2012 by Vitaly Puzrin 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/argparse/index.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | module.exports = require('./lib/argparse'); 4 | -------------------------------------------------------------------------------- /node_modules/argparse/lib/action.js: -------------------------------------------------------------------------------- 1 | /** 2 | * class Action 3 | * 4 | * Base class for all actions 5 | * Do not call in your code, use this class only for inherits your own action 6 | * 7 | * Information about how to convert command line strings to Javascript objects. 8 | * Action objects are used by an ArgumentParser to represent the information 9 | * needed to parse a single argument from one or more strings from the command 10 | * line. The keyword arguments to the Action constructor are also all attributes 11 | * of Action instances. 12 | * 13 | * ##### Allowed keywords: 14 | * 15 | * - `store` 16 | * - `storeConstant` 17 | * - `storeTrue` 18 | * - `storeFalse` 19 | * - `append` 20 | * - `appendConstant` 21 | * - `count` 22 | * - `help` 23 | * - `version` 24 | * 25 | * Information about action options see [[Action.new]] 26 | * 27 | * See also [original guide](http://docs.python.org/dev/library/argparse.html#action) 28 | * 29 | **/ 30 | 31 | 'use strict'; 32 | 33 | 34 | // Constants 35 | var c = require('./const'); 36 | 37 | 38 | /** 39 | * new Action(options) 40 | * 41 | * Base class for all actions. Used only for inherits 42 | * 43 | * 44 | * ##### Options: 45 | * 46 | * - `optionStrings` A list of command-line option strings for the action. 47 | * - `dest` Attribute to hold the created object(s) 48 | * - `nargs` The number of command-line arguments that should be consumed. 49 | * By default, one argument will be consumed and a single value will be 50 | * produced. 51 | * - `constant` Default value for an action with no value. 52 | * - `defaultValue` The value to be produced if the option is not specified. 53 | * - `type` Cast to 'string'|'int'|'float'|'complex'|function (string). If 54 | * None, 'string'. 55 | * - `choices` The choices available. 56 | * - `required` True if the action must always be specified at the command 57 | * line. 58 | * - `help` The help describing the argument. 59 | * - `metavar` The name to be used for the option's argument with the help 60 | * string. If None, the 'dest' value will be used as the name. 61 | * 62 | * ##### nargs supported values: 63 | * 64 | * - `N` (an integer) consumes N arguments (and produces a list) 65 | * - `?` consumes zero or one arguments 66 | * - `*` consumes zero or more arguments (and produces a list) 67 | * - `+` consumes one or more arguments (and produces a list) 68 | * 69 | * Note: that the difference between the default and nargs=1 is that with the 70 | * default, a single value will be produced, while with nargs=1, a list 71 | * containing a single value will be produced. 72 | **/ 73 | var Action = module.exports = function Action(options) { 74 | options = options || {}; 75 | this.optionStrings = options.optionStrings || []; 76 | this.dest = options.dest; 77 | this.nargs = typeof options.nargs !== 'undefined' ? options.nargs : null; 78 | this.constant = typeof options.constant !== 'undefined' ? options.constant : null; 79 | this.defaultValue = options.defaultValue; 80 | this.type = typeof options.type !== 'undefined' ? options.type : null; 81 | this.choices = typeof options.choices !== 'undefined' ? options.choices : null; 82 | this.required = typeof options.required !== 'undefined' ? options.required : false; 83 | this.help = typeof options.help !== 'undefined' ? options.help : null; 84 | this.metavar = typeof options.metavar !== 'undefined' ? options.metavar : null; 85 | 86 | if (!(this.optionStrings instanceof Array)) { 87 | throw new Error('optionStrings should be an array'); 88 | } 89 | if (typeof this.required !== 'undefined' && typeof this.required !== 'boolean') { 90 | throw new Error('required should be a boolean'); 91 | } 92 | }; 93 | 94 | /** 95 | * Action#getName -> String 96 | * 97 | * Tells action name 98 | **/ 99 | Action.prototype.getName = function () { 100 | if (this.optionStrings.length > 0) { 101 | return this.optionStrings.join('/'); 102 | } else if (this.metavar !== null && this.metavar !== c.SUPPRESS) { 103 | return this.metavar; 104 | } else if (typeof this.dest !== 'undefined' && this.dest !== c.SUPPRESS) { 105 | return this.dest; 106 | } 107 | return null; 108 | }; 109 | 110 | /** 111 | * Action#isOptional -> Boolean 112 | * 113 | * Return true if optional 114 | **/ 115 | Action.prototype.isOptional = function () { 116 | return !this.isPositional(); 117 | }; 118 | 119 | /** 120 | * Action#isPositional -> Boolean 121 | * 122 | * Return true if positional 123 | **/ 124 | Action.prototype.isPositional = function () { 125 | return (this.optionStrings.length === 0); 126 | }; 127 | 128 | /** 129 | * Action#call(parser, namespace, values, optionString) -> Void 130 | * - parser (ArgumentParser): current parser 131 | * - namespace (Namespace): namespace for output data 132 | * - values (Array): parsed values 133 | * - optionString (Array): input option string(not parsed) 134 | * 135 | * Call the action. Should be implemented in inherited classes 136 | * 137 | * ##### Example 138 | * 139 | * ActionCount.prototype.call = function (parser, namespace, values, optionString) { 140 | * namespace.set(this.dest, (namespace[this.dest] || 0) + 1); 141 | * }; 142 | * 143 | **/ 144 | Action.prototype.call = function () { 145 | throw new Error('.call() not defined');// Not Implemented error 146 | }; 147 | -------------------------------------------------------------------------------- /node_modules/argparse/lib/action/append.js: -------------------------------------------------------------------------------- 1 | /*:nodoc:* 2 | * class ActionAppend 3 | * 4 | * This action stores a list, and appends each argument value to the list. 5 | * This is useful to allow an option to be specified multiple times. 6 | * This class inherided from [[Action]] 7 | * 8 | **/ 9 | 10 | 'use strict'; 11 | 12 | var util = require('util'); 13 | 14 | var Action = require('../action'); 15 | 16 | // Constants 17 | var c = require('../const'); 18 | 19 | /*:nodoc:* 20 | * new ActionAppend(options) 21 | * - options (object): options hash see [[Action.new]] 22 | * 23 | * Note: options.nargs should be optional for constants 24 | * and more then zero for other 25 | **/ 26 | var ActionAppend = module.exports = function ActionAppend(options) { 27 | options = options || {}; 28 | if (this.nargs <= 0) { 29 | throw new Error('nargs for append actions must be > 0; if arg ' + 30 | 'strings are not supplying the value to append, ' + 31 | 'the append const action may be more appropriate'); 32 | } 33 | if (!!this.constant && this.nargs !== c.OPTIONAL) { 34 | throw new Error('nargs must be OPTIONAL to supply const'); 35 | } 36 | Action.call(this, options); 37 | }; 38 | util.inherits(ActionAppend, Action); 39 | 40 | /*:nodoc:* 41 | * ActionAppend#call(parser, namespace, values, optionString) -> Void 42 | * - parser (ArgumentParser): current parser 43 | * - namespace (Namespace): namespace for output data 44 | * - values (Array): parsed values 45 | * - optionString (Array): input option string(not parsed) 46 | * 47 | * Call the action. Save result in namespace object 48 | **/ 49 | ActionAppend.prototype.call = function (parser, namespace, values) { 50 | var items = (namespace[this.dest] || []).slice(); 51 | items.push(values); 52 | namespace.set(this.dest, items); 53 | }; 54 | -------------------------------------------------------------------------------- /node_modules/argparse/lib/action/append/constant.js: -------------------------------------------------------------------------------- 1 | /*:nodoc:* 2 | * class ActionAppendConstant 3 | * 4 | * This stores a list, and appends the value specified by 5 | * the const keyword argument to the list. 6 | * (Note that the const keyword argument defaults to null.) 7 | * The 'appendConst' action is typically useful when multiple 8 | * arguments need to store constants to the same list. 9 | * 10 | * This class inherited from [[Action]] 11 | **/ 12 | 13 | 'use strict'; 14 | 15 | var util = require('util'); 16 | 17 | var Action = require('../../action'); 18 | 19 | /*:nodoc:* 20 | * new ActionAppendConstant(options) 21 | * - options (object): options hash see [[Action.new]] 22 | * 23 | **/ 24 | var ActionAppendConstant = module.exports = function ActionAppendConstant(options) { 25 | options = options || {}; 26 | options.nargs = 0; 27 | if (typeof options.constant === 'undefined') { 28 | throw new Error('constant option is required for appendAction'); 29 | } 30 | Action.call(this, options); 31 | }; 32 | util.inherits(ActionAppendConstant, Action); 33 | 34 | /*:nodoc:* 35 | * ActionAppendConstant#call(parser, namespace, values, optionString) -> Void 36 | * - parser (ArgumentParser): current parser 37 | * - namespace (Namespace): namespace for output data 38 | * - values (Array): parsed values 39 | * - optionString (Array): input option string(not parsed) 40 | * 41 | * Call the action. Save result in namespace object 42 | **/ 43 | ActionAppendConstant.prototype.call = function (parser, namespace) { 44 | var items = [].concat(namespace[this.dest] || []); 45 | items.push(this.constant); 46 | namespace.set(this.dest, items); 47 | }; 48 | -------------------------------------------------------------------------------- /node_modules/argparse/lib/action/count.js: -------------------------------------------------------------------------------- 1 | /*:nodoc:* 2 | * class ActionCount 3 | * 4 | * This counts the number of times a keyword argument occurs. 5 | * For example, this is useful for increasing verbosity levels 6 | * 7 | * This class inherided from [[Action]] 8 | * 9 | **/ 10 | 'use strict'; 11 | 12 | var util = require('util'); 13 | 14 | var Action = require('../action'); 15 | 16 | /*:nodoc:* 17 | * new ActionCount(options) 18 | * - options (object): options hash see [[Action.new]] 19 | * 20 | **/ 21 | var ActionCount = module.exports = function ActionCount(options) { 22 | options = options || {}; 23 | options.nargs = 0; 24 | 25 | Action.call(this, options); 26 | }; 27 | util.inherits(ActionCount, Action); 28 | 29 | /*:nodoc:* 30 | * ActionCount#call(parser, namespace, values, optionString) -> Void 31 | * - parser (ArgumentParser): current parser 32 | * - namespace (Namespace): namespace for output data 33 | * - values (Array): parsed values 34 | * - optionString (Array): input option string(not parsed) 35 | * 36 | * Call the action. Save result in namespace object 37 | **/ 38 | ActionCount.prototype.call = function (parser, namespace) { 39 | namespace.set(this.dest, (namespace[this.dest] || 0) + 1); 40 | }; 41 | -------------------------------------------------------------------------------- /node_modules/argparse/lib/action/help.js: -------------------------------------------------------------------------------- 1 | /*:nodoc:* 2 | * class ActionHelp 3 | * 4 | * Support action for printing help 5 | * This class inherided from [[Action]] 6 | **/ 7 | 'use strict'; 8 | 9 | var util = require('util'); 10 | 11 | var Action = require('../action'); 12 | 13 | // Constants 14 | var c = require('../const'); 15 | 16 | /*:nodoc:* 17 | * new ActionHelp(options) 18 | * - options (object): options hash see [[Action.new]] 19 | * 20 | **/ 21 | var ActionHelp = module.exports = function ActionHelp(options) { 22 | options = options || {}; 23 | if (options.defaultValue !== null) { 24 | options.defaultValue = options.defaultValue; 25 | } else { 26 | options.defaultValue = c.SUPPRESS; 27 | } 28 | options.dest = (options.dest !== null ? options.dest : c.SUPPRESS); 29 | options.nargs = 0; 30 | Action.call(this, options); 31 | 32 | }; 33 | util.inherits(ActionHelp, Action); 34 | 35 | /*:nodoc:* 36 | * ActionHelp#call(parser, namespace, values, optionString) 37 | * - parser (ArgumentParser): current parser 38 | * - namespace (Namespace): namespace for output data 39 | * - values (Array): parsed values 40 | * - optionString (Array): input option string(not parsed) 41 | * 42 | * Print help and exit 43 | **/ 44 | ActionHelp.prototype.call = function (parser) { 45 | parser.printHelp(); 46 | parser.exit(); 47 | }; 48 | -------------------------------------------------------------------------------- /node_modules/argparse/lib/action/store.js: -------------------------------------------------------------------------------- 1 | /*:nodoc:* 2 | * class ActionStore 3 | * 4 | * This action just stores the argument’s value. This is the default action. 5 | * 6 | * This class inherited from [[Action]] 7 | * 8 | **/ 9 | 'use strict'; 10 | 11 | var util = require('util'); 12 | 13 | var Action = require('../action'); 14 | 15 | // Constants 16 | var c = require('../const'); 17 | 18 | 19 | /*:nodoc:* 20 | * new ActionStore(options) 21 | * - options (object): options hash see [[Action.new]] 22 | * 23 | **/ 24 | var ActionStore = module.exports = function ActionStore(options) { 25 | options = options || {}; 26 | if (this.nargs <= 0) { 27 | throw new Error('nargs for store actions must be > 0; if you ' + 28 | 'have nothing to store, actions such as store ' + 29 | 'true or store const may be more appropriate'); 30 | 31 | } 32 | if (typeof this.constant !== 'undefined' && this.nargs !== c.OPTIONAL) { 33 | throw new Error('nargs must be OPTIONAL to supply const'); 34 | } 35 | Action.call(this, options); 36 | }; 37 | util.inherits(ActionStore, Action); 38 | 39 | /*:nodoc:* 40 | * ActionStore#call(parser, namespace, values, optionString) -> Void 41 | * - parser (ArgumentParser): current parser 42 | * - namespace (Namespace): namespace for output data 43 | * - values (Array): parsed values 44 | * - optionString (Array): input option string(not parsed) 45 | * 46 | * Call the action. Save result in namespace object 47 | **/ 48 | ActionStore.prototype.call = function (parser, namespace, values) { 49 | namespace.set(this.dest, values); 50 | }; 51 | -------------------------------------------------------------------------------- /node_modules/argparse/lib/action/store/constant.js: -------------------------------------------------------------------------------- 1 | /*:nodoc:* 2 | * class ActionStoreConstant 3 | * 4 | * This action stores the value specified by the const keyword argument. 5 | * (Note that the const keyword argument defaults to the rather unhelpful null.) 6 | * The 'store_const' action is most commonly used with optional 7 | * arguments that specify some sort of flag. 8 | * 9 | * This class inherited from [[Action]] 10 | **/ 11 | 'use strict'; 12 | 13 | var util = require('util'); 14 | 15 | var Action = require('../../action'); 16 | 17 | /*:nodoc:* 18 | * new ActionStoreConstant(options) 19 | * - options (object): options hash see [[Action.new]] 20 | * 21 | **/ 22 | var ActionStoreConstant = module.exports = function ActionStoreConstant(options) { 23 | options = options || {}; 24 | options.nargs = 0; 25 | if (typeof options.constant === 'undefined') { 26 | throw new Error('constant option is required for storeAction'); 27 | } 28 | Action.call(this, options); 29 | }; 30 | util.inherits(ActionStoreConstant, Action); 31 | 32 | /*:nodoc:* 33 | * ActionStoreConstant#call(parser, namespace, values, optionString) -> Void 34 | * - parser (ArgumentParser): current parser 35 | * - namespace (Namespace): namespace for output data 36 | * - values (Array): parsed values 37 | * - optionString (Array): input option string(not parsed) 38 | * 39 | * Call the action. Save result in namespace object 40 | **/ 41 | ActionStoreConstant.prototype.call = function (parser, namespace) { 42 | namespace.set(this.dest, this.constant); 43 | }; 44 | -------------------------------------------------------------------------------- /node_modules/argparse/lib/action/store/false.js: -------------------------------------------------------------------------------- 1 | /*:nodoc:* 2 | * class ActionStoreFalse 3 | * 4 | * This action store the values False respectively. 5 | * This is special cases of 'storeConst' 6 | * 7 | * This class inherited from [[Action]] 8 | **/ 9 | 10 | 'use strict'; 11 | 12 | var util = require('util'); 13 | 14 | var ActionStoreConstant = require('./constant'); 15 | 16 | /*:nodoc:* 17 | * new ActionStoreFalse(options) 18 | * - options (object): hash of options see [[Action.new]] 19 | * 20 | **/ 21 | var ActionStoreFalse = module.exports = function ActionStoreFalse(options) { 22 | options = options || {}; 23 | options.constant = false; 24 | options.defaultValue = options.defaultValue !== null ? options.defaultValue : true; 25 | ActionStoreConstant.call(this, options); 26 | }; 27 | util.inherits(ActionStoreFalse, ActionStoreConstant); 28 | -------------------------------------------------------------------------------- /node_modules/argparse/lib/action/store/true.js: -------------------------------------------------------------------------------- 1 | /*:nodoc:* 2 | * class ActionStoreTrue 3 | * 4 | * This action store the values True respectively. 5 | * This isspecial cases of 'storeConst' 6 | * 7 | * This class inherited from [[Action]] 8 | **/ 9 | 'use strict'; 10 | 11 | var util = require('util'); 12 | 13 | var ActionStoreConstant = require('./constant'); 14 | 15 | /*:nodoc:* 16 | * new ActionStoreTrue(options) 17 | * - options (object): options hash see [[Action.new]] 18 | * 19 | **/ 20 | var ActionStoreTrue = module.exports = function ActionStoreTrue(options) { 21 | options = options || {}; 22 | options.constant = true; 23 | options.defaultValue = options.defaultValue !== null ? options.defaultValue : false; 24 | ActionStoreConstant.call(this, options); 25 | }; 26 | util.inherits(ActionStoreTrue, ActionStoreConstant); 27 | -------------------------------------------------------------------------------- /node_modules/argparse/lib/action/subparsers.js: -------------------------------------------------------------------------------- 1 | /** internal 2 | * class ActionSubparsers 3 | * 4 | * Support the creation of such sub-commands with the addSubparsers() 5 | * 6 | * This class inherited from [[Action]] 7 | **/ 8 | 'use strict'; 9 | 10 | var util = require('util'); 11 | var format = require('util').format; 12 | 13 | 14 | var Action = require('../action'); 15 | 16 | // Constants 17 | var c = require('../const'); 18 | 19 | // Errors 20 | var argumentErrorHelper = require('../argument/error'); 21 | 22 | 23 | /*:nodoc:* 24 | * new ChoicesPseudoAction(name, help) 25 | * 26 | * Create pseudo action for correct help text 27 | * 28 | **/ 29 | function ChoicesPseudoAction(name, help) { 30 | var options = { 31 | optionStrings: [], 32 | dest: name, 33 | help: help 34 | }; 35 | 36 | Action.call(this, options); 37 | } 38 | 39 | util.inherits(ChoicesPseudoAction, Action); 40 | 41 | /** 42 | * new ActionSubparsers(options) 43 | * - options (object): options hash see [[Action.new]] 44 | * 45 | **/ 46 | function ActionSubparsers(options) { 47 | options = options || {}; 48 | options.dest = options.dest || c.SUPPRESS; 49 | options.nargs = c.PARSER; 50 | 51 | this.debug = (options.debug === true); 52 | 53 | this._progPrefix = options.prog; 54 | this._parserClass = options.parserClass; 55 | this._nameParserMap = {}; 56 | this._choicesActions = []; 57 | 58 | options.choices = this._nameParserMap; 59 | Action.call(this, options); 60 | } 61 | 62 | util.inherits(ActionSubparsers, Action); 63 | 64 | /*:nodoc:* 65 | * ActionSubparsers#addParser(name, options) -> ArgumentParser 66 | * - name (string): sub-command name 67 | * - options (object): see [[ArgumentParser.new]] 68 | * 69 | * Note: 70 | * addParser supports an additional aliases option, 71 | * which allows multiple strings to refer to the same subparser. 72 | * This example, like svn, aliases co as a shorthand for checkout 73 | * 74 | **/ 75 | ActionSubparsers.prototype.addParser = function (name, options) { 76 | var parser; 77 | 78 | var self = this; 79 | 80 | options = options || {}; 81 | 82 | options.debug = (this.debug === true); 83 | 84 | // set program from the existing prefix 85 | if (!options.prog) { 86 | options.prog = this._progPrefix + ' ' + name; 87 | } 88 | 89 | var aliases = options.aliases || []; 90 | 91 | // create a pseudo-action to hold the choice help 92 | if (!!options.help || typeof options.help === 'string') { 93 | var help = options.help; 94 | delete options.help; 95 | 96 | var choiceAction = new ChoicesPseudoAction(name, help); 97 | this._choicesActions.push(choiceAction); 98 | } 99 | 100 | // create the parser and add it to the map 101 | parser = new this._parserClass(options); 102 | this._nameParserMap[name] = parser; 103 | 104 | // make parser available under aliases also 105 | aliases.forEach(function (alias) { 106 | self._nameParserMap[alias] = parser; 107 | }); 108 | 109 | return parser; 110 | }; 111 | 112 | ActionSubparsers.prototype._getSubactions = function () { 113 | return this._choicesActions; 114 | }; 115 | 116 | /*:nodoc:* 117 | * ActionSubparsers#call(parser, namespace, values, optionString) -> Void 118 | * - parser (ArgumentParser): current parser 119 | * - namespace (Namespace): namespace for output data 120 | * - values (Array): parsed values 121 | * - optionString (Array): input option string(not parsed) 122 | * 123 | * Call the action. Parse input aguments 124 | **/ 125 | ActionSubparsers.prototype.call = function (parser, namespace, values) { 126 | var parserName = values[0]; 127 | var argStrings = values.slice(1); 128 | 129 | // set the parser name if requested 130 | if (this.dest !== c.SUPPRESS) { 131 | namespace[this.dest] = parserName; 132 | } 133 | 134 | // select the parser 135 | if (this._nameParserMap[parserName]) { 136 | parser = this._nameParserMap[parserName]; 137 | } else { 138 | throw argumentErrorHelper(format( 139 | 'Unknown parser "%s" (choices: [%s]).', 140 | parserName, 141 | Object.keys(this._nameParserMap).join(', ') 142 | )); 143 | } 144 | 145 | // parse all the remaining options into the namespace 146 | parser.parseArgs(argStrings, namespace); 147 | }; 148 | 149 | module.exports = ActionSubparsers; 150 | -------------------------------------------------------------------------------- /node_modules/argparse/lib/action/version.js: -------------------------------------------------------------------------------- 1 | /*:nodoc:* 2 | * class ActionVersion 3 | * 4 | * Support action for printing program version 5 | * This class inherited from [[Action]] 6 | **/ 7 | 'use strict'; 8 | 9 | var util = require('util'); 10 | 11 | var Action = require('../action'); 12 | 13 | // 14 | // Constants 15 | // 16 | var c = require('../const'); 17 | 18 | /*:nodoc:* 19 | * new ActionVersion(options) 20 | * - options (object): options hash see [[Action.new]] 21 | * 22 | **/ 23 | var ActionVersion = module.exports = function ActionVersion(options) { 24 | options = options || {}; 25 | options.defaultValue = (options.defaultValue ? options.defaultValue : c.SUPPRESS); 26 | options.dest = (options.dest || c.SUPPRESS); 27 | options.nargs = 0; 28 | this.version = options.version; 29 | Action.call(this, options); 30 | }; 31 | util.inherits(ActionVersion, Action); 32 | 33 | /*:nodoc:* 34 | * ActionVersion#call(parser, namespace, values, optionString) -> Void 35 | * - parser (ArgumentParser): current parser 36 | * - namespace (Namespace): namespace for output data 37 | * - values (Array): parsed values 38 | * - optionString (Array): input option string(not parsed) 39 | * 40 | * Print version and exit 41 | **/ 42 | ActionVersion.prototype.call = function (parser) { 43 | var version = this.version || parser.version; 44 | var formatter = parser._getFormatter(); 45 | formatter.addText(version); 46 | parser.exit(0, formatter.formatHelp()); 47 | }; 48 | -------------------------------------------------------------------------------- /node_modules/argparse/lib/argparse.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | module.exports.ArgumentParser = require('./argument_parser.js'); 4 | module.exports.Namespace = require('./namespace'); 5 | module.exports.Action = require('./action'); 6 | module.exports.HelpFormatter = require('./help/formatter.js'); 7 | module.exports.Const = require('./const.js'); 8 | 9 | module.exports.ArgumentDefaultsHelpFormatter = 10 | require('./help/added_formatters.js').ArgumentDefaultsHelpFormatter; 11 | module.exports.RawDescriptionHelpFormatter = 12 | require('./help/added_formatters.js').RawDescriptionHelpFormatter; 13 | module.exports.RawTextHelpFormatter = 14 | require('./help/added_formatters.js').RawTextHelpFormatter; 15 | -------------------------------------------------------------------------------- /node_modules/argparse/lib/argument/error.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | 4 | var format = require('util').format; 5 | 6 | 7 | var ERR_CODE = 'ARGError'; 8 | 9 | /*:nodoc:* 10 | * argumentError(argument, message) -> TypeError 11 | * - argument (Object): action with broken argument 12 | * - message (String): error message 13 | * 14 | * Error format helper. An error from creating or using an argument 15 | * (optional or positional). The string value of this exception 16 | * is the message, augmented with information 17 | * about the argument that caused it. 18 | * 19 | * #####Example 20 | * 21 | * var argumentErrorHelper = require('./argument/error'); 22 | * if (conflictOptionals.length > 0) { 23 | * throw argumentErrorHelper( 24 | * action, 25 | * format('Conflicting option string(s): %s', conflictOptionals.join(', ')) 26 | * ); 27 | * } 28 | * 29 | **/ 30 | module.exports = function (argument, message) { 31 | var argumentName = null; 32 | var errMessage; 33 | var err; 34 | 35 | if (argument.getName) { 36 | argumentName = argument.getName(); 37 | } else { 38 | argumentName = '' + argument; 39 | } 40 | 41 | if (!argumentName) { 42 | errMessage = message; 43 | } else { 44 | errMessage = format('argument "%s": %s', argumentName, message); 45 | } 46 | 47 | err = new TypeError(errMessage); 48 | err.code = ERR_CODE; 49 | return err; 50 | }; 51 | -------------------------------------------------------------------------------- /node_modules/argparse/lib/argument/exclusive.js: -------------------------------------------------------------------------------- 1 | /** internal 2 | * class MutuallyExclusiveGroup 3 | * 4 | * Group arguments. 5 | * By default, ArgumentParser groups command-line arguments 6 | * into “positional arguments” and “optional arguments” 7 | * when displaying help messages. When there is a better 8 | * conceptual grouping of arguments than this default one, 9 | * appropriate groups can be created using the addArgumentGroup() method 10 | * 11 | * This class inherited from [[ArgumentContainer]] 12 | **/ 13 | 'use strict'; 14 | 15 | var util = require('util'); 16 | 17 | var ArgumentGroup = require('./group'); 18 | 19 | /** 20 | * new MutuallyExclusiveGroup(container, options) 21 | * - container (object): main container 22 | * - options (object): options.required -> true/false 23 | * 24 | * `required` could be an argument itself, but making it a property of 25 | * the options argument is more consistent with the JS adaptation of the Python) 26 | **/ 27 | var MutuallyExclusiveGroup = module.exports = function MutuallyExclusiveGroup(container, options) { 28 | var required; 29 | options = options || {}; 30 | required = options.required || false; 31 | ArgumentGroup.call(this, container); 32 | this.required = required; 33 | 34 | }; 35 | util.inherits(MutuallyExclusiveGroup, ArgumentGroup); 36 | 37 | 38 | MutuallyExclusiveGroup.prototype._addAction = function (action) { 39 | var msg; 40 | if (action.required) { 41 | msg = 'mutually exclusive arguments must be optional'; 42 | throw new Error(msg); 43 | } 44 | action = this._container._addAction(action); 45 | this._groupActions.push(action); 46 | return action; 47 | }; 48 | 49 | 50 | MutuallyExclusiveGroup.prototype._removeAction = function (action) { 51 | this._container._removeAction(action); 52 | this._groupActions.remove(action); 53 | }; 54 | 55 | -------------------------------------------------------------------------------- /node_modules/argparse/lib/argument/group.js: -------------------------------------------------------------------------------- 1 | /** internal 2 | * class ArgumentGroup 3 | * 4 | * Group arguments. 5 | * By default, ArgumentParser groups command-line arguments 6 | * into “positional arguments” and “optional arguments” 7 | * when displaying help messages. When there is a better 8 | * conceptual grouping of arguments than this default one, 9 | * appropriate groups can be created using the addArgumentGroup() method 10 | * 11 | * This class inherited from [[ArgumentContainer]] 12 | **/ 13 | 'use strict'; 14 | 15 | var util = require('util'); 16 | 17 | var ActionContainer = require('../action_container'); 18 | 19 | 20 | /** 21 | * new ArgumentGroup(container, options) 22 | * - container (object): main container 23 | * - options (object): hash of group options 24 | * 25 | * #### options 26 | * - **prefixChars** group name prefix 27 | * - **argumentDefault** default argument value 28 | * - **title** group title 29 | * - **description** group description 30 | * 31 | **/ 32 | var ArgumentGroup = module.exports = function ArgumentGroup(container, options) { 33 | 34 | options = options || {}; 35 | 36 | // add any missing keyword arguments by checking the container 37 | options.conflictHandler = (options.conflictHandler || container.conflictHandler); 38 | options.prefixChars = (options.prefixChars || container.prefixChars); 39 | options.argumentDefault = (options.argumentDefault || container.argumentDefault); 40 | 41 | ActionContainer.call(this, options); 42 | 43 | // group attributes 44 | this.title = options.title; 45 | this._groupActions = []; 46 | 47 | // share most attributes with the container 48 | this._container = container; 49 | this._registries = container._registries; 50 | this._actions = container._actions; 51 | this._optionStringActions = container._optionStringActions; 52 | this._defaults = container._defaults; 53 | this._hasNegativeNumberOptionals = container._hasNegativeNumberOptionals; 54 | this._mutuallyExclusiveGroups = container._mutuallyExclusiveGroups; 55 | }; 56 | util.inherits(ArgumentGroup, ActionContainer); 57 | 58 | 59 | ArgumentGroup.prototype._addAction = function (action) { 60 | // Parent add action 61 | action = ActionContainer.prototype._addAction.call(this, action); 62 | this._groupActions.push(action); 63 | return action; 64 | }; 65 | 66 | 67 | ArgumentGroup.prototype._removeAction = function (action) { 68 | // Parent remove action 69 | ActionContainer.prototype._removeAction.call(this, action); 70 | var actionIndex = this._groupActions.indexOf(action); 71 | if (actionIndex >= 0) { 72 | this._groupActions.splice(actionIndex, 1); 73 | } 74 | }; 75 | 76 | -------------------------------------------------------------------------------- /node_modules/argparse/lib/const.js: -------------------------------------------------------------------------------- 1 | // 2 | // Constants 3 | // 4 | 5 | 'use strict'; 6 | 7 | module.exports.EOL = '\n'; 8 | 9 | module.exports.SUPPRESS = '==SUPPRESS=='; 10 | 11 | module.exports.OPTIONAL = '?'; 12 | 13 | module.exports.ZERO_OR_MORE = '*'; 14 | 15 | module.exports.ONE_OR_MORE = '+'; 16 | 17 | module.exports.PARSER = 'A...'; 18 | 19 | module.exports.REMAINDER = '...'; 20 | 21 | module.exports._UNRECOGNIZED_ARGS_ATTR = '_unrecognized_args'; 22 | -------------------------------------------------------------------------------- /node_modules/argparse/lib/help/added_formatters.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | var util = require('util'); 4 | 5 | // Constants 6 | var c = require('../const'); 7 | 8 | var $$ = require('../utils'); 9 | var HelpFormatter = require('./formatter.js'); 10 | 11 | /** 12 | * new RawDescriptionHelpFormatter(options) 13 | * new ArgumentParser({formatterClass: argparse.RawDescriptionHelpFormatter, ...}) 14 | * 15 | * Help message formatter which adds default values to argument help. 16 | * 17 | * Only the name of this class is considered a public API. All the methods 18 | * provided by the class are considered an implementation detail. 19 | **/ 20 | 21 | function ArgumentDefaultsHelpFormatter(options) { 22 | HelpFormatter.call(this, options); 23 | } 24 | 25 | util.inherits(ArgumentDefaultsHelpFormatter, HelpFormatter); 26 | 27 | ArgumentDefaultsHelpFormatter.prototype._getHelpString = function (action) { 28 | var help = action.help; 29 | if (action.help.indexOf('%(defaultValue)s') === -1) { 30 | if (action.defaultValue !== c.SUPPRESS) { 31 | var defaulting_nargs = [ c.OPTIONAL, c.ZERO_OR_MORE ]; 32 | if (action.isOptional() || (defaulting_nargs.indexOf(action.nargs) >= 0)) { 33 | help += ' (default: %(defaultValue)s)'; 34 | } 35 | } 36 | } 37 | return help; 38 | }; 39 | 40 | module.exports.ArgumentDefaultsHelpFormatter = ArgumentDefaultsHelpFormatter; 41 | 42 | /** 43 | * new RawDescriptionHelpFormatter(options) 44 | * new ArgumentParser({formatterClass: argparse.RawDescriptionHelpFormatter, ...}) 45 | * 46 | * Help message formatter which retains any formatting in descriptions. 47 | * 48 | * Only the name of this class is considered a public API. All the methods 49 | * provided by the class are considered an implementation detail. 50 | **/ 51 | 52 | function RawDescriptionHelpFormatter(options) { 53 | HelpFormatter.call(this, options); 54 | } 55 | 56 | util.inherits(RawDescriptionHelpFormatter, HelpFormatter); 57 | 58 | RawDescriptionHelpFormatter.prototype._fillText = function (text, width, indent) { 59 | var lines = text.split('\n'); 60 | lines = lines.map(function (line) { 61 | return $$.trimEnd(indent + line); 62 | }); 63 | return lines.join('\n'); 64 | }; 65 | module.exports.RawDescriptionHelpFormatter = RawDescriptionHelpFormatter; 66 | 67 | /** 68 | * new RawTextHelpFormatter(options) 69 | * new ArgumentParser({formatterClass: argparse.RawTextHelpFormatter, ...}) 70 | * 71 | * Help message formatter which retains formatting of all help text. 72 | * 73 | * Only the name of this class is considered a public API. All the methods 74 | * provided by the class are considered an implementation detail. 75 | **/ 76 | 77 | function RawTextHelpFormatter(options) { 78 | RawDescriptionHelpFormatter.call(this, options); 79 | } 80 | 81 | util.inherits(RawTextHelpFormatter, RawDescriptionHelpFormatter); 82 | 83 | RawTextHelpFormatter.prototype._splitLines = function (text) { 84 | return text.split('\n'); 85 | }; 86 | 87 | module.exports.RawTextHelpFormatter = RawTextHelpFormatter; 88 | -------------------------------------------------------------------------------- /node_modules/argparse/lib/namespace.js: -------------------------------------------------------------------------------- 1 | /** 2 | * class Namespace 3 | * 4 | * Simple object for storing attributes. Implements equality by attribute names 5 | * and values, and provides a simple string representation. 6 | * 7 | * See also [original guide][1] 8 | * 9 | * [1]:http://docs.python.org/dev/library/argparse.html#the-namespace-object 10 | **/ 11 | 'use strict'; 12 | 13 | var $$ = require('./utils'); 14 | 15 | /** 16 | * new Namespace(options) 17 | * - options(object): predefined propertis for result object 18 | * 19 | **/ 20 | var Namespace = module.exports = function Namespace(options) { 21 | $$.extend(this, options); 22 | }; 23 | 24 | /** 25 | * Namespace#isset(key) -> Boolean 26 | * - key (string|number): property name 27 | * 28 | * Tells whenever `namespace` contains given `key` or not. 29 | **/ 30 | Namespace.prototype.isset = function (key) { 31 | return $$.has(this, key); 32 | }; 33 | 34 | /** 35 | * Namespace#set(key, value) -> self 36 | * -key (string|number|object): propery name 37 | * -value (mixed): new property value 38 | * 39 | * Set the property named key with value. 40 | * If key object then set all key properties to namespace object 41 | **/ 42 | Namespace.prototype.set = function (key, value) { 43 | if (typeof (key) === 'object') { 44 | $$.extend(this, key); 45 | } else { 46 | this[key] = value; 47 | } 48 | return this; 49 | }; 50 | 51 | /** 52 | * Namespace#get(key, defaultValue) -> mixed 53 | * - key (string|number): property name 54 | * - defaultValue (mixed): default value 55 | * 56 | * Return the property key or defaulValue if not set 57 | **/ 58 | Namespace.prototype.get = function (key, defaultValue) { 59 | return !this[key] ? defaultValue : this[key]; 60 | }; 61 | 62 | /** 63 | * Namespace#unset(key, defaultValue) -> mixed 64 | * - key (string|number): property name 65 | * - defaultValue (mixed): default value 66 | * 67 | * Return data[key](and delete it) or defaultValue 68 | **/ 69 | Namespace.prototype.unset = function (key, defaultValue) { 70 | var value = this[key]; 71 | if (value !== null) { 72 | delete this[key]; 73 | return value; 74 | } 75 | return defaultValue; 76 | }; 77 | -------------------------------------------------------------------------------- /node_modules/argparse/lib/utils.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | exports.repeat = function (str, num) { 4 | var result = ''; 5 | for (var i = 0; i < num; i++) { result += str; } 6 | return result; 7 | }; 8 | 9 | exports.arrayEqual = function (a, b) { 10 | if (a.length !== b.length) { return false; } 11 | for (var i = 0; i < a.length; i++) { 12 | if (a[i] !== b[i]) { return false; } 13 | } 14 | return true; 15 | }; 16 | 17 | exports.trimChars = function (str, chars) { 18 | var start = 0; 19 | var end = str.length - 1; 20 | while (chars.indexOf(str.charAt(start)) >= 0) { start++; } 21 | while (chars.indexOf(str.charAt(end)) >= 0) { end--; } 22 | return str.slice(start, end + 1); 23 | }; 24 | 25 | exports.capitalize = function (str) { 26 | return str.charAt(0).toUpperCase() + str.slice(1); 27 | }; 28 | 29 | exports.arrayUnion = function () { 30 | var result = []; 31 | for (var i = 0, values = {}; i < arguments.length; i++) { 32 | var arr = arguments[i]; 33 | for (var j = 0; j < arr.length; j++) { 34 | if (!values[arr[j]]) { 35 | values[arr[j]] = true; 36 | result.push(arr[j]); 37 | } 38 | } 39 | } 40 | return result; 41 | }; 42 | 43 | function has(obj, key) { 44 | return Object.prototype.hasOwnProperty.call(obj, key); 45 | } 46 | 47 | exports.has = has; 48 | 49 | exports.extend = function (dest, src) { 50 | for (var i in src) { 51 | if (has(src, i)) { dest[i] = src[i]; } 52 | } 53 | }; 54 | 55 | exports.trimEnd = function (str) { 56 | return str.replace(/\s+$/g, ''); 57 | }; 58 | -------------------------------------------------------------------------------- /node_modules/argparse/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "_args": [ 3 | [ 4 | "argparse@1.0.10", 5 | "/Users/sabino/src/use-private-action" 6 | ] 7 | ], 8 | "_from": "argparse@1.0.10", 9 | "_id": "argparse@1.0.10", 10 | "_inBundle": false, 11 | "_integrity": "sha512-o5Roy6tNG4SL/FOkCAN6RzjiakZS25RLYFrcMttJqbdd8BWrnA+fGz57iN5Pb06pvBGvl5gQ0B48dJlslXvoTg==", 12 | "_location": "/argparse", 13 | "_phantomChildren": {}, 14 | "_requested": { 15 | "type": "version", 16 | "registry": true, 17 | "raw": "argparse@1.0.10", 18 | "name": "argparse", 19 | "escapedName": "argparse", 20 | "rawSpec": "1.0.10", 21 | "saveSpec": null, 22 | "fetchSpec": "1.0.10" 23 | }, 24 | "_requiredBy": [ 25 | "/js-yaml" 26 | ], 27 | "_resolved": "https://registry.npmjs.org/argparse/-/argparse-1.0.10.tgz", 28 | "_spec": "1.0.10", 29 | "_where": "/Users/sabino/src/use-private-action", 30 | "bugs": { 31 | "url": "https://github.com/nodeca/argparse/issues" 32 | }, 33 | "contributors": [ 34 | { 35 | "name": "Eugene Shkuropat" 36 | }, 37 | { 38 | "name": "Paul Jacobson" 39 | } 40 | ], 41 | "dependencies": { 42 | "sprintf-js": "~1.0.2" 43 | }, 44 | "description": "Very powerful CLI arguments parser. Native port of argparse - python's options parsing library", 45 | "devDependencies": { 46 | "eslint": "^2.13.1", 47 | "istanbul": "^0.4.5", 48 | "mocha": "^3.1.0", 49 | "ndoc": "^5.0.1" 50 | }, 51 | "files": [ 52 | "index.js", 53 | "lib/" 54 | ], 55 | "homepage": "https://github.com/nodeca/argparse#readme", 56 | "keywords": [ 57 | "cli", 58 | "parser", 59 | "argparse", 60 | "option", 61 | "args" 62 | ], 63 | "license": "MIT", 64 | "name": "argparse", 65 | "repository": { 66 | "type": "git", 67 | "url": "git+https://github.com/nodeca/argparse.git" 68 | }, 69 | "scripts": { 70 | "test": "make test" 71 | }, 72 | "version": "1.0.10" 73 | } 74 | -------------------------------------------------------------------------------- /node_modules/js-yaml/LICENSE: -------------------------------------------------------------------------------- 1 | (The MIT License) 2 | 3 | Copyright (C) 2011-2015 by Vitaly Puzrin 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/js-yaml/bin/js-yaml.js: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env node 2 | 3 | 4 | 'use strict'; 5 | 6 | /*eslint-disable no-console*/ 7 | 8 | 9 | // stdlib 10 | var fs = require('fs'); 11 | 12 | 13 | // 3rd-party 14 | var argparse = require('argparse'); 15 | 16 | 17 | // internal 18 | var yaml = require('..'); 19 | 20 | 21 | //////////////////////////////////////////////////////////////////////////////// 22 | 23 | 24 | var cli = new argparse.ArgumentParser({ 25 | prog: 'js-yaml', 26 | version: require('../package.json').version, 27 | addHelp: true 28 | }); 29 | 30 | 31 | cli.addArgument([ '-c', '--compact' ], { 32 | help: 'Display errors in compact mode', 33 | action: 'storeTrue' 34 | }); 35 | 36 | 37 | // deprecated (not needed after we removed output colors) 38 | // option suppressed, but not completely removed for compatibility 39 | cli.addArgument([ '-j', '--to-json' ], { 40 | help: argparse.Const.SUPPRESS, 41 | dest: 'json', 42 | action: 'storeTrue' 43 | }); 44 | 45 | 46 | cli.addArgument([ '-t', '--trace' ], { 47 | help: 'Show stack trace on error', 48 | action: 'storeTrue' 49 | }); 50 | 51 | cli.addArgument([ 'file' ], { 52 | help: 'File to read, utf-8 encoded without BOM', 53 | nargs: '?', 54 | defaultValue: '-' 55 | }); 56 | 57 | 58 | //////////////////////////////////////////////////////////////////////////////// 59 | 60 | 61 | var options = cli.parseArgs(); 62 | 63 | 64 | //////////////////////////////////////////////////////////////////////////////// 65 | 66 | function readFile(filename, encoding, callback) { 67 | if (options.file === '-') { 68 | // read from stdin 69 | 70 | var chunks = []; 71 | 72 | process.stdin.on('data', function (chunk) { 73 | chunks.push(chunk); 74 | }); 75 | 76 | process.stdin.on('end', function () { 77 | return callback(null, Buffer.concat(chunks).toString(encoding)); 78 | }); 79 | } else { 80 | fs.readFile(filename, encoding, callback); 81 | } 82 | } 83 | 84 | readFile(options.file, 'utf8', function (error, input) { 85 | var output, isYaml; 86 | 87 | if (error) { 88 | if (error.code === 'ENOENT') { 89 | console.error('File not found: ' + options.file); 90 | process.exit(2); 91 | } 92 | 93 | console.error( 94 | options.trace && error.stack || 95 | error.message || 96 | String(error)); 97 | 98 | process.exit(1); 99 | } 100 | 101 | try { 102 | output = JSON.parse(input); 103 | isYaml = false; 104 | } catch (err) { 105 | if (err instanceof SyntaxError) { 106 | try { 107 | output = []; 108 | yaml.loadAll(input, function (doc) { output.push(doc); }, {}); 109 | isYaml = true; 110 | 111 | if (output.length === 0) output = null; 112 | else if (output.length === 1) output = output[0]; 113 | 114 | } catch (e) { 115 | if (options.trace && err.stack) console.error(e.stack); 116 | else console.error(e.toString(options.compact)); 117 | 118 | process.exit(1); 119 | } 120 | } else { 121 | console.error( 122 | options.trace && err.stack || 123 | err.message || 124 | String(err)); 125 | 126 | process.exit(1); 127 | } 128 | } 129 | 130 | if (isYaml) console.log(JSON.stringify(output, null, ' ')); 131 | else console.log(yaml.dump(output)); 132 | }); 133 | -------------------------------------------------------------------------------- /node_modules/js-yaml/index.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | 4 | var yaml = require('./lib/js-yaml.js'); 5 | 6 | 7 | module.exports = yaml; 8 | -------------------------------------------------------------------------------- /node_modules/js-yaml/lib/js-yaml.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | 4 | var loader = require('./js-yaml/loader'); 5 | var dumper = require('./js-yaml/dumper'); 6 | 7 | 8 | function deprecated(name) { 9 | return function () { 10 | throw new Error('Function ' + name + ' is deprecated and cannot be used.'); 11 | }; 12 | } 13 | 14 | 15 | module.exports.Type = require('./js-yaml/type'); 16 | module.exports.Schema = require('./js-yaml/schema'); 17 | module.exports.FAILSAFE_SCHEMA = require('./js-yaml/schema/failsafe'); 18 | module.exports.JSON_SCHEMA = require('./js-yaml/schema/json'); 19 | module.exports.CORE_SCHEMA = require('./js-yaml/schema/core'); 20 | module.exports.DEFAULT_SAFE_SCHEMA = require('./js-yaml/schema/default_safe'); 21 | module.exports.DEFAULT_FULL_SCHEMA = require('./js-yaml/schema/default_full'); 22 | module.exports.load = loader.load; 23 | module.exports.loadAll = loader.loadAll; 24 | module.exports.safeLoad = loader.safeLoad; 25 | module.exports.safeLoadAll = loader.safeLoadAll; 26 | module.exports.dump = dumper.dump; 27 | module.exports.safeDump = dumper.safeDump; 28 | module.exports.YAMLException = require('./js-yaml/exception'); 29 | 30 | // Deprecated schema names from JS-YAML 2.0.x 31 | module.exports.MINIMAL_SCHEMA = require('./js-yaml/schema/failsafe'); 32 | module.exports.SAFE_SCHEMA = require('./js-yaml/schema/default_safe'); 33 | module.exports.DEFAULT_SCHEMA = require('./js-yaml/schema/default_full'); 34 | 35 | // Deprecated functions from JS-YAML 1.x.x 36 | module.exports.scan = deprecated('scan'); 37 | module.exports.parse = deprecated('parse'); 38 | module.exports.compose = deprecated('compose'); 39 | module.exports.addConstructor = deprecated('addConstructor'); 40 | -------------------------------------------------------------------------------- /node_modules/js-yaml/lib/js-yaml/common.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | 4 | function isNothing(subject) { 5 | return (typeof subject === 'undefined') || (subject === null); 6 | } 7 | 8 | 9 | function isObject(subject) { 10 | return (typeof subject === 'object') && (subject !== null); 11 | } 12 | 13 | 14 | function toArray(sequence) { 15 | if (Array.isArray(sequence)) return sequence; 16 | else if (isNothing(sequence)) return []; 17 | 18 | return [ sequence ]; 19 | } 20 | 21 | 22 | function extend(target, source) { 23 | var index, length, key, sourceKeys; 24 | 25 | if (source) { 26 | sourceKeys = Object.keys(source); 27 | 28 | for (index = 0, length = sourceKeys.length; index < length; index += 1) { 29 | key = sourceKeys[index]; 30 | target[key] = source[key]; 31 | } 32 | } 33 | 34 | return target; 35 | } 36 | 37 | 38 | function repeat(string, count) { 39 | var result = '', cycle; 40 | 41 | for (cycle = 0; cycle < count; cycle += 1) { 42 | result += string; 43 | } 44 | 45 | return result; 46 | } 47 | 48 | 49 | function isNegativeZero(number) { 50 | return (number === 0) && (Number.NEGATIVE_INFINITY === 1 / number); 51 | } 52 | 53 | 54 | module.exports.isNothing = isNothing; 55 | module.exports.isObject = isObject; 56 | module.exports.toArray = toArray; 57 | module.exports.repeat = repeat; 58 | module.exports.isNegativeZero = isNegativeZero; 59 | module.exports.extend = extend; 60 | -------------------------------------------------------------------------------- /node_modules/js-yaml/lib/js-yaml/exception.js: -------------------------------------------------------------------------------- 1 | // YAML error class. http://stackoverflow.com/questions/8458984 2 | // 3 | 'use strict'; 4 | 5 | function YAMLException(reason, mark) { 6 | // Super constructor 7 | Error.call(this); 8 | 9 | this.name = 'YAMLException'; 10 | this.reason = reason; 11 | this.mark = mark; 12 | this.message = (this.reason || '(unknown reason)') + (this.mark ? ' ' + this.mark.toString() : ''); 13 | 14 | // Include stack trace in error object 15 | if (Error.captureStackTrace) { 16 | // Chrome and NodeJS 17 | Error.captureStackTrace(this, this.constructor); 18 | } else { 19 | // FF, IE 10+ and Safari 6+. Fallback for others 20 | this.stack = (new Error()).stack || ''; 21 | } 22 | } 23 | 24 | 25 | // Inherit from Error 26 | YAMLException.prototype = Object.create(Error.prototype); 27 | YAMLException.prototype.constructor = YAMLException; 28 | 29 | 30 | YAMLException.prototype.toString = function toString(compact) { 31 | var result = this.name + ': '; 32 | 33 | result += this.reason || '(unknown reason)'; 34 | 35 | if (!compact && this.mark) { 36 | result += ' ' + this.mark.toString(); 37 | } 38 | 39 | return result; 40 | }; 41 | 42 | 43 | module.exports = YAMLException; 44 | -------------------------------------------------------------------------------- /node_modules/js-yaml/lib/js-yaml/mark.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | 4 | var common = require('./common'); 5 | 6 | 7 | function Mark(name, buffer, position, line, column) { 8 | this.name = name; 9 | this.buffer = buffer; 10 | this.position = position; 11 | this.line = line; 12 | this.column = column; 13 | } 14 | 15 | 16 | Mark.prototype.getSnippet = function getSnippet(indent, maxLength) { 17 | var head, start, tail, end, snippet; 18 | 19 | if (!this.buffer) return null; 20 | 21 | indent = indent || 4; 22 | maxLength = maxLength || 75; 23 | 24 | head = ''; 25 | start = this.position; 26 | 27 | while (start > 0 && '\x00\r\n\x85\u2028\u2029'.indexOf(this.buffer.charAt(start - 1)) === -1) { 28 | start -= 1; 29 | if (this.position - start > (maxLength / 2 - 1)) { 30 | head = ' ... '; 31 | start += 5; 32 | break; 33 | } 34 | } 35 | 36 | tail = ''; 37 | end = this.position; 38 | 39 | while (end < this.buffer.length && '\x00\r\n\x85\u2028\u2029'.indexOf(this.buffer.charAt(end)) === -1) { 40 | end += 1; 41 | if (end - this.position > (maxLength / 2 - 1)) { 42 | tail = ' ... '; 43 | end -= 5; 44 | break; 45 | } 46 | } 47 | 48 | snippet = this.buffer.slice(start, end); 49 | 50 | return common.repeat(' ', indent) + head + snippet + tail + '\n' + 51 | common.repeat(' ', indent + this.position - start + head.length) + '^'; 52 | }; 53 | 54 | 55 | Mark.prototype.toString = function toString(compact) { 56 | var snippet, where = ''; 57 | 58 | if (this.name) { 59 | where += 'in "' + this.name + '" '; 60 | } 61 | 62 | where += 'at line ' + (this.line + 1) + ', column ' + (this.column + 1); 63 | 64 | if (!compact) { 65 | snippet = this.getSnippet(); 66 | 67 | if (snippet) { 68 | where += ':\n' + snippet; 69 | } 70 | } 71 | 72 | return where; 73 | }; 74 | 75 | 76 | module.exports = Mark; 77 | -------------------------------------------------------------------------------- /node_modules/js-yaml/lib/js-yaml/schema.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | /*eslint-disable max-len*/ 4 | 5 | var common = require('./common'); 6 | var YAMLException = require('./exception'); 7 | var Type = require('./type'); 8 | 9 | 10 | function compileList(schema, name, result) { 11 | var exclude = []; 12 | 13 | schema.include.forEach(function (includedSchema) { 14 | result = compileList(includedSchema, name, result); 15 | }); 16 | 17 | schema[name].forEach(function (currentType) { 18 | result.forEach(function (previousType, previousIndex) { 19 | if (previousType.tag === currentType.tag && previousType.kind === currentType.kind) { 20 | exclude.push(previousIndex); 21 | } 22 | }); 23 | 24 | result.push(currentType); 25 | }); 26 | 27 | return result.filter(function (type, index) { 28 | return exclude.indexOf(index) === -1; 29 | }); 30 | } 31 | 32 | 33 | function compileMap(/* lists... */) { 34 | var result = { 35 | scalar: {}, 36 | sequence: {}, 37 | mapping: {}, 38 | fallback: {} 39 | }, index, length; 40 | 41 | function collectType(type) { 42 | result[type.kind][type.tag] = result['fallback'][type.tag] = type; 43 | } 44 | 45 | for (index = 0, length = arguments.length; index < length; index += 1) { 46 | arguments[index].forEach(collectType); 47 | } 48 | return result; 49 | } 50 | 51 | 52 | function Schema(definition) { 53 | this.include = definition.include || []; 54 | this.implicit = definition.implicit || []; 55 | this.explicit = definition.explicit || []; 56 | 57 | this.implicit.forEach(function (type) { 58 | if (type.loadKind && type.loadKind !== 'scalar') { 59 | throw new YAMLException('There is a non-scalar type in the implicit list of a schema. Implicit resolving of such types is not supported.'); 60 | } 61 | }); 62 | 63 | this.compiledImplicit = compileList(this, 'implicit', []); 64 | this.compiledExplicit = compileList(this, 'explicit', []); 65 | this.compiledTypeMap = compileMap(this.compiledImplicit, this.compiledExplicit); 66 | } 67 | 68 | 69 | Schema.DEFAULT = null; 70 | 71 | 72 | Schema.create = function createSchema() { 73 | var schemas, types; 74 | 75 | switch (arguments.length) { 76 | case 1: 77 | schemas = Schema.DEFAULT; 78 | types = arguments[0]; 79 | break; 80 | 81 | case 2: 82 | schemas = arguments[0]; 83 | types = arguments[1]; 84 | break; 85 | 86 | default: 87 | throw new YAMLException('Wrong number of arguments for Schema.create function'); 88 | } 89 | 90 | schemas = common.toArray(schemas); 91 | types = common.toArray(types); 92 | 93 | if (!schemas.every(function (schema) { return schema instanceof Schema; })) { 94 | throw new YAMLException('Specified list of super schemas (or a single Schema object) contains a non-Schema object.'); 95 | } 96 | 97 | if (!types.every(function (type) { return type instanceof Type; })) { 98 | throw new YAMLException('Specified list of YAML types (or a single Type object) contains a non-Type object.'); 99 | } 100 | 101 | return new Schema({ 102 | include: schemas, 103 | explicit: types 104 | }); 105 | }; 106 | 107 | 108 | module.exports = Schema; 109 | -------------------------------------------------------------------------------- /node_modules/js-yaml/lib/js-yaml/schema/core.js: -------------------------------------------------------------------------------- 1 | // Standard YAML's Core schema. 2 | // http://www.yaml.org/spec/1.2/spec.html#id2804923 3 | // 4 | // NOTE: JS-YAML does not support schema-specific tag resolution restrictions. 5 | // So, Core schema has no distinctions from JSON schema is JS-YAML. 6 | 7 | 8 | 'use strict'; 9 | 10 | 11 | var Schema = require('../schema'); 12 | 13 | 14 | module.exports = new Schema({ 15 | include: [ 16 | require('./json') 17 | ] 18 | }); 19 | -------------------------------------------------------------------------------- /node_modules/js-yaml/lib/js-yaml/schema/default_full.js: -------------------------------------------------------------------------------- 1 | // JS-YAML's default schema for `load` function. 2 | // It is not described in the YAML specification. 3 | // 4 | // This schema is based on JS-YAML's default safe schema and includes 5 | // JavaScript-specific types: !!js/undefined, !!js/regexp and !!js/function. 6 | // 7 | // Also this schema is used as default base schema at `Schema.create` function. 8 | 9 | 10 | 'use strict'; 11 | 12 | 13 | var Schema = require('../schema'); 14 | 15 | 16 | module.exports = Schema.DEFAULT = new Schema({ 17 | include: [ 18 | require('./default_safe') 19 | ], 20 | explicit: [ 21 | require('../type/js/undefined'), 22 | require('../type/js/regexp'), 23 | require('../type/js/function') 24 | ] 25 | }); 26 | -------------------------------------------------------------------------------- /node_modules/js-yaml/lib/js-yaml/schema/default_safe.js: -------------------------------------------------------------------------------- 1 | // JS-YAML's default schema for `safeLoad` function. 2 | // It is not described in the YAML specification. 3 | // 4 | // This schema is based on standard YAML's Core schema and includes most of 5 | // extra types described at YAML tag repository. (http://yaml.org/type/) 6 | 7 | 8 | 'use strict'; 9 | 10 | 11 | var Schema = require('../schema'); 12 | 13 | 14 | module.exports = new Schema({ 15 | include: [ 16 | require('./core') 17 | ], 18 | implicit: [ 19 | require('../type/timestamp'), 20 | require('../type/merge') 21 | ], 22 | explicit: [ 23 | require('../type/binary'), 24 | require('../type/omap'), 25 | require('../type/pairs'), 26 | require('../type/set') 27 | ] 28 | }); 29 | -------------------------------------------------------------------------------- /node_modules/js-yaml/lib/js-yaml/schema/failsafe.js: -------------------------------------------------------------------------------- 1 | // Standard YAML's Failsafe schema. 2 | // http://www.yaml.org/spec/1.2/spec.html#id2802346 3 | 4 | 5 | 'use strict'; 6 | 7 | 8 | var Schema = require('../schema'); 9 | 10 | 11 | module.exports = new Schema({ 12 | explicit: [ 13 | require('../type/str'), 14 | require('../type/seq'), 15 | require('../type/map') 16 | ] 17 | }); 18 | -------------------------------------------------------------------------------- /node_modules/js-yaml/lib/js-yaml/schema/json.js: -------------------------------------------------------------------------------- 1 | // Standard YAML's JSON schema. 2 | // http://www.yaml.org/spec/1.2/spec.html#id2803231 3 | // 4 | // NOTE: JS-YAML does not support schema-specific tag resolution restrictions. 5 | // So, this schema is not such strict as defined in the YAML specification. 6 | // It allows numbers in binary notaion, use `Null` and `NULL` as `null`, etc. 7 | 8 | 9 | 'use strict'; 10 | 11 | 12 | var Schema = require('../schema'); 13 | 14 | 15 | module.exports = new Schema({ 16 | include: [ 17 | require('./failsafe') 18 | ], 19 | implicit: [ 20 | require('../type/null'), 21 | require('../type/bool'), 22 | require('../type/int'), 23 | require('../type/float') 24 | ] 25 | }); 26 | -------------------------------------------------------------------------------- /node_modules/js-yaml/lib/js-yaml/type.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | var YAMLException = require('./exception'); 4 | 5 | var TYPE_CONSTRUCTOR_OPTIONS = [ 6 | 'kind', 7 | 'resolve', 8 | 'construct', 9 | 'instanceOf', 10 | 'predicate', 11 | 'represent', 12 | 'defaultStyle', 13 | 'styleAliases' 14 | ]; 15 | 16 | var YAML_NODE_KINDS = [ 17 | 'scalar', 18 | 'sequence', 19 | 'mapping' 20 | ]; 21 | 22 | function compileStyleAliases(map) { 23 | var result = {}; 24 | 25 | if (map !== null) { 26 | Object.keys(map).forEach(function (style) { 27 | map[style].forEach(function (alias) { 28 | result[String(alias)] = style; 29 | }); 30 | }); 31 | } 32 | 33 | return result; 34 | } 35 | 36 | function Type(tag, options) { 37 | options = options || {}; 38 | 39 | Object.keys(options).forEach(function (name) { 40 | if (TYPE_CONSTRUCTOR_OPTIONS.indexOf(name) === -1) { 41 | throw new YAMLException('Unknown option "' + name + '" is met in definition of "' + tag + '" YAML type.'); 42 | } 43 | }); 44 | 45 | // TODO: Add tag format check. 46 | this.tag = tag; 47 | this.kind = options['kind'] || null; 48 | this.resolve = options['resolve'] || function () { return true; }; 49 | this.construct = options['construct'] || function (data) { return data; }; 50 | this.instanceOf = options['instanceOf'] || null; 51 | this.predicate = options['predicate'] || null; 52 | this.represent = options['represent'] || null; 53 | this.defaultStyle = options['defaultStyle'] || null; 54 | this.styleAliases = compileStyleAliases(options['styleAliases'] || null); 55 | 56 | if (YAML_NODE_KINDS.indexOf(this.kind) === -1) { 57 | throw new YAMLException('Unknown kind "' + this.kind + '" is specified for "' + tag + '" YAML type.'); 58 | } 59 | } 60 | 61 | module.exports = Type; 62 | -------------------------------------------------------------------------------- /node_modules/js-yaml/lib/js-yaml/type/binary.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | /*eslint-disable no-bitwise*/ 4 | 5 | var NodeBuffer; 6 | 7 | try { 8 | // A trick for browserified version, to not include `Buffer` shim 9 | var _require = require; 10 | NodeBuffer = _require('buffer').Buffer; 11 | } catch (__) {} 12 | 13 | var Type = require('../type'); 14 | 15 | 16 | // [ 64, 65, 66 ] -> [ padding, CR, LF ] 17 | var BASE64_MAP = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=\n\r'; 18 | 19 | 20 | function resolveYamlBinary(data) { 21 | if (data === null) return false; 22 | 23 | var code, idx, bitlen = 0, max = data.length, map = BASE64_MAP; 24 | 25 | // Convert one by one. 26 | for (idx = 0; idx < max; idx++) { 27 | code = map.indexOf(data.charAt(idx)); 28 | 29 | // Skip CR/LF 30 | if (code > 64) continue; 31 | 32 | // Fail on illegal characters 33 | if (code < 0) return false; 34 | 35 | bitlen += 6; 36 | } 37 | 38 | // If there are any bits left, source was corrupted 39 | return (bitlen % 8) === 0; 40 | } 41 | 42 | function constructYamlBinary(data) { 43 | var idx, tailbits, 44 | input = data.replace(/[\r\n=]/g, ''), // remove CR/LF & padding to simplify scan 45 | max = input.length, 46 | map = BASE64_MAP, 47 | bits = 0, 48 | result = []; 49 | 50 | // Collect by 6*4 bits (3 bytes) 51 | 52 | for (idx = 0; idx < max; idx++) { 53 | if ((idx % 4 === 0) && idx) { 54 | result.push((bits >> 16) & 0xFF); 55 | result.push((bits >> 8) & 0xFF); 56 | result.push(bits & 0xFF); 57 | } 58 | 59 | bits = (bits << 6) | map.indexOf(input.charAt(idx)); 60 | } 61 | 62 | // Dump tail 63 | 64 | tailbits = (max % 4) * 6; 65 | 66 | if (tailbits === 0) { 67 | result.push((bits >> 16) & 0xFF); 68 | result.push((bits >> 8) & 0xFF); 69 | result.push(bits & 0xFF); 70 | } else if (tailbits === 18) { 71 | result.push((bits >> 10) & 0xFF); 72 | result.push((bits >> 2) & 0xFF); 73 | } else if (tailbits === 12) { 74 | result.push((bits >> 4) & 0xFF); 75 | } 76 | 77 | // Wrap into Buffer for NodeJS and leave Array for browser 78 | if (NodeBuffer) { 79 | // Support node 6.+ Buffer API when available 80 | return NodeBuffer.from ? NodeBuffer.from(result) : new NodeBuffer(result); 81 | } 82 | 83 | return result; 84 | } 85 | 86 | function representYamlBinary(object /*, style*/) { 87 | var result = '', bits = 0, idx, tail, 88 | max = object.length, 89 | map = BASE64_MAP; 90 | 91 | // Convert every three bytes to 4 ASCII characters. 92 | 93 | for (idx = 0; idx < max; idx++) { 94 | if ((idx % 3 === 0) && idx) { 95 | result += map[(bits >> 18) & 0x3F]; 96 | result += map[(bits >> 12) & 0x3F]; 97 | result += map[(bits >> 6) & 0x3F]; 98 | result += map[bits & 0x3F]; 99 | } 100 | 101 | bits = (bits << 8) + object[idx]; 102 | } 103 | 104 | // Dump tail 105 | 106 | tail = max % 3; 107 | 108 | if (tail === 0) { 109 | result += map[(bits >> 18) & 0x3F]; 110 | result += map[(bits >> 12) & 0x3F]; 111 | result += map[(bits >> 6) & 0x3F]; 112 | result += map[bits & 0x3F]; 113 | } else if (tail === 2) { 114 | result += map[(bits >> 10) & 0x3F]; 115 | result += map[(bits >> 4) & 0x3F]; 116 | result += map[(bits << 2) & 0x3F]; 117 | result += map[64]; 118 | } else if (tail === 1) { 119 | result += map[(bits >> 2) & 0x3F]; 120 | result += map[(bits << 4) & 0x3F]; 121 | result += map[64]; 122 | result += map[64]; 123 | } 124 | 125 | return result; 126 | } 127 | 128 | function isBinary(object) { 129 | return NodeBuffer && NodeBuffer.isBuffer(object); 130 | } 131 | 132 | module.exports = new Type('tag:yaml.org,2002:binary', { 133 | kind: 'scalar', 134 | resolve: resolveYamlBinary, 135 | construct: constructYamlBinary, 136 | predicate: isBinary, 137 | represent: representYamlBinary 138 | }); 139 | -------------------------------------------------------------------------------- /node_modules/js-yaml/lib/js-yaml/type/bool.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | var Type = require('../type'); 4 | 5 | function resolveYamlBoolean(data) { 6 | if (data === null) return false; 7 | 8 | var max = data.length; 9 | 10 | return (max === 4 && (data === 'true' || data === 'True' || data === 'TRUE')) || 11 | (max === 5 && (data === 'false' || data === 'False' || data === 'FALSE')); 12 | } 13 | 14 | function constructYamlBoolean(data) { 15 | return data === 'true' || 16 | data === 'True' || 17 | data === 'TRUE'; 18 | } 19 | 20 | function isBoolean(object) { 21 | return Object.prototype.toString.call(object) === '[object Boolean]'; 22 | } 23 | 24 | module.exports = new Type('tag:yaml.org,2002:bool', { 25 | kind: 'scalar', 26 | resolve: resolveYamlBoolean, 27 | construct: constructYamlBoolean, 28 | predicate: isBoolean, 29 | represent: { 30 | lowercase: function (object) { return object ? 'true' : 'false'; }, 31 | uppercase: function (object) { return object ? 'TRUE' : 'FALSE'; }, 32 | camelcase: function (object) { return object ? 'True' : 'False'; } 33 | }, 34 | defaultStyle: 'lowercase' 35 | }); 36 | -------------------------------------------------------------------------------- /node_modules/js-yaml/lib/js-yaml/type/float.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | var common = require('../common'); 4 | var Type = require('../type'); 5 | 6 | var YAML_FLOAT_PATTERN = new RegExp( 7 | // 2.5e4, 2.5 and integers 8 | '^(?:[-+]?(?:0|[1-9][0-9_]*)(?:\\.[0-9_]*)?(?:[eE][-+]?[0-9]+)?' + 9 | // .2e4, .2 10 | // special case, seems not from spec 11 | '|\\.[0-9_]+(?:[eE][-+]?[0-9]+)?' + 12 | // 20:59 13 | '|[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+\\.[0-9_]*' + 14 | // .inf 15 | '|[-+]?\\.(?:inf|Inf|INF)' + 16 | // .nan 17 | '|\\.(?:nan|NaN|NAN))$'); 18 | 19 | function resolveYamlFloat(data) { 20 | if (data === null) return false; 21 | 22 | if (!YAML_FLOAT_PATTERN.test(data) || 23 | // Quick hack to not allow integers end with `_` 24 | // Probably should update regexp & check speed 25 | data[data.length - 1] === '_') { 26 | return false; 27 | } 28 | 29 | return true; 30 | } 31 | 32 | function constructYamlFloat(data) { 33 | var value, sign, base, digits; 34 | 35 | value = data.replace(/_/g, '').toLowerCase(); 36 | sign = value[0] === '-' ? -1 : 1; 37 | digits = []; 38 | 39 | if ('+-'.indexOf(value[0]) >= 0) { 40 | value = value.slice(1); 41 | } 42 | 43 | if (value === '.inf') { 44 | return (sign === 1) ? Number.POSITIVE_INFINITY : Number.NEGATIVE_INFINITY; 45 | 46 | } else if (value === '.nan') { 47 | return NaN; 48 | 49 | } else if (value.indexOf(':') >= 0) { 50 | value.split(':').forEach(function (v) { 51 | digits.unshift(parseFloat(v, 10)); 52 | }); 53 | 54 | value = 0.0; 55 | base = 1; 56 | 57 | digits.forEach(function (d) { 58 | value += d * base; 59 | base *= 60; 60 | }); 61 | 62 | return sign * value; 63 | 64 | } 65 | return sign * parseFloat(value, 10); 66 | } 67 | 68 | 69 | var SCIENTIFIC_WITHOUT_DOT = /^[-+]?[0-9]+e/; 70 | 71 | function representYamlFloat(object, style) { 72 | var res; 73 | 74 | if (isNaN(object)) { 75 | switch (style) { 76 | case 'lowercase': return '.nan'; 77 | case 'uppercase': return '.NAN'; 78 | case 'camelcase': return '.NaN'; 79 | } 80 | } else if (Number.POSITIVE_INFINITY === object) { 81 | switch (style) { 82 | case 'lowercase': return '.inf'; 83 | case 'uppercase': return '.INF'; 84 | case 'camelcase': return '.Inf'; 85 | } 86 | } else if (Number.NEGATIVE_INFINITY === object) { 87 | switch (style) { 88 | case 'lowercase': return '-.inf'; 89 | case 'uppercase': return '-.INF'; 90 | case 'camelcase': return '-.Inf'; 91 | } 92 | } else if (common.isNegativeZero(object)) { 93 | return '-0.0'; 94 | } 95 | 96 | res = object.toString(10); 97 | 98 | // JS stringifier can build scientific format without dots: 5e-100, 99 | // while YAML requres dot: 5.e-100. Fix it with simple hack 100 | 101 | return SCIENTIFIC_WITHOUT_DOT.test(res) ? res.replace('e', '.e') : res; 102 | } 103 | 104 | function isFloat(object) { 105 | return (Object.prototype.toString.call(object) === '[object Number]') && 106 | (object % 1 !== 0 || common.isNegativeZero(object)); 107 | } 108 | 109 | module.exports = new Type('tag:yaml.org,2002:float', { 110 | kind: 'scalar', 111 | resolve: resolveYamlFloat, 112 | construct: constructYamlFloat, 113 | predicate: isFloat, 114 | represent: representYamlFloat, 115 | defaultStyle: 'lowercase' 116 | }); 117 | -------------------------------------------------------------------------------- /node_modules/js-yaml/lib/js-yaml/type/int.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | var common = require('../common'); 4 | var Type = require('../type'); 5 | 6 | function isHexCode(c) { 7 | return ((0x30/* 0 */ <= c) && (c <= 0x39/* 9 */)) || 8 | ((0x41/* A */ <= c) && (c <= 0x46/* F */)) || 9 | ((0x61/* a */ <= c) && (c <= 0x66/* f */)); 10 | } 11 | 12 | function isOctCode(c) { 13 | return ((0x30/* 0 */ <= c) && (c <= 0x37/* 7 */)); 14 | } 15 | 16 | function isDecCode(c) { 17 | return ((0x30/* 0 */ <= c) && (c <= 0x39/* 9 */)); 18 | } 19 | 20 | function resolveYamlInteger(data) { 21 | if (data === null) return false; 22 | 23 | var max = data.length, 24 | index = 0, 25 | hasDigits = false, 26 | ch; 27 | 28 | if (!max) return false; 29 | 30 | ch = data[index]; 31 | 32 | // sign 33 | if (ch === '-' || ch === '+') { 34 | ch = data[++index]; 35 | } 36 | 37 | if (ch === '0') { 38 | // 0 39 | if (index + 1 === max) return true; 40 | ch = data[++index]; 41 | 42 | // base 2, base 8, base 16 43 | 44 | if (ch === 'b') { 45 | // base 2 46 | index++; 47 | 48 | for (; index < max; index++) { 49 | ch = data[index]; 50 | if (ch === '_') continue; 51 | if (ch !== '0' && ch !== '1') return false; 52 | hasDigits = true; 53 | } 54 | return hasDigits && ch !== '_'; 55 | } 56 | 57 | 58 | if (ch === 'x') { 59 | // base 16 60 | index++; 61 | 62 | for (; index < max; index++) { 63 | ch = data[index]; 64 | if (ch === '_') continue; 65 | if (!isHexCode(data.charCodeAt(index))) return false; 66 | hasDigits = true; 67 | } 68 | return hasDigits && ch !== '_'; 69 | } 70 | 71 | // base 8 72 | for (; index < max; index++) { 73 | ch = data[index]; 74 | if (ch === '_') continue; 75 | if (!isOctCode(data.charCodeAt(index))) return false; 76 | hasDigits = true; 77 | } 78 | return hasDigits && ch !== '_'; 79 | } 80 | 81 | // base 10 (except 0) or base 60 82 | 83 | // value should not start with `_`; 84 | if (ch === '_') return false; 85 | 86 | for (; index < max; index++) { 87 | ch = data[index]; 88 | if (ch === '_') continue; 89 | if (ch === ':') break; 90 | if (!isDecCode(data.charCodeAt(index))) { 91 | return false; 92 | } 93 | hasDigits = true; 94 | } 95 | 96 | // Should have digits and should not end with `_` 97 | if (!hasDigits || ch === '_') return false; 98 | 99 | // if !base60 - done; 100 | if (ch !== ':') return true; 101 | 102 | // base60 almost not used, no needs to optimize 103 | return /^(:[0-5]?[0-9])+$/.test(data.slice(index)); 104 | } 105 | 106 | function constructYamlInteger(data) { 107 | var value = data, sign = 1, ch, base, digits = []; 108 | 109 | if (value.indexOf('_') !== -1) { 110 | value = value.replace(/_/g, ''); 111 | } 112 | 113 | ch = value[0]; 114 | 115 | if (ch === '-' || ch === '+') { 116 | if (ch === '-') sign = -1; 117 | value = value.slice(1); 118 | ch = value[0]; 119 | } 120 | 121 | if (value === '0') return 0; 122 | 123 | if (ch === '0') { 124 | if (value[1] === 'b') return sign * parseInt(value.slice(2), 2); 125 | if (value[1] === 'x') return sign * parseInt(value, 16); 126 | return sign * parseInt(value, 8); 127 | } 128 | 129 | if (value.indexOf(':') !== -1) { 130 | value.split(':').forEach(function (v) { 131 | digits.unshift(parseInt(v, 10)); 132 | }); 133 | 134 | value = 0; 135 | base = 1; 136 | 137 | digits.forEach(function (d) { 138 | value += (d * base); 139 | base *= 60; 140 | }); 141 | 142 | return sign * value; 143 | 144 | } 145 | 146 | return sign * parseInt(value, 10); 147 | } 148 | 149 | function isInteger(object) { 150 | return (Object.prototype.toString.call(object)) === '[object Number]' && 151 | (object % 1 === 0 && !common.isNegativeZero(object)); 152 | } 153 | 154 | module.exports = new Type('tag:yaml.org,2002:int', { 155 | kind: 'scalar', 156 | resolve: resolveYamlInteger, 157 | construct: constructYamlInteger, 158 | predicate: isInteger, 159 | represent: { 160 | binary: function (obj) { return obj >= 0 ? '0b' + obj.toString(2) : '-0b' + obj.toString(2).slice(1); }, 161 | octal: function (obj) { return obj >= 0 ? '0' + obj.toString(8) : '-0' + obj.toString(8).slice(1); }, 162 | decimal: function (obj) { return obj.toString(10); }, 163 | /* eslint-disable max-len */ 164 | hexadecimal: function (obj) { return obj >= 0 ? '0x' + obj.toString(16).toUpperCase() : '-0x' + obj.toString(16).toUpperCase().slice(1); } 165 | }, 166 | defaultStyle: 'decimal', 167 | styleAliases: { 168 | binary: [ 2, 'bin' ], 169 | octal: [ 8, 'oct' ], 170 | decimal: [ 10, 'dec' ], 171 | hexadecimal: [ 16, 'hex' ] 172 | } 173 | }); 174 | -------------------------------------------------------------------------------- /node_modules/js-yaml/lib/js-yaml/type/js/function.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | var esprima; 4 | 5 | // Browserified version does not have esprima 6 | // 7 | // 1. For node.js just require module as deps 8 | // 2. For browser try to require mudule via external AMD system. 9 | // If not found - try to fallback to window.esprima. If not 10 | // found too - then fail to parse. 11 | // 12 | try { 13 | // workaround to exclude package from browserify list. 14 | var _require = require; 15 | esprima = _require('esprima'); 16 | } catch (_) { 17 | /*global window */ 18 | if (typeof window !== 'undefined') esprima = window.esprima; 19 | } 20 | 21 | var Type = require('../../type'); 22 | 23 | function resolveJavascriptFunction(data) { 24 | if (data === null) return false; 25 | 26 | try { 27 | var source = '(' + data + ')', 28 | ast = esprima.parse(source, { range: true }); 29 | 30 | if (ast.type !== 'Program' || 31 | ast.body.length !== 1 || 32 | ast.body[0].type !== 'ExpressionStatement' || 33 | (ast.body[0].expression.type !== 'ArrowFunctionExpression' && 34 | ast.body[0].expression.type !== 'FunctionExpression')) { 35 | return false; 36 | } 37 | 38 | return true; 39 | } catch (err) { 40 | return false; 41 | } 42 | } 43 | 44 | function constructJavascriptFunction(data) { 45 | /*jslint evil:true*/ 46 | 47 | var source = '(' + data + ')', 48 | ast = esprima.parse(source, { range: true }), 49 | params = [], 50 | body; 51 | 52 | if (ast.type !== 'Program' || 53 | ast.body.length !== 1 || 54 | ast.body[0].type !== 'ExpressionStatement' || 55 | (ast.body[0].expression.type !== 'ArrowFunctionExpression' && 56 | ast.body[0].expression.type !== 'FunctionExpression')) { 57 | throw new Error('Failed to resolve function'); 58 | } 59 | 60 | ast.body[0].expression.params.forEach(function (param) { 61 | params.push(param.name); 62 | }); 63 | 64 | body = ast.body[0].expression.body.range; 65 | 66 | // Esprima's ranges include the first '{' and the last '}' characters on 67 | // function expressions. So cut them out. 68 | if (ast.body[0].expression.body.type === 'BlockStatement') { 69 | /*eslint-disable no-new-func*/ 70 | return new Function(params, source.slice(body[0] + 1, body[1] - 1)); 71 | } 72 | // ES6 arrow functions can omit the BlockStatement. In that case, just return 73 | // the body. 74 | /*eslint-disable no-new-func*/ 75 | return new Function(params, 'return ' + source.slice(body[0], body[1])); 76 | } 77 | 78 | function representJavascriptFunction(object /*, style*/) { 79 | return object.toString(); 80 | } 81 | 82 | function isFunction(object) { 83 | return Object.prototype.toString.call(object) === '[object Function]'; 84 | } 85 | 86 | module.exports = new Type('tag:yaml.org,2002:js/function', { 87 | kind: 'scalar', 88 | resolve: resolveJavascriptFunction, 89 | construct: constructJavascriptFunction, 90 | predicate: isFunction, 91 | represent: representJavascriptFunction 92 | }); 93 | -------------------------------------------------------------------------------- /node_modules/js-yaml/lib/js-yaml/type/js/regexp.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | var Type = require('../../type'); 4 | 5 | function resolveJavascriptRegExp(data) { 6 | if (data === null) return false; 7 | if (data.length === 0) return false; 8 | 9 | var regexp = data, 10 | tail = /\/([gim]*)$/.exec(data), 11 | modifiers = ''; 12 | 13 | // if regexp starts with '/' it can have modifiers and must be properly closed 14 | // `/foo/gim` - modifiers tail can be maximum 3 chars 15 | if (regexp[0] === '/') { 16 | if (tail) modifiers = tail[1]; 17 | 18 | if (modifiers.length > 3) return false; 19 | // if expression starts with /, is should be properly terminated 20 | if (regexp[regexp.length - modifiers.length - 1] !== '/') return false; 21 | } 22 | 23 | return true; 24 | } 25 | 26 | function constructJavascriptRegExp(data) { 27 | var regexp = data, 28 | tail = /\/([gim]*)$/.exec(data), 29 | modifiers = ''; 30 | 31 | // `/foo/gim` - tail can be maximum 4 chars 32 | if (regexp[0] === '/') { 33 | if (tail) modifiers = tail[1]; 34 | regexp = regexp.slice(1, regexp.length - modifiers.length - 1); 35 | } 36 | 37 | return new RegExp(regexp, modifiers); 38 | } 39 | 40 | function representJavascriptRegExp(object /*, style*/) { 41 | var result = '/' + object.source + '/'; 42 | 43 | if (object.global) result += 'g'; 44 | if (object.multiline) result += 'm'; 45 | if (object.ignoreCase) result += 'i'; 46 | 47 | return result; 48 | } 49 | 50 | function isRegExp(object) { 51 | return Object.prototype.toString.call(object) === '[object RegExp]'; 52 | } 53 | 54 | module.exports = new Type('tag:yaml.org,2002:js/regexp', { 55 | kind: 'scalar', 56 | resolve: resolveJavascriptRegExp, 57 | construct: constructJavascriptRegExp, 58 | predicate: isRegExp, 59 | represent: representJavascriptRegExp 60 | }); 61 | -------------------------------------------------------------------------------- /node_modules/js-yaml/lib/js-yaml/type/js/undefined.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | var Type = require('../../type'); 4 | 5 | function resolveJavascriptUndefined() { 6 | return true; 7 | } 8 | 9 | function constructJavascriptUndefined() { 10 | /*eslint-disable no-undefined*/ 11 | return undefined; 12 | } 13 | 14 | function representJavascriptUndefined() { 15 | return ''; 16 | } 17 | 18 | function isUndefined(object) { 19 | return typeof object === 'undefined'; 20 | } 21 | 22 | module.exports = new Type('tag:yaml.org,2002:js/undefined', { 23 | kind: 'scalar', 24 | resolve: resolveJavascriptUndefined, 25 | construct: constructJavascriptUndefined, 26 | predicate: isUndefined, 27 | represent: representJavascriptUndefined 28 | }); 29 | -------------------------------------------------------------------------------- /node_modules/js-yaml/lib/js-yaml/type/map.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | var Type = require('../type'); 4 | 5 | module.exports = new Type('tag:yaml.org,2002:map', { 6 | kind: 'mapping', 7 | construct: function (data) { return data !== null ? data : {}; } 8 | }); 9 | -------------------------------------------------------------------------------- /node_modules/js-yaml/lib/js-yaml/type/merge.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | var Type = require('../type'); 4 | 5 | function resolveYamlMerge(data) { 6 | return data === '<<' || data === null; 7 | } 8 | 9 | module.exports = new Type('tag:yaml.org,2002:merge', { 10 | kind: 'scalar', 11 | resolve: resolveYamlMerge 12 | }); 13 | -------------------------------------------------------------------------------- /node_modules/js-yaml/lib/js-yaml/type/null.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | var Type = require('../type'); 4 | 5 | function resolveYamlNull(data) { 6 | if (data === null) return true; 7 | 8 | var max = data.length; 9 | 10 | return (max === 1 && data === '~') || 11 | (max === 4 && (data === 'null' || data === 'Null' || data === 'NULL')); 12 | } 13 | 14 | function constructYamlNull() { 15 | return null; 16 | } 17 | 18 | function isNull(object) { 19 | return object === null; 20 | } 21 | 22 | module.exports = new Type('tag:yaml.org,2002:null', { 23 | kind: 'scalar', 24 | resolve: resolveYamlNull, 25 | construct: constructYamlNull, 26 | predicate: isNull, 27 | represent: { 28 | canonical: function () { return '~'; }, 29 | lowercase: function () { return 'null'; }, 30 | uppercase: function () { return 'NULL'; }, 31 | camelcase: function () { return 'Null'; } 32 | }, 33 | defaultStyle: 'lowercase' 34 | }); 35 | -------------------------------------------------------------------------------- /node_modules/js-yaml/lib/js-yaml/type/omap.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | var Type = require('../type'); 4 | 5 | var _hasOwnProperty = Object.prototype.hasOwnProperty; 6 | var _toString = Object.prototype.toString; 7 | 8 | function resolveYamlOmap(data) { 9 | if (data === null) return true; 10 | 11 | var objectKeys = [], index, length, pair, pairKey, pairHasKey, 12 | object = data; 13 | 14 | for (index = 0, length = object.length; index < length; index += 1) { 15 | pair = object[index]; 16 | pairHasKey = false; 17 | 18 | if (_toString.call(pair) !== '[object Object]') return false; 19 | 20 | for (pairKey in pair) { 21 | if (_hasOwnProperty.call(pair, pairKey)) { 22 | if (!pairHasKey) pairHasKey = true; 23 | else return false; 24 | } 25 | } 26 | 27 | if (!pairHasKey) return false; 28 | 29 | if (objectKeys.indexOf(pairKey) === -1) objectKeys.push(pairKey); 30 | else return false; 31 | } 32 | 33 | return true; 34 | } 35 | 36 | function constructYamlOmap(data) { 37 | return data !== null ? data : []; 38 | } 39 | 40 | module.exports = new Type('tag:yaml.org,2002:omap', { 41 | kind: 'sequence', 42 | resolve: resolveYamlOmap, 43 | construct: constructYamlOmap 44 | }); 45 | -------------------------------------------------------------------------------- /node_modules/js-yaml/lib/js-yaml/type/pairs.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | var Type = require('../type'); 4 | 5 | var _toString = Object.prototype.toString; 6 | 7 | function resolveYamlPairs(data) { 8 | if (data === null) return true; 9 | 10 | var index, length, pair, keys, result, 11 | object = data; 12 | 13 | result = new Array(object.length); 14 | 15 | for (index = 0, length = object.length; index < length; index += 1) { 16 | pair = object[index]; 17 | 18 | if (_toString.call(pair) !== '[object Object]') return false; 19 | 20 | keys = Object.keys(pair); 21 | 22 | if (keys.length !== 1) return false; 23 | 24 | result[index] = [ keys[0], pair[keys[0]] ]; 25 | } 26 | 27 | return true; 28 | } 29 | 30 | function constructYamlPairs(data) { 31 | if (data === null) return []; 32 | 33 | var index, length, pair, keys, result, 34 | object = data; 35 | 36 | result = new Array(object.length); 37 | 38 | for (index = 0, length = object.length; index < length; index += 1) { 39 | pair = object[index]; 40 | 41 | keys = Object.keys(pair); 42 | 43 | result[index] = [ keys[0], pair[keys[0]] ]; 44 | } 45 | 46 | return result; 47 | } 48 | 49 | module.exports = new Type('tag:yaml.org,2002:pairs', { 50 | kind: 'sequence', 51 | resolve: resolveYamlPairs, 52 | construct: constructYamlPairs 53 | }); 54 | -------------------------------------------------------------------------------- /node_modules/js-yaml/lib/js-yaml/type/seq.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | var Type = require('../type'); 4 | 5 | module.exports = new Type('tag:yaml.org,2002:seq', { 6 | kind: 'sequence', 7 | construct: function (data) { return data !== null ? data : []; } 8 | }); 9 | -------------------------------------------------------------------------------- /node_modules/js-yaml/lib/js-yaml/type/set.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | var Type = require('../type'); 4 | 5 | var _hasOwnProperty = Object.prototype.hasOwnProperty; 6 | 7 | function resolveYamlSet(data) { 8 | if (data === null) return true; 9 | 10 | var key, object = data; 11 | 12 | for (key in object) { 13 | if (_hasOwnProperty.call(object, key)) { 14 | if (object[key] !== null) return false; 15 | } 16 | } 17 | 18 | return true; 19 | } 20 | 21 | function constructYamlSet(data) { 22 | return data !== null ? data : {}; 23 | } 24 | 25 | module.exports = new Type('tag:yaml.org,2002:set', { 26 | kind: 'mapping', 27 | resolve: resolveYamlSet, 28 | construct: constructYamlSet 29 | }); 30 | -------------------------------------------------------------------------------- /node_modules/js-yaml/lib/js-yaml/type/str.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | var Type = require('../type'); 4 | 5 | module.exports = new Type('tag:yaml.org,2002:str', { 6 | kind: 'scalar', 7 | construct: function (data) { return data !== null ? data : ''; } 8 | }); 9 | -------------------------------------------------------------------------------- /node_modules/js-yaml/lib/js-yaml/type/timestamp.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | var Type = require('../type'); 4 | 5 | var YAML_DATE_REGEXP = new RegExp( 6 | '^([0-9][0-9][0-9][0-9])' + // [1] year 7 | '-([0-9][0-9])' + // [2] month 8 | '-([0-9][0-9])$'); // [3] day 9 | 10 | var YAML_TIMESTAMP_REGEXP = new RegExp( 11 | '^([0-9][0-9][0-9][0-9])' + // [1] year 12 | '-([0-9][0-9]?)' + // [2] month 13 | '-([0-9][0-9]?)' + // [3] day 14 | '(?:[Tt]|[ \\t]+)' + // ... 15 | '([0-9][0-9]?)' + // [4] hour 16 | ':([0-9][0-9])' + // [5] minute 17 | ':([0-9][0-9])' + // [6] second 18 | '(?:\\.([0-9]*))?' + // [7] fraction 19 | '(?:[ \\t]*(Z|([-+])([0-9][0-9]?)' + // [8] tz [9] tz_sign [10] tz_hour 20 | '(?::([0-9][0-9]))?))?$'); // [11] tz_minute 21 | 22 | function resolveYamlTimestamp(data) { 23 | if (data === null) return false; 24 | if (YAML_DATE_REGEXP.exec(data) !== null) return true; 25 | if (YAML_TIMESTAMP_REGEXP.exec(data) !== null) return true; 26 | return false; 27 | } 28 | 29 | function constructYamlTimestamp(data) { 30 | var match, year, month, day, hour, minute, second, fraction = 0, 31 | delta = null, tz_hour, tz_minute, date; 32 | 33 | match = YAML_DATE_REGEXP.exec(data); 34 | if (match === null) match = YAML_TIMESTAMP_REGEXP.exec(data); 35 | 36 | if (match === null) throw new Error('Date resolve error'); 37 | 38 | // match: [1] year [2] month [3] day 39 | 40 | year = +(match[1]); 41 | month = +(match[2]) - 1; // JS month starts with 0 42 | day = +(match[3]); 43 | 44 | if (!match[4]) { // no hour 45 | return new Date(Date.UTC(year, month, day)); 46 | } 47 | 48 | // match: [4] hour [5] minute [6] second [7] fraction 49 | 50 | hour = +(match[4]); 51 | minute = +(match[5]); 52 | second = +(match[6]); 53 | 54 | if (match[7]) { 55 | fraction = match[7].slice(0, 3); 56 | while (fraction.length < 3) { // milli-seconds 57 | fraction += '0'; 58 | } 59 | fraction = +fraction; 60 | } 61 | 62 | // match: [8] tz [9] tz_sign [10] tz_hour [11] tz_minute 63 | 64 | if (match[9]) { 65 | tz_hour = +(match[10]); 66 | tz_minute = +(match[11] || 0); 67 | delta = (tz_hour * 60 + tz_minute) * 60000; // delta in mili-seconds 68 | if (match[9] === '-') delta = -delta; 69 | } 70 | 71 | date = new Date(Date.UTC(year, month, day, hour, minute, second, fraction)); 72 | 73 | if (delta) date.setTime(date.getTime() - delta); 74 | 75 | return date; 76 | } 77 | 78 | function representYamlTimestamp(object /*, style*/) { 79 | return object.toISOString(); 80 | } 81 | 82 | module.exports = new Type('tag:yaml.org,2002:timestamp', { 83 | kind: 'scalar', 84 | resolve: resolveYamlTimestamp, 85 | construct: constructYamlTimestamp, 86 | instanceOf: Date, 87 | represent: representYamlTimestamp 88 | }); 89 | -------------------------------------------------------------------------------- /node_modules/js-yaml/node_modules/.bin/esparse: -------------------------------------------------------------------------------- 1 | ../esprima/bin/esparse.js -------------------------------------------------------------------------------- /node_modules/js-yaml/node_modules/.bin/esvalidate: -------------------------------------------------------------------------------- 1 | ../esprima/bin/esvalidate.js -------------------------------------------------------------------------------- /node_modules/js-yaml/node_modules/esprima/LICENSE.BSD: -------------------------------------------------------------------------------- 1 | Copyright JS Foundation and other contributors, https://js.foundation/ 2 | 3 | Redistribution and use in source and binary forms, with or without 4 | modification, are permitted provided that the following conditions are met: 5 | 6 | * Redistributions of source code must retain the above copyright 7 | notice, this list of conditions and the following disclaimer. 8 | * Redistributions in binary form must reproduce the above copyright 9 | notice, this list of conditions and the following disclaimer in the 10 | documentation and/or other materials provided with the distribution. 11 | 12 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 13 | AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 14 | IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 15 | ARE DISCLAIMED. IN NO EVENT SHALL BE LIABLE FOR ANY 16 | DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 17 | (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 18 | LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 19 | ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 20 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 21 | THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 22 | -------------------------------------------------------------------------------- /node_modules/js-yaml/node_modules/esprima/README.md: -------------------------------------------------------------------------------- 1 | [![NPM version](https://img.shields.io/npm/v/esprima.svg)](https://www.npmjs.com/package/esprima) 2 | [![npm download](https://img.shields.io/npm/dm/esprima.svg)](https://www.npmjs.com/package/esprima) 3 | [![Build Status](https://img.shields.io/travis/jquery/esprima/master.svg)](https://travis-ci.org/jquery/esprima) 4 | [![Coverage Status](https://img.shields.io/codecov/c/github/jquery/esprima/master.svg)](https://codecov.io/github/jquery/esprima) 5 | 6 | **Esprima** ([esprima.org](http://esprima.org), BSD license) is a high performance, 7 | standard-compliant [ECMAScript](http://www.ecma-international.org/publications/standards/Ecma-262.htm) 8 | parser written in ECMAScript (also popularly known as 9 | [JavaScript](https://en.wikipedia.org/wiki/JavaScript)). 10 | Esprima is created and maintained by [Ariya Hidayat](https://twitter.com/ariyahidayat), 11 | with the help of [many contributors](https://github.com/jquery/esprima/contributors). 12 | 13 | ### Features 14 | 15 | - Full support for ECMAScript 2017 ([ECMA-262 8th Edition](http://www.ecma-international.org/publications/standards/Ecma-262.htm)) 16 | - Sensible [syntax tree format](https://github.com/estree/estree/blob/master/es5.md) as standardized by [ESTree project](https://github.com/estree/estree) 17 | - Experimental support for [JSX](https://facebook.github.io/jsx/), a syntax extension for [React](https://facebook.github.io/react/) 18 | - Optional tracking of syntax node location (index-based and line-column) 19 | - [Heavily tested](http://esprima.org/test/ci.html) (~1500 [unit tests](https://github.com/jquery/esprima/tree/master/test/fixtures) with [full code coverage](https://codecov.io/github/jquery/esprima)) 20 | 21 | ### API 22 | 23 | Esprima can be used to perform [lexical analysis](https://en.wikipedia.org/wiki/Lexical_analysis) (tokenization) or [syntactic analysis](https://en.wikipedia.org/wiki/Parsing) (parsing) of a JavaScript program. 24 | 25 | A simple example on Node.js REPL: 26 | 27 | ```javascript 28 | > var esprima = require('esprima'); 29 | > var program = 'const answer = 42'; 30 | 31 | > esprima.tokenize(program); 32 | [ { type: 'Keyword', value: 'const' }, 33 | { type: 'Identifier', value: 'answer' }, 34 | { type: 'Punctuator', value: '=' }, 35 | { type: 'Numeric', value: '42' } ] 36 | 37 | > esprima.parseScript(program); 38 | { type: 'Program', 39 | body: 40 | [ { type: 'VariableDeclaration', 41 | declarations: [Object], 42 | kind: 'const' } ], 43 | sourceType: 'script' } 44 | ``` 45 | 46 | For more information, please read the [complete documentation](http://esprima.org/doc). -------------------------------------------------------------------------------- /node_modules/js-yaml/node_modules/esprima/bin/esparse.js: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env node 2 | /* 3 | Copyright JS Foundation and other contributors, https://js.foundation/ 4 | 5 | Redistribution and use in source and binary forms, with or without 6 | modification, are permitted provided that the following conditions are met: 7 | 8 | * Redistributions of source code must retain the above copyright 9 | notice, this list of conditions and the following disclaimer. 10 | * Redistributions in binary form must reproduce the above copyright 11 | notice, this list of conditions and the following disclaimer in the 12 | documentation and/or other materials provided with the distribution. 13 | 14 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 15 | AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 16 | IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 17 | ARE DISCLAIMED. IN NO EVENT SHALL BE LIABLE FOR ANY 18 | DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 19 | (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 20 | LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 21 | ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 22 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 23 | THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 24 | */ 25 | 26 | /*jslint sloppy:true node:true rhino:true */ 27 | 28 | var fs, esprima, fname, forceFile, content, options, syntax; 29 | 30 | if (typeof require === 'function') { 31 | fs = require('fs'); 32 | try { 33 | esprima = require('esprima'); 34 | } catch (e) { 35 | esprima = require('../'); 36 | } 37 | } else if (typeof load === 'function') { 38 | try { 39 | load('esprima.js'); 40 | } catch (e) { 41 | load('../esprima.js'); 42 | } 43 | } 44 | 45 | // Shims to Node.js objects when running under Rhino. 46 | if (typeof console === 'undefined' && typeof process === 'undefined') { 47 | console = { log: print }; 48 | fs = { readFileSync: readFile }; 49 | process = { argv: arguments, exit: quit }; 50 | process.argv.unshift('esparse.js'); 51 | process.argv.unshift('rhino'); 52 | } 53 | 54 | function showUsage() { 55 | console.log('Usage:'); 56 | console.log(' esparse [options] [file.js]'); 57 | console.log(); 58 | console.log('Available options:'); 59 | console.log(); 60 | console.log(' --comment Gather all line and block comments in an array'); 61 | console.log(' --loc Include line-column location info for each syntax node'); 62 | console.log(' --range Include index-based range for each syntax node'); 63 | console.log(' --raw Display the raw value of literals'); 64 | console.log(' --tokens List all tokens in an array'); 65 | console.log(' --tolerant Tolerate errors on a best-effort basis (experimental)'); 66 | console.log(' -v, --version Shows program version'); 67 | console.log(); 68 | process.exit(1); 69 | } 70 | 71 | options = {}; 72 | 73 | process.argv.splice(2).forEach(function (entry) { 74 | 75 | if (forceFile || entry === '-' || entry.slice(0, 1) !== '-') { 76 | if (typeof fname === 'string') { 77 | console.log('Error: more than one input file.'); 78 | process.exit(1); 79 | } else { 80 | fname = entry; 81 | } 82 | } else if (entry === '-h' || entry === '--help') { 83 | showUsage(); 84 | } else if (entry === '-v' || entry === '--version') { 85 | console.log('ECMAScript Parser (using Esprima version', esprima.version, ')'); 86 | console.log(); 87 | process.exit(0); 88 | } else if (entry === '--comment') { 89 | options.comment = true; 90 | } else if (entry === '--loc') { 91 | options.loc = true; 92 | } else if (entry === '--range') { 93 | options.range = true; 94 | } else if (entry === '--raw') { 95 | options.raw = true; 96 | } else if (entry === '--tokens') { 97 | options.tokens = true; 98 | } else if (entry === '--tolerant') { 99 | options.tolerant = true; 100 | } else if (entry === '--') { 101 | forceFile = true; 102 | } else { 103 | console.log('Error: unknown option ' + entry + '.'); 104 | process.exit(1); 105 | } 106 | }); 107 | 108 | // Special handling for regular expression literal since we need to 109 | // convert it to a string literal, otherwise it will be decoded 110 | // as object "{}" and the regular expression would be lost. 111 | function adjustRegexLiteral(key, value) { 112 | if (key === 'value' && value instanceof RegExp) { 113 | value = value.toString(); 114 | } 115 | return value; 116 | } 117 | 118 | function run(content) { 119 | syntax = esprima.parse(content, options); 120 | console.log(JSON.stringify(syntax, adjustRegexLiteral, 4)); 121 | } 122 | 123 | try { 124 | if (fname && (fname !== '-' || forceFile)) { 125 | run(fs.readFileSync(fname, 'utf-8')); 126 | } else { 127 | var content = ''; 128 | process.stdin.resume(); 129 | process.stdin.on('data', function(chunk) { 130 | content += chunk; 131 | }); 132 | process.stdin.on('end', function() { 133 | run(content); 134 | }); 135 | } 136 | } catch (e) { 137 | console.log('Error: ' + e.message); 138 | process.exit(1); 139 | } 140 | -------------------------------------------------------------------------------- /node_modules/js-yaml/node_modules/esprima/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "_args": [ 3 | [ 4 | "esprima@4.0.1", 5 | "/Users/sabino/src/use-private-action" 6 | ] 7 | ], 8 | "_from": "esprima@4.0.1", 9 | "_id": "esprima@4.0.1", 10 | "_inBundle": false, 11 | "_integrity": "sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A==", 12 | "_location": "/js-yaml/esprima", 13 | "_phantomChildren": {}, 14 | "_requested": { 15 | "type": "version", 16 | "registry": true, 17 | "raw": "esprima@4.0.1", 18 | "name": "esprima", 19 | "escapedName": "esprima", 20 | "rawSpec": "4.0.1", 21 | "saveSpec": null, 22 | "fetchSpec": "4.0.1" 23 | }, 24 | "_requiredBy": [ 25 | "/js-yaml" 26 | ], 27 | "_resolved": "https://registry.npmjs.org/esprima/-/esprima-4.0.1.tgz", 28 | "_spec": "4.0.1", 29 | "_where": "/Users/sabino/src/use-private-action", 30 | "author": { 31 | "name": "Ariya Hidayat", 32 | "email": "ariya.hidayat@gmail.com" 33 | }, 34 | "bin": { 35 | "esparse": "./bin/esparse.js", 36 | "esvalidate": "./bin/esvalidate.js" 37 | }, 38 | "bugs": { 39 | "url": "https://github.com/jquery/esprima/issues" 40 | }, 41 | "description": "ECMAScript parsing infrastructure for multipurpose analysis", 42 | "devDependencies": { 43 | "codecov.io": "~0.1.6", 44 | "escomplex-js": "1.2.0", 45 | "everything.js": "~1.0.3", 46 | "glob": "~7.1.0", 47 | "istanbul": "~0.4.0", 48 | "json-diff": "~0.3.1", 49 | "karma": "~1.3.0", 50 | "karma-chrome-launcher": "~2.0.0", 51 | "karma-detect-browsers": "~2.2.3", 52 | "karma-edge-launcher": "~0.2.0", 53 | "karma-firefox-launcher": "~1.0.0", 54 | "karma-ie-launcher": "~1.0.0", 55 | "karma-mocha": "~1.3.0", 56 | "karma-safari-launcher": "~1.0.0", 57 | "karma-safaritechpreview-launcher": "~0.0.4", 58 | "karma-sauce-launcher": "~1.1.0", 59 | "lodash": "~3.10.1", 60 | "mocha": "~3.2.0", 61 | "node-tick-processor": "~0.0.2", 62 | "regenerate": "~1.3.2", 63 | "temp": "~0.8.3", 64 | "tslint": "~5.1.0", 65 | "typescript": "~2.3.2", 66 | "typescript-formatter": "~5.1.3", 67 | "unicode-8.0.0": "~0.7.0", 68 | "webpack": "~1.14.0" 69 | }, 70 | "engines": { 71 | "node": ">=4" 72 | }, 73 | "files": [ 74 | "bin", 75 | "dist/esprima.js" 76 | ], 77 | "homepage": "http://esprima.org", 78 | "keywords": [ 79 | "ast", 80 | "ecmascript", 81 | "esprima", 82 | "javascript", 83 | "parser", 84 | "syntax" 85 | ], 86 | "license": "BSD-2-Clause", 87 | "main": "dist/esprima.js", 88 | "maintainers": [ 89 | { 90 | "name": "Ariya Hidayat", 91 | "email": "ariya.hidayat@gmail.com", 92 | "url": "http://ariya.ofilabs.com" 93 | } 94 | ], 95 | "name": "esprima", 96 | "repository": { 97 | "type": "git", 98 | "url": "git+https://github.com/jquery/esprima.git" 99 | }, 100 | "scripts": { 101 | "all-tests": "npm run verify-line-ending && npm run generate-fixtures && npm run unit-tests && npm run api-tests && npm run grammar-tests && npm run regression-tests && npm run hostile-env-tests", 102 | "analyze-coverage": "istanbul cover test/unit-tests.js", 103 | "api-tests": "mocha -R dot test/api-tests.js", 104 | "appveyor": "npm run compile && npm run all-tests && npm run browser-tests", 105 | "benchmark": "npm run benchmark-parser && npm run benchmark-tokenizer", 106 | "benchmark-parser": "node -expose_gc test/benchmark-parser.js", 107 | "benchmark-tokenizer": "node --expose_gc test/benchmark-tokenizer.js", 108 | "browser-tests": "npm run compile && npm run generate-fixtures && cd test && karma start --single-run", 109 | "check-coverage": "istanbul check-coverage --statement 100 --branch 100 --function 100", 110 | "check-version": "node test/check-version.js", 111 | "circleci": "npm test && npm run codecov && npm run downstream", 112 | "code-style": "tsfmt --verify src/*.ts && tsfmt --verify test/*.js", 113 | "codecov": "istanbul report cobertura && codecov < ./coverage/cobertura-coverage.xml", 114 | "compile": "tsc -p src/ && webpack && node tools/fixupbundle.js", 115 | "complexity": "node test/check-complexity.js", 116 | "downstream": "node test/downstream.js", 117 | "droneio": "npm run compile && npm run all-tests && npm run saucelabs", 118 | "dynamic-analysis": "npm run analyze-coverage && npm run check-coverage", 119 | "format-code": "tsfmt -r src/*.ts && tsfmt -r test/*.js", 120 | "generate-fixtures": "node tools/generate-fixtures.js", 121 | "generate-regex": "node tools/generate-identifier-regex.js", 122 | "generate-xhtml-entities": "node tools/generate-xhtml-entities.js", 123 | "grammar-tests": "node test/grammar-tests.js", 124 | "hostile-env-tests": "node test/hostile-environment-tests.js", 125 | "prepublish": "npm run compile", 126 | "profile": "node --prof test/profile.js && mv isolate*.log v8.log && node-tick-processor", 127 | "regression-tests": "node test/regression-tests.js", 128 | "saucelabs": "npm run saucelabs-evergreen && npm run saucelabs-ie && npm run saucelabs-safari", 129 | "saucelabs-evergreen": "cd test && karma start saucelabs-evergreen.conf.js", 130 | "saucelabs-ie": "cd test && karma start saucelabs-ie.conf.js", 131 | "saucelabs-safari": "cd test && karma start saucelabs-safari.conf.js", 132 | "static-analysis": "npm run check-version && npm run tslint && npm run code-style && npm run complexity", 133 | "test": "npm run compile && npm run all-tests && npm run static-analysis && npm run dynamic-analysis", 134 | "travis": "npm test", 135 | "tslint": "tslint src/*.ts", 136 | "unit-tests": "node test/unit-tests.js", 137 | "verify-line-ending": "node test/verify-line-ending.js" 138 | }, 139 | "version": "4.0.1" 140 | } 141 | -------------------------------------------------------------------------------- /node_modules/js-yaml/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "_args": [ 3 | [ 4 | "js-yaml@3.13.1", 5 | "/Users/sabino/src/use-private-action" 6 | ] 7 | ], 8 | "_from": "js-yaml@3.13.1", 9 | "_id": "js-yaml@3.13.1", 10 | "_inBundle": false, 11 | "_integrity": "sha512-YfbcO7jXDdyj0DGxYVSlSeQNHbD7XPWvrVWeVUujrQEoZzWJIRrCPoyk6kL6IAjAG2IolMK4T0hNUe0HOUs5Jw==", 12 | "_location": "/js-yaml", 13 | "_phantomChildren": {}, 14 | "_requested": { 15 | "type": "version", 16 | "registry": true, 17 | "raw": "js-yaml@3.13.1", 18 | "name": "js-yaml", 19 | "escapedName": "js-yaml", 20 | "rawSpec": "3.13.1", 21 | "saveSpec": null, 22 | "fetchSpec": "3.13.1" 23 | }, 24 | "_requiredBy": [ 25 | "/" 26 | ], 27 | "_resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-3.13.1.tgz", 28 | "_spec": "3.13.1", 29 | "_where": "/Users/sabino/src/use-private-action", 30 | "author": { 31 | "name": "Vladimir Zapparov", 32 | "email": "dervus.grim@gmail.com" 33 | }, 34 | "bin": { 35 | "js-yaml": "bin/js-yaml.js" 36 | }, 37 | "bugs": { 38 | "url": "https://github.com/nodeca/js-yaml/issues" 39 | }, 40 | "contributors": [ 41 | { 42 | "name": "Aleksey V Zapparov", 43 | "email": "ixti@member.fsf.org", 44 | "url": "http://www.ixti.net/" 45 | }, 46 | { 47 | "name": "Vitaly Puzrin", 48 | "email": "vitaly@rcdesign.ru", 49 | "url": "https://github.com/puzrin" 50 | }, 51 | { 52 | "name": "Martin Grenfell", 53 | "email": "martin.grenfell@gmail.com", 54 | "url": "http://got-ravings.blogspot.com" 55 | } 56 | ], 57 | "dependencies": { 58 | "argparse": "^1.0.7", 59 | "esprima": "^4.0.0" 60 | }, 61 | "description": "YAML 1.2 parser and serializer", 62 | "devDependencies": { 63 | "ansi": "^0.3.1", 64 | "benchmark": "^2.1.4", 65 | "browserify": "^16.2.2", 66 | "codemirror": "^5.13.4", 67 | "eslint": "^4.1.1", 68 | "fast-check": "1.1.3", 69 | "istanbul": "^0.4.5", 70 | "mocha": "^5.2.0", 71 | "uglify-js": "^3.0.1" 72 | }, 73 | "files": [ 74 | "index.js", 75 | "lib/", 76 | "bin/", 77 | "dist/" 78 | ], 79 | "homepage": "https://github.com/nodeca/js-yaml", 80 | "keywords": [ 81 | "yaml", 82 | "parser", 83 | "serializer", 84 | "pyyaml" 85 | ], 86 | "license": "MIT", 87 | "name": "js-yaml", 88 | "repository": { 89 | "type": "git", 90 | "url": "git+https://github.com/nodeca/js-yaml.git" 91 | }, 92 | "scripts": { 93 | "test": "make test" 94 | }, 95 | "version": "3.13.1" 96 | } 97 | -------------------------------------------------------------------------------- /node_modules/sprintf-js/.npmignore: -------------------------------------------------------------------------------- 1 | /node_modules/ -------------------------------------------------------------------------------- /node_modules/sprintf-js/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2007-2014, Alexandru Marasteanu 2 | All rights reserved. 3 | 4 | Redistribution and use in source and binary forms, with or without 5 | modification, are permitted provided that the following conditions are met: 6 | * Redistributions of source code must retain the above copyright 7 | notice, this list of conditions and the following disclaimer. 8 | * Redistributions in binary form must reproduce the above copyright 9 | notice, this list of conditions and the following disclaimer in the 10 | documentation and/or other materials provided with the distribution. 11 | * Neither the name of this software nor the names of its contributors may be 12 | used to endorse or promote products derived from this software without 13 | specific prior written permission. 14 | 15 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 16 | ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 17 | WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 18 | DISCLAIMED. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR 19 | ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 20 | (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 21 | LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 22 | ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 23 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 24 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 25 | -------------------------------------------------------------------------------- /node_modules/sprintf-js/README.md: -------------------------------------------------------------------------------- 1 | # sprintf.js 2 | **sprintf.js** is a complete open source JavaScript sprintf implementation for the *browser* and *node.js*. 3 | 4 | Its prototype is simple: 5 | 6 | string sprintf(string format , [mixed arg1 [, mixed arg2 [ ,...]]]) 7 | 8 | The placeholders in the format string are marked by `%` and are followed by one or more of these elements, in this order: 9 | 10 | * An optional number followed by a `$` sign that selects which argument index to use for the value. If not specified, arguments will be placed in the same order as the placeholders in the input string. 11 | * An optional `+` sign that forces to preceed the result with a plus or minus sign on numeric values. By default, only the `-` sign is used on negative numbers. 12 | * An optional padding specifier that says what character to use for padding (if specified). Possible values are `0` or any other character precedeed by a `'` (single quote). The default is to pad with *spaces*. 13 | * An optional `-` sign, that causes sprintf to left-align the result of this placeholder. The default is to right-align the result. 14 | * An optional number, that says how many characters the result should have. If the value to be returned is shorter than this number, the result will be padded. When used with the `j` (JSON) type specifier, the padding length specifies the tab size used for indentation. 15 | * An optional precision modifier, consisting of a `.` (dot) followed by a number, that says how many digits should be displayed for floating point numbers. When used with the `g` type specifier, it specifies the number of significant digits. When used on a string, it causes the result to be truncated. 16 | * A type specifier that can be any of: 17 | * `%` — yields a literal `%` character 18 | * `b` — yields an integer as a binary number 19 | * `c` — yields an integer as the character with that ASCII value 20 | * `d` or `i` — yields an integer as a signed decimal number 21 | * `e` — yields a float using scientific notation 22 | * `u` — yields an integer as an unsigned decimal number 23 | * `f` — yields a float as is; see notes on precision above 24 | * `g` — yields a float as is; see notes on precision above 25 | * `o` — yields an integer as an octal number 26 | * `s` — yields a string as is 27 | * `x` — yields an integer as a hexadecimal number (lower-case) 28 | * `X` — yields an integer as a hexadecimal number (upper-case) 29 | * `j` — yields a JavaScript object or array as a JSON encoded string 30 | 31 | ## JavaScript `vsprintf` 32 | `vsprintf` is the same as `sprintf` except that it accepts an array of arguments, rather than a variable number of arguments: 33 | 34 | vsprintf("The first 4 letters of the english alphabet are: %s, %s, %s and %s", ["a", "b", "c", "d"]) 35 | 36 | ## Argument swapping 37 | You can also swap the arguments. That is, the order of the placeholders doesn't have to match the order of the arguments. You can do that by simply indicating in the format string which arguments the placeholders refer to: 38 | 39 | sprintf("%2$s %3$s a %1$s", "cracker", "Polly", "wants") 40 | And, of course, you can repeat the placeholders without having to increase the number of arguments. 41 | 42 | ## Named arguments 43 | Format strings may contain replacement fields rather than positional placeholders. Instead of referring to a certain argument, you can now refer to a certain key within an object. Replacement fields are surrounded by rounded parentheses - `(` and `)` - and begin with a keyword that refers to a key: 44 | 45 | var user = { 46 | name: "Dolly" 47 | } 48 | sprintf("Hello %(name)s", user) // Hello Dolly 49 | Keywords in replacement fields can be optionally followed by any number of keywords or indexes: 50 | 51 | var users = [ 52 | {name: "Dolly"}, 53 | {name: "Molly"}, 54 | {name: "Polly"} 55 | ] 56 | sprintf("Hello %(users[0].name)s, %(users[1].name)s and %(users[2].name)s", {users: users}) // Hello Dolly, Molly and Polly 57 | Note: mixing positional and named placeholders is not (yet) supported 58 | 59 | ## Computed values 60 | You can pass in a function as a dynamic value and it will be invoked (with no arguments) in order to compute the value on-the-fly. 61 | 62 | sprintf("Current timestamp: %d", Date.now) // Current timestamp: 1398005382890 63 | sprintf("Current date and time: %s", function() { return new Date().toString() }) 64 | 65 | # AngularJS 66 | You can now use `sprintf` and `vsprintf` (also aliased as `fmt` and `vfmt` respectively) in your AngularJS projects. See `demo/`. 67 | 68 | # Installation 69 | 70 | ## Via Bower 71 | 72 | bower install sprintf 73 | 74 | ## Or as a node.js module 75 | 76 | npm install sprintf-js 77 | 78 | ### Usage 79 | 80 | var sprintf = require("sprintf-js").sprintf, 81 | vsprintf = require("sprintf-js").vsprintf 82 | 83 | sprintf("%2$s %3$s a %1$s", "cracker", "Polly", "wants") 84 | vsprintf("The first 4 letters of the english alphabet are: %s, %s, %s and %s", ["a", "b", "c", "d"]) 85 | 86 | # License 87 | 88 | **sprintf.js** is licensed under the terms of the 3-clause BSD license. 89 | -------------------------------------------------------------------------------- /node_modules/sprintf-js/bower.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "sprintf", 3 | "description": "JavaScript sprintf implementation", 4 | "version": "1.0.3", 5 | "main": "src/sprintf.js", 6 | "license": "BSD-3-Clause-Clear", 7 | "keywords": ["sprintf", "string", "formatting"], 8 | "authors": ["Alexandru Marasteanu (http://alexei.ro/)"], 9 | "homepage": "https://github.com/alexei/sprintf.js", 10 | "repository": { 11 | "type": "git", 12 | "url": "git://github.com/alexei/sprintf.js.git" 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /node_modules/sprintf-js/demo/angular.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 |
{{ "%+010d"|sprintf:-123 }}
10 |
{{ "%+010d"|vsprintf:[-123] }}
11 |
{{ "%+010d"|fmt:-123 }}
12 |
{{ "%+010d"|vfmt:[-123] }}
13 |
{{ "I've got %2$d apples and %1$d oranges."|fmt:4:2 }}
14 |
{{ "I've got %(apples)d apples and %(oranges)d oranges."|fmt:{apples: 2, oranges: 4} }}
15 | 16 | 19 | 20 | 21 | -------------------------------------------------------------------------------- /node_modules/sprintf-js/dist/angular-sprintf.min.js: -------------------------------------------------------------------------------- 1 | /*! sprintf-js | Alexandru Marasteanu (http://alexei.ro/) | BSD-3-Clause */ 2 | 3 | angular.module("sprintf",[]).filter("sprintf",function(){return function(){return sprintf.apply(null,arguments)}}).filter("fmt",["$filter",function(a){return a("sprintf")}]).filter("vsprintf",function(){return function(a,b){return vsprintf(a,b)}}).filter("vfmt",["$filter",function(a){return a("vsprintf")}]); 4 | //# sourceMappingURL=angular-sprintf.min.map -------------------------------------------------------------------------------- /node_modules/sprintf-js/dist/angular-sprintf.min.js.map: -------------------------------------------------------------------------------- 1 | {"version":3,"file":"angular-sprintf.min.js","sources":["../src/angular-sprintf.js"],"names":["angular","module","filter","sprintf","apply","arguments","$filter","format","argv","vsprintf"],"mappings":";;AAAAA,QACIC,OAAO,cACPC,OAAO,UAAW,WACd,MAAO,YACH,MAAOC,SAAQC,MAAM,KAAMC,cAGnCH,OAAO,OAAQ,UAAW,SAASI,GAC/B,MAAOA,GAAQ,cAEnBJ,OAAO,WAAY,WACf,MAAO,UAASK,EAAQC,GACpB,MAAOC,UAASF,EAAQC,MAGhCN,OAAO,QAAS,UAAW,SAASI,GAChC,MAAOA,GAAQ"} -------------------------------------------------------------------------------- /node_modules/sprintf-js/dist/angular-sprintf.min.map: -------------------------------------------------------------------------------- 1 | {"version":3,"file":"angular-sprintf.min.js","sources":["../src/angular-sprintf.js"],"names":["angular","module","filter","sprintf","apply","arguments","$filter","format","argv","vsprintf"],"mappings":";;AAAAA,QACIC,OAAO,cACPC,OAAO,UAAW,WACd,MAAO,YACH,MAAOC,SAAQC,MAAM,KAAMC,cAGnCH,OAAO,OAAQ,UAAW,SAASI,GAC/B,MAAOA,GAAQ,cAEnBJ,OAAO,WAAY,WACf,MAAO,UAASK,EAAQC,GACpB,MAAOC,UAASF,EAAQC,MAGhCN,OAAO,QAAS,UAAW,SAASI,GAChC,MAAOA,GAAQ"} -------------------------------------------------------------------------------- /node_modules/sprintf-js/dist/sprintf.min.js: -------------------------------------------------------------------------------- 1 | /*! sprintf-js | Alexandru Marasteanu (http://alexei.ro/) | BSD-3-Clause */ 2 | 3 | !function(a){function b(){var a=arguments[0],c=b.cache;return c[a]&&c.hasOwnProperty(a)||(c[a]=b.parse(a)),b.format.call(null,c[a],arguments)}function c(a){return Object.prototype.toString.call(a).slice(8,-1).toLowerCase()}function d(a,b){return Array(b+1).join(a)}var e={not_string:/[^s]/,number:/[diefg]/,json:/[j]/,not_json:/[^j]/,text:/^[^\x25]+/,modulo:/^\x25{2}/,placeholder:/^\x25(?:([1-9]\d*)\$|\(([^\)]+)\))?(\+)?(0|'[^$])?(-)?(\d+)?(?:\.(\d+))?([b-gijosuxX])/,key:/^([a-z_][a-z_\d]*)/i,key_access:/^\.([a-z_][a-z_\d]*)/i,index_access:/^\[(\d+)\]/,sign:/^[\+\-]/};b.format=function(a,f){var g,h,i,j,k,l,m,n=1,o=a.length,p="",q=[],r=!0,s="";for(h=0;o>h;h++)if(p=c(a[h]),"string"===p)q[q.length]=a[h];else if("array"===p){if(j=a[h],j[2])for(g=f[n],i=0;i=0),j[8]){case"b":g=g.toString(2);break;case"c":g=String.fromCharCode(g);break;case"d":case"i":g=parseInt(g,10);break;case"j":g=JSON.stringify(g,null,j[6]?parseInt(j[6]):0);break;case"e":g=j[7]?g.toExponential(j[7]):g.toExponential();break;case"f":g=j[7]?parseFloat(g).toFixed(j[7]):parseFloat(g);break;case"g":g=j[7]?parseFloat(g).toPrecision(j[7]):parseFloat(g);break;case"o":g=g.toString(8);break;case"s":g=(g=String(g))&&j[7]?g.substring(0,j[7]):g;break;case"u":g>>>=0;break;case"x":g=g.toString(16);break;case"X":g=g.toString(16).toUpperCase()}e.json.test(j[8])?q[q.length]=g:(!e.number.test(j[8])||r&&!j[3]?s="":(s=r?"+":"-",g=g.toString().replace(e.sign,"")),l=j[4]?"0"===j[4]?"0":j[4].charAt(1):" ",m=j[6]-(s+g).length,k=j[6]&&m>0?d(l,m):"",q[q.length]=j[5]?s+g+k:"0"===l?s+k+g:k+s+g)}return q.join("")},b.cache={},b.parse=function(a){for(var b=a,c=[],d=[],f=0;b;){if(null!==(c=e.text.exec(b)))d[d.length]=c[0];else if(null!==(c=e.modulo.exec(b)))d[d.length]="%";else{if(null===(c=e.placeholder.exec(b)))throw new SyntaxError("[sprintf] unexpected placeholder");if(c[2]){f|=1;var g=[],h=c[2],i=[];if(null===(i=e.key.exec(h)))throw new SyntaxError("[sprintf] failed to parse named argument key");for(g[g.length]=i[1];""!==(h=h.substring(i[0].length));)if(null!==(i=e.key_access.exec(h)))g[g.length]=i[1];else{if(null===(i=e.index_access.exec(h)))throw new SyntaxError("[sprintf] failed to parse named argument key");g[g.length]=i[1]}c[2]=g}else f|=2;if(3===f)throw new Error("[sprintf] mixing positional and named placeholders is not (yet) supported");d[d.length]=c}b=b.substring(c[0].length)}return d};var f=function(a,c,d){return d=(c||[]).slice(0),d.splice(0,0,a),b.apply(null,d)};"undefined"!=typeof exports?(exports.sprintf=b,exports.vsprintf=f):(a.sprintf=b,a.vsprintf=f,"function"==typeof define&&define.amd&&define(function(){return{sprintf:b,vsprintf:f}}))}("undefined"==typeof window?this:window); 4 | //# sourceMappingURL=sprintf.min.map -------------------------------------------------------------------------------- /node_modules/sprintf-js/dist/sprintf.min.js.map: -------------------------------------------------------------------------------- 1 | {"version":3,"file":"sprintf.min.js","sources":["../src/sprintf.js"],"names":["window","sprintf","key","arguments","cache","hasOwnProperty","parse","format","call","get_type","variable","Object","prototype","toString","slice","toLowerCase","str_repeat","input","multiplier","Array","join","re","not_string","number","json","not_json","text","modulo","placeholder","key_access","index_access","sign","parse_tree","argv","arg","i","k","match","pad","pad_character","pad_length","cursor","tree_length","length","node_type","output","is_positive","Error","test","isNaN","TypeError","String","fromCharCode","parseInt","JSON","stringify","toExponential","parseFloat","toFixed","substring","toUpperCase","replace","charAt","fmt","_fmt","arg_names","exec","SyntaxError","field_list","replacement_field","field_match","vsprintf","_argv","splice","apply","exports","define","amd","this"],"mappings":";;CAAA,SAAUA,GAeN,QAASC,KACL,GAAIC,GAAMC,UAAU,GAAIC,EAAQH,EAAQG,KAIxC,OAHMA,GAAMF,IAAQE,EAAMC,eAAeH,KACrCE,EAAMF,GAAOD,EAAQK,MAAMJ,IAExBD,EAAQM,OAAOC,KAAK,KAAMJ,EAAMF,GAAMC,WA4JjD,QAASM,GAASC,GACd,MAAOC,QAAOC,UAAUC,SAASL,KAAKE,GAAUI,MAAM,EAAG,IAAIC,cAGjE,QAASC,GAAWC,EAAOC,GACvB,MAAOC,OAAMD,EAAa,GAAGE,KAAKH,GApLtC,GAAII,IACAC,WAAY,OACZC,OAAQ,SACRC,KAAM,MACNC,SAAU,OACVC,KAAM,YACNC,OAAQ,WACRC,YAAa,yFACb1B,IAAK,sBACL2B,WAAY,wBACZC,aAAc,aACdC,KAAM,UAWV9B,GAAQM,OAAS,SAASyB,EAAYC,GAClC,GAAiEC,GAAkBC,EAAGC,EAAGC,EAAOC,EAAKC,EAAeC,EAAhHC,EAAS,EAAGC,EAAcV,EAAWW,OAAQC,EAAY,GAASC,KAA0DC,GAAc,EAAMf,EAAO,EAC3J,KAAKI,EAAI,EAAOO,EAAJP,EAAiBA,IAEzB,GADAS,EAAYnC,EAASuB,EAAWG,IACd,WAAdS,EACAC,EAAOA,EAAOF,QAAUX,EAAWG,OAElC,IAAkB,UAAdS,EAAuB,CAE5B,GADAP,EAAQL,EAAWG,GACfE,EAAM,GAEN,IADAH,EAAMD,EAAKQ,GACNL,EAAI,EAAGA,EAAIC,EAAM,GAAGM,OAAQP,IAAK,CAClC,IAAKF,EAAI7B,eAAegC,EAAM,GAAGD,IAC7B,KAAM,IAAIW,OAAM9C,EAAQ,yCAA0CoC,EAAM,G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,GAAWA,EAAWzB,QAAU2B,EAAY,GAUxDjC,EAAM,GAAK+B,MAGXH,IAAa,CAEjB,IAAkB,IAAdA,EACA,KAAM,IAAIlB,OAAM,4EAEpBf,GAAWA,EAAWW,QAAUN,EAKpC2B,EAAOA,EAAKL,UAAUtB,EAAM,GAAGM,QAEnC,MAAOX,GAGX,IAAIuC,GAAW,SAASR,EAAK9B,EAAMuC,GAG/B,MAFAA,IAASvC,OAAYnB,MAAM,GAC3B0D,EAAMC,OAAO,EAAG,EAAGV,GACZ9D,EAAQyE,MAAM,KAAMF,GAiBR,oBAAZG,UACPA,QAAQ1E,QAAUA,EAClB0E,QAAQJ,SAAWA,IAGnBvE,EAAOC,QAAUA,EACjBD,EAAOuE,SAAWA,EAEI,kBAAXK,SAAyBA,OAAOC,KACvCD,OAAO,WACH,OACI3E,QAASA,EACTsE,SAAUA,OAKT,mBAAXvE,QAAyB8E,KAAO9E"} -------------------------------------------------------------------------------- /node_modules/sprintf-js/dist/sprintf.min.map: -------------------------------------------------------------------------------- 1 | {"version":3,"file":"sprintf.min.js","sources":["../src/sprintf.js"],"names":["window","sprintf","key","arguments","cache","hasOwnProperty","parse","format","call","get_type","variable","Object","prototype","toString","slice","toLowerCase","str_repeat","input","multiplier","Array","join","re","not_string","number","json","not_json","text","modulo","placeholder","key_access","index_access","sign","parse_tree","argv","arg","i","k","match","pad","pad_character","pad_length","cursor","tree_length","length","node_type","output","is_positive","Error","test","isNaN","TypeError","String","fromCharCode","parseInt","JSON","stringify","toExponential","parseFloat","toFixed","toPrecision","substring","toUpperCase","replace","charAt","fmt","_fmt","arg_names","exec","SyntaxError","field_list","replacement_field","field_match","vsprintf","_argv","splice","apply","exports","define","amd","this"],"mappings":";;CAAA,SAAUA,GAeN,QAASC,KACL,GAAIC,GAAMC,UAAU,GAAIC,EAAQH,EAAQG,KAIxC,OAHMA,GAAMF,IAAQE,EAAMC,eAAeH,KACrCE,EAAMF,GAAOD,EAAQK,MAAMJ,IAExBD,EAAQ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MwC,GAG/B,MAFAA,IAASxC,OAAYnB,MAAM,GAC3B2D,EAAMC,OAAO,EAAG,EAAGV,GACZ/D,EAAQ0E,MAAM,KAAMF,GAiBR,oBAAZG,UACPA,QAAQ3E,QAAUA,EAClB2E,QAAQJ,SAAWA,IAGnBxE,EAAOC,QAAUA,EACjBD,EAAOwE,SAAWA,EAEI,kBAAXK,SAAyBA,OAAOC,KACvCD,OAAO,WACH,OACI5E,QAASA,EACTuE,SAAUA,OAKT,mBAAXxE,QAAyB+E,KAAO/E"} -------------------------------------------------------------------------------- /node_modules/sprintf-js/gruntfile.js: -------------------------------------------------------------------------------- 1 | module.exports = function(grunt) { 2 | grunt.initConfig({ 3 | pkg: grunt.file.readJSON("package.json"), 4 | 5 | uglify: { 6 | options: { 7 | banner: "/*! <%= pkg.name %> | <%= pkg.author %> | <%= pkg.license %> */\n", 8 | sourceMap: true 9 | }, 10 | build: { 11 | files: [ 12 | { 13 | src: "src/sprintf.js", 14 | dest: "dist/sprintf.min.js" 15 | }, 16 | { 17 | src: "src/angular-sprintf.js", 18 | dest: "dist/angular-sprintf.min.js" 19 | } 20 | ] 21 | } 22 | }, 23 | 24 | watch: { 25 | js: { 26 | files: "src/*.js", 27 | tasks: ["uglify"] 28 | } 29 | } 30 | }) 31 | 32 | grunt.loadNpmTasks("grunt-contrib-uglify") 33 | grunt.loadNpmTasks("grunt-contrib-watch") 34 | 35 | grunt.registerTask("default", ["uglify", "watch"]) 36 | } 37 | -------------------------------------------------------------------------------- /node_modules/sprintf-js/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "_args": [ 3 | [ 4 | "sprintf-js@1.0.3", 5 | "/Users/sabino/src/use-private-action" 6 | ] 7 | ], 8 | "_from": "sprintf-js@1.0.3", 9 | "_id": "sprintf-js@1.0.3", 10 | "_inBundle": false, 11 | "_integrity": "sha1-BOaSb2YolTVPPdAVIDYzuFcpfiw=", 12 | "_location": "/sprintf-js", 13 | "_phantomChildren": {}, 14 | "_requested": { 15 | "type": "version", 16 | "registry": true, 17 | "raw": "sprintf-js@1.0.3", 18 | "name": "sprintf-js", 19 | "escapedName": "sprintf-js", 20 | "rawSpec": "1.0.3", 21 | "saveSpec": null, 22 | "fetchSpec": "1.0.3" 23 | }, 24 | "_requiredBy": [ 25 | "/argparse" 26 | ], 27 | "_resolved": "https://registry.npmjs.org/sprintf-js/-/sprintf-js-1.0.3.tgz", 28 | "_spec": "1.0.3", 29 | "_where": "/Users/sabino/src/use-private-action", 30 | "author": { 31 | "name": "Alexandru Marasteanu", 32 | "email": "hello@alexei.ro", 33 | "url": "http://alexei.ro/" 34 | }, 35 | "bugs": { 36 | "url": "https://github.com/alexei/sprintf.js/issues" 37 | }, 38 | "description": "JavaScript sprintf implementation", 39 | "devDependencies": { 40 | "grunt": "*", 41 | "grunt-contrib-uglify": "*", 42 | "grunt-contrib-watch": "*", 43 | "mocha": "*" 44 | }, 45 | "homepage": "https://github.com/alexei/sprintf.js#readme", 46 | "license": "BSD-3-Clause", 47 | "main": "src/sprintf.js", 48 | "name": "sprintf-js", 49 | "repository": { 50 | "type": "git", 51 | "url": "git+https://github.com/alexei/sprintf.js.git" 52 | }, 53 | "scripts": { 54 | "test": "mocha test/test.js" 55 | }, 56 | "version": "1.0.3" 57 | } 58 | -------------------------------------------------------------------------------- /node_modules/sprintf-js/src/angular-sprintf.js: -------------------------------------------------------------------------------- 1 | angular. 2 | module("sprintf", []). 3 | filter("sprintf", function() { 4 | return function() { 5 | return sprintf.apply(null, arguments) 6 | } 7 | }). 8 | filter("fmt", ["$filter", function($filter) { 9 | return $filter("sprintf") 10 | }]). 11 | filter("vsprintf", function() { 12 | return function(format, argv) { 13 | return vsprintf(format, argv) 14 | } 15 | }). 16 | filter("vfmt", ["$filter", function($filter) { 17 | return $filter("vsprintf") 18 | }]) 19 | -------------------------------------------------------------------------------- /node_modules/sprintf-js/test/test.js: -------------------------------------------------------------------------------- 1 | var assert = require("assert"), 2 | sprintfjs = require("../src/sprintf.js"), 3 | sprintf = sprintfjs.sprintf, 4 | vsprintf = sprintfjs.vsprintf 5 | 6 | describe("sprintfjs", function() { 7 | var pi = 3.141592653589793 8 | 9 | it("should return formated strings for simple placeholders", function() { 10 | assert.equal("%", sprintf("%%")) 11 | assert.equal("10", sprintf("%b", 2)) 12 | assert.equal("A", sprintf("%c", 65)) 13 | assert.equal("2", sprintf("%d", 2)) 14 | assert.equal("2", sprintf("%i", 2)) 15 | assert.equal("2", sprintf("%d", "2")) 16 | assert.equal("2", sprintf("%i", "2")) 17 | assert.equal('{"foo":"bar"}', sprintf("%j", {foo: "bar"})) 18 | assert.equal('["foo","bar"]', sprintf("%j", ["foo", "bar"])) 19 | assert.equal("2e+0", sprintf("%e", 2)) 20 | assert.equal("2", sprintf("%u", 2)) 21 | assert.equal("4294967294", sprintf("%u", -2)) 22 | assert.equal("2.2", sprintf("%f", 2.2)) 23 | assert.equal("3.141592653589793", sprintf("%g", pi)) 24 | assert.equal("10", sprintf("%o", 8)) 25 | assert.equal("%s", sprintf("%s", "%s")) 26 | assert.equal("ff", sprintf("%x", 255)) 27 | assert.equal("FF", sprintf("%X", 255)) 28 | assert.equal("Polly wants a cracker", sprintf("%2$s %3$s a %1$s", "cracker", "Polly", "wants")) 29 | assert.equal("Hello world!", sprintf("Hello %(who)s!", {"who": "world"})) 30 | }) 31 | 32 | it("should return formated strings for complex placeholders", function() { 33 | // sign 34 | assert.equal("2", sprintf("%d", 2)) 35 | assert.equal("-2", sprintf("%d", -2)) 36 | assert.equal("+2", sprintf("%+d", 2)) 37 | assert.equal("-2", sprintf("%+d", -2)) 38 | assert.equal("2", sprintf("%i", 2)) 39 | assert.equal("-2", sprintf("%i", -2)) 40 | assert.equal("+2", sprintf("%+i", 2)) 41 | assert.equal("-2", sprintf("%+i", -2)) 42 | assert.equal("2.2", sprintf("%f", 2.2)) 43 | assert.equal("-2.2", sprintf("%f", -2.2)) 44 | assert.equal("+2.2", sprintf("%+f", 2.2)) 45 | assert.equal("-2.2", sprintf("%+f", -2.2)) 46 | assert.equal("-2.3", sprintf("%+.1f", -2.34)) 47 | assert.equal("-0.0", sprintf("%+.1f", -0.01)) 48 | assert.equal("3.14159", sprintf("%.6g", pi)) 49 | assert.equal("3.14", sprintf("%.3g", pi)) 50 | assert.equal("3", sprintf("%.1g", pi)) 51 | assert.equal("-000000123", sprintf("%+010d", -123)) 52 | assert.equal("______-123", sprintf("%+'_10d", -123)) 53 | assert.equal("-234.34 123.2", sprintf("%f %f", -234.34, 123.2)) 54 | 55 | // padding 56 | assert.equal("-0002", sprintf("%05d", -2)) 57 | assert.equal("-0002", sprintf("%05i", -2)) 58 | assert.equal(" <", sprintf("%5s", "<")) 59 | assert.equal("0000<", sprintf("%05s", "<")) 60 | assert.equal("____<", sprintf("%'_5s", "<")) 61 | assert.equal("> ", sprintf("%-5s", ">")) 62 | assert.equal(">0000", sprintf("%0-5s", ">")) 63 | assert.equal(">____", sprintf("%'_-5s", ">")) 64 | assert.equal("xxxxxx", sprintf("%5s", "xxxxxx")) 65 | assert.equal("1234", sprintf("%02u", 1234)) 66 | assert.equal(" -10.235", sprintf("%8.3f", -10.23456)) 67 | assert.equal("-12.34 xxx", sprintf("%f %s", -12.34, "xxx")) 68 | assert.equal('{\n "foo": "bar"\n}', sprintf("%2j", {foo: "bar"})) 69 | assert.equal('[\n "foo",\n "bar"\n]', sprintf("%2j", ["foo", "bar"])) 70 | 71 | // precision 72 | assert.equal("2.3", sprintf("%.1f", 2.345)) 73 | assert.equal("xxxxx", sprintf("%5.5s", "xxxxxx")) 74 | assert.equal(" x", sprintf("%5.1s", "xxxxxx")) 75 | 76 | }) 77 | 78 | it("should return formated strings for callbacks", function() { 79 | assert.equal("foobar", sprintf("%s", function() { return "foobar" })) 80 | assert.equal(Date.now(), sprintf("%s", Date.now)) // should pass... 81 | }) 82 | }) 83 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "@bagbyte/use-private-action", 3 | "version": "0.0.2", 4 | "private": true, 5 | "description": "This action allow the use of GitHub private actions", 6 | "main": "dist/main.js", 7 | "scripts": { 8 | "build": "tsc", 9 | "test": "jest", 10 | "prepublishOnly": "npm run build && npm prune --prod && npm version patch" 11 | }, 12 | "repository": { 13 | "type": "git", 14 | "url": "git+https://github.com/bagbyte/use-private-action.git" 15 | }, 16 | "keywords": [ 17 | "github", 18 | "actions", 19 | "private" 20 | ], 21 | "author": "bagbyte", 22 | "license": "MIT", 23 | "files": [ 24 | "dist/**/*", 25 | "node_modules/**/*", 26 | "action.yml" 27 | ], 28 | "dependencies": { 29 | "@actions/core": "^1.2.0", 30 | "@actions/exec": "^1.0.1", 31 | "@actions/io": "^1.0.1", 32 | "js-yaml": "^3.13.1" 33 | }, 34 | "devDependencies": { 35 | "@types/jest": "^24.0.13", 36 | "@types/node": "^12.0.4", 37 | "jest": "^24.8.0", 38 | "jest-circus": "^24.7.1", 39 | "ts-jest": "^24.0.2", 40 | "typescript": "^3.5.1" 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /src/main.ts: -------------------------------------------------------------------------------- 1 | import * as core from '@actions/core'; 2 | import * as exec from '@actions/exec'; 3 | import * as io from '@actions/io'; 4 | 5 | import * as path from 'path'; 6 | 7 | const yaml = require('js-yaml'); 8 | 9 | // Default error message describing the `action` input parmeter format 10 | const ACTION_ERROR = `Provided 'action' is not valid, it must have the following format: '{org}/{repo}[/path]@ref'`; 11 | 12 | // Interface describing the `action.yml` file format 13 | interface ActionFileContent { 14 | runs: { 15 | using: string; 16 | main: string; 17 | }, 18 | } 19 | 20 | // This method generates a random string to be useed as temporary folder to clone the action repo 21 | function randomFolderName() { 22 | return Math.random().toString(36).substring(2, 15); 23 | } 24 | 25 | // This method clones the action repository 26 | async function cloneRepository(tempFolder: string, repositoryUrl: string) { 27 | try { 28 | await exec.exec('git', ['clone', repositoryUrl, tempFolder]); 29 | } catch (err) { 30 | core.error(err); 31 | throw new Error('There was an error while trying to clone the action repository'); 32 | } 33 | } 34 | 35 | // This method checks out the requested repo's reference (branch/tag/commit) 36 | async function checkout(tempFolder: string, reference: string) { 37 | try { 38 | await exec.exec('git', ['checkout', '-f', '--detach', reference], { cwd: tempFolder }); 39 | } catch (err) { 40 | core.error(err); 41 | throw new Error(`There was an error while trying to checkout '${reference}'`); 42 | } 43 | } 44 | 45 | // This method parses the `action.yml` file and execute the action 46 | async function executeAction(actionFileFolder: string) { 47 | // Prepare an empty string which will contain the content of the `action.yml` file 48 | let actionFileContent = ''; 49 | 50 | // Create an object to listen on the stdout of the cat command 51 | const options = { 52 | listeners: { 53 | stdout: (data: Buffer) => { 54 | actionFileContent += data.toString(); 55 | }, 56 | } 57 | }; 58 | 59 | try { 60 | // Use cat to fetch the content of `action.yml` file 61 | await exec.exec('cat', [actionFileFolder + '/action.yml'], options); 62 | } catch (err) { 63 | core.error(err); 64 | throw new Error(`There was an error while trying to read 'action.yml'`); 65 | } 66 | 67 | let actionFileObject: ActionFileContent; 68 | try { 69 | // Convert the YML file into a javascript object 70 | actionFileObject = await yaml.safeLoad(actionFileContent); 71 | } catch (err) { 72 | core.error(err); 73 | throw new Error(`The 'action.yml' file seems to have an invalid format`); 74 | } 75 | 76 | // Check if the `action.yml` file has properly written 77 | if (!('runs' in actionFileObject) || !('using' in actionFileObject.runs)) { 78 | throw new Error(`There was an error while parsing 'action.yml' file, missing 'runs.using'`); 79 | } 80 | 81 | // Check if the action is based on node 82 | if (!actionFileObject.runs.using.startsWith('node')) { 83 | throw new Error(`Unexpected value '${actionFileObject.runs.using}' for 'runs.using' in the 'action.yml' file`); 84 | } 85 | 86 | try { 87 | let currentPath = ''; 88 | 89 | // Get the full path of the current path 90 | await exec.exec('pwd', [], { 91 | listeners: { 92 | stdline: (data: string) => { 93 | currentPath = data; 94 | } 95 | } 96 | }); 97 | 98 | // Get the full path of the main file of the action to execute 99 | const mainFullPath = path.join(currentPath, actionFileFolder, actionFileObject.runs.main.replace(/^((.\/)|(\/))/, '')); 100 | 101 | // Execute the action 102 | await require(mainFullPath); 103 | } catch (err) { 104 | core.error(err); 105 | throw new Error(`There was an error while trying to execute the action`); 106 | } 107 | } 108 | 109 | // This method deletes the folder used for the repository clone 110 | async function deleteFolder(tempFolder: string) { 111 | // Cleanup 112 | if (tempFolder) { 113 | try { 114 | await io.rmRF(tempFolder); 115 | } catch (err) { 116 | core.error(err); 117 | core.setFailed(`There was an error while trying to delete temp folder '${tempFolder}'`); 118 | } 119 | } 120 | } 121 | 122 | // This method checks out the code from the repository and branch where the action has been called 123 | async function checkoutCode() { 124 | // Read `private-action` input parmeter 125 | const action = core.getInput('private-action'); 126 | 127 | // Read `private-action-token` input parmeter 128 | const token = core.getInput('private-action-token'); 129 | 130 | // If `private-action` input prameter is missing, return an error 131 | if (!action) { 132 | core.setFailed(`Missing 'private-action' input parameter`); 133 | return; 134 | } 135 | 136 | // If `private-action-token` input prameter is missing, return an error 137 | if (!token) { 138 | core.setFailed(`Missing 'private-action-token' input parameter`); 139 | return; 140 | } 141 | 142 | // Extract `ref` from `private-action` 143 | const [ repoParts, ref ] = action.split('@'); 144 | 145 | // If `ref` is missing, return an error 146 | if (!ref) { 147 | core.setFailed(ACTION_ERROR); 148 | return; 149 | } 150 | 151 | // Extract all components from `private-action` input parameter 152 | const [ org, repo, path ] = repoParts.split('/'); 153 | 154 | // If `org` or `repo` is missing, return an error 155 | if (!org || !repo) { 156 | core.setFailed(ACTION_ERROR); 157 | return; 158 | } 159 | 160 | // Create a random folder name where to checkout the action 161 | const tempFolderName = randomFolderName(); 162 | 163 | try { 164 | // Generate repository URL for the action to checkout 165 | const url = `https://${token}:x-oauth-basic@github.com/${org}/${repo}.git`; 166 | 167 | // Clone the action repository 168 | await cloneRepository(tempFolderName, url); 169 | 170 | // Checkout the reference 171 | await checkout(tempFolderName, ref); 172 | 173 | // Set the expected path for the `action.yml` file 174 | const actionFileFolder = [tempFolderName, path].filter(p => p).join('/'); 175 | 176 | // Execute the action 177 | await executeAction(actionFileFolder); 178 | } catch (err) { 179 | core.setFailed(err); 180 | } finally { 181 | // Cleanup 182 | deleteFolder(tempFolderName); 183 | } 184 | } 185 | 186 | // Start the execution 187 | checkoutCode(); 188 | -------------------------------------------------------------------------------- /tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "target": "es6", 4 | "module": "commonjs", 5 | "outDir": "./dist", 6 | "rootDir": "./src", 7 | "strict": true, 8 | "noImplicitAny": false, 9 | "esModuleInterop": true 10 | }, 11 | "exclude": ["node_modules", "**/*.spec.ts", "**/*.test.ts"] 12 | } --------------------------------------------------------------------------------