diff --git a/.editorconfig b/.editorconfig new file mode 100644 index 0000000..63ffeaf --- /dev/null +++ b/.editorconfig @@ -0,0 +1,10 @@ +root = true + +[*] +charset = utf-8 +end_of_line = lf +indent_size = 2 +indent_style = space +insert_final_newline = true +max_line_length = 100 +tab_width = 2 diff --git a/.eslintrc.json b/.eslintrc.json new file mode 100644 index 0000000..5c2d52a --- /dev/null +++ b/.eslintrc.json @@ -0,0 +1,17 @@ +{ + "env": { + "commonjs": true, + "es6": true, + "node": true + }, + "extends": "eslint:recommended", + "globals": { + "Atomics": "readonly", + "SharedArrayBuffer": "readonly" + }, + "parserOptions": { + "ecmaVersion": 2018 + }, + "rules": { + } +} diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml new file mode 100644 index 0000000..f316397 --- /dev/null +++ b/.github/workflows/main.yml @@ -0,0 +1,78 @@ +name: CICD + +on: + pull_request: + push: + branches: + - master + +jobs: + test: + strategy: + matrix: + runs-on: [ubuntu-latest, macos-latest, windows-latest] + runs-on: ${{ matrix.runs-on }} + + steps: + - name: Checkout + uses: actions/checkout@v2 + + - name: Convert + id: convert + uses: ./ + with: + text: | + # Heading 1 + + ## Heading 2 + + [Link](http://example.com) + + * List Item 1 + * List Item 2 + + - name: Verify + shell: bash + env: + ACTUAL: ${{ steps.convert.outputs.text }} + EXPECTED: | + *Heading 1* + + *Heading 2* + + + + • List Item 1 + • List Item 2 + run: | + if [ "$ACTUAL" != "$EXPECTED" ]; then + echo "Actual: $ACTUAL" + echo "Expected: $EXPECTED" + exit 1 + fi + + release: + needs: test + if: github.event_name == 'push' + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v2 + + - name: Release + id: release + uses: cycjimmy/semantic-release-action@v2 + with: + extra_plugins: | + @semantic-release/changelog + @semantic-release/git + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + + - name: Update major version tag + if: steps.release.outputs.new_release_published == 'true' + env: + TAG: v${{ steps.release.outputs.new_release_major_version }} + run: | + git tag "$TAG" + git push origin "$TAG" diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..706fd07 --- /dev/null +++ b/.gitignore @@ -0,0 +1,2 @@ +.idea +.vscode diff --git a/.releaserc.json b/.releaserc.json new file mode 100644 index 0000000..a69881d --- /dev/null +++ b/.releaserc.json @@ -0,0 +1,12 @@ +{ + "branches": [ + "master" + ], + "plugins": [ + "@semantic-release/commit-analyzer", + "@semantic-release/release-notes-generator", + "@semantic-release/changelog", + "@semantic-release/git", + "@semantic-release/github" + ] +} diff --git a/README.md b/README.md index 7642fe8..0ff1a5c 100644 --- a/README.md +++ b/README.md @@ -1,2 +1,12 @@ # slackify-markdown-action GitHub Action to convert markdown into Slack's mrkdwn. + +## Usage + +### Inputs + +* `text` - The markdown text to convert. + +### Outputs + +* `text` - The markdown text converted to Slack's mrkdwn format. diff --git a/action.yml b/action.yml new file mode 100644 index 0000000..7083dba --- /dev/null +++ b/action.yml @@ -0,0 +1,16 @@ +name: 'Slack Markdown Converter' +author: 'Joshua Coady' +description: "Converts markdown to Slack's mrkdwn" +inputs: + text: + description: 'Markdown text to convert' + required: true +outputs: + text: + description: 'Converted Slack mrkdwn text' +runs: + using: 'node12' + main: 'index.js' +branding: + icon: 'heart' + color: 'red' diff --git a/index.js b/index.js new file mode 100644 index 0000000..fc93d99 --- /dev/null +++ b/index.js @@ -0,0 +1,10 @@ +const core = require('@actions/core'); +const slackifyMarkdown = require('slackify-markdown'); + +try { + const md = core.getInput('text', {required: true}); + const mrkdwn = slackifyMarkdown(md); + core.setOutput("text", mrkdwn); +} catch (error) { + core.setFailed(error.message); +} diff --git a/node_modules/@actions/core/README.md b/node_modules/@actions/core/README.md new file mode 100644 index 0000000..5ad27ee --- /dev/null +++ b/node_modules/@actions/core/README.md @@ -0,0 +1,146 @@ +# `@actions/core` + +> Core functions for setting results, logging, registering secrets and exporting variables across actions + +## Usage + +### Import the package + +```js +// javascript +const core = require('@actions/core'); + +// typescript +import * as core from '@actions/core'; +``` + +#### Inputs/Outputs + +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. + +```js +const myInput = core.getInput('inputName', { required: true }); + +core.setOutput('outputKey', 'outputVal'); +``` + +#### Exporting variables + +Since each step runs in a separate process, you can use `exportVariable` to add it to this step and future steps environment blocks. + +```js +core.exportVariable('envVar', 'Val'); +``` + +#### Setting a secret + +Setting a secret registers the secret with the runner to ensure it is masked in logs. + +```js +core.setSecret('myPassword'); +``` + +#### PATH Manipulation + +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. + +```js +core.addPath('/path/to/mytool'); +``` + +#### Exit codes + +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. + +```js +const core = require('@actions/core'); + +try { + // Do stuff +} +catch (err) { + // setFailed logs the message and sets a failing exit code + core.setFailed(`Action failed with error ${err}`); +} + +Note that `setNeutral` is not yet implemented in actions V2 but equivalent functionality is being planned. + +``` + +#### Logging + +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). + +```js +const core = require('@actions/core'); + +const myInput = core.getInput('input'); +try { + core.debug('Inside try block'); + + if (!myInput) { + core.warning('myInput was not set'); + } + + if (core.isDebug()) { + // curl -v https://github.com + } else { + // curl https://github.com + } + + // Do stuff +} +catch (err) { + core.error(`Error ${err}, action may still succeed though`); +} +``` + +This library can also wrap chunks of output in foldable groups. + +```js +const core = require('@actions/core') + +// Manually wrap output +core.startGroup('Do some function') +doSomeFunction() +core.endGroup() + +// Wrap an asynchronous function call +const result = await core.group('Do something async', async () => { + const response = await doSomeHTTPRequest() + return response +}) +``` + +#### Action state + +You can use this library to save state and get state for sharing information between a given wrapper action: + +**action.yml** +```yaml +name: 'Wrapper action sample' +inputs: + name: + default: 'GitHub' +runs: + using: 'node12' + main: 'main.js' + post: 'cleanup.js' +``` + +In action's `main.js`: + +```js +const core = require('@actions/core'); + +core.saveState("pidToKill", 12345); +``` + +In action's `cleanup.js`: +```js +const core = require('@actions/core'); + +var pid = core.getState("pidToKill"); + +process.kill(pid); +``` \ No newline at end of file diff --git a/node_modules/@actions/core/lib/command.d.ts b/node_modules/@actions/core/lib/command.d.ts new file mode 100644 index 0000000..94d5e44 --- /dev/null +++ b/node_modules/@actions/core/lib/command.d.ts @@ -0,0 +1,21 @@ +interface CommandProperties { + [key: string]: any; +} +/** + * Commands + * + * Command Format: + * ::name key=value,key=value::message + * + * Examples: + * ::warning::This is the message + * ::set-env name=MY_VAR::some value + */ +export declare function issueCommand(command: string, properties: CommandProperties, message: any): void; +export declare function issue(name: string, message?: string): void; +/** + * Sanitizes an input into a string so it can be passed into issueCommand safely + * @param input input to sanitize into a string + */ +export declare function toCommandValue(input: any): string; +export {}; diff --git a/node_modules/@actions/core/lib/command.js b/node_modules/@actions/core/lib/command.js new file mode 100644 index 0000000..af28d2b --- /dev/null +++ b/node_modules/@actions/core/lib/command.js @@ -0,0 +1,92 @@ +"use strict"; +var __importStar = (this && this.__importStar) || function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k]; + result["default"] = mod; + return result; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +const os = __importStar(require("os")); +/** + * Commands + * + * Command Format: + * ::name key=value,key=value::message + * + * Examples: + * ::warning::This is the message + * ::set-env name=MY_VAR::some value + */ +function issueCommand(command, properties, message) { + const cmd = new Command(command, properties, message); + process.stdout.write(cmd.toString() + os.EOL); +} +exports.issueCommand = issueCommand; +function issue(name, message = '') { + issueCommand(name, {}, message); +} +exports.issue = issue; +const CMD_STRING = '::'; +class Command { + constructor(command, properties, message) { + if (!command) { + command = 'missing.command'; + } + this.command = command; + this.properties = properties; + this.message = message; + } + toString() { + let cmdStr = CMD_STRING + this.command; + if (this.properties && Object.keys(this.properties).length > 0) { + cmdStr += ' '; + let first = true; + for (const key in this.properties) { + if (this.properties.hasOwnProperty(key)) { + const val = this.properties[key]; + if (val) { + if (first) { + first = false; + } + else { + cmdStr += ','; + } + cmdStr += `${key}=${escapeProperty(val)}`; + } + } + } + } + cmdStr += `${CMD_STRING}${escapeData(this.message)}`; + return cmdStr; + } +} +/** + * Sanitizes an input into a string so it can be passed into issueCommand safely + * @param input input to sanitize into a string + */ +function toCommandValue(input) { + if (input === null || input === undefined) { + return ''; + } + else if (typeof input === 'string' || input instanceof String) { + return input; + } + return JSON.stringify(input); +} +exports.toCommandValue = toCommandValue; +function escapeData(s) { + return toCommandValue(s) + .replace(/%/g, '%25') + .replace(/\r/g, '%0D') + .replace(/\n/g, '%0A'); +} +function escapeProperty(s) { + return toCommandValue(s) + .replace(/%/g, '%25') + .replace(/\r/g, '%0D') + .replace(/\n/g, '%0A') + .replace(/:/g, '%3A') + .replace(/,/g, '%2C'); +} +//# sourceMappingURL=command.js.map \ No newline at end of file diff --git a/node_modules/@actions/core/lib/command.js.map b/node_modules/@actions/core/lib/command.js.map new file mode 100644 index 0000000..ae75565 --- /dev/null +++ b/node_modules/@actions/core/lib/command.js.map @@ -0,0 +1 @@ +{"version":3,"file":"command.js","sourceRoot":"","sources":["../src/command.ts"],"names":[],"mappings":";;;;;;;;;AAAA,uCAAwB;AAWxB;;;;;;;;;GASG;AACH,SAAgB,YAAY,CAC1B,OAAe,EACf,UAA6B,EAC7B,OAAY;IAEZ,MAAM,GAAG,GAAG,IAAI,OAAO,CAAC,OAAO,EAAE,UAAU,EAAE,OAAO,CAAC,CAAA;IACrD,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,GAAG,CAAC,QAAQ,EAAE,GAAG,EAAE,CAAC,GAAG,CAAC,CAAA;AAC/C,CAAC;AAPD,oCAOC;AAED,SAAgB,KAAK,CAAC,IAAY,EAAE,UAAkB,EAAE;IACtD,YAAY,CAAC,IAAI,EAAE,EAAE,EAAE,OAAO,CAAC,CAAA;AACjC,CAAC;AAFD,sBAEC;AAED,MAAM,UAAU,GAAG,IAAI,CAAA;AAEvB,MAAM,OAAO;IAKX,YAAY,OAAe,EAAE,UAA6B,EAAE,OAAe;QACzE,IAAI,CAAC,OAAO,EAAE;YACZ,OAAO,GAAG,iBAAiB,CAAA;SAC5B;QAED,IAAI,CAAC,OAAO,GAAG,OAAO,CAAA;QACtB,IAAI,CAAC,UAAU,GAAG,UAAU,CAAA;QAC5B,IAAI,CAAC,OAAO,GAAG,OAAO,CAAA;IACxB,CAAC;IAED,QAAQ;QACN,IAAI,MAAM,GAAG,UAAU,GAAG,IAAI,CAAC,OAAO,CAAA;QAEtC,IAAI,IAAI,CAAC,UAAU,IAAI,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC,MAAM,GAAG,CAAC,EAAE;YAC9D,MAAM,IAAI,GAAG,CAAA;YACb,IAAI,KAAK,GAAG,IAAI,CAAA;YAChB,KAAK,MAAM,GAAG,IAAI,IAAI,CAAC,UAAU,EAAE;gBACjC,IAAI,IAAI,CAAC,UAAU,CAAC,cAAc,CAAC,GAAG,CAAC,EAAE;oBACvC,MAAM,GAAG,GAAG,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC,CAAA;oBAChC,IAAI,GAAG,EAAE;wBACP,IAAI,KAAK,EAAE;4BACT,KAAK,GAAG,KAAK,CAAA;yBACd;6BAAM;4BACL,MAAM,IAAI,GAAG,CAAA;yBACd;wBAED,MAAM,IAAI,GAAG,GAAG,IAAI,cAAc,CAAC,GAAG,CAAC,EAAE,CAAA;qBAC1C;iBACF;aACF;SACF;QAED,MAAM,IAAI,GAAG,UAAU,GAAG,UAAU,CAAC,IAAI,CAAC,OAAO,CAAC,EAAE,CAAA;QACpD,OAAO,MAAM,CAAA;IACf,CAAC;CACF;AAED;;;GAGG;AACH,SAAgB,cAAc,CAAC,KAAU;IACvC,IAAI,KAAK,KAAK,IAAI,IAAI,KAAK,KAAK,SAAS,EAAE;QACzC,OAAO,EAAE,CAAA;KACV;SAAM,IAAI,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,YAAY,MAAM,EAAE;QAC/D,OAAO,KAAe,CAAA;KACvB;IACD,OAAO,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,CAAA;AAC9B,CAAC;AAPD,wCAOC;AAED,SAAS,UAAU,CAAC,CAAM;IACxB,OAAO,cAAc,CAAC,CAAC,CAAC;SACrB,OAAO,CAAC,IAAI,EAAE,KAAK,CAAC;SACpB,OAAO,CAAC,KAAK,EAAE,KAAK,CAAC;SACrB,OAAO,CAAC,KAAK,EAAE,KAAK,CAAC,CAAA;AAC1B,CAAC;AAED,SAAS,cAAc,CAAC,CAAM;IAC5B,OAAO,cAAc,CAAC,CAAC,CAAC;SACrB,OAAO,CAAC,IAAI,EAAE,KAAK,CAAC;SACpB,OAAO,CAAC,KAAK,EAAE,KAAK,CAAC;SACrB,OAAO,CAAC,KAAK,EAAE,KAAK,CAAC;SACrB,OAAO,CAAC,IAAI,EAAE,KAAK,CAAC;SACpB,OAAO,CAAC,IAAI,EAAE,KAAK,CAAC,CAAA;AACzB,CAAC"} \ No newline at end of file diff --git a/node_modules/@actions/core/lib/core.d.ts b/node_modules/@actions/core/lib/core.d.ts new file mode 100644 index 0000000..8bb5093 --- /dev/null +++ b/node_modules/@actions/core/lib/core.d.ts @@ -0,0 +1,122 @@ +/** + * Interface for getInput options + */ +export interface InputOptions { + /** Optional. Whether the input is required. If required and not present, will throw. Defaults to false */ + required?: boolean; +} +/** + * The code to exit an action + */ +export declare enum ExitCode { + /** + * A code indicating that the action was successful + */ + Success = 0, + /** + * A code indicating that the action was a failure + */ + Failure = 1 +} +/** + * Sets env variable for this action and future actions in the job + * @param name the name of the variable to set + * @param val the value of the variable. Non-string values will be converted to a string via JSON.stringify + */ +export declare function exportVariable(name: string, val: any): void; +/** + * Registers a secret which will get masked from logs + * @param secret value of the secret + */ +export declare function setSecret(secret: string): void; +/** + * Prepends inputPath to the PATH (for this action and future actions) + * @param inputPath + */ +export declare function addPath(inputPath: string): void; +/** + * Gets the value of an input. The value is also trimmed. + * + * @param name name of the input to get + * @param options optional. See InputOptions. + * @returns string + */ +export declare function getInput(name: string, options?: InputOptions): string; +/** + * Sets the value of an output. + * + * @param name name of the output to set + * @param value value to store. Non-string values will be converted to a string via JSON.stringify + */ +export declare function setOutput(name: string, value: any): void; +/** + * Enables or disables the echoing of commands into stdout for the rest of the step. + * Echoing is disabled by default if ACTIONS_STEP_DEBUG is not set. + * + */ +export declare function setCommandEcho(enabled: boolean): void; +/** + * Sets the action status to failed. + * When the action exits it will be with an exit code of 1 + * @param message add error issue message + */ +export declare function setFailed(message: string | Error): void; +/** + * Gets whether Actions Step Debug is on or not + */ +export declare function isDebug(): boolean; +/** + * Writes debug message to user log + * @param message debug message + */ +export declare function debug(message: string): void; +/** + * Adds an error issue + * @param message error issue message. Errors will be converted to string via toString() + */ +export declare function error(message: string | Error): void; +/** + * Adds an warning issue + * @param message warning issue message. Errors will be converted to string via toString() + */ +export declare function warning(message: string | Error): void; +/** + * Writes info to log with console.log. + * @param message info message + */ +export declare function info(message: string): void; +/** + * Begin an output group. + * + * Output until the next `groupEnd` will be foldable in this group + * + * @param name The name of the output group + */ +export declare function startGroup(name: string): void; +/** + * End an output group. + */ +export declare function endGroup(): void; +/** + * Wrap an asynchronous function call in a group. + * + * Returns the same type as the function itself. + * + * @param name The name of the group + * @param fn The function to wrap in the group + */ +export declare function group(name: string, fn: () => Promise): Promise; +/** + * Saves state for current action, the state can only be retrieved by this action's post job execution. + * + * @param name name of the state to store + * @param value value to store. Non-string values will be converted to a string via JSON.stringify + */ +export declare function saveState(name: string, value: any): void; +/** + * Gets the value of an state set by this action's main execution. + * + * @param name name of the state to get + * @returns string + */ +export declare function getState(name: string): string; diff --git a/node_modules/@actions/core/lib/core.js b/node_modules/@actions/core/lib/core.js new file mode 100644 index 0000000..c838f4e --- /dev/null +++ b/node_modules/@actions/core/lib/core.js @@ -0,0 +1,222 @@ +"use strict"; +var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { + function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } + return new (P || (P = Promise))(function (resolve, reject) { + function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } + function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } + function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } + step((generator = generator.apply(thisArg, _arguments || [])).next()); + }); +}; +var __importStar = (this && this.__importStar) || function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k]; + result["default"] = mod; + return result; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +const command_1 = require("./command"); +const os = __importStar(require("os")); +const path = __importStar(require("path")); +/** + * The code to exit an action + */ +var ExitCode; +(function (ExitCode) { + /** + * A code indicating that the action was successful + */ + ExitCode[ExitCode["Success"] = 0] = "Success"; + /** + * A code indicating that the action was a failure + */ + ExitCode[ExitCode["Failure"] = 1] = "Failure"; +})(ExitCode = exports.ExitCode || (exports.ExitCode = {})); +//----------------------------------------------------------------------- +// Variables +//----------------------------------------------------------------------- +/** + * Sets env variable for this action and future actions in the job + * @param name the name of the variable to set + * @param val the value of the variable. Non-string values will be converted to a string via JSON.stringify + */ +// eslint-disable-next-line @typescript-eslint/no-explicit-any +function exportVariable(name, val) { + const convertedVal = command_1.toCommandValue(val); + process.env[name] = convertedVal; + command_1.issueCommand('set-env', { name }, convertedVal); +} +exports.exportVariable = exportVariable; +/** + * Registers a secret which will get masked from logs + * @param secret value of the secret + */ +function setSecret(secret) { + command_1.issueCommand('add-mask', {}, secret); +} +exports.setSecret = setSecret; +/** + * Prepends inputPath to the PATH (for this action and future actions) + * @param inputPath + */ +function addPath(inputPath) { + command_1.issueCommand('add-path', {}, inputPath); + process.env['PATH'] = `${inputPath}${path.delimiter}${process.env['PATH']}`; +} +exports.addPath = addPath; +/** + * Gets the value of an input. The value is also trimmed. + * + * @param name name of the input to get + * @param options optional. See InputOptions. + * @returns string + */ +function getInput(name, options) { + const val = process.env[`INPUT_${name.replace(/ /g, '_').toUpperCase()}`] || ''; + if (options && options.required && !val) { + throw new Error(`Input required and not supplied: ${name}`); + } + return val.trim(); +} +exports.getInput = getInput; +/** + * Sets the value of an output. + * + * @param name name of the output to set + * @param value value to store. Non-string values will be converted to a string via JSON.stringify + */ +// eslint-disable-next-line @typescript-eslint/no-explicit-any +function setOutput(name, value) { + command_1.issueCommand('set-output', { name }, value); +} +exports.setOutput = setOutput; +/** + * Enables or disables the echoing of commands into stdout for the rest of the step. + * Echoing is disabled by default if ACTIONS_STEP_DEBUG is not set. + * + */ +function setCommandEcho(enabled) { + command_1.issue('echo', enabled ? 'on' : 'off'); +} +exports.setCommandEcho = setCommandEcho; +//----------------------------------------------------------------------- +// Results +//----------------------------------------------------------------------- +/** + * Sets the action status to failed. + * When the action exits it will be with an exit code of 1 + * @param message add error issue message + */ +function setFailed(message) { + process.exitCode = ExitCode.Failure; + error(message); +} +exports.setFailed = setFailed; +//----------------------------------------------------------------------- +// Logging Commands +//----------------------------------------------------------------------- +/** + * Gets whether Actions Step Debug is on or not + */ +function isDebug() { + return process.env['RUNNER_DEBUG'] === '1'; +} +exports.isDebug = isDebug; +/** + * Writes debug message to user log + * @param message debug message + */ +function debug(message) { + command_1.issueCommand('debug', {}, message); +} +exports.debug = debug; +/** + * Adds an error issue + * @param message error issue message. Errors will be converted to string via toString() + */ +function error(message) { + command_1.issue('error', message instanceof Error ? message.toString() : message); +} +exports.error = error; +/** + * Adds an warning issue + * @param message warning issue message. Errors will be converted to string via toString() + */ +function warning(message) { + command_1.issue('warning', message instanceof Error ? message.toString() : message); +} +exports.warning = warning; +/** + * Writes info to log with console.log. + * @param message info message + */ +function info(message) { + process.stdout.write(message + os.EOL); +} +exports.info = info; +/** + * Begin an output group. + * + * Output until the next `groupEnd` will be foldable in this group + * + * @param name The name of the output group + */ +function startGroup(name) { + command_1.issue('group', name); +} +exports.startGroup = startGroup; +/** + * End an output group. + */ +function endGroup() { + command_1.issue('endgroup'); +} +exports.endGroup = endGroup; +/** + * Wrap an asynchronous function call in a group. + * + * Returns the same type as the function itself. + * + * @param name The name of the group + * @param fn The function to wrap in the group + */ +function group(name, fn) { + return __awaiter(this, void 0, void 0, function* () { + startGroup(name); + let result; + try { + result = yield fn(); + } + finally { + endGroup(); + } + return result; + }); +} +exports.group = group; +//----------------------------------------------------------------------- +// Wrapper action state +//----------------------------------------------------------------------- +/** + * Saves state for current action, the state can only be retrieved by this action's post job execution. + * + * @param name name of the state to store + * @param value value to store. Non-string values will be converted to a string via JSON.stringify + */ +// eslint-disable-next-line @typescript-eslint/no-explicit-any +function saveState(name, value) { + command_1.issueCommand('save-state', { name }, value); +} +exports.saveState = saveState; +/** + * Gets the value of an state set by this action's main execution. + * + * @param name name of the state to get + * @returns string + */ +function getState(name) { + return process.env[`STATE_${name}`] || ''; +} +exports.getState = getState; +//# sourceMappingURL=core.js.map \ No newline at end of file diff --git a/node_modules/@actions/core/lib/core.js.map b/node_modules/@actions/core/lib/core.js.map new file mode 100644 index 0000000..68e9f31 --- /dev/null +++ b/node_modules/@actions/core/lib/core.js.map @@ -0,0 +1 @@ +{"version":3,"file":"core.js","sourceRoot":"","sources":["../src/core.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;AAAA,uCAA6D;AAE7D,uCAAwB;AACxB,2CAA4B;AAU5B;;GAEG;AACH,IAAY,QAUX;AAVD,WAAY,QAAQ;IAClB;;OAEG;IACH,6CAAW,CAAA;IAEX;;OAEG;IACH,6CAAW,CAAA;AACb,CAAC,EAVW,QAAQ,GAAR,gBAAQ,KAAR,gBAAQ,QAUnB;AAED,yEAAyE;AACzE,YAAY;AACZ,yEAAyE;AAEzE;;;;GAIG;AACH,8DAA8D;AAC9D,SAAgB,cAAc,CAAC,IAAY,EAAE,GAAQ;IACnD,MAAM,YAAY,GAAG,wBAAc,CAAC,GAAG,CAAC,CAAA;IACxC,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC,GAAG,YAAY,CAAA;IAChC,sBAAY,CAAC,SAAS,EAAE,EAAC,IAAI,EAAC,EAAE,YAAY,CAAC,CAAA;AAC/C,CAAC;AAJD,wCAIC;AAED;;;GAGG;AACH,SAAgB,SAAS,CAAC,MAAc;IACtC,sBAAY,CAAC,UAAU,EAAE,EAAE,EAAE,MAAM,CAAC,CAAA;AACtC,CAAC;AAFD,8BAEC;AAED;;;GAGG;AACH,SAAgB,OAAO,CAAC,SAAiB;IACvC,sBAAY,CAAC,UAAU,EAAE,EAAE,EAAE,SAAS,CAAC,CAAA;IACvC,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC,GAAG,GAAG,SAAS,GAAG,IAAI,CAAC,SAAS,GAAG,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC,EAAE,CAAA;AAC7E,CAAC;AAHD,0BAGC;AAED;;;;;;GAMG;AACH,SAAgB,QAAQ,CAAC,IAAY,EAAE,OAAsB;IAC3D,MAAM,GAAG,GACP,OAAO,CAAC,GAAG,CAAC,SAAS,IAAI,CAAC,OAAO,CAAC,IAAI,EAAE,GAAG,CAAC,CAAC,WAAW,EAAE,EAAE,CAAC,IAAI,EAAE,CAAA;IACrE,IAAI,OAAO,IAAI,OAAO,CAAC,QAAQ,IAAI,CAAC,GAAG,EAAE;QACvC,MAAM,IAAI,KAAK,CAAC,oCAAoC,IAAI,EAAE,CAAC,CAAA;KAC5D;IAED,OAAO,GAAG,CAAC,IAAI,EAAE,CAAA;AACnB,CAAC;AARD,4BAQC;AAED;;;;;GAKG;AACH,8DAA8D;AAC9D,SAAgB,SAAS,CAAC,IAAY,EAAE,KAAU;IAChD,sBAAY,CAAC,YAAY,EAAE,EAAC,IAAI,EAAC,EAAE,KAAK,CAAC,CAAA;AAC3C,CAAC;AAFD,8BAEC;AAED;;;;GAIG;AACH,SAAgB,cAAc,CAAC,OAAgB;IAC7C,eAAK,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,KAAK,CAAC,CAAA;AACvC,CAAC;AAFD,wCAEC;AAED,yEAAyE;AACzE,UAAU;AACV,yEAAyE;AAEzE;;;;GAIG;AACH,SAAgB,SAAS,CAAC,OAAuB;IAC/C,OAAO,CAAC,QAAQ,GAAG,QAAQ,CAAC,OAAO,CAAA;IAEnC,KAAK,CAAC,OAAO,CAAC,CAAA;AAChB,CAAC;AAJD,8BAIC;AAED,yEAAyE;AACzE,mBAAmB;AACnB,yEAAyE;AAEzE;;GAEG;AACH,SAAgB,OAAO;IACrB,OAAO,OAAO,CAAC,GAAG,CAAC,cAAc,CAAC,KAAK,GAAG,CAAA;AAC5C,CAAC;AAFD,0BAEC;AAED;;;GAGG;AACH,SAAgB,KAAK,CAAC,OAAe;IACnC,sBAAY,CAAC,OAAO,EAAE,EAAE,EAAE,OAAO,CAAC,CAAA;AACpC,CAAC;AAFD,sBAEC;AAED;;;GAGG;AACH,SAAgB,KAAK,CAAC,OAAuB;IAC3C,eAAK,CAAC,OAAO,EAAE,OAAO,YAAY,KAAK,CAAC,CAAC,CAAC,OAAO,CAAC,QAAQ,EAAE,CAAC,CAAC,CAAC,OAAO,CAAC,CAAA;AACzE,CAAC;AAFD,sBAEC;AAED;;;GAGG;AACH,SAAgB,OAAO,CAAC,OAAuB;IAC7C,eAAK,CAAC,SAAS,EAAE,OAAO,YAAY,KAAK,CAAC,CAAC,CAAC,OAAO,CAAC,QAAQ,EAAE,CAAC,CAAC,CAAC,OAAO,CAAC,CAAA;AAC3E,CAAC;AAFD,0BAEC;AAED;;;GAGG;AACH,SAAgB,IAAI,CAAC,OAAe;IAClC,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,OAAO,GAAG,EAAE,CAAC,GAAG,CAAC,CAAA;AACxC,CAAC;AAFD,oBAEC;AAED;;;;;;GAMG;AACH,SAAgB,UAAU,CAAC,IAAY;IACrC,eAAK,CAAC,OAAO,EAAE,IAAI,CAAC,CAAA;AACtB,CAAC;AAFD,gCAEC;AAED;;GAEG;AACH,SAAgB,QAAQ;IACtB,eAAK,CAAC,UAAU,CAAC,CAAA;AACnB,CAAC;AAFD,4BAEC;AAED;;;;;;;GAOG;AACH,SAAsB,KAAK,CAAI,IAAY,EAAE,EAAoB;;QAC/D,UAAU,CAAC,IAAI,CAAC,CAAA;QAEhB,IAAI,MAAS,CAAA;QAEb,IAAI;YACF,MAAM,GAAG,MAAM,EAAE,EAAE,CAAA;SACpB;gBAAS;YACR,QAAQ,EAAE,CAAA;SACX;QAED,OAAO,MAAM,CAAA;IACf,CAAC;CAAA;AAZD,sBAYC;AAED,yEAAyE;AACzE,uBAAuB;AACvB,yEAAyE;AAEzE;;;;;GAKG;AACH,8DAA8D;AAC9D,SAAgB,SAAS,CAAC,IAAY,EAAE,KAAU;IAChD,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"} \ No newline at end of file diff --git a/node_modules/@actions/core/package.json b/node_modules/@actions/core/package.json new file mode 100644 index 0000000..6027366 --- /dev/null +++ b/node_modules/@actions/core/package.json @@ -0,0 +1,66 @@ +{ + "_from": "@actions/core@^1.2.4", + "_id": "@actions/core@1.2.4", + "_inBundle": false, + "_integrity": "sha512-YJCEq8BE3CdN8+7HPZ/4DxJjk/OkZV2FFIf+DlZTC/4iBlzYCD5yjRR6eiOS5llO11zbRltIRuKAjMKaWTE6cg==", + "_location": "/@actions/core", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "@actions/core@^1.2.4", + "name": "@actions/core", + "escapedName": "@actions%2fcore", + "scope": "@actions", + "rawSpec": "^1.2.4", + "saveSpec": null, + "fetchSpec": "^1.2.4" + }, + "_requiredBy": [ + "/" + ], + "_resolved": "https://registry.npmjs.org/@actions/core/-/core-1.2.4.tgz", + "_shasum": "96179dbf9f8d951dd74b40a0dbd5c22555d186ab", + "_spec": "@actions/core@^1.2.4", + "_where": "/Users/josh/Projects/slackify-markdown-action", + "bugs": { + "url": "https://github.com/actions/toolkit/issues" + }, + "bundleDependencies": false, + "deprecated": false, + "description": "Actions core lib", + "devDependencies": { + "@types/node": "^12.0.2" + }, + "directories": { + "lib": "lib", + "test": "__tests__" + }, + "files": [ + "lib" + ], + "homepage": "https://github.com/actions/toolkit/tree/master/packages/core", + "keywords": [ + "github", + "actions", + "core" + ], + "license": "MIT", + "main": "lib/core.js", + "name": "@actions/core", + "publishConfig": { + "access": "public" + }, + "repository": { + "type": "git", + "url": "git+https://github.com/actions/toolkit.git", + "directory": "packages/core" + }, + "scripts": { + "audit-moderate": "npm install && npm audit --audit-level=moderate", + "test": "echo \"Error: run tests from root\" && exit 1", + "tsc": "tsc" + }, + "types": "lib/core.d.ts", + "version": "1.2.4" +} diff --git a/node_modules/@types/unist/LICENSE b/node_modules/@types/unist/LICENSE new file mode 100644 index 0000000..2107107 --- /dev/null +++ b/node_modules/@types/unist/LICENSE @@ -0,0 +1,21 @@ + MIT License + + Copyright (c) Microsoft Corporation. All rights reserved. + + 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: + + The above copyright notice and this permission notice shall be included in all + copies or substantial portions of the Software. + + 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 diff --git a/node_modules/@types/unist/README.md b/node_modules/@types/unist/README.md new file mode 100644 index 0000000..8b6fcdf --- /dev/null +++ b/node_modules/@types/unist/README.md @@ -0,0 +1,16 @@ +# Installation +> `npm install --save @types/unist` + +# Summary +This package contains type definitions for non-npm package Unist ( https://github.com/syntax-tree/unist ). + +# Details +Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/unist + +Additional Details + * Last updated: Thu, 14 Feb 2019 18:10:46 GMT + * Dependencies: none + * Global values: none + +# Credits +These definitions were written by bizen241 , Jun Lu , Hernan Rajchert , Titus Wormer , Junyoung Choi . diff --git a/node_modules/@types/unist/index.d.ts b/node_modules/@types/unist/index.d.ts new file mode 100644 index 0000000..e5e052d --- /dev/null +++ b/node_modules/@types/unist/index.d.ts @@ -0,0 +1,98 @@ +// Type definitions for non-npm package Unist 2.0 +// Project: https://github.com/syntax-tree/unist +// Definitions by: bizen241 +// Jun Lu +// Hernan Rajchert +// Titus Wormer +// Junyoung Choi +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 3.0 + +/** + * Syntactic units in unist syntax trees are called nodes. + */ +export interface Node { + /** + * The variant of a node. + */ + type: string; + + /** + * Information from the ecosystem. + */ + data?: Data; + + /** + * Location of a node in a source document. + * Must not be present if a node is generated. + */ + position?: Position; + + [key: string]: unknown; +} + +/** + * Information associated by the ecosystem with the node. + * Space is guaranteed to never be specified by unist or specifications + * implementing unist. + */ +export interface Data { + [key: string]: unknown; +} + +/** + * Location of a node in a source file. + */ +export interface Position { + /** + * Place of the first character of the parsed source region. + */ + start: Point; + + /** + * Place of the first character after the parsed source region. + */ + end: Point; + + /** + * Start column at each index (plus start line) in the source region, + * for elements that span multiple lines. + */ + indent?: number[]; +} + +/** + * One place in a source file. + */ +export interface Point { + /** + * Line in a source file (1-indexed integer). + */ + line: number; + + /** + * Column in a source file (1-indexed integer). + */ + column: number; + /** + * Character in a source file (0-indexed integer). + */ + offset?: number; +} + +/** + * Nodes containing other nodes. + */ +export interface Parent extends Node { + /** + * List representing the children of a node. + */ + children: Node[]; +} + +/** + * Nodes containing a value. + */ +export interface Literal extends Node { + value: unknown; +} diff --git a/node_modules/@types/unist/package.json b/node_modules/@types/unist/package.json new file mode 100644 index 0000000..79c52a2 --- /dev/null +++ b/node_modules/@types/unist/package.json @@ -0,0 +1,72 @@ +{ + "_from": "@types/unist@^2.0.0", + "_id": "@types/unist@2.0.3", + "_inBundle": false, + "_integrity": "sha512-FvUupuM3rlRsRtCN+fDudtmytGO6iHJuuRKS1Ss0pG5z8oX0diNEw94UEL7hgDbpN94rgaK5R7sWm6RrSkZuAQ==", + "_location": "/@types/unist", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "@types/unist@^2.0.0", + "name": "@types/unist", + "escapedName": "@types%2funist", + "scope": "@types", + "rawSpec": "^2.0.0", + "saveSpec": null, + "fetchSpec": "^2.0.0" + }, + "_requiredBy": [ + "/unist-util-stringify-position", + "/unist-util-visit", + "/unist-util-visit-parents", + "/vfile", + "/vfile-message" + ], + "_resolved": "https://registry.npmjs.org/@types/unist/-/unist-2.0.3.tgz", + "_shasum": "9c088679876f374eb5983f150d4787aa6fb32d7e", + "_spec": "@types/unist@^2.0.0", + "_where": "/Users/josh/Projects/slackify-markdown-action/node_modules/unist-util-visit", + "bugs": { + "url": "https://github.com/DefinitelyTyped/DefinitelyTyped/issues" + }, + "bundleDependencies": false, + "contributors": [ + { + "name": "bizen241", + "url": "https://github.com/bizen241" + }, + { + "name": "Jun Lu", + "url": "https://github.com/lujun2" + }, + { + "name": "Hernan Rajchert", + "url": "https://github.com/hrajchert" + }, + { + "name": "Titus Wormer", + "url": "https://github.com/wooorm" + }, + { + "name": "Junyoung Choi", + "url": "https://github.com/rokt33r" + } + ], + "dependencies": {}, + "deprecated": false, + "description": "TypeScript definitions for non-npm package Unist", + "homepage": "https://github.com/DefinitelyTyped/DefinitelyTyped#readme", + "license": "MIT", + "main": "", + "name": "@types/unist", + "repository": { + "type": "git", + "url": "git+https://github.com/DefinitelyTyped/DefinitelyTyped.git" + }, + "scripts": {}, + "typeScriptVersion": "3.0", + "types": "index", + "typesPublisherContentHash": "555fe20f164ccded02a3f69d8b45c8c9d2ec6fd53844a7c7858a3001c281bc9b", + "version": "2.0.3" +} diff --git a/node_modules/bail/index.js b/node_modules/bail/index.js new file mode 100644 index 0000000..ef5e880 --- /dev/null +++ b/node_modules/bail/index.js @@ -0,0 +1,9 @@ +'use strict' + +module.exports = bail + +function bail(err) { + if (err) { + throw err + } +} diff --git a/node_modules/bail/license b/node_modules/bail/license new file mode 100644 index 0000000..32e7a3d --- /dev/null +++ b/node_modules/bail/license @@ -0,0 +1,22 @@ +(The MIT License) + +Copyright (c) 2015 Titus Wormer + +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: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +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. diff --git a/node_modules/bail/package.json b/node_modules/bail/package.json new file mode 100644 index 0000000..f6549bc --- /dev/null +++ b/node_modules/bail/package.json @@ -0,0 +1,111 @@ +{ + "_from": "bail@^1.0.0", + "_id": "bail@1.0.5", + "_inBundle": false, + "_integrity": "sha512-xFbRxM1tahm08yHBP16MMjVUAvDaBMD38zsM9EMAUN61omwLmKlOpB/Zku5QkjZ8TZ4vn53pj+t518cH0S03RQ==", + "_location": "/bail", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "bail@^1.0.0", + "name": "bail", + "escapedName": "bail", + "rawSpec": "^1.0.0", + "saveSpec": null, + "fetchSpec": "^1.0.0" + }, + "_requiredBy": [ + "/unified" + ], + "_resolved": "https://registry.npmjs.org/bail/-/bail-1.0.5.tgz", + "_shasum": "b6fa133404a392cbc1f8c4bf63f5953351e7a776", + "_spec": "bail@^1.0.0", + "_where": "/Users/josh/Projects/slackify-markdown-action/node_modules/unified", + "author": { + "name": "Titus Wormer", + "email": "tituswormer@gmail.com", + "url": "https://wooorm.com" + }, + "bugs": { + "url": "https://github.com/wooorm/bail/issues" + }, + "bundleDependencies": false, + "contributors": [ + { + "name": "Titus Wormer", + "email": "tituswormer@gmail.com", + "url": "https://wooorm.com" + } + ], + "dependencies": {}, + "deprecated": false, + "description": "Throw a given error", + "devDependencies": { + "browserify": "^16.0.0", + "nyc": "^15.0.0", + "prettier": "^1.0.0", + "remark-cli": "^7.0.0", + "remark-preset-wooorm": "^6.0.0", + "tape": "^4.0.0", + "tinyify": "^2.0.0", + "xo": "^0.25.0" + }, + "files": [ + "index.js" + ], + "funding": { + "type": "github", + "url": "https://github.com/sponsors/wooorm" + }, + "homepage": "https://github.com/wooorm/bail#readme", + "keywords": [ + "fail", + "bail", + "throw", + "callback", + "error" + ], + "license": "MIT", + "name": "bail", + "nyc": { + "check-coverage": true, + "lines": 100, + "functions": 100, + "branches": 100 + }, + "prettier": { + "tabWidth": 2, + "useTabs": false, + "singleQuote": true, + "bracketSpacing": false, + "semi": false, + "trailingComma": "none" + }, + "remarkConfig": { + "plugins": [ + "preset-wooorm" + ] + }, + "repository": { + "type": "git", + "url": "git+https://github.com/wooorm/bail.git" + }, + "scripts": { + "build": "npm run build-bundle && npm run build-mangle", + "build-bundle": "browserify index.js -s bail -o bail.js", + "build-mangle": "browserify index.js -s bail -p tinyify -o bail.min.js", + "format": "remark . -qfo && prettier --write \"**/*.js\" && xo --fix", + "test": "npm run format && npm run build && npm run test-coverage", + "test-api": "node test", + "test-coverage": "nyc --reporter lcov tape test.js" + }, + "version": "1.0.5", + "xo": { + "prettier": true, + "esnext": false, + "ignores": [ + "bail.js" + ] + } +} diff --git a/node_modules/bail/readme.md b/node_modules/bail/readme.md new file mode 100644 index 0000000..8e7b086 --- /dev/null +++ b/node_modules/bail/readme.md @@ -0,0 +1,84 @@ +# bail + +[![Build][build-badge]][build] +[![Coverage][coverage-badge]][coverage] +[![Downloads][downloads-badge]][downloads] +[![Size][size-badge]][size] + +:warning: Throw a given error. + +## Install + +[npm][]: + +```sh +npm install bail +``` + +## Use + +```js +var bail = require('bail') + +bail() + +bail(new Error('failure')) +// Error: failure +// at repl:1:6 +// at REPLServer.defaultEval (repl.js:154:27) +// … +``` + +## API + +### `bail([err])` + +Throw a given error. + +###### Parameters + +* `err` (`Error?`) — Optional error. + +###### Throws + +* `Error` — Given error, if any. + +## Related + +* [`noop`][noop] +* [`noop2`][noop2] +* [`noop3`][noop3] + +## License + +[MIT][license] © [Titus Wormer][author] + + + +[build-badge]: https://img.shields.io/travis/wooorm/bail.svg + +[build]: https://travis-ci.org/wooorm/bail + +[coverage-badge]: https://img.shields.io/codecov/c/github/wooorm/bail.svg + +[coverage]: https://codecov.io/github/wooorm/bail + +[downloads-badge]: https://img.shields.io/npm/dm/bail.svg + +[downloads]: https://www.npmjs.com/package/bail + +[size-badge]: https://img.shields.io/bundlephobia/minzip/bail.svg + +[size]: https://bundlephobia.com/result?p=bail + +[npm]: https://docs.npmjs.com/cli/install + +[license]: license + +[author]: https://wooorm.com + +[noop]: https://www.npmjs.com/package/noop + +[noop2]: https://www.npmjs.com/package/noop2 + +[noop3]: https://www.npmjs.com/package/noop3 diff --git a/node_modules/ccount/index.js b/node_modules/ccount/index.js new file mode 100644 index 0000000..3051998 --- /dev/null +++ b/node_modules/ccount/index.js @@ -0,0 +1,22 @@ +'use strict' + +module.exports = ccount + +function ccount(value, character) { + var val = String(value) + var count = 0 + var index + + if (typeof character !== 'string' || character.length !== 1) { + throw new Error('Expected character') + } + + index = val.indexOf(character) + + while (index !== -1) { + count++ + index = val.indexOf(character, index + 1) + } + + return count +} diff --git a/node_modules/ccount/license b/node_modules/ccount/license new file mode 100644 index 0000000..32e7a3d --- /dev/null +++ b/node_modules/ccount/license @@ -0,0 +1,22 @@ +(The MIT License) + +Copyright (c) 2015 Titus Wormer + +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: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +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. diff --git a/node_modules/ccount/package.json b/node_modules/ccount/package.json new file mode 100644 index 0000000..22c62cc --- /dev/null +++ b/node_modules/ccount/package.json @@ -0,0 +1,110 @@ +{ + "_from": "ccount@^1.0.0", + "_id": "ccount@1.0.5", + "_inBundle": false, + "_integrity": "sha512-MOli1W+nfbPLlKEhInaxhRdp7KVLFxLN5ykwzHgLsLI3H3gs5jjFAK4Eoj3OzzcxCtumDaI8onoVDeQyWaNTkw==", + "_location": "/ccount", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "ccount@^1.0.0", + "name": "ccount", + "escapedName": "ccount", + "rawSpec": "^1.0.0", + "saveSpec": null, + "fetchSpec": "^1.0.0" + }, + "_requiredBy": [ + "/remark-parse", + "/remark-stringify" + ], + "_resolved": "https://registry.npmjs.org/ccount/-/ccount-1.0.5.tgz", + "_shasum": "ac82a944905a65ce204eb03023157edf29425c17", + "_spec": "ccount@^1.0.0", + "_where": "/Users/josh/Projects/slackify-markdown-action/node_modules/remark-parse", + "author": { + "name": "Titus Wormer", + "email": "tituswormer@gmail.com", + "url": "https://wooorm.com" + }, + "bugs": { + "url": "https://github.com/wooorm/ccount/issues" + }, + "bundleDependencies": false, + "contributors": [ + { + "name": "Titus Wormer", + "email": "tituswormer@gmail.com", + "url": "https://wooorm.com" + } + ], + "dependencies": {}, + "deprecated": false, + "description": "Count characters", + "devDependencies": { + "browserify": "^16.0.0", + "nyc": "^15.0.0", + "prettier": "^1.0.0", + "remark-cli": "^7.0.0", + "remark-preset-wooorm": "^6.0.0", + "tape": "^4.0.0", + "tinyify": "^2.0.0", + "xo": "^0.25.0" + }, + "files": [ + "index.js" + ], + "funding": { + "type": "github", + "url": "https://github.com/sponsors/wooorm" + }, + "homepage": "https://github.com/wooorm/ccount#readme", + "keywords": [ + "character", + "count", + "char" + ], + "license": "MIT", + "name": "ccount", + "nyc": { + "check-coverage": true, + "lines": 100, + "functions": 100, + "branches": 100 + }, + "prettier": { + "tabWidth": 2, + "useTabs": false, + "singleQuote": true, + "bracketSpacing": false, + "semi": false, + "trailingComma": "none" + }, + "remarkConfig": { + "plugins": [ + "preset-wooorm" + ] + }, + "repository": { + "type": "git", + "url": "git+https://github.com/wooorm/ccount.git" + }, + "scripts": { + "build": "npm run build-bundle && npm run build-mangle", + "build-bundle": "browserify . -s ccount -o ccount.js", + "build-mangle": "browserify . -s ccount -p tinyify -o ccount.min.js", + "format": "remark . -qfo && prettier --write \"**/*.js\" && xo --fix", + "test": "npm run format && npm run build && npm run test-coverage", + "test-api": "node test", + "test-coverage": "nyc --reporter lcov tape test.js" + }, + "version": "1.0.5", + "xo": { + "prettier": true, + "esnext": false, + "ignores": [ + "ccount.js" + ] + } +} diff --git a/node_modules/ccount/readme.md b/node_modules/ccount/readme.md new file mode 100644 index 0000000..f3e41a9 --- /dev/null +++ b/node_modules/ccount/readme.md @@ -0,0 +1,68 @@ +# ccount + +[![Build][build-badge]][build] +[![Coverage][coverage-badge]][coverage] +[![Downloads][downloads-badge]][downloads] +[![Size][size-badge]][size] + +Count characters. + +## Install + +[npm][]: + +```sh +npm install ccount +``` + +## Use + +```js +var ccount = require('ccount') + +ccount('foo(bar(baz)', '(') // => 2 +ccount('foo(bar(baz)', ')') // => 1 +``` + +## API + +### `ccount(value, character)` + +Get the total count of `character` in `value`. + +###### Parameters + +* `value` (`string`) — Content, coerced to string +* `character` (`string`) — Single character to look for + +###### Returns + +`number` — Number of times `character` occurred in `value`. + +## License + +[MIT][license] © [Titus Wormer][author] + + + +[build-badge]: https://img.shields.io/travis/wooorm/ccount.svg + +[build]: https://travis-ci.org/wooorm/ccount + +[coverage-badge]: https://img.shields.io/codecov/c/github/wooorm/ccount.svg + +[coverage]: https://codecov.io/github/wooorm/ccount + +[downloads-badge]: https://img.shields.io/npm/dm/ccount.svg + +[downloads]: https://www.npmjs.com/package/ccount + +[size-badge]: https://img.shields.io/bundlephobia/minzip/ccount.svg + +[size]: https://bundlephobia.com/result?p=ccount + +[npm]: https://docs.npmjs.com/cli/install + +[license]: license + +[author]: https://wooorm.com diff --git a/node_modules/character-entities-html4/index.json b/node_modules/character-entities-html4/index.json new file mode 100644 index 0000000..fa0d7bc --- /dev/null +++ b/node_modules/character-entities-html4/index.json @@ -0,0 +1,254 @@ +{ + "nbsp": " ", + "iexcl": "¡", + "cent": "¢", + "pound": "£", + "curren": "¤", + "yen": "¥", + "brvbar": "¦", + "sect": "§", + "uml": "¨", + "copy": "©", + "ordf": "ª", + "laquo": "«", + "not": "¬", + "shy": "­", + "reg": "®", + "macr": "¯", + "deg": "°", + "plusmn": "±", + "sup2": "²", + "sup3": "³", + "acute": "´", + "micro": "µ", + "para": "¶", + "middot": "·", + "cedil": "¸", + "sup1": "¹", + "ordm": "º", + "raquo": "»", + "frac14": "¼", + "frac12": "½", + "frac34": "¾", + "iquest": "¿", + "Agrave": "À", + "Aacute": "Á", + "Acirc": "Â", + "Atilde": "Ã", + "Auml": "Ä", + "Aring": "Å", + "AElig": "Æ", + "Ccedil": "Ç", + "Egrave": "È", + "Eacute": "É", + "Ecirc": "Ê", + "Euml": "Ë", + "Igrave": "Ì", + "Iacute": "Í", + "Icirc": "Î", + "Iuml": "Ï", + "ETH": "Ð", + "Ntilde": "Ñ", + "Ograve": "Ò", + "Oacute": "Ó", + "Ocirc": "Ô", + "Otilde": "Õ", + "Ouml": "Ö", + "times": "×", + "Oslash": "Ø", + "Ugrave": "Ù", + "Uacute": "Ú", + "Ucirc": "Û", + "Uuml": "Ü", + "Yacute": "Ý", + "THORN": "Þ", + "szlig": "ß", + "agrave": "à", + "aacute": "á", + "acirc": "â", + "atilde": "ã", + "auml": "ä", + "aring": "å", + "aelig": "æ", + "ccedil": "ç", + "egrave": "è", + "eacute": "é", + "ecirc": "ê", + "euml": "ë", + "igrave": "ì", + "iacute": "í", + "icirc": "î", + "iuml": "ï", + "eth": "ð", + "ntilde": "ñ", + "ograve": "ò", + "oacute": "ó", + "ocirc": "ô", + "otilde": "õ", + "ouml": "ö", + "divide": "÷", + "oslash": "ø", + "ugrave": "ù", + "uacute": "ú", + "ucirc": "û", + "uuml": "ü", + "yacute": "ý", + "thorn": "þ", + "yuml": "ÿ", + "fnof": "ƒ", + "Alpha": "Α", + "Beta": "Β", + "Gamma": "Γ", + "Delta": "Δ", + "Epsilon": "Ε", + "Zeta": "Ζ", + "Eta": "Η", + "Theta": "Θ", + "Iota": "Ι", + "Kappa": "Κ", + "Lambda": "Λ", + "Mu": "Μ", + "Nu": "Ν", + "Xi": "Ξ", + "Omicron": "Ο", + "Pi": "Π", + "Rho": "Ρ", + "Sigma": "Σ", + "Tau": "Τ", + "Upsilon": "Υ", + "Phi": "Φ", + "Chi": "Χ", + "Psi": "Ψ", + "Omega": "Ω", + "alpha": "α", + "beta": "β", + "gamma": "γ", + "delta": "δ", + "epsilon": "ε", + "zeta": "ζ", + "eta": "η", + "theta": "θ", + "iota": "ι", + "kappa": "κ", + "lambda": "λ", + "mu": "μ", + "nu": "ν", + "xi": "ξ", + "omicron": "ο", + "pi": "π", + "rho": "ρ", + "sigmaf": "ς", + "sigma": "σ", + "tau": "τ", + "upsilon": "υ", + "phi": "φ", + "chi": "χ", + "psi": "ψ", + "omega": "ω", + "thetasym": "ϑ", + "upsih": "ϒ", + "piv": "ϖ", + "bull": "•", + "hellip": "…", + "prime": "′", + "Prime": "″", + "oline": "‾", + "frasl": "⁄", + "weierp": "℘", + "image": "ℑ", + "real": "ℜ", + "trade": "™", + "alefsym": "ℵ", + "larr": "←", + "uarr": "↑", + "rarr": "→", + "darr": "↓", + "harr": "↔", + "crarr": "↵", + "lArr": "⇐", + "uArr": "⇑", + "rArr": "⇒", + "dArr": "⇓", + "hArr": "⇔", + "forall": "∀", + "part": "∂", + "exist": "∃", + "empty": "∅", + "nabla": "∇", + "isin": "∈", + "notin": "∉", + "ni": "∋", + "prod": "∏", + "sum": "∑", + "minus": "−", + "lowast": "∗", + "radic": "√", + "prop": "∝", + "infin": "∞", + "ang": "∠", + "and": "∧", + "or": "∨", + "cap": "∩", + "cup": "∪", + "int": "∫", + "there4": "∴", + "sim": "∼", + "cong": "≅", + "asymp": "≈", + "ne": "≠", + "equiv": "≡", + "le": "≤", + "ge": "≥", + "sub": "⊂", + "sup": "⊃", + "nsub": "⊄", + "sube": "⊆", + "supe": "⊇", + "oplus": "⊕", + "otimes": "⊗", + "perp": "⊥", + "sdot": "⋅", + "lceil": "⌈", + "rceil": "⌉", + "lfloor": "⌊", + "rfloor": "⌋", + "lang": "〈", + "rang": "〉", + "loz": "◊", + "spades": "♠", + "clubs": "♣", + "hearts": "♥", + "diams": "♦", + "quot": "\"", + "amp": "&", + "lt": "<", + "gt": ">", + "OElig": "Œ", + "oelig": "œ", + "Scaron": "Š", + "scaron": "š", + "Yuml": "Ÿ", + "circ": "ˆ", + "tilde": "˜", + "ensp": " ", + "emsp": " ", + "thinsp": " ", + "zwnj": "‌", + "zwj": "‍", + "lrm": "‎", + "rlm": "‏", + "ndash": "–", + "mdash": "—", + "lsquo": "‘", + "rsquo": "’", + "sbquo": "‚", + "ldquo": "“", + "rdquo": "”", + "bdquo": "„", + "dagger": "†", + "Dagger": "‡", + "permil": "‰", + "lsaquo": "‹", + "rsaquo": "›", + "euro": "€" +} diff --git a/node_modules/character-entities-html4/license b/node_modules/character-entities-html4/license new file mode 100644 index 0000000..32e7a3d --- /dev/null +++ b/node_modules/character-entities-html4/license @@ -0,0 +1,22 @@ +(The MIT License) + +Copyright (c) 2015 Titus Wormer + +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: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +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. diff --git a/node_modules/character-entities-html4/package.json b/node_modules/character-entities-html4/package.json new file mode 100644 index 0000000..310ba22 --- /dev/null +++ b/node_modules/character-entities-html4/package.json @@ -0,0 +1,110 @@ +{ + "_from": "character-entities-html4@^1.0.0", + "_id": "character-entities-html4@1.1.4", + "_inBundle": false, + "_integrity": "sha512-HRcDxZuZqMx3/a+qrzxdBKBPUpxWEq9xw2OPZ3a/174ihfrQKVsFhqtthBInFy1zZ9GgZyFXOatNujm8M+El3g==", + "_location": "/character-entities-html4", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "character-entities-html4@^1.0.0", + "name": "character-entities-html4", + "escapedName": "character-entities-html4", + "rawSpec": "^1.0.0", + "saveSpec": null, + "fetchSpec": "^1.0.0" + }, + "_requiredBy": [ + "/stringify-entities" + ], + "_resolved": "https://registry.npmjs.org/character-entities-html4/-/character-entities-html4-1.1.4.tgz", + "_shasum": "0e64b0a3753ddbf1fdc044c5fd01d0199a02e125", + "_spec": "character-entities-html4@^1.0.0", + "_where": "/Users/josh/Projects/slackify-markdown-action/node_modules/stringify-entities", + "author": { + "name": "Titus Wormer", + "email": "tituswormer@gmail.com", + "url": "https://wooorm.com" + }, + "bugs": { + "url": "https://github.com/wooorm/character-entities-html4/issues" + }, + "bundleDependencies": false, + "contributors": [ + { + "name": "Titus Wormer", + "email": "tituswormer@gmail.com", + "url": "https://wooorm.com" + } + ], + "dependencies": {}, + "deprecated": false, + "description": "HTML4 character entity information", + "devDependencies": { + "bail": "^1.0.1", + "browserify": "^16.0.0", + "concat-stream": "^2.0.0", + "prettier": "^1.0.0", + "remark-cli": "^7.0.0", + "remark-preset-wooorm": "^6.0.0", + "tape": "^4.0.0", + "tinyify": "^2.0.0", + "xo": "^0.25.0" + }, + "files": [ + "index.json" + ], + "funding": { + "type": "github", + "url": "https://github.com/sponsors/wooorm" + }, + "homepage": "https://github.com/wooorm/character-entities-html4#readme", + "keywords": [ + "html", + "html4", + "entity", + "entities", + "character", + "reference", + "name", + "replacement" + ], + "license": "MIT", + "main": "index.json", + "name": "character-entities-html4", + "prettier": { + "tabWidth": 2, + "useTabs": false, + "singleQuote": true, + "bracketSpacing": false, + "semi": false, + "trailingComma": "none" + }, + "remarkConfig": { + "plugins": [ + "preset-wooorm" + ] + }, + "repository": { + "type": "git", + "url": "git+https://github.com/wooorm/character-entities-html4.git" + }, + "scripts": { + "build": "npm run build-bundle && npm run build-mangle", + "build-bundle": "browserify index.json -s characterEntitiesHTML4 -o character-entities-html4.js", + "build-mangle": "browserify index.json -s characterEntitiesHTML4 -p tinyify -o character-entities-html4.js", + "format": "remark . -qfo && prettier --write \"**/*.js\" && xo --fix", + "generate": "node build", + "test": "npm run generate && npm run format && npm run build && npm run test-api", + "test-api": "node test" + }, + "version": "1.1.4", + "xo": { + "prettier": true, + "esnext": false, + "ignores": [ + "character-entities-html4.js" + ] + } +} diff --git a/node_modules/character-entities-html4/readme.md b/node_modules/character-entities-html4/readme.md new file mode 100644 index 0000000..85b0bba --- /dev/null +++ b/node_modules/character-entities-html4/readme.md @@ -0,0 +1,73 @@ +# character-entities-html4 + +[![Build][build-badge]][build] +[![Downloads][downloads-badge]][downloads] +[![Size][size-badge]][size] + +HTML4 character entity information. + +## Install + +[npm][]: + +```sh +npm install character-entities-html4 +``` + +## Use + +```js +var characterEntities = require('character-entities-html4') + +console.log(characterEntities.AElig) // => 'Æ' +console.log(characterEntities.aelig) // => 'æ' +console.log(characterEntities.amp) // => '&' +console.log(characterEntities.apos) // => undefined +``` + +## API + +### `characterEntitiesHTML4` + +Mapping between (case-sensitive) character entity names to replacements. + +## Support + +See [`w3.org`][html]. + +## Related + +* [`character-entities`](https://github.com/wooorm/character-entities) + — HTML character entity info +* [`character-entities-legacy`](https://github.com/wooorm/character-entities-legacy) + — Legacy character entity info +* [`parse-entities`](https://github.com/wooorm/parse-entities) + — Parse HTML character references +* [`stringify-entities`](https://github.com/wooorm/stringify-entities) + — Stringify HTML character references + +## License + +[MIT][license] © [Titus Wormer][author] + + + +[build-badge]: https://img.shields.io/travis/wooorm/character-entities-html4.svg + +[build]: https://travis-ci.org/wooorm/character-entities-html4 + +[downloads-badge]: https://img.shields.io/npm/dm/character-entities-html4.svg + +[downloads]: https://www.npmjs.com/package/character-entities-html4 + +[size-badge]: https://img.shields.io/bundlephobia/minzip/character-entities-html4.svg + +[size]: https://bundlephobia.com/result?p=character-entities-html4 + +[npm]: https://docs.npmjs.com/cli/install + +[license]: license + +[author]: https://wooorm.com + +[html]: https://www.w3.org/TR/html4/sgml/entities.html diff --git a/node_modules/character-entities-legacy/index.json b/node_modules/character-entities-legacy/index.json new file mode 100644 index 0000000..d83b752 --- /dev/null +++ b/node_modules/character-entities-legacy/index.json @@ -0,0 +1,108 @@ +{ + "AElig": "Æ", + "AMP": "&", + "Aacute": "Á", + "Acirc": "Â", + "Agrave": "À", + "Aring": "Å", + "Atilde": "Ã", + "Auml": "Ä", + "COPY": "©", + "Ccedil": "Ç", + "ETH": "Ð", + "Eacute": "É", + "Ecirc": "Ê", + "Egrave": "È", + "Euml": "Ë", + "GT": ">", + "Iacute": "Í", + "Icirc": "Î", + "Igrave": "Ì", + "Iuml": "Ï", + "LT": "<", + "Ntilde": "Ñ", + "Oacute": "Ó", + "Ocirc": "Ô", + "Ograve": "Ò", + "Oslash": "Ø", + "Otilde": "Õ", + "Ouml": "Ö", + "QUOT": "\"", + "REG": "®", + "THORN": "Þ", + "Uacute": "Ú", + "Ucirc": "Û", + "Ugrave": "Ù", + "Uuml": "Ü", + "Yacute": "Ý", + "aacute": "á", + "acirc": "â", + "acute": "´", + "aelig": "æ", + "agrave": "à", + "amp": "&", + "aring": "å", + "atilde": "ã", + "auml": "ä", + "brvbar": "¦", + "ccedil": "ç", + "cedil": "¸", + "cent": "¢", + "copy": "©", + "curren": "¤", + "deg": "°", + "divide": "÷", + "eacute": "é", + "ecirc": "ê", + "egrave": "è", + "eth": "ð", + "euml": "ë", + "frac12": "½", + "frac14": "¼", + "frac34": "¾", + "gt": ">", + "iacute": "í", + "icirc": "î", + "iexcl": "¡", + "igrave": "ì", + "iquest": "¿", + "iuml": "ï", + "laquo": "«", + "lt": "<", + "macr": "¯", + "micro": "µ", + "middot": "·", + "nbsp": " ", + "not": "¬", + "ntilde": "ñ", + "oacute": "ó", + "ocirc": "ô", + "ograve": "ò", + "ordf": "ª", + "ordm": "º", + "oslash": "ø", + "otilde": "õ", + "ouml": "ö", + "para": "¶", + "plusmn": "±", + "pound": "£", + "quot": "\"", + "raquo": "»", + "reg": "®", + "sect": "§", + "shy": "­", + "sup1": "¹", + "sup2": "²", + "sup3": "³", + "szlig": "ß", + "thorn": "þ", + "times": "×", + "uacute": "ú", + "ucirc": "û", + "ugrave": "ù", + "uml": "¨", + "uuml": "ü", + "yacute": "ý", + "yen": "¥", + "yuml": "ÿ" +} diff --git a/node_modules/character-entities-legacy/license b/node_modules/character-entities-legacy/license new file mode 100644 index 0000000..32e7a3d --- /dev/null +++ b/node_modules/character-entities-legacy/license @@ -0,0 +1,22 @@ +(The MIT License) + +Copyright (c) 2015 Titus Wormer + +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: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +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. diff --git a/node_modules/character-entities-legacy/package.json b/node_modules/character-entities-legacy/package.json new file mode 100644 index 0000000..5510d0d --- /dev/null +++ b/node_modules/character-entities-legacy/package.json @@ -0,0 +1,110 @@ +{ + "_from": "character-entities-legacy@^1.0.0", + "_id": "character-entities-legacy@1.1.4", + "_inBundle": false, + "_integrity": "sha512-3Xnr+7ZFS1uxeiUDvV02wQ+QDbc55o97tIV5zHScSPJpcLm/r0DFPcoY3tYRp+VZukxuMeKgXYmsXQHO05zQeA==", + "_location": "/character-entities-legacy", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "character-entities-legacy@^1.0.0", + "name": "character-entities-legacy", + "escapedName": "character-entities-legacy", + "rawSpec": "^1.0.0", + "saveSpec": null, + "fetchSpec": "^1.0.0" + }, + "_requiredBy": [ + "/parse-entities", + "/stringify-entities" + ], + "_resolved": "https://registry.npmjs.org/character-entities-legacy/-/character-entities-legacy-1.1.4.tgz", + "_shasum": "94bc1845dce70a5bb9d2ecc748725661293d8fc1", + "_spec": "character-entities-legacy@^1.0.0", + "_where": "/Users/josh/Projects/slackify-markdown-action/node_modules/parse-entities", + "author": { + "name": "Titus Wormer", + "email": "tituswormer@gmail.com", + "url": "https://wooorm.com" + }, + "bugs": { + "url": "https://github.com/wooorm/character-entities-legacy/issues" + }, + "bundleDependencies": false, + "contributors": [ + { + "name": "Titus Wormer", + "email": "tituswormer@gmail.com", + "url": "https://wooorm.com" + } + ], + "dependencies": {}, + "deprecated": false, + "description": "HTML legacy character entity information", + "devDependencies": { + "bail": "^1.0.0", + "browserify": "^16.0.0", + "concat-stream": "^2.0.0", + "prettier": "^1.0.0", + "remark-cli": "^7.0.0", + "remark-preset-wooorm": "^6.0.0", + "tape": "^4.0.0", + "tinyify": "^2.0.0", + "xo": "^0.25.0" + }, + "files": [ + "index.json" + ], + "funding": { + "type": "github", + "url": "https://github.com/sponsors/wooorm" + }, + "homepage": "https://github.com/wooorm/character-entities-legacy#readme", + "keywords": [ + "html", + "entity", + "entities", + "character", + "reference", + "name", + "replacement" + ], + "license": "MIT", + "main": "index.json", + "name": "character-entities-legacy", + "prettier": { + "tabWidth": 2, + "useTabs": false, + "singleQuote": true, + "bracketSpacing": false, + "semi": false, + "trailingComma": "none" + }, + "remarkConfig": { + "plugins": [ + "preset-wooorm" + ] + }, + "repository": { + "type": "git", + "url": "git+https://github.com/wooorm/character-entities-legacy.git" + }, + "scripts": { + "build": "npm run build-bundle && npm run build-mangle", + "build-bundle": "browserify index.json -s characterEntitiesLegacy -o character-entities-legacy.js", + "build-mangle": "browserify index.json -s characterEntitiesLegacy -p tinyify -o character-entities-legacy.min.js", + "format": "remark . -qfo && prettier --write \"**/*.js\" && xo --fix", + "generate": "node build", + "test": "npm run generate && npm run format && npm run build && npm run test-api", + "test-api": "node test" + }, + "version": "1.1.4", + "xo": { + "prettier": true, + "esnext": false, + "ignores": [ + "character-entities-legacy.js" + ] + } +} diff --git a/node_modules/character-entities-legacy/readme.md b/node_modules/character-entities-legacy/readme.md new file mode 100644 index 0000000..711a090 --- /dev/null +++ b/node_modules/character-entities-legacy/readme.md @@ -0,0 +1,74 @@ +# character-entities-legacy + +[![Build][build-badge]][build] +[![Downloads][downloads-badge]][downloads] +[![Size][size-badge]][size] + +HTML legacy character entity information: for legacy reasons some character +entities are not required to have a trailing semicolon: `©` is perfectly +okay for `©`. + +## Install + +[npm][]: + +```sh +npm install character-entities-legacy +``` + +## Use + +```js +var characterEntitiesLegacy = require('character-entities-legacy') + +console.log(characterEntitiesLegacy.copy) // => '©' +console.log(characterEntitiesLegacy.frac34) // => '¾' +console.log(characterEntitiesLegacy.sup1) // => '¹' +``` + +## API + +### `characterEntitiesLegacy` + +Mapping between (case-sensitive) legacy character entity names to replacements. + +## Support + +See [`whatwg/html`][html]. + +## Related + +* [`character-entities`](https://github.com/wooorm/character-entities) + — HTML character entity info +* [`character-entities-html4`](https://github.com/wooorm/character-entities-html4) + — HTML 4 character entity info +* [`parse-entities`](https://github.com/wooorm/parse-entities) + — Parse HTML character references +* [`stringify-entities`](https://github.com/wooorm/stringify-entities) + — Serialize HTML character references + +## License + +[MIT][license] © [Titus Wormer][author] + + + +[build-badge]: https://img.shields.io/travis/wooorm/character-entities-legacy.svg + +[build]: https://travis-ci.org/wooorm/character-entities-legacy + +[downloads-badge]: https://img.shields.io/npm/dm/character-entities-legacy.svg + +[downloads]: https://www.npmjs.com/package/character-entities-legacy + +[size-badge]: https://img.shields.io/bundlephobia/minzip/character-entities-legacy.svg + +[size]: https://bundlephobia.com/result?p=character-entities-legacy + +[npm]: https://docs.npmjs.com/cli/install + +[license]: license + +[author]: https://wooorm.com + +[html]: https://raw.githubusercontent.com/whatwg/html/master/json-entities-legacy.inc diff --git a/node_modules/character-entities/index.json b/node_modules/character-entities/index.json new file mode 100644 index 0000000..a63babe --- /dev/null +++ b/node_modules/character-entities/index.json @@ -0,0 +1,2224 @@ +{ + "AEli": "Æ", + "AElig": "Æ", + "AM": "&", + "AMP": "&", + "Aacut": "Á", + "Aacute": "Á", + "Abreve": "Ă", + "Acir": "Â", + "Acirc": "Â", + "Acy": "А", + "Afr": "𝔄", + "Agrav": "À", + "Agrave": "À", + "Alpha": "Α", + "Amacr": "Ā", + "And": "⩓", + "Aogon": "Ą", + "Aopf": "𝔸", + "ApplyFunction": "⁡", + "Arin": "Å", + "Aring": "Å", + "Ascr": "𝒜", + "Assign": "≔", + "Atild": "Ã", + "Atilde": "Ã", + "Aum": "Ä", + "Auml": "Ä", + "Backslash": "∖", + "Barv": "⫧", + "Barwed": "⌆", + "Bcy": "Б", + "Because": "∵", + "Bernoullis": "ℬ", + "Beta": "Β", + "Bfr": "𝔅", + "Bopf": "𝔹", + "Breve": "˘", + "Bscr": "ℬ", + "Bumpeq": "≎", + "CHcy": "Ч", + "COP": "©", + "COPY": "©", + "Cacute": "Ć", + "Cap": "⋒", + "CapitalDifferentialD": "ⅅ", + "Cayleys": "ℭ", + "Ccaron": "Č", + "Ccedi": "Ç", + "Ccedil": "Ç", + "Ccirc": "Ĉ", + "Cconint": "∰", + "Cdot": "Ċ", + "Cedilla": "¸", + "CenterDot": "·", + "Cfr": "ℭ", + "Chi": "Χ", + "CircleDot": "⊙", + "CircleMinus": "⊖", + "CirclePlus": "⊕", + "CircleTimes": "⊗", + "ClockwiseContourIntegral": "∲", + "CloseCurlyDoubleQuote": "”", + "CloseCurlyQuote": "’", + "Colon": "∷", + "Colone": "⩴", + "Congruent": "≡", + "Conint": "∯", + "ContourIntegral": "∮", + "Copf": "ℂ", + "Coproduct": "∐", + "CounterClockwiseContourIntegral": "∳", + "Cross": "⨯", + "Cscr": "𝒞", + "Cup": "⋓", + "CupCap": "≍", + "DD": "ⅅ", + "DDotrahd": "⤑", + "DJcy": "Ђ", + "DScy": "Ѕ", + "DZcy": "Џ", + "Dagger": "‡", + "Darr": "↡", + "Dashv": "⫤", + "Dcaron": "Ď", + "Dcy": "Д", + "Del": "∇", + "Delta": "Δ", + "Dfr": "𝔇", + "DiacriticalAcute": "´", + "DiacriticalDot": "˙", + "DiacriticalDoubleAcute": "˝", + "DiacriticalGrave": "`", + "DiacriticalTilde": "˜", + "Diamond": "⋄", + "DifferentialD": "ⅆ", + "Dopf": "𝔻", + "Dot": "¨", + "DotDot": "⃜", + "DotEqual": "≐", + "DoubleContourIntegral": "∯", + "DoubleDot": "¨", + "DoubleDownArrow": "⇓", + "DoubleLeftArrow": "⇐", + "DoubleLeftRightArrow": "⇔", + "DoubleLeftTee": "⫤", + "DoubleLongLeftArrow": "⟸", + "DoubleLongLeftRightArrow": "⟺", + "DoubleLongRightArrow": "⟹", + "DoubleRightArrow": "⇒", + "DoubleRightTee": "⊨", + "DoubleUpArrow": "⇑", + "DoubleUpDownArrow": "⇕", + "DoubleVerticalBar": "∥", + "DownArrow": "↓", + "DownArrowBar": "⤓", + "DownArrowUpArrow": "⇵", + "DownBreve": "̑", + "DownLeftRightVector": "⥐", + "DownLeftTeeVector": "⥞", + "DownLeftVector": "↽", + "DownLeftVectorBar": "⥖", + "DownRightTeeVector": "⥟", + "DownRightVector": "⇁", + "DownRightVectorBar": "⥗", + "DownTee": "⊤", + "DownTeeArrow": "↧", + "Downarrow": "⇓", + "Dscr": "𝒟", + "Dstrok": "Đ", + "ENG": "Ŋ", + "ET": "Ð", + "ETH": "Ð", + "Eacut": "É", + "Eacute": "É", + "Ecaron": "Ě", + "Ecir": "Ê", + "Ecirc": "Ê", + "Ecy": "Э", + "Edot": "Ė", + "Efr": "𝔈", + "Egrav": "È", + "Egrave": "È", + "Element": "∈", + "Emacr": "Ē", + "EmptySmallSquare": "◻", + "EmptyVerySmallSquare": "▫", + "Eogon": "Ę", + "Eopf": "𝔼", + "Epsilon": "Ε", + "Equal": "⩵", + "EqualTilde": "≂", + "Equilibrium": "⇌", + "Escr": "ℰ", + "Esim": "⩳", + "Eta": "Η", + "Eum": "Ë", + "Euml": "Ë", + "Exists": "∃", + "ExponentialE": "ⅇ", + "Fcy": "Ф", + "Ffr": "𝔉", + "FilledSmallSquare": "◼", + "FilledVerySmallSquare": "▪", + "Fopf": "𝔽", + "ForAll": "∀", + "Fouriertrf": "ℱ", + "Fscr": "ℱ", + "GJcy": "Ѓ", + "G": ">", + "GT": ">", + "Gamma": "Γ", + "Gammad": "Ϝ", + "Gbreve": "Ğ", + "Gcedil": "Ģ", + "Gcirc": "Ĝ", + "Gcy": "Г", + "Gdot": "Ġ", + "Gfr": "𝔊", + "Gg": "⋙", + "Gopf": "𝔾", + "GreaterEqual": "≥", + "GreaterEqualLess": "⋛", + "GreaterFullEqual": "≧", + "GreaterGreater": "⪢", + "GreaterLess": "≷", + "GreaterSlantEqual": "⩾", + "GreaterTilde": "≳", + "Gscr": "𝒢", + "Gt": "≫", + "HARDcy": "Ъ", + "Hacek": "ˇ", + "Hat": "^", + "Hcirc": "Ĥ", + "Hfr": "ℌ", + "HilbertSpace": "ℋ", + "Hopf": "ℍ", + "HorizontalLine": "─", + "Hscr": "ℋ", + "Hstrok": "Ħ", + "HumpDownHump": "≎", + "HumpEqual": "≏", + "IEcy": "Е", + "IJlig": "IJ", + "IOcy": "Ё", + "Iacut": "Í", + "Iacute": "Í", + "Icir": "Î", + "Icirc": "Î", + "Icy": "И", + "Idot": "İ", + "Ifr": "ℑ", + "Igrav": "Ì", + "Igrave": "Ì", + "Im": "ℑ", + "Imacr": "Ī", + "ImaginaryI": "ⅈ", + "Implies": "⇒", + "Int": "∬", + "Integral": "∫", + "Intersection": "⋂", + "InvisibleComma": "⁣", + "InvisibleTimes": "⁢", + "Iogon": "Į", + "Iopf": "𝕀", + "Iota": "Ι", + "Iscr": "ℐ", + "Itilde": "Ĩ", + "Iukcy": "І", + "Ium": "Ï", + "Iuml": "Ï", + "Jcirc": "Ĵ", + "Jcy": "Й", + "Jfr": "𝔍", + "Jopf": "𝕁", + "Jscr": "𝒥", + "Jsercy": "Ј", + "Jukcy": "Є", + "KHcy": "Х", + "KJcy": "Ќ", + "Kappa": "Κ", + "Kcedil": "Ķ", + "Kcy": "К", + "Kfr": "𝔎", + "Kopf": "𝕂", + "Kscr": "𝒦", + "LJcy": "Љ", + "L": "<", + "LT": "<", + "Lacute": "Ĺ", + "Lambda": "Λ", + "Lang": "⟪", + "Laplacetrf": "ℒ", + "Larr": "↞", + "Lcaron": "Ľ", + "Lcedil": "Ļ", + "Lcy": "Л", + "LeftAngleBracket": "⟨", + "LeftArrow": "←", + "LeftArrowBar": "⇤", + "LeftArrowRightArrow": "⇆", + "LeftCeiling": "⌈", + "LeftDoubleBracket": "⟦", + "LeftDownTeeVector": "⥡", + "LeftDownVector": "⇃", + "LeftDownVectorBar": "⥙", + "LeftFloor": "⌊", + "LeftRightArrow": "↔", + "LeftRightVector": "⥎", + "LeftTee": "⊣", + "LeftTeeArrow": "↤", + "LeftTeeVector": "⥚", + "LeftTriangle": "⊲", + "LeftTriangleBar": "⧏", + "LeftTriangleEqual": "⊴", + "LeftUpDownVector": "⥑", + "LeftUpTeeVector": "⥠", + "LeftUpVector": "↿", + "LeftUpVectorBar": "⥘", + "LeftVector": "↼", + "LeftVectorBar": "⥒", + "Leftarrow": "⇐", + "Leftrightarrow": "⇔", + "LessEqualGreater": "⋚", + "LessFullEqual": "≦", + "LessGreater": "≶", + "LessLess": "⪡", + "LessSlantEqual": "⩽", + "LessTilde": "≲", + "Lfr": "𝔏", + "Ll": "⋘", + "Lleftarrow": "⇚", + "Lmidot": "Ŀ", + "LongLeftArrow": "⟵", + "LongLeftRightArrow": "⟷", + "LongRightArrow": "⟶", + "Longleftarrow": "⟸", + "Longleftrightarrow": "⟺", + "Longrightarrow": "⟹", + "Lopf": "𝕃", + "LowerLeftArrow": "↙", + "LowerRightArrow": "↘", + "Lscr": "ℒ", + "Lsh": "↰", + "Lstrok": "Ł", + "Lt": "≪", + "Map": "⤅", + "Mcy": "М", + "MediumSpace": " ", + "Mellintrf": "ℳ", + "Mfr": "𝔐", + "MinusPlus": "∓", + "Mopf": "𝕄", + "Mscr": "ℳ", + "Mu": "Μ", + "NJcy": "Њ", + "Nacute": "Ń", + "Ncaron": "Ň", + "Ncedil": "Ņ", + "Ncy": "Н", + "NegativeMediumSpace": "​", + "NegativeThickSpace": "​", + "NegativeThinSpace": "​", + "NegativeVeryThinSpace": "​", + "NestedGreaterGreater": "≫", + "NestedLessLess": "≪", + "NewLine": "\n", + "Nfr": "𝔑", + "NoBreak": "⁠", + "NonBreakingSpace": " ", + "Nopf": "ℕ", + "Not": "⫬", + "NotCongruent": "≢", + "NotCupCap": "≭", + "NotDoubleVerticalBar": "∦", + "NotElement": "∉", + "NotEqual": "≠", + "NotEqualTilde": "≂̸", + "NotExists": "∄", + "NotGreater": "≯", + "NotGreaterEqual": "≱", + "NotGreaterFullEqual": "≧̸", + "NotGreaterGreater": "≫̸", + "NotGreaterLess": "≹", + "NotGreaterSlantEqual": "⩾̸", + "NotGreaterTilde": "≵", + "NotHumpDownHump": "≎̸", + "NotHumpEqual": "≏̸", + "NotLeftTriangle": "⋪", + "NotLeftTriangleBar": "⧏̸", + "NotLeftTriangleEqual": "⋬", + "NotLess": "≮", + "NotLessEqual": "≰", + "NotLessGreater": "≸", + "NotLessLess": "≪̸", + "NotLessSlantEqual": "⩽̸", + "NotLessTilde": "≴", + "NotNestedGreaterGreater": "⪢̸", + "NotNestedLessLess": "⪡̸", + "NotPrecedes": "⊀", + "NotPrecedesEqual": "⪯̸", + "NotPrecedesSlantEqual": "⋠", + "NotReverseElement": "∌", + "NotRightTriangle": "⋫", + "NotRightTriangleBar": "⧐̸", + "NotRightTriangleEqual": "⋭", + "NotSquareSubset": "⊏̸", + "NotSquareSubsetEqual": "⋢", + "NotSquareSuperset": "⊐̸", + "NotSquareSupersetEqual": "⋣", + "NotSubset": "⊂⃒", + "NotSubsetEqual": "⊈", + "NotSucceeds": "⊁", + "NotSucceedsEqual": "⪰̸", + "NotSucceedsSlantEqual": "⋡", + "NotSucceedsTilde": "≿̸", + "NotSuperset": "⊃⃒", + "NotSupersetEqual": "⊉", + "NotTilde": "≁", + "NotTildeEqual": "≄", + "NotTildeFullEqual": "≇", + "NotTildeTilde": "≉", + "NotVerticalBar": "∤", + "Nscr": "𝒩", + "Ntild": "Ñ", + "Ntilde": "Ñ", + "Nu": "Ν", + "OElig": "Œ", + "Oacut": "Ó", + "Oacute": "Ó", + "Ocir": "Ô", + "Ocirc": "Ô", + "Ocy": "О", + "Odblac": "Ő", + "Ofr": "𝔒", + "Ograv": "Ò", + "Ograve": "Ò", + "Omacr": "Ō", + "Omega": "Ω", + "Omicron": "Ο", + "Oopf": "𝕆", + "OpenCurlyDoubleQuote": "“", + "OpenCurlyQuote": "‘", + "Or": "⩔", + "Oscr": "𝒪", + "Oslas": "Ø", + "Oslash": "Ø", + "Otild": "Õ", + "Otilde": "Õ", + "Otimes": "⨷", + "Oum": "Ö", + "Ouml": "Ö", + "OverBar": "‾", + "OverBrace": "⏞", + "OverBracket": "⎴", + "OverParenthesis": "⏜", + "PartialD": "∂", + "Pcy": "П", + "Pfr": "𝔓", + "Phi": "Φ", + "Pi": "Π", + "PlusMinus": "±", + "Poincareplane": "ℌ", + "Popf": "ℙ", + "Pr": "⪻", + "Precedes": "≺", + "PrecedesEqual": "⪯", + "PrecedesSlantEqual": "≼", + "PrecedesTilde": "≾", + "Prime": "″", + "Product": "∏", + "Proportion": "∷", + "Proportional": "∝", + "Pscr": "𝒫", + "Psi": "Ψ", + "QUO": "\"", + "QUOT": "\"", + "Qfr": "𝔔", + "Qopf": "ℚ", + "Qscr": "𝒬", + "RBarr": "⤐", + "RE": "®", + "REG": "®", + "Racute": "Ŕ", + "Rang": "⟫", + "Rarr": "↠", + "Rarrtl": "⤖", + "Rcaron": "Ř", + "Rcedil": "Ŗ", + "Rcy": "Р", + "Re": "ℜ", + "ReverseElement": "∋", + "ReverseEquilibrium": "⇋", + "ReverseUpEquilibrium": "⥯", + "Rfr": "ℜ", + "Rho": "Ρ", + "RightAngleBracket": "⟩", + "RightArrow": "→", + "RightArrowBar": "⇥", + "RightArrowLeftArrow": "⇄", + "RightCeiling": "⌉", + "RightDoubleBracket": "⟧", + "RightDownTeeVector": "⥝", + "RightDownVector": "⇂", + "RightDownVectorBar": "⥕", + "RightFloor": "⌋", + "RightTee": "⊢", + "RightTeeArrow": "↦", + "RightTeeVector": "⥛", + "RightTriangle": "⊳", + "RightTriangleBar": "⧐", + "RightTriangleEqual": "⊵", + "RightUpDownVector": "⥏", + "RightUpTeeVector": "⥜", + "RightUpVector": "↾", + "RightUpVectorBar": "⥔", + "RightVector": "⇀", + "RightVectorBar": "⥓", + "Rightarrow": "⇒", + "Ropf": "ℝ", + "RoundImplies": "⥰", + "Rrightarrow": "⇛", + "Rscr": "ℛ", + "Rsh": "↱", + "RuleDelayed": "⧴", + "SHCHcy": "Щ", + "SHcy": "Ш", + "SOFTcy": "Ь", + "Sacute": "Ś", + "Sc": "⪼", + "Scaron": "Š", + "Scedil": "Ş", + "Scirc": "Ŝ", + "Scy": "С", + "Sfr": "𝔖", + "ShortDownArrow": "↓", + "ShortLeftArrow": "←", + "ShortRightArrow": "→", + "ShortUpArrow": "↑", + "Sigma": "Σ", + "SmallCircle": "∘", + "Sopf": "𝕊", + "Sqrt": "√", + "Square": "□", + "SquareIntersection": "⊓", + "SquareSubset": "⊏", + "SquareSubsetEqual": "⊑", + "SquareSuperset": "⊐", + "SquareSupersetEqual": "⊒", + "SquareUnion": "⊔", + "Sscr": "𝒮", + "Star": "⋆", + "Sub": "⋐", + "Subset": "⋐", + "SubsetEqual": "⊆", + "Succeeds": "≻", + "SucceedsEqual": "⪰", + "SucceedsSlantEqual": "≽", + "SucceedsTilde": "≿", + "SuchThat": "∋", + "Sum": "∑", + "Sup": "⋑", + "Superset": "⊃", + "SupersetEqual": "⊇", + "Supset": "⋑", + "THOR": "Þ", + "THORN": "Þ", + "TRADE": "™", + "TSHcy": "Ћ", + "TScy": "Ц", + "Tab": "\t", + "Tau": "Τ", + "Tcaron": "Ť", + "Tcedil": "Ţ", + "Tcy": "Т", + "Tfr": "𝔗", + "Therefore": "∴", + "Theta": "Θ", + "ThickSpace": "  ", + "ThinSpace": " ", + "Tilde": "∼", + "TildeEqual": "≃", + "TildeFullEqual": "≅", + "TildeTilde": "≈", + "Topf": "𝕋", + "TripleDot": "⃛", + "Tscr": "𝒯", + "Tstrok": "Ŧ", + "Uacut": "Ú", + "Uacute": "Ú", + "Uarr": "↟", + "Uarrocir": "⥉", + "Ubrcy": "Ў", + "Ubreve": "Ŭ", + "Ucir": "Û", + "Ucirc": "Û", + "Ucy": "У", + "Udblac": "Ű", + "Ufr": "𝔘", + "Ugrav": "Ù", + "Ugrave": "Ù", + "Umacr": "Ū", + "UnderBar": "_", + "UnderBrace": "⏟", + "UnderBracket": "⎵", + "UnderParenthesis": "⏝", + "Union": "⋃", + "UnionPlus": "⊎", + "Uogon": "Ų", + "Uopf": "𝕌", + "UpArrow": "↑", + "UpArrowBar": "⤒", + "UpArrowDownArrow": "⇅", + "UpDownArrow": "↕", + "UpEquilibrium": "⥮", + "UpTee": "⊥", + "UpTeeArrow": "↥", + "Uparrow": "⇑", + "Updownarrow": "⇕", + "UpperLeftArrow": "↖", + "UpperRightArrow": "↗", + "Upsi": "ϒ", + "Upsilon": "Υ", + "Uring": "Ů", + "Uscr": "𝒰", + "Utilde": "Ũ", + "Uum": "Ü", + "Uuml": "Ü", + "VDash": "⊫", + "Vbar": "⫫", + "Vcy": "В", + "Vdash": "⊩", + "Vdashl": "⫦", + "Vee": "⋁", + "Verbar": "‖", + "Vert": "‖", + "VerticalBar": "∣", + "VerticalLine": "|", + "VerticalSeparator": "❘", + "VerticalTilde": "≀", + "VeryThinSpace": " ", + "Vfr": "𝔙", + "Vopf": "𝕍", + "Vscr": "𝒱", + "Vvdash": "⊪", + "Wcirc": "Ŵ", + "Wedge": "⋀", + "Wfr": "𝔚", + "Wopf": "𝕎", + "Wscr": "𝒲", + "Xfr": "𝔛", + "Xi": "Ξ", + "Xopf": "𝕏", + "Xscr": "𝒳", + "YAcy": "Я", + "YIcy": "Ї", + "YUcy": "Ю", + "Yacut": "Ý", + "Yacute": "Ý", + "Ycirc": "Ŷ", + "Ycy": "Ы", + "Yfr": "𝔜", + "Yopf": "𝕐", + "Yscr": "𝒴", + "Yuml": "Ÿ", + "ZHcy": "Ж", + "Zacute": "Ź", + "Zcaron": "Ž", + "Zcy": "З", + "Zdot": "Ż", + "ZeroWidthSpace": "​", + "Zeta": "Ζ", + "Zfr": "ℨ", + "Zopf": "ℤ", + "Zscr": "𝒵", + "aacut": "á", + "aacute": "á", + "abreve": "ă", + "ac": "∾", + "acE": "∾̳", + "acd": "∿", + "acir": "â", + "acirc": "â", + "acut": "´", + "acute": "´", + "acy": "а", + "aeli": "æ", + "aelig": "æ", + "af": "⁡", + "afr": "𝔞", + "agrav": "à", + "agrave": "à", + "alefsym": "ℵ", + "aleph": "ℵ", + "alpha": "α", + "amacr": "ā", + "amalg": "⨿", + "am": "&", + "amp": "&", + "and": "∧", + "andand": "⩕", + "andd": "⩜", + "andslope": "⩘", + "andv": "⩚", + "ang": "∠", + "ange": "⦤", + "angle": "∠", + "angmsd": "∡", + "angmsdaa": "⦨", + "angmsdab": "⦩", + "angmsdac": "⦪", + "angmsdad": "⦫", + "angmsdae": "⦬", + "angmsdaf": "⦭", + "angmsdag": "⦮", + "angmsdah": "⦯", + "angrt": "∟", + "angrtvb": "⊾", + "angrtvbd": "⦝", + "angsph": "∢", + "angst": "Å", + "angzarr": "⍼", + "aogon": "ą", + "aopf": "𝕒", + "ap": "≈", + "apE": "⩰", + "apacir": "⩯", + "ape": "≊", + "apid": "≋", + "apos": "'", + "approx": "≈", + "approxeq": "≊", + "arin": "å", + "aring": "å", + "ascr": "𝒶", + "ast": "*", + "asymp": "≈", + "asympeq": "≍", + "atild": "ã", + "atilde": "ã", + "aum": "ä", + "auml": "ä", + "awconint": "∳", + "awint": "⨑", + "bNot": "⫭", + "backcong": "≌", + "backepsilon": "϶", + "backprime": "‵", + "backsim": "∽", + "backsimeq": "⋍", + "barvee": "⊽", + "barwed": "⌅", + "barwedge": "⌅", + "bbrk": "⎵", + "bbrktbrk": "⎶", + "bcong": "≌", + "bcy": "б", + "bdquo": "„", + "becaus": "∵", + "because": "∵", + "bemptyv": "⦰", + "bepsi": "϶", + "bernou": "ℬ", + "beta": "β", + "beth": "ℶ", + "between": "≬", + "bfr": "𝔟", + "bigcap": "⋂", + "bigcirc": "◯", + "bigcup": "⋃", + "bigodot": "⨀", + "bigoplus": "⨁", + "bigotimes": "⨂", + "bigsqcup": "⨆", + "bigstar": "★", + "bigtriangledown": "▽", + "bigtriangleup": "△", + "biguplus": "⨄", + "bigvee": "⋁", + "bigwedge": "⋀", + "bkarow": "⤍", + "blacklozenge": "⧫", + "blacksquare": "▪", + "blacktriangle": "▴", + "blacktriangledown": "▾", + "blacktriangleleft": "◂", + "blacktriangleright": "▸", + "blank": "␣", + "blk12": "▒", + "blk14": "░", + "blk34": "▓", + "block": "█", + "bne": "=⃥", + "bnequiv": "≡⃥", + "bnot": "⌐", + "bopf": "𝕓", + "bot": "⊥", + "bottom": "⊥", + "bowtie": "⋈", + "boxDL": "╗", + "boxDR": "╔", + "boxDl": "╖", + "boxDr": "╓", + "boxH": "═", + "boxHD": "╦", + "boxHU": "╩", + "boxHd": "╤", + "boxHu": "╧", + "boxUL": "╝", + "boxUR": "╚", + "boxUl": "╜", + "boxUr": "╙", + "boxV": "║", + "boxVH": "╬", + "boxVL": "╣", + "boxVR": "╠", + "boxVh": "╫", + "boxVl": "╢", + "boxVr": "╟", + "boxbox": "⧉", + "boxdL": "╕", + "boxdR": "╒", + "boxdl": "┐", + "boxdr": "┌", + "boxh": "─", + "boxhD": "╥", + "boxhU": "╨", + "boxhd": "┬", + "boxhu": "┴", + "boxminus": "⊟", + "boxplus": "⊞", + "boxtimes": "⊠", + "boxuL": "╛", + "boxuR": "╘", + "boxul": "┘", + "boxur": "└", + "boxv": "│", + "boxvH": "╪", + "boxvL": "╡", + "boxvR": "╞", + "boxvh": "┼", + "boxvl": "┤", + "boxvr": "├", + "bprime": "‵", + "breve": "˘", + "brvba": "¦", + "brvbar": "¦", + "bscr": "𝒷", + "bsemi": "⁏", + "bsim": "∽", + "bsime": "⋍", + "bsol": "\\", + "bsolb": "⧅", + "bsolhsub": "⟈", + "bull": "•", + "bullet": "•", + "bump": "≎", + "bumpE": "⪮", + "bumpe": "≏", + "bumpeq": "≏", + "cacute": "ć", + "cap": "∩", + "capand": "⩄", + "capbrcup": "⩉", + "capcap": "⩋", + "capcup": "⩇", + "capdot": "⩀", + "caps": "∩︀", + "caret": "⁁", + "caron": "ˇ", + "ccaps": "⩍", + "ccaron": "č", + "ccedi": "ç", + "ccedil": "ç", + "ccirc": "ĉ", + "ccups": "⩌", + "ccupssm": "⩐", + "cdot": "ċ", + "cedi": "¸", + "cedil": "¸", + "cemptyv": "⦲", + "cen": "¢", + "cent": "¢", + "centerdot": "·", + "cfr": "𝔠", + "chcy": "ч", + "check": "✓", + "checkmark": "✓", + "chi": "χ", + "cir": "○", + "cirE": "⧃", + "circ": "ˆ", + "circeq": "≗", + "circlearrowleft": "↺", + "circlearrowright": "↻", + "circledR": "®", + "circledS": "Ⓢ", + "circledast": "⊛", + "circledcirc": "⊚", + "circleddash": "⊝", + "cire": "≗", + "cirfnint": "⨐", + "cirmid": "⫯", + "cirscir": "⧂", + "clubs": "♣", + "clubsuit": "♣", + "colon": ":", + "colone": "≔", + "coloneq": "≔", + "comma": ",", + "commat": "@", + "comp": "∁", + "compfn": "∘", + "complement": "∁", + "complexes": "ℂ", + "cong": "≅", + "congdot": "⩭", + "conint": "∮", + "copf": "𝕔", + "coprod": "∐", + "cop": "©", + "copy": "©", + "copysr": "℗", + "crarr": "↵", + "cross": "✗", + "cscr": "𝒸", + "csub": "⫏", + "csube": "⫑", + "csup": "⫐", + "csupe": "⫒", + "ctdot": "⋯", + "cudarrl": "⤸", + "cudarrr": "⤵", + "cuepr": "⋞", + "cuesc": "⋟", + "cularr": "↶", + "cularrp": "⤽", + "cup": "∪", + "cupbrcap": "⩈", + "cupcap": "⩆", + "cupcup": "⩊", + "cupdot": "⊍", + "cupor": "⩅", + "cups": "∪︀", + "curarr": "↷", + "curarrm": "⤼", + "curlyeqprec": "⋞", + "curlyeqsucc": "⋟", + "curlyvee": "⋎", + "curlywedge": "⋏", + "curre": "¤", + "curren": "¤", + "curvearrowleft": "↶", + "curvearrowright": "↷", + "cuvee": "⋎", + "cuwed": "⋏", + "cwconint": "∲", + "cwint": "∱", + "cylcty": "⌭", + "dArr": "⇓", + "dHar": "⥥", + "dagger": "†", + "daleth": "ℸ", + "darr": "↓", + "dash": "‐", + "dashv": "⊣", + "dbkarow": "⤏", + "dblac": "˝", + "dcaron": "ď", + "dcy": "д", + "dd": "ⅆ", + "ddagger": "‡", + "ddarr": "⇊", + "ddotseq": "⩷", + "de": "°", + "deg": "°", + "delta": "δ", + "demptyv": "⦱", + "dfisht": "⥿", + "dfr": "𝔡", + "dharl": "⇃", + "dharr": "⇂", + "diam": "⋄", + "diamond": "⋄", + "diamondsuit": "♦", + "diams": "♦", + "die": "¨", + "digamma": "ϝ", + "disin": "⋲", + "div": "÷", + "divid": "÷", + "divide": "÷", + "divideontimes": "⋇", + "divonx": "⋇", + "djcy": "ђ", + "dlcorn": "⌞", + "dlcrop": "⌍", + "dollar": "$", + "dopf": "𝕕", + "dot": "˙", + "doteq": "≐", + "doteqdot": "≑", + "dotminus": "∸", + "dotplus": "∔", + "dotsquare": "⊡", + "doublebarwedge": "⌆", + "downarrow": "↓", + "downdownarrows": "⇊", + "downharpoonleft": "⇃", + "downharpoonright": "⇂", + "drbkarow": "⤐", + "drcorn": "⌟", + "drcrop": "⌌", + "dscr": "𝒹", + "dscy": "ѕ", + "dsol": "⧶", + "dstrok": "đ", + "dtdot": "⋱", + "dtri": "▿", + "dtrif": "▾", + "duarr": "⇵", + "duhar": "⥯", + "dwangle": "⦦", + "dzcy": "џ", + "dzigrarr": "⟿", + "eDDot": "⩷", + "eDot": "≑", + "eacut": "é", + "eacute": "é", + "easter": "⩮", + "ecaron": "ě", + "ecir": "ê", + "ecirc": "ê", + "ecolon": "≕", + "ecy": "э", + "edot": "ė", + "ee": "ⅇ", + "efDot": "≒", + "efr": "𝔢", + "eg": "⪚", + "egrav": "è", + "egrave": "è", + "egs": "⪖", + "egsdot": "⪘", + "el": "⪙", + "elinters": "⏧", + "ell": "ℓ", + "els": "⪕", + "elsdot": "⪗", + "emacr": "ē", + "empty": "∅", + "emptyset": "∅", + "emptyv": "∅", + "emsp13": " ", + "emsp14": " ", + "emsp": " ", + "eng": "ŋ", + "ensp": " ", + "eogon": "ę", + "eopf": "𝕖", + "epar": "⋕", + "eparsl": "⧣", + "eplus": "⩱", + "epsi": "ε", + "epsilon": "ε", + "epsiv": "ϵ", + "eqcirc": "≖", + "eqcolon": "≕", + "eqsim": "≂", + "eqslantgtr": "⪖", + "eqslantless": "⪕", + "equals": "=", + "equest": "≟", + "equiv": "≡", + "equivDD": "⩸", + "eqvparsl": "⧥", + "erDot": "≓", + "erarr": "⥱", + "escr": "ℯ", + "esdot": "≐", + "esim": "≂", + "eta": "η", + "et": "ð", + "eth": "ð", + "eum": "ë", + "euml": "ë", + "euro": "€", + "excl": "!", + "exist": "∃", + "expectation": "ℰ", + "exponentiale": "ⅇ", + "fallingdotseq": "≒", + "fcy": "ф", + "female": "♀", + "ffilig": "ffi", + "fflig": "ff", + "ffllig": "ffl", + "ffr": "𝔣", + "filig": "fi", + "fjlig": "fj", + "flat": "♭", + "fllig": "fl", + "fltns": "▱", + "fnof": "ƒ", + "fopf": "𝕗", + "forall": "∀", + "fork": "⋔", + "forkv": "⫙", + "fpartint": "⨍", + "frac1": "¼", + "frac12": "½", + "frac13": "⅓", + "frac14": "¼", + "frac15": "⅕", + "frac16": "⅙", + "frac18": "⅛", + "frac23": "⅔", + "frac25": "⅖", + "frac3": "¾", + "frac34": "¾", + "frac35": "⅗", + "frac38": "⅜", + "frac45": "⅘", + "frac56": "⅚", + "frac58": "⅝", + "frac78": "⅞", + "frasl": "⁄", + "frown": "⌢", + "fscr": "𝒻", + "gE": "≧", + "gEl": "⪌", + "gacute": "ǵ", + "gamma": "γ", + "gammad": "ϝ", + "gap": "⪆", + "gbreve": "ğ", + "gcirc": "ĝ", + "gcy": "г", + "gdot": "ġ", + "ge": "≥", + "gel": "⋛", + "geq": "≥", + "geqq": "≧", + "geqslant": "⩾", + "ges": "⩾", + "gescc": "⪩", + "gesdot": "⪀", + "gesdoto": "⪂", + "gesdotol": "⪄", + "gesl": "⋛︀", + "gesles": "⪔", + "gfr": "𝔤", + "gg": "≫", + "ggg": "⋙", + "gimel": "ℷ", + "gjcy": "ѓ", + "gl": "≷", + "glE": "⪒", + "gla": "⪥", + "glj": "⪤", + "gnE": "≩", + "gnap": "⪊", + "gnapprox": "⪊", + "gne": "⪈", + "gneq": "⪈", + "gneqq": "≩", + "gnsim": "⋧", + "gopf": "𝕘", + "grave": "`", + "gscr": "ℊ", + "gsim": "≳", + "gsime": "⪎", + "gsiml": "⪐", + "g": ">", + "gt": ">", + "gtcc": "⪧", + "gtcir": "⩺", + "gtdot": "⋗", + "gtlPar": "⦕", + "gtquest": "⩼", + "gtrapprox": "⪆", + "gtrarr": "⥸", + "gtrdot": "⋗", + "gtreqless": "⋛", + "gtreqqless": "⪌", + "gtrless": "≷", + "gtrsim": "≳", + "gvertneqq": "≩︀", + "gvnE": "≩︀", + "hArr": "⇔", + "hairsp": " ", + "half": "½", + "hamilt": "ℋ", + "hardcy": "ъ", + "harr": "↔", + "harrcir": "⥈", + "harrw": "↭", + "hbar": "ℏ", + "hcirc": "ĥ", + "hearts": "♥", + "heartsuit": "♥", + "hellip": "…", + "hercon": "⊹", + "hfr": "𝔥", + "hksearow": "⤥", + "hkswarow": "⤦", + "hoarr": "⇿", + "homtht": "∻", + "hookleftarrow": "↩", + "hookrightarrow": "↪", + "hopf": "𝕙", + "horbar": "―", + "hscr": "𝒽", + "hslash": "ℏ", + "hstrok": "ħ", + "hybull": "⁃", + "hyphen": "‐", + "iacut": "í", + "iacute": "í", + "ic": "⁣", + "icir": "î", + "icirc": "î", + "icy": "и", + "iecy": "е", + "iexc": "¡", + "iexcl": "¡", + "iff": "⇔", + "ifr": "𝔦", + "igrav": "ì", + "igrave": "ì", + "ii": "ⅈ", + "iiiint": "⨌", + "iiint": "∭", + "iinfin": "⧜", + "iiota": "℩", + "ijlig": "ij", + "imacr": "ī", + "image": "ℑ", + "imagline": "ℐ", + "imagpart": "ℑ", + "imath": "ı", + "imof": "⊷", + "imped": "Ƶ", + "in": "∈", + "incare": "℅", + "infin": "∞", + "infintie": "⧝", + "inodot": "ı", + "int": "∫", + "intcal": "⊺", + "integers": "ℤ", + "intercal": "⊺", + "intlarhk": "⨗", + "intprod": "⨼", + "iocy": "ё", + "iogon": "į", + "iopf": "𝕚", + "iota": "ι", + "iprod": "⨼", + "iques": "¿", + "iquest": "¿", + "iscr": "𝒾", + "isin": "∈", + "isinE": "⋹", + "isindot": "⋵", + "isins": "⋴", + "isinsv": "⋳", + "isinv": "∈", + "it": "⁢", + "itilde": "ĩ", + "iukcy": "і", + "ium": "ï", + "iuml": "ï", + "jcirc": "ĵ", + "jcy": "й", + "jfr": "𝔧", + "jmath": "ȷ", + "jopf": "𝕛", + "jscr": "𝒿", + "jsercy": "ј", + "jukcy": "є", + "kappa": "κ", + "kappav": "ϰ", + "kcedil": "ķ", + "kcy": "к", + "kfr": "𝔨", + "kgreen": "ĸ", + "khcy": "х", + "kjcy": "ќ", + "kopf": "𝕜", + "kscr": "𝓀", + "lAarr": "⇚", + "lArr": "⇐", + "lAtail": "⤛", + "lBarr": "⤎", + "lE": "≦", + "lEg": "⪋", + "lHar": "⥢", + "lacute": "ĺ", + "laemptyv": "⦴", + "lagran": "ℒ", + "lambda": "λ", + "lang": "⟨", + "langd": "⦑", + "langle": "⟨", + "lap": "⪅", + "laqu": "«", + "laquo": "«", + "larr": "←", + "larrb": "⇤", + "larrbfs": "⤟", + "larrfs": "⤝", + "larrhk": "↩", + "larrlp": "↫", + "larrpl": "⤹", + "larrsim": "⥳", + "larrtl": "↢", + "lat": "⪫", + "latail": "⤙", + "late": "⪭", + "lates": "⪭︀", + "lbarr": "⤌", + "lbbrk": "❲", + "lbrace": "{", + "lbrack": "[", + "lbrke": "⦋", + "lbrksld": "⦏", + "lbrkslu": "⦍", + "lcaron": "ľ", + "lcedil": "ļ", + "lceil": "⌈", + "lcub": "{", + "lcy": "л", + "ldca": "⤶", + "ldquo": "“", + "ldquor": "„", + "ldrdhar": "⥧", + "ldrushar": "⥋", + "ldsh": "↲", + "le": "≤", + "leftarrow": "←", + "leftarrowtail": "↢", + "leftharpoondown": "↽", + "leftharpoonup": "↼", + "leftleftarrows": "⇇", + "leftrightarrow": "↔", + "leftrightarrows": "⇆", + "leftrightharpoons": "⇋", + "leftrightsquigarrow": "↭", + "leftthreetimes": "⋋", + "leg": "⋚", + "leq": "≤", + "leqq": "≦", + "leqslant": "⩽", + "les": "⩽", + "lescc": "⪨", + "lesdot": "⩿", + "lesdoto": "⪁", + "lesdotor": "⪃", + "lesg": "⋚︀", + "lesges": "⪓", + "lessapprox": "⪅", + "lessdot": "⋖", + "lesseqgtr": "⋚", + "lesseqqgtr": "⪋", + "lessgtr": "≶", + "lesssim": "≲", + "lfisht": "⥼", + "lfloor": "⌊", + "lfr": "𝔩", + "lg": "≶", + "lgE": "⪑", + "lhard": "↽", + "lharu": "↼", + "lharul": "⥪", + "lhblk": "▄", + "ljcy": "љ", + "ll": "≪", + "llarr": "⇇", + "llcorner": "⌞", + "llhard": "⥫", + "lltri": "◺", + "lmidot": "ŀ", + "lmoust": "⎰", + "lmoustache": "⎰", + "lnE": "≨", + "lnap": "⪉", + "lnapprox": "⪉", + "lne": "⪇", + "lneq": "⪇", + "lneqq": "≨", + "lnsim": "⋦", + "loang": "⟬", + "loarr": "⇽", + "lobrk": "⟦", + "longleftarrow": "⟵", + "longleftrightarrow": "⟷", + "longmapsto": "⟼", + "longrightarrow": "⟶", + "looparrowleft": "↫", + "looparrowright": "↬", + "lopar": "⦅", + "lopf": "𝕝", + "loplus": "⨭", + "lotimes": "⨴", + "lowast": "∗", + "lowbar": "_", + "loz": "◊", + "lozenge": "◊", + "lozf": "⧫", + "lpar": "(", + "lparlt": "⦓", + "lrarr": "⇆", + "lrcorner": "⌟", + "lrhar": "⇋", + "lrhard": "⥭", + "lrm": "‎", + "lrtri": "⊿", + "lsaquo": "‹", + "lscr": "𝓁", + "lsh": "↰", + "lsim": "≲", + "lsime": "⪍", + "lsimg": "⪏", + "lsqb": "[", + "lsquo": "‘", + "lsquor": "‚", + "lstrok": "ł", + "l": "<", + "lt": "<", + "ltcc": "⪦", + "ltcir": "⩹", + "ltdot": "⋖", + "lthree": "⋋", + "ltimes": "⋉", + "ltlarr": "⥶", + "ltquest": "⩻", + "ltrPar": "⦖", + "ltri": "◃", + "ltrie": "⊴", + "ltrif": "◂", + "lurdshar": "⥊", + "luruhar": "⥦", + "lvertneqq": "≨︀", + "lvnE": "≨︀", + "mDDot": "∺", + "mac": "¯", + "macr": "¯", + "male": "♂", + "malt": "✠", + "maltese": "✠", + "map": "↦", + "mapsto": "↦", + "mapstodown": "↧", + "mapstoleft": "↤", + "mapstoup": "↥", + "marker": "▮", + "mcomma": "⨩", + "mcy": "м", + "mdash": "—", + "measuredangle": "∡", + "mfr": "𝔪", + "mho": "℧", + "micr": "µ", + "micro": "µ", + "mid": "∣", + "midast": "*", + "midcir": "⫰", + "middo": "·", + "middot": "·", + "minus": "−", + "minusb": "⊟", + "minusd": "∸", + "minusdu": "⨪", + "mlcp": "⫛", + "mldr": "…", + "mnplus": "∓", + "models": "⊧", + "mopf": "𝕞", + "mp": "∓", + "mscr": "𝓂", + "mstpos": "∾", + "mu": "μ", + "multimap": "⊸", + "mumap": "⊸", + "nGg": "⋙̸", + "nGt": "≫⃒", + "nGtv": "≫̸", + "nLeftarrow": "⇍", + "nLeftrightarrow": "⇎", + "nLl": "⋘̸", + "nLt": "≪⃒", + "nLtv": "≪̸", + "nRightarrow": "⇏", + "nVDash": "⊯", + "nVdash": "⊮", + "nabla": "∇", + "nacute": "ń", + "nang": "∠⃒", + "nap": "≉", + "napE": "⩰̸", + "napid": "≋̸", + "napos": "ʼn", + "napprox": "≉", + "natur": "♮", + "natural": "♮", + "naturals": "ℕ", + "nbs": " ", + "nbsp": " ", + "nbump": "≎̸", + "nbumpe": "≏̸", + "ncap": "⩃", + "ncaron": "ň", + "ncedil": "ņ", + "ncong": "≇", + "ncongdot": "⩭̸", + "ncup": "⩂", + "ncy": "н", + "ndash": "–", + "ne": "≠", + "neArr": "⇗", + "nearhk": "⤤", + "nearr": "↗", + "nearrow": "↗", + "nedot": "≐̸", + "nequiv": "≢", + "nesear": "⤨", + "nesim": "≂̸", + "nexist": "∄", + "nexists": "∄", + "nfr": "𝔫", + "ngE": "≧̸", + "nge": "≱", + "ngeq": "≱", + "ngeqq": "≧̸", + "ngeqslant": "⩾̸", + "nges": "⩾̸", + "ngsim": "≵", + "ngt": "≯", + "ngtr": "≯", + "nhArr": "⇎", + "nharr": "↮", + "nhpar": "⫲", + "ni": "∋", + "nis": "⋼", + "nisd": "⋺", + "niv": "∋", + "njcy": "њ", + "nlArr": "⇍", + "nlE": "≦̸", + "nlarr": "↚", + "nldr": "‥", + "nle": "≰", + "nleftarrow": "↚", + "nleftrightarrow": "↮", + "nleq": "≰", + "nleqq": "≦̸", + "nleqslant": "⩽̸", + "nles": "⩽̸", + "nless": "≮", + "nlsim": "≴", + "nlt": "≮", + "nltri": "⋪", + "nltrie": "⋬", + "nmid": "∤", + "nopf": "𝕟", + "no": "¬", + "not": "¬", + "notin": "∉", + "notinE": "⋹̸", + "notindot": "⋵̸", + "notinva": "∉", + "notinvb": "⋷", + "notinvc": "⋶", + "notni": "∌", + "notniva": "∌", + "notnivb": "⋾", + "notnivc": "⋽", + "npar": "∦", + "nparallel": "∦", + "nparsl": "⫽⃥", + "npart": "∂̸", + "npolint": "⨔", + "npr": "⊀", + "nprcue": "⋠", + "npre": "⪯̸", + "nprec": "⊀", + "npreceq": "⪯̸", + "nrArr": "⇏", + "nrarr": "↛", + "nrarrc": "⤳̸", + "nrarrw": "↝̸", + "nrightarrow": "↛", + "nrtri": "⋫", + "nrtrie": "⋭", + "nsc": "⊁", + "nsccue": "⋡", + "nsce": "⪰̸", + "nscr": "𝓃", + "nshortmid": "∤", + "nshortparallel": "∦", + "nsim": "≁", + "nsime": "≄", + "nsimeq": "≄", + "nsmid": "∤", + "nspar": "∦", + "nsqsube": "⋢", + "nsqsupe": "⋣", + "nsub": "⊄", + "nsubE": "⫅̸", + "nsube": "⊈", + "nsubset": "⊂⃒", + "nsubseteq": "⊈", + "nsubseteqq": "⫅̸", + "nsucc": "⊁", + "nsucceq": "⪰̸", + "nsup": "⊅", + "nsupE": "⫆̸", + "nsupe": "⊉", + "nsupset": "⊃⃒", + "nsupseteq": "⊉", + "nsupseteqq": "⫆̸", + "ntgl": "≹", + "ntild": "ñ", + "ntilde": "ñ", + "ntlg": "≸", + "ntriangleleft": "⋪", + "ntrianglelefteq": "⋬", + "ntriangleright": "⋫", + "ntrianglerighteq": "⋭", + "nu": "ν", + "num": "#", + "numero": "№", + "numsp": " ", + "nvDash": "⊭", + "nvHarr": "⤄", + "nvap": "≍⃒", + "nvdash": "⊬", + "nvge": "≥⃒", + "nvgt": ">⃒", + "nvinfin": "⧞", + "nvlArr": "⤂", + "nvle": "≤⃒", + "nvlt": "<⃒", + "nvltrie": "⊴⃒", + "nvrArr": "⤃", + "nvrtrie": "⊵⃒", + "nvsim": "∼⃒", + "nwArr": "⇖", + "nwarhk": "⤣", + "nwarr": "↖", + "nwarrow": "↖", + "nwnear": "⤧", + "oS": "Ⓢ", + "oacut": "ó", + "oacute": "ó", + "oast": "⊛", + "ocir": "ô", + "ocirc": "ô", + "ocy": "о", + "odash": "⊝", + "odblac": "ő", + "odiv": "⨸", + "odot": "⊙", + "odsold": "⦼", + "oelig": "œ", + "ofcir": "⦿", + "ofr": "𝔬", + "ogon": "˛", + "ograv": "ò", + "ograve": "ò", + "ogt": "⧁", + "ohbar": "⦵", + "ohm": "Ω", + "oint": "∮", + "olarr": "↺", + "olcir": "⦾", + "olcross": "⦻", + "oline": "‾", + "olt": "⧀", + "omacr": "ō", + "omega": "ω", + "omicron": "ο", + "omid": "⦶", + "ominus": "⊖", + "oopf": "𝕠", + "opar": "⦷", + "operp": "⦹", + "oplus": "⊕", + "or": "∨", + "orarr": "↻", + "ord": "º", + "order": "ℴ", + "orderof": "ℴ", + "ordf": "ª", + "ordm": "º", + "origof": "⊶", + "oror": "⩖", + "orslope": "⩗", + "orv": "⩛", + "oscr": "ℴ", + "oslas": "ø", + "oslash": "ø", + "osol": "⊘", + "otild": "õ", + "otilde": "õ", + "otimes": "⊗", + "otimesas": "⨶", + "oum": "ö", + "ouml": "ö", + "ovbar": "⌽", + "par": "¶", + "para": "¶", + "parallel": "∥", + "parsim": "⫳", + "parsl": "⫽", + "part": "∂", + "pcy": "п", + "percnt": "%", + "period": ".", + "permil": "‰", + "perp": "⊥", + "pertenk": "‱", + "pfr": "𝔭", + "phi": "φ", + "phiv": "ϕ", + "phmmat": "ℳ", + "phone": "☎", + "pi": "π", + "pitchfork": "⋔", + "piv": "ϖ", + "planck": "ℏ", + "planckh": "ℎ", + "plankv": "ℏ", + "plus": "+", + "plusacir": "⨣", + "plusb": "⊞", + "pluscir": "⨢", + "plusdo": "∔", + "plusdu": "⨥", + "pluse": "⩲", + "plusm": "±", + "plusmn": "±", + "plussim": "⨦", + "plustwo": "⨧", + "pm": "±", + "pointint": "⨕", + "popf": "𝕡", + "poun": "£", + "pound": "£", + "pr": "≺", + "prE": "⪳", + "prap": "⪷", + "prcue": "≼", + "pre": "⪯", + "prec": "≺", + "precapprox": "⪷", + "preccurlyeq": "≼", + "preceq": "⪯", + "precnapprox": "⪹", + "precneqq": "⪵", + "precnsim": "⋨", + "precsim": "≾", + "prime": "′", + "primes": "ℙ", + "prnE": "⪵", + "prnap": "⪹", + "prnsim": "⋨", + "prod": "∏", + "profalar": "⌮", + "profline": "⌒", + "profsurf": "⌓", + "prop": "∝", + "propto": "∝", + "prsim": "≾", + "prurel": "⊰", + "pscr": "𝓅", + "psi": "ψ", + "puncsp": " ", + "qfr": "𝔮", + "qint": "⨌", + "qopf": "𝕢", + "qprime": "⁗", + "qscr": "𝓆", + "quaternions": "ℍ", + "quatint": "⨖", + "quest": "?", + "questeq": "≟", + "quo": "\"", + "quot": "\"", + "rAarr": "⇛", + "rArr": "⇒", + "rAtail": "⤜", + "rBarr": "⤏", + "rHar": "⥤", + "race": "∽̱", + "racute": "ŕ", + "radic": "√", + "raemptyv": "⦳", + "rang": "⟩", + "rangd": "⦒", + "range": "⦥", + "rangle": "⟩", + "raqu": "»", + "raquo": "»", + "rarr": "→", + "rarrap": "⥵", + "rarrb": "⇥", + "rarrbfs": "⤠", + "rarrc": "⤳", + "rarrfs": "⤞", + "rarrhk": "↪", + "rarrlp": "↬", + "rarrpl": "⥅", + "rarrsim": "⥴", + "rarrtl": "↣", + "rarrw": "↝", + "ratail": "⤚", + "ratio": "∶", + "rationals": "ℚ", + "rbarr": "⤍", + "rbbrk": "❳", + "rbrace": "}", + "rbrack": "]", + "rbrke": "⦌", + "rbrksld": "⦎", + "rbrkslu": "⦐", + "rcaron": "ř", + "rcedil": "ŗ", + "rceil": "⌉", + "rcub": "}", + "rcy": "р", + "rdca": "⤷", + "rdldhar": "⥩", + "rdquo": "”", + "rdquor": "”", + "rdsh": "↳", + "real": "ℜ", + "realine": "ℛ", + "realpart": "ℜ", + "reals": "ℝ", + "rect": "▭", + "re": "®", + "reg": "®", + "rfisht": "⥽", + "rfloor": "⌋", + "rfr": "𝔯", + "rhard": "⇁", + "rharu": "⇀", + "rharul": "⥬", + "rho": "ρ", + "rhov": "ϱ", + "rightarrow": "→", + "rightarrowtail": "↣", + "rightharpoondown": "⇁", + "rightharpoonup": "⇀", + "rightleftarrows": "⇄", + "rightleftharpoons": "⇌", + "rightrightarrows": "⇉", + "rightsquigarrow": "↝", + "rightthreetimes": "⋌", + "ring": "˚", + "risingdotseq": "≓", + "rlarr": "⇄", + "rlhar": "⇌", + "rlm": "‏", + "rmoust": "⎱", + "rmoustache": "⎱", + "rnmid": "⫮", + "roang": "⟭", + "roarr": "⇾", + "robrk": "⟧", + "ropar": "⦆", + "ropf": "𝕣", + "roplus": "⨮", + "rotimes": "⨵", + "rpar": ")", + "rpargt": "⦔", + "rppolint": "⨒", + "rrarr": "⇉", + "rsaquo": "›", + "rscr": "𝓇", + "rsh": "↱", + "rsqb": "]", + "rsquo": "’", + "rsquor": "’", + "rthree": "⋌", + "rtimes": "⋊", + "rtri": "▹", + "rtrie": "⊵", + "rtrif": "▸", + "rtriltri": "⧎", + "ruluhar": "⥨", + "rx": "℞", + "sacute": "ś", + "sbquo": "‚", + "sc": "≻", + "scE": "⪴", + "scap": "⪸", + "scaron": "š", + "sccue": "≽", + "sce": "⪰", + "scedil": "ş", + "scirc": "ŝ", + "scnE": "⪶", + "scnap": "⪺", + "scnsim": "⋩", + "scpolint": "⨓", + "scsim": "≿", + "scy": "с", + "sdot": "⋅", + "sdotb": "⊡", + "sdote": "⩦", + "seArr": "⇘", + "searhk": "⤥", + "searr": "↘", + "searrow": "↘", + "sec": "§", + "sect": "§", + "semi": ";", + "seswar": "⤩", + "setminus": "∖", + "setmn": "∖", + "sext": "✶", + "sfr": "𝔰", + "sfrown": "⌢", + "sharp": "♯", + "shchcy": "щ", + "shcy": "ш", + "shortmid": "∣", + "shortparallel": "∥", + "sh": "­", + "shy": "­", + "sigma": "σ", + "sigmaf": "ς", + "sigmav": "ς", + "sim": "∼", + "simdot": "⩪", + "sime": "≃", + "simeq": "≃", + "simg": "⪞", + "simgE": "⪠", + "siml": "⪝", + "simlE": "⪟", + "simne": "≆", + "simplus": "⨤", + "simrarr": "⥲", + "slarr": "←", + "smallsetminus": "∖", + "smashp": "⨳", + "smeparsl": "⧤", + "smid": "∣", + "smile": "⌣", + "smt": "⪪", + "smte": "⪬", + "smtes": "⪬︀", + "softcy": "ь", + "sol": "/", + "solb": "⧄", + "solbar": "⌿", + "sopf": "𝕤", + "spades": "♠", + "spadesuit": "♠", + "spar": "∥", + "sqcap": "⊓", + "sqcaps": "⊓︀", + "sqcup": "⊔", + "sqcups": "⊔︀", + "sqsub": "⊏", + "sqsube": "⊑", + "sqsubset": "⊏", + "sqsubseteq": "⊑", + "sqsup": "⊐", + "sqsupe": "⊒", + "sqsupset": "⊐", + "sqsupseteq": "⊒", + "squ": "□", + "square": "□", + "squarf": "▪", + "squf": "▪", + "srarr": "→", + "sscr": "𝓈", + "ssetmn": "∖", + "ssmile": "⌣", + "sstarf": "⋆", + "star": "☆", + "starf": "★", + "straightepsilon": "ϵ", + "straightphi": "ϕ", + "strns": "¯", + "sub": "⊂", + "subE": "⫅", + "subdot": "⪽", + "sube": "⊆", + "subedot": "⫃", + "submult": "⫁", + "subnE": "⫋", + "subne": "⊊", + "subplus": "⪿", + "subrarr": "⥹", + "subset": "⊂", + "subseteq": "⊆", + "subseteqq": "⫅", + "subsetneq": "⊊", + "subsetneqq": "⫋", + "subsim": "⫇", + "subsub": "⫕", + "subsup": "⫓", + "succ": "≻", + "succapprox": "⪸", + "succcurlyeq": "≽", + "succeq": "⪰", + "succnapprox": "⪺", + "succneqq": "⪶", + "succnsim": "⋩", + "succsim": "≿", + "sum": "∑", + "sung": "♪", + "sup": "⊃", + "sup1": "¹", + "sup2": "²", + "sup3": "³", + "supE": "⫆", + "supdot": "⪾", + "supdsub": "⫘", + "supe": "⊇", + "supedot": "⫄", + "suphsol": "⟉", + "suphsub": "⫗", + "suplarr": "⥻", + "supmult": "⫂", + "supnE": "⫌", + "supne": "⊋", + "supplus": "⫀", + "supset": "⊃", + "supseteq": "⊇", + "supseteqq": "⫆", + "supsetneq": "⊋", + "supsetneqq": "⫌", + "supsim": "⫈", + "supsub": "⫔", + "supsup": "⫖", + "swArr": "⇙", + "swarhk": "⤦", + "swarr": "↙", + "swarrow": "↙", + "swnwar": "⤪", + "szli": "ß", + "szlig": "ß", + "target": "⌖", + "tau": "τ", + "tbrk": "⎴", + "tcaron": "ť", + "tcedil": "ţ", + "tcy": "т", + "tdot": "⃛", + "telrec": "⌕", + "tfr": "𝔱", + "there4": "∴", + "therefore": "∴", + "theta": "θ", + "thetasym": "ϑ", + "thetav": "ϑ", + "thickapprox": "≈", + "thicksim": "∼", + "thinsp": " ", + "thkap": "≈", + "thksim": "∼", + "thor": "þ", + "thorn": "þ", + "tilde": "˜", + "time": "×", + "times": "×", + "timesb": "⊠", + "timesbar": "⨱", + "timesd": "⨰", + "tint": "∭", + "toea": "⤨", + "top": "⊤", + "topbot": "⌶", + "topcir": "⫱", + "topf": "𝕥", + "topfork": "⫚", + "tosa": "⤩", + "tprime": "‴", + "trade": "™", + "triangle": "▵", + "triangledown": "▿", + "triangleleft": "◃", + "trianglelefteq": "⊴", + "triangleq": "≜", + "triangleright": "▹", + "trianglerighteq": "⊵", + "tridot": "◬", + "trie": "≜", + "triminus": "⨺", + "triplus": "⨹", + "trisb": "⧍", + "tritime": "⨻", + "trpezium": "⏢", + "tscr": "𝓉", + "tscy": "ц", + "tshcy": "ћ", + "tstrok": "ŧ", + "twixt": "≬", + "twoheadleftarrow": "↞", + "twoheadrightarrow": "↠", + "uArr": "⇑", + "uHar": "⥣", + "uacut": "ú", + "uacute": "ú", + "uarr": "↑", + "ubrcy": "ў", + "ubreve": "ŭ", + "ucir": "û", + "ucirc": "û", + "ucy": "у", + "udarr": "⇅", + "udblac": "ű", + "udhar": "⥮", + "ufisht": "⥾", + "ufr": "𝔲", + "ugrav": "ù", + "ugrave": "ù", + "uharl": "↿", + "uharr": "↾", + "uhblk": "▀", + "ulcorn": "⌜", + "ulcorner": "⌜", + "ulcrop": "⌏", + "ultri": "◸", + "umacr": "ū", + "um": "¨", + "uml": "¨", + "uogon": "ų", + "uopf": "𝕦", + "uparrow": "↑", + "updownarrow": "↕", + "upharpoonleft": "↿", + "upharpoonright": "↾", + "uplus": "⊎", + "upsi": "υ", + "upsih": "ϒ", + "upsilon": "υ", + "upuparrows": "⇈", + "urcorn": "⌝", + "urcorner": "⌝", + "urcrop": "⌎", + "uring": "ů", + "urtri": "◹", + "uscr": "𝓊", + "utdot": "⋰", + "utilde": "ũ", + "utri": "▵", + "utrif": "▴", + "uuarr": "⇈", + "uum": "ü", + "uuml": "ü", + "uwangle": "⦧", + "vArr": "⇕", + "vBar": "⫨", + "vBarv": "⫩", + "vDash": "⊨", + "vangrt": "⦜", + "varepsilon": "ϵ", + "varkappa": "ϰ", + "varnothing": "∅", + "varphi": "ϕ", + "varpi": "ϖ", + "varpropto": "∝", + "varr": "↕", + "varrho": "ϱ", + "varsigma": "ς", + "varsubsetneq": "⊊︀", + "varsubsetneqq": "⫋︀", + "varsupsetneq": "⊋︀", + "varsupsetneqq": "⫌︀", + "vartheta": "ϑ", + "vartriangleleft": "⊲", + "vartriangleright": "⊳", + "vcy": "в", + "vdash": "⊢", + "vee": "∨", + "veebar": "⊻", + "veeeq": "≚", + "vellip": "⋮", + "verbar": "|", + "vert": "|", + "vfr": "𝔳", + "vltri": "⊲", + "vnsub": "⊂⃒", + "vnsup": "⊃⃒", + "vopf": "𝕧", + "vprop": "∝", + "vrtri": "⊳", + "vscr": "𝓋", + "vsubnE": "⫋︀", + "vsubne": "⊊︀", + "vsupnE": "⫌︀", + "vsupne": "⊋︀", + "vzigzag": "⦚", + "wcirc": "ŵ", + "wedbar": "⩟", + "wedge": "∧", + "wedgeq": "≙", + "weierp": "℘", + "wfr": "𝔴", + "wopf": "𝕨", + "wp": "℘", + "wr": "≀", + "wreath": "≀", + "wscr": "𝓌", + "xcap": "⋂", + "xcirc": "◯", + "xcup": "⋃", + "xdtri": "▽", + "xfr": "𝔵", + "xhArr": "⟺", + "xharr": "⟷", + "xi": "ξ", + "xlArr": "⟸", + "xlarr": "⟵", + "xmap": "⟼", + "xnis": "⋻", + "xodot": "⨀", + "xopf": "𝕩", + "xoplus": "⨁", + "xotime": "⨂", + "xrArr": "⟹", + "xrarr": "⟶", + "xscr": "𝓍", + "xsqcup": "⨆", + "xuplus": "⨄", + "xutri": "△", + "xvee": "⋁", + "xwedge": "⋀", + "yacut": "ý", + "yacute": "ý", + "yacy": "я", + "ycirc": "ŷ", + "ycy": "ы", + "ye": "¥", + "yen": "¥", + "yfr": "𝔶", + "yicy": "ї", + "yopf": "𝕪", + "yscr": "𝓎", + "yucy": "ю", + "yum": "ÿ", + "yuml": "ÿ", + "zacute": "ź", + "zcaron": "ž", + "zcy": "з", + "zdot": "ż", + "zeetrf": "ℨ", + "zeta": "ζ", + "zfr": "𝔷", + "zhcy": "ж", + "zigrarr": "⇝", + "zopf": "𝕫", + "zscr": "𝓏", + "zwj": "‍", + "zwnj": "‌" +} diff --git a/node_modules/character-entities/license b/node_modules/character-entities/license new file mode 100644 index 0000000..32e7a3d --- /dev/null +++ b/node_modules/character-entities/license @@ -0,0 +1,22 @@ +(The MIT License) + +Copyright (c) 2015 Titus Wormer + +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: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +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. diff --git a/node_modules/character-entities/package.json b/node_modules/character-entities/package.json new file mode 100644 index 0000000..6923aa3 --- /dev/null +++ b/node_modules/character-entities/package.json @@ -0,0 +1,110 @@ +{ + "_from": "character-entities@^1.0.0", + "_id": "character-entities@1.2.4", + "_inBundle": false, + "_integrity": "sha512-iBMyeEHxfVnIakwOuDXpVkc54HijNgCyQB2w0VfGQThle6NXn50zU6V/u+LDhxHcDUPojn6Kpga3PTAD8W1bQw==", + "_location": "/character-entities", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "character-entities@^1.0.0", + "name": "character-entities", + "escapedName": "character-entities", + "rawSpec": "^1.0.0", + "saveSpec": null, + "fetchSpec": "^1.0.0" + }, + "_requiredBy": [ + "/parse-entities" + ], + "_resolved": "https://registry.npmjs.org/character-entities/-/character-entities-1.2.4.tgz", + "_shasum": "e12c3939b7eaf4e5b15e7ad4c5e28e1d48c5b16b", + "_spec": "character-entities@^1.0.0", + "_where": "/Users/josh/Projects/slackify-markdown-action/node_modules/parse-entities", + "author": { + "name": "Titus Wormer", + "email": "tituswormer@gmail.com", + "url": "https://wooorm.com" + }, + "bugs": { + "url": "https://github.com/wooorm/character-entities/issues" + }, + "bundleDependencies": false, + "contributors": [ + { + "name": "Titus Wormer", + "email": "tituswormer@gmail.com", + "url": "https://wooorm.com" + } + ], + "dependencies": {}, + "deprecated": false, + "description": "HTML character entity information", + "devDependencies": { + "bail": "^1.0.0", + "browserify": "^16.0.0", + "concat-stream": "^2.0.0", + "prettier": "^1.0.0", + "remark-cli": "^7.0.0", + "remark-preset-wooorm": "^6.0.0", + "tape": "^4.0.0", + "tinyify": "^2.0.0", + "xo": "^0.25.0" + }, + "files": [ + "index.json" + ], + "funding": { + "type": "github", + "url": "https://github.com/sponsors/wooorm" + }, + "homepage": "https://github.com/wooorm/character-entities#readme", + "keywords": [ + "html", + "entity", + "entities", + "character", + "reference", + "name", + "replacement" + ], + "license": "MIT", + "main": "index.json", + "name": "character-entities", + "prettier": { + "tabWidth": 2, + "useTabs": false, + "singleQuote": true, + "bracketSpacing": false, + "semi": false, + "trailingComma": "none" + }, + "remarkConfig": { + "plugins": [ + "preset-wooorm" + ] + }, + "repository": { + "type": "git", + "url": "git+https://github.com/wooorm/character-entities.git" + }, + "scripts": { + "build": "npm run build-bundle && npm run build-mangle", + "build-bundle": "browserify index.json -s characterEntities -o character-entities.js", + "build-mangle": "browserify index.json -s characterEntities -p tinyify -o character-entities.min.js", + "format": "remark . -qfo && prettier --write \"**/*.js\" && xo --fix", + "generate": "node build", + "lint": "xo", + "test": "npm run generate && npm run format && npm run build && npm run test-api", + "test-api": "node test" + }, + "version": "1.2.4", + "xo": { + "prettier": true, + "esnext": false, + "ignores": [ + "character-entities.js" + ] + } +} diff --git a/node_modules/character-entities/readme.md b/node_modules/character-entities/readme.md new file mode 100644 index 0000000..b890e2a --- /dev/null +++ b/node_modules/character-entities/readme.md @@ -0,0 +1,72 @@ +# character-entities + +[![Build][build-badge]][build] +[![Downloads][downloads-badge]][downloads] +[![Size][size-badge]][size] + +HTML character entity information. + +## Install + +[npm][]: + +```sh +npm install character-entities +``` + +## Use + +```js +var characterEntities = require('character-entities') + +console.log(characterEntities.AElig) // => 'Æ' +console.log(characterEntities.aelig) // => 'æ' +console.log(characterEntities.amp) // => '&' +``` + +## API + +### characterEntities + +Mapping between (case-sensitive) character entity names to replacements. + +## Support + +See [`html.spec.whatwg.org`][html]. + +## Related + +* [`character-entities-html4`](https://github.com/wooorm/character-entities-html4) + — HTML 4 character entity info +* [`character-entities-legacy`](https://github.com/wooorm/character-entities-legacy) + — Legacy character entity info +* [`parse-entities`](https://github.com/wooorm/parse-entities) + — Parse HTML character references +* [`stringify-entities`](https://github.com/wooorm/stringify-entities) + — Stringify HTML character references + +## License + +[MIT][license] © [Titus Wormer][author] + + + +[build-badge]: https://img.shields.io/travis/wooorm/character-entities.svg + +[build]: https://travis-ci.org/wooorm/character-entities + +[downloads-badge]: https://img.shields.io/npm/dm/character-entities.svg + +[downloads]: https://www.npmjs.com/package/character-entities + +[size-badge]: https://img.shields.io/bundlephobia/minzip/character-entities.svg + +[size]: https://bundlephobia.com/result?p=character-entities + +[npm]: https://docs.npmjs.com/cli/install + +[license]: license + +[author]: https://wooorm.com + +[html]: https://html.spec.whatwg.org/multipage/syntax.html#named-character-references diff --git a/node_modules/character-reference-invalid/index.json b/node_modules/character-reference-invalid/index.json new file mode 100644 index 0000000..9337a85 --- /dev/null +++ b/node_modules/character-reference-invalid/index.json @@ -0,0 +1,30 @@ +{ + "0": "�", + "128": "€", + "130": "‚", + "131": "ƒ", + "132": "„", + "133": "…", + "134": "†", + "135": "‡", + "136": "ˆ", + "137": "‰", + "138": "Š", + "139": "‹", + "140": "Œ", + "142": "Ž", + "145": "‘", + "146": "’", + "147": "“", + "148": "”", + "149": "•", + "150": "–", + "151": "—", + "152": "˜", + "153": "™", + "154": "š", + "155": "›", + "156": "œ", + "158": "ž", + "159": "Ÿ" +} diff --git a/node_modules/character-reference-invalid/license b/node_modules/character-reference-invalid/license new file mode 100644 index 0000000..32e7a3d --- /dev/null +++ b/node_modules/character-reference-invalid/license @@ -0,0 +1,22 @@ +(The MIT License) + +Copyright (c) 2015 Titus Wormer + +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: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +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. diff --git a/node_modules/character-reference-invalid/package.json b/node_modules/character-reference-invalid/package.json new file mode 100644 index 0000000..e61e748 --- /dev/null +++ b/node_modules/character-reference-invalid/package.json @@ -0,0 +1,113 @@ +{ + "_from": "character-reference-invalid@^1.0.0", + "_id": "character-reference-invalid@1.1.4", + "_inBundle": false, + "_integrity": "sha512-mKKUkUbhPpQlCOfIuZkvSEgktjPFIsZKRRbC6KWVEMvlzblj3i3asQv5ODsrwt0N3pHAEvjP8KTQPHkp0+6jOg==", + "_location": "/character-reference-invalid", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "character-reference-invalid@^1.0.0", + "name": "character-reference-invalid", + "escapedName": "character-reference-invalid", + "rawSpec": "^1.0.0", + "saveSpec": null, + "fetchSpec": "^1.0.0" + }, + "_requiredBy": [ + "/parse-entities" + ], + "_resolved": "https://registry.npmjs.org/character-reference-invalid/-/character-reference-invalid-1.1.4.tgz", + "_shasum": "083329cda0eae272ab3dbbf37e9a382c13af1560", + "_spec": "character-reference-invalid@^1.0.0", + "_where": "/Users/josh/Projects/slackify-markdown-action/node_modules/parse-entities", + "author": { + "name": "Titus Wormer", + "email": "tituswormer@gmail.com", + "url": "https://wooorm.com" + }, + "bugs": { + "url": "https://github.com/wooorm/character-reference-invalid/issues" + }, + "bundleDependencies": false, + "contributors": [ + { + "name": "Titus Wormer", + "email": "tituswormer@gmail.com", + "url": "https://wooorm.com" + } + ], + "dependencies": {}, + "deprecated": false, + "description": "HTML invalid numeric character reference information", + "devDependencies": { + "bail": "^1.0.0", + "browserify": "^16.0.0", + "concat-stream": "^2.0.0", + "hast-util-select": "^3.0.0", + "hast-util-to-string": "^1.0.0", + "rehype-parse": "^6.0.0", + "remark-cli": "^7.0.0", + "remark-preset-wooorm": "^6.0.0", + "tape": "^4.0.0", + "tinyify": "^2.0.0", + "unified": "^8.0.0", + "xo": "^0.25.0" + }, + "files": [ + "index.json" + ], + "funding": { + "type": "github", + "url": "https://github.com/sponsors/wooorm" + }, + "homepage": "https://github.com/wooorm/character-reference-invalid#readme", + "keywords": [ + "html", + "entity", + "numeric", + "character", + "reference", + "replacement", + "invalid", + "name" + ], + "license": "MIT", + "main": "index.json", + "name": "character-reference-invalid", + "prettier": { + "tabWidth": 2, + "useTabs": false, + "singleQuote": true, + "bracketSpacing": false, + "semi": false, + "trailingComma": "none" + }, + "remarkConfig": { + "plugins": [ + "preset-wooorm" + ] + }, + "repository": { + "type": "git", + "url": "git+https://github.com/wooorm/character-reference-invalid.git" + }, + "scripts": { + "build": "npm run build-bundle && npm run build-mangle", + "build-bundle": "browserify index.json -s characterReferenceInvalid -o character-reference-invalid.js", + "build-mangle": "browserify index.json -s characterReferenceInvalid -p tinyify -o character-reference-invalid.min.js", + "format": "remark . -qfo && prettier --write \"**/*.js\" && xo --fix", + "generate": "node build", + "test": "npm run generate && npm run format && npm run build && npm run test-api", + "test-api": "node test" + }, + "version": "1.1.4", + "xo": { + "prettier": true, + "esnext": false, + "ignores": [ + "character-reference-invalid.js" + ] + } +} diff --git a/node_modules/character-reference-invalid/readme.md b/node_modules/character-reference-invalid/readme.md new file mode 100644 index 0000000..e2e8f7a --- /dev/null +++ b/node_modules/character-reference-invalid/readme.md @@ -0,0 +1,74 @@ +# character-reference-invalid + +[![Build][build-badge]][build] +[![Downloads][downloads-badge]][downloads] +[![Size][size-badge]][size] + +HTML invalid numeric character reference information. + +## Install + +[npm][]: + +```sh +npm install character-reference-invalid +``` + +## Use + +```js +var characterReferenceInvalid = require('character-reference-invalid') + +console.log(characterReferenceInvalid[0x80]) // => '€' +console.log(characterReferenceInvalid[0x89]) // => '‰' +console.log(characterReferenceInvalid[0x99]) // => '™' +``` + +## API + +### `characterReferenceInvalid` + +Mapping between invalid numeric character reference to replacements. + +## Support + +See [`html.spec.whatwg.org`][html]. + +## Related + +* [`character-entities`](https://github.com/wooorm/character-entities) + — HTML character entity info +* [`character-entities-html4`](https://github.com/wooorm/character-entities-html4) + — HTML 4 character entity info +* [`character-entities-legacy`](https://github.com/wooorm/character-entities-legacy) + — Legacy character entity info +* [`parse-entities`](https://github.com/wooorm/parse-entities) + — Parse HTML character references +* [`stringify-entities`](https://github.com/wooorm/stringify-entities) + — Serialize HTML character references + +## License + +[MIT][license] © [Titus Wormer][author] + + + +[build-badge]: https://img.shields.io/travis/wooorm/character-reference-invalid.svg + +[build]: https://travis-ci.org/wooorm/character-reference-invalid + +[downloads-badge]: https://img.shields.io/npm/dm/character-reference-invalid.svg + +[downloads]: https://www.npmjs.com/package/character-reference-invalid + +[size-badge]: https://img.shields.io/bundlephobia/minzip/character-reference-invalid.svg + +[size]: https://bundlephobia.com/result?p=character-reference-invalid + +[npm]: https://docs.npmjs.com/cli/install + +[license]: license + +[author]: https://wooorm.com + +[html]: https://html.spec.whatwg.org/multipage/syntax.html#table-charref-overrides diff --git a/node_modules/collapse-white-space/index.js b/node_modules/collapse-white-space/index.js new file mode 100644 index 0000000..93d5466 --- /dev/null +++ b/node_modules/collapse-white-space/index.js @@ -0,0 +1,8 @@ +'use strict' + +module.exports = collapse + +// `collapse(' \t\nbar \nbaz\t') // ' bar baz '` +function collapse(value) { + return String(value).replace(/\s+/g, ' ') +} diff --git a/node_modules/collapse-white-space/license b/node_modules/collapse-white-space/license new file mode 100644 index 0000000..32e7a3d --- /dev/null +++ b/node_modules/collapse-white-space/license @@ -0,0 +1,22 @@ +(The MIT License) + +Copyright (c) 2015 Titus Wormer + +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: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +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. diff --git a/node_modules/collapse-white-space/package.json b/node_modules/collapse-white-space/package.json new file mode 100644 index 0000000..379db87 --- /dev/null +++ b/node_modules/collapse-white-space/package.json @@ -0,0 +1,109 @@ +{ + "_from": "collapse-white-space@^1.0.2", + "_id": "collapse-white-space@1.0.6", + "_inBundle": false, + "_integrity": "sha512-jEovNnrhMuqyCcjfEJA56v0Xq8SkIoPKDyaHahwo3POf4qcSXqMYuwNcOTzp74vTsR9Tn08z4MxWqAhcekogkQ==", + "_location": "/collapse-white-space", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "collapse-white-space@^1.0.2", + "name": "collapse-white-space", + "escapedName": "collapse-white-space", + "rawSpec": "^1.0.2", + "saveSpec": null, + "fetchSpec": "^1.0.2" + }, + "_requiredBy": [ + "/remark-parse" + ], + "_resolved": "https://registry.npmjs.org/collapse-white-space/-/collapse-white-space-1.0.6.tgz", + "_shasum": "e63629c0016665792060dbbeb79c42239d2c5287", + "_spec": "collapse-white-space@^1.0.2", + "_where": "/Users/josh/Projects/slackify-markdown-action/node_modules/remark-parse", + "author": { + "name": "Titus Wormer", + "email": "tituswormer@gmail.com", + "url": "https://wooorm.com" + }, + "bugs": { + "url": "https://github.com/wooorm/collapse-white-space/issues" + }, + "bundleDependencies": false, + "contributors": [ + { + "name": "Titus Wormer", + "email": "tituswormer@gmail.com", + "url": "https://wooorm.com" + } + ], + "dependencies": {}, + "deprecated": false, + "description": "Replace multiple white-space characters with a single space", + "devDependencies": { + "browserify": "^16.0.0", + "nyc": "^15.0.0", + "prettier": "^1.0.0", + "remark-cli": "^7.0.0", + "remark-preset-wooorm": "^6.0.0", + "tape": "^4.0.0", + "tinyify": "^2.0.0", + "xo": "^0.25.0" + }, + "files": [ + "index.js" + ], + "funding": { + "type": "github", + "url": "https://github.com/sponsors/wooorm" + }, + "homepage": "https://github.com/wooorm/collapse-white-space#readme", + "keywords": [ + "collapse", + "white", + "space" + ], + "license": "MIT", + "name": "collapse-white-space", + "nyc": { + "check-coverage": true, + "lines": 100, + "functions": 100, + "branches": 100 + }, + "prettier": { + "tabWidth": 2, + "useTabs": false, + "singleQuote": true, + "bracketSpacing": false, + "semi": false, + "trailingComma": "none" + }, + "remarkConfig": { + "plugins": [ + "preset-wooorm" + ] + }, + "repository": { + "type": "git", + "url": "git+https://github.com/wooorm/collapse-white-space.git" + }, + "scripts": { + "build": "npm run build-bundle && npm run build-mangle", + "build-bundle": "browserify . -s collapseWhiteSpace -o collapse-white-space.js", + "build-mangle": "browserify . -s collapseWhiteSpace -p tinyify -o collapse-white-space.min.js", + "format": "remark . -qfo && prettier --write \"**/*.js\" && xo --fix", + "test": "npm run format && npm run build && npm run test-coverage", + "test-api": "node test", + "test-coverage": "nyc --reporter lcov tape test.js" + }, + "version": "1.0.6", + "xo": { + "prettier": true, + "esnext": false, + "ignores": [ + "collapse-white-space.js" + ] + } +} diff --git a/node_modules/collapse-white-space/readme.md b/node_modules/collapse-white-space/readme.md new file mode 100644 index 0000000..5154c9f --- /dev/null +++ b/node_modules/collapse-white-space/readme.md @@ -0,0 +1,58 @@ +# collapse-white-space + +[![Build][build-badge]][build] +[![Coverage][coverage-badge]][coverage] +[![Downloads][downloads-badge]][downloads] +[![Size][size-badge]][size] + +Replace multiple whitespace characters with a single space. + +## Install + +[npm][]: + +```sh +npm install collapse-white-space +``` + +## Use + +```js +var collapse = require('collapse-white-space') + +collapse('\tfoo \n\tbar \t\r\nbaz') //=> ' foo bar baz' +``` + +## API + +### `collapse(value)` + +Replace multiple whitespace characters in value with a single space. + +## License + +[MIT][license] © [Titus Wormer][author] + + + +[build-badge]: https://img.shields.io/travis/wooorm/collapse-white-space.svg + +[build]: https://travis-ci.org/wooorm/collapse-white-space + +[coverage-badge]: https://img.shields.io/codecov/c/github/wooorm/collapse-white-space.svg + +[coverage]: https://codecov.io/github/wooorm/collapse-white-space + +[downloads-badge]: https://img.shields.io/npm/dm/collapse-white-space.svg + +[downloads]: https://www.npmjs.com/package/collapse-white-space + +[size-badge]: https://img.shields.io/bundlephobia/minzip/collapse-white-space.svg + +[size]: https://bundlephobia.com/result?p=collapse-white-space + +[npm]: https://docs.npmjs.com/cli/install + +[license]: license + +[author]: https://wooorm.com diff --git a/node_modules/extend/.editorconfig b/node_modules/extend/.editorconfig new file mode 100644 index 0000000..bc228f8 --- /dev/null +++ b/node_modules/extend/.editorconfig @@ -0,0 +1,20 @@ +root = true + +[*] +indent_style = tab +indent_size = 4 +end_of_line = lf +charset = utf-8 +trim_trailing_whitespace = true +insert_final_newline = true +max_line_length = 150 + +[CHANGELOG.md] +indent_style = space +indent_size = 2 + +[*.json] +max_line_length = off + +[Makefile] +max_line_length = off diff --git a/node_modules/extend/.eslintrc b/node_modules/extend/.eslintrc new file mode 100644 index 0000000..a34cf28 --- /dev/null +++ b/node_modules/extend/.eslintrc @@ -0,0 +1,17 @@ +{ + "root": true, + + "extends": "@ljharb", + + "rules": { + "complexity": [2, 20], + "eqeqeq": [2, "allow-null"], + "func-name-matching": [1], + "max-depth": [1, 4], + "max-statements": [2, 26], + "no-extra-parens": [1], + "no-magic-numbers": [0], + "no-restricted-syntax": [2, "BreakStatement", "ContinueStatement", "DebuggerStatement", "LabeledStatement", "WithStatement"], + "sort-keys": [0], + } +} diff --git a/node_modules/extend/.jscs.json b/node_modules/extend/.jscs.json new file mode 100644 index 0000000..3cce01d --- /dev/null +++ b/node_modules/extend/.jscs.json @@ -0,0 +1,175 @@ +{ + "es3": true, + + "additionalRules": [], + + "requireSemicolons": true, + + "disallowMultipleSpaces": true, + + "disallowIdentifierNames": [], + + "requireCurlyBraces": { + "allExcept": [], + "keywords": ["if", "else", "for", "while", "do", "try", "catch"] + }, + + "requireSpaceAfterKeywords": ["if", "else", "for", "while", "do", "switch", "return", "try", "catch", "function"], + + "disallowSpaceAfterKeywords": [], + + "disallowSpaceBeforeComma": true, + "disallowSpaceAfterComma": false, + "disallowSpaceBeforeSemicolon": true, + + "disallowNodeTypes": [ + "DebuggerStatement", + "LabeledStatement", + "SwitchCase", + "SwitchStatement", + "WithStatement" + ], + + "requireObjectKeysOnNewLine": { "allExcept": ["sameLine"] }, + + "requireSpacesInAnonymousFunctionExpression": { "beforeOpeningRoundBrace": true, "beforeOpeningCurlyBrace": true }, + "requireSpacesInNamedFunctionExpression": { "beforeOpeningCurlyBrace": true }, + "disallowSpacesInNamedFunctionExpression": { "beforeOpeningRoundBrace": true }, + "requireSpacesInFunctionDeclaration": { "beforeOpeningCurlyBrace": true }, + "disallowSpacesInFunctionDeclaration": { "beforeOpeningRoundBrace": true }, + + "requireSpaceBetweenArguments": true, + + "disallowSpacesInsideParentheses": true, + + "disallowSpacesInsideArrayBrackets": true, + + "disallowQuotedKeysInObjects": { "allExcept": ["reserved"] }, + + "disallowSpaceAfterObjectKeys": true, + + "requireCommaBeforeLineBreak": true, + + "disallowSpaceAfterPrefixUnaryOperators": ["++", "--", "+", "-", "~", "!"], + "requireSpaceAfterPrefixUnaryOperators": [], + + "disallowSpaceBeforePostfixUnaryOperators": ["++", "--"], + "requireSpaceBeforePostfixUnaryOperators": [], + + "disallowSpaceBeforeBinaryOperators": [], + "requireSpaceBeforeBinaryOperators": ["+", "-", "/", "*", "=", "==", "===", "!=", "!=="], + + "requireSpaceAfterBinaryOperators": ["+", "-", "/", "*", "=", "==", "===", "!=", "!=="], + "disallowSpaceAfterBinaryOperators": [], + + "disallowImplicitTypeConversion": ["binary", "string"], + + "disallowKeywords": ["with", "eval"], + + "requireKeywordsOnNewLine": [], + "disallowKeywordsOnNewLine": ["else"], + + "requireLineFeedAtFileEnd": true, + + "disallowTrailingWhitespace": true, + + "disallowTrailingComma": true, + + "excludeFiles": ["node_modules/**", "vendor/**"], + + "disallowMultipleLineStrings": true, + + "requireDotNotation": { "allExcept": ["keywords"] }, + + "requireParenthesesAroundIIFE": true, + + "validateLineBreaks": "LF", + + "validateQuoteMarks": { + "escape": true, + "mark": "'" + }, + + "disallowOperatorBeforeLineBreak": [], + + "requireSpaceBeforeKeywords": [ + "do", + "for", + "if", + "else", + "switch", + "case", + "try", + "catch", + "finally", + "while", + "with", + "return" + ], + + "validateAlignedFunctionParameters": { + "lineBreakAfterOpeningBraces": true, + "lineBreakBeforeClosingBraces": true + }, + + "requirePaddingNewLinesBeforeExport": true, + + "validateNewlineAfterArrayElements": { + "maximum": 6 + }, + + "requirePaddingNewLinesAfterUseStrict": true, + + "disallowArrowFunctions": true, + + "disallowMultiLineTernary": true, + + "validateOrderInObjectKeys": false, + + "disallowIdenticalDestructuringNames": true, + + "disallowNestedTernaries": { "maxLevel": 1 }, + + "requireSpaceAfterComma": { "allExcept": ["trailing"] }, + "requireAlignedMultilineParams": false, + + "requireSpacesInGenerator": { + "afterStar": true + }, + + "disallowSpacesInGenerator": { + "beforeStar": true + }, + + "disallowVar": false, + + "requireArrayDestructuring": false, + + "requireEnhancedObjectLiterals": false, + + "requireObjectDestructuring": false, + + "requireEarlyReturn": false, + + "requireCapitalizedConstructorsNew": { + "allExcept": ["Function", "String", "Object", "Symbol", "Number", "Date", "RegExp", "Error", "Boolean", "Array"] + }, + + "requireImportAlphabetized": false, + + "requireSpaceBeforeObjectValues": true, + "requireSpaceBeforeDestructuredValues": true, + + "disallowSpacesInsideTemplateStringPlaceholders": true, + + "disallowArrayDestructuringReturn": false, + + "requireNewlineBeforeSingleStatementsInIf": false, + + "disallowUnusedVariables": true, + + "requireSpacesInsideImportedObjectBraces": true, + + "requireUseStrict": true +} + diff --git a/node_modules/extend/.travis.yml b/node_modules/extend/.travis.yml new file mode 100644 index 0000000..5ccdfc4 --- /dev/null +++ b/node_modules/extend/.travis.yml @@ -0,0 +1,230 @@ +language: node_js +os: + - linux +node_js: + - "10.7" + - "9.11" + - "8.11" + - "7.10" + - "6.14" + - "5.12" + - "4.9" + - "iojs-v3.3" + - "iojs-v2.5" + - "iojs-v1.8" + - "0.12" + - "0.10" + - "0.8" +before_install: + - 'case "${TRAVIS_NODE_VERSION}" in 0.*) export NPM_CONFIG_STRICT_SSL=false ;; esac' + - 'nvm install-latest-npm' +install: + - 'if [ "${TRAVIS_NODE_VERSION}" = "0.6" ] || [ "${TRAVIS_NODE_VERSION}" = "0.9" ]; then nvm install --latest-npm 0.8 && npm install && nvm use "${TRAVIS_NODE_VERSION}"; else npm install; fi;' +script: + - 'if [ -n "${PRETEST-}" ]; then npm run pretest ; fi' + - 'if [ -n "${POSTTEST-}" ]; then npm run posttest ; fi' + - 'if [ -n "${COVERAGE-}" ]; then npm run coverage ; fi' + - 'if [ -n "${TEST-}" ]; then npm run tests-only ; fi' +sudo: false +env: + - TEST=true +matrix: + fast_finish: true + include: + - node_js: "lts/*" + env: PRETEST=true + - node_js: "lts/*" + env: POSTTEST=true + - node_js: "4" + env: COVERAGE=true + - node_js: "10.6" + env: TEST=true ALLOW_FAILURE=true + - node_js: "10.5" + env: TEST=true ALLOW_FAILURE=true + - node_js: "10.4" + env: TEST=true ALLOW_FAILURE=true + - node_js: "10.3" + env: TEST=true ALLOW_FAILURE=true + - node_js: "10.2" + env: TEST=true ALLOW_FAILURE=true + - node_js: "10.1" + env: TEST=true ALLOW_FAILURE=true + - node_js: "10.0" + env: TEST=true ALLOW_FAILURE=true + - node_js: "9.10" + env: TEST=true ALLOW_FAILURE=true + - node_js: "9.9" + env: TEST=true ALLOW_FAILURE=true + - node_js: "9.8" + env: TEST=true ALLOW_FAILURE=true + - node_js: "9.7" + env: TEST=true ALLOW_FAILURE=true + - node_js: "9.6" + env: TEST=true ALLOW_FAILURE=true + - node_js: "9.5" + env: TEST=true ALLOW_FAILURE=true + - node_js: "9.4" + env: TEST=true ALLOW_FAILURE=true + - node_js: "9.3" + env: TEST=true ALLOW_FAILURE=true + - node_js: "9.2" + env: TEST=true ALLOW_FAILURE=true + - node_js: "9.1" + env: TEST=true ALLOW_FAILURE=true + - node_js: "9.0" + env: TEST=true ALLOW_FAILURE=true + - node_js: "8.10" + env: TEST=true ALLOW_FAILURE=true + - node_js: "8.9" + env: TEST=true ALLOW_FAILURE=true + - node_js: "8.8" + env: TEST=true ALLOW_FAILURE=true + - node_js: "8.7" + env: TEST=true ALLOW_FAILURE=true + - node_js: "8.6" + env: TEST=true ALLOW_FAILURE=true + - node_js: "8.5" + env: TEST=true ALLOW_FAILURE=true + - node_js: "8.4" + env: TEST=true ALLOW_FAILURE=true + - node_js: "8.3" + env: TEST=true ALLOW_FAILURE=true + - node_js: "8.2" + env: TEST=true ALLOW_FAILURE=true + - node_js: "8.1" + env: TEST=true ALLOW_FAILURE=true + - node_js: "8.0" + env: TEST=true ALLOW_FAILURE=true + - node_js: "7.9" + env: TEST=true ALLOW_FAILURE=true + - node_js: "7.8" + env: TEST=true ALLOW_FAILURE=true + - node_js: "7.7" + env: TEST=true ALLOW_FAILURE=true + - node_js: "7.6" + env: TEST=true ALLOW_FAILURE=true + - node_js: "7.5" + env: TEST=true ALLOW_FAILURE=true + - node_js: "7.4" + env: TEST=true ALLOW_FAILURE=true + - node_js: "7.3" + env: TEST=true ALLOW_FAILURE=true + - node_js: "7.2" + env: TEST=true ALLOW_FAILURE=true + - node_js: "7.1" + env: TEST=true ALLOW_FAILURE=true + - node_js: "7.0" + env: TEST=true ALLOW_FAILURE=true + - node_js: "6.13" + env: TEST=true ALLOW_FAILURE=true + - node_js: "6.12" + env: TEST=true ALLOW_FAILURE=true + - node_js: "6.11" + env: TEST=true ALLOW_FAILURE=true + - node_js: "6.10" + env: TEST=true ALLOW_FAILURE=true + - node_js: "6.9" + env: TEST=true ALLOW_FAILURE=true + - node_js: "6.8" + env: TEST=true ALLOW_FAILURE=true + - node_js: "6.7" + env: TEST=true ALLOW_FAILURE=true + - node_js: "6.6" + env: TEST=true ALLOW_FAILURE=true + - node_js: "6.5" + env: TEST=true ALLOW_FAILURE=true + - node_js: "6.4" + env: TEST=true ALLOW_FAILURE=true + - node_js: "6.3" + env: TEST=true ALLOW_FAILURE=true + - node_js: "6.2" + env: TEST=true ALLOW_FAILURE=true + - node_js: "6.1" + env: TEST=true ALLOW_FAILURE=true + - node_js: "6.0" + env: TEST=true ALLOW_FAILURE=true + - node_js: "5.11" + env: TEST=true ALLOW_FAILURE=true + - node_js: "5.10" + env: TEST=true ALLOW_FAILURE=true + - node_js: "5.9" + env: TEST=true ALLOW_FAILURE=true + - node_js: "5.8" + env: TEST=true ALLOW_FAILURE=true + - node_js: "5.7" + env: TEST=true ALLOW_FAILURE=true + - node_js: "5.6" + env: TEST=true ALLOW_FAILURE=true + - node_js: "5.5" + env: TEST=true ALLOW_FAILURE=true + - node_js: "5.4" + env: TEST=true ALLOW_FAILURE=true + - node_js: "5.3" + env: TEST=true ALLOW_FAILURE=true + - node_js: "5.2" + env: TEST=true ALLOW_FAILURE=true + - node_js: "5.1" + env: TEST=true ALLOW_FAILURE=true + - node_js: "5.0" + env: TEST=true ALLOW_FAILURE=true + - node_js: "4.8" + env: TEST=true ALLOW_FAILURE=true + - node_js: "4.7" + env: TEST=true ALLOW_FAILURE=true + - node_js: "4.6" + env: TEST=true ALLOW_FAILURE=true + - node_js: "4.5" + env: TEST=true ALLOW_FAILURE=true + - node_js: "4.4" + env: TEST=true ALLOW_FAILURE=true + - node_js: "4.3" + env: TEST=true ALLOW_FAILURE=true + - node_js: "4.2" + env: TEST=true ALLOW_FAILURE=true + - node_js: "4.1" + env: TEST=true ALLOW_FAILURE=true + - node_js: "4.0" + env: TEST=true ALLOW_FAILURE=true + - node_js: "iojs-v3.2" + env: TEST=true ALLOW_FAILURE=true + - node_js: "iojs-v3.1" + env: TEST=true ALLOW_FAILURE=true + - node_js: "iojs-v3.0" + env: TEST=true ALLOW_FAILURE=true + - node_js: "iojs-v2.4" + env: TEST=true ALLOW_FAILURE=true + - node_js: "iojs-v2.3" + env: TEST=true ALLOW_FAILURE=true + - node_js: "iojs-v2.2" + env: TEST=true ALLOW_FAILURE=true + - node_js: "iojs-v2.1" + env: TEST=true ALLOW_FAILURE=true + - node_js: "iojs-v2.0" + env: TEST=true ALLOW_FAILURE=true + - node_js: "iojs-v1.7" + env: TEST=true ALLOW_FAILURE=true + - node_js: "iojs-v1.6" + env: TEST=true ALLOW_FAILURE=true + - node_js: "iojs-v1.5" + env: TEST=true ALLOW_FAILURE=true + - node_js: "iojs-v1.4" + env: TEST=true ALLOW_FAILURE=true + - node_js: "iojs-v1.3" + env: TEST=true ALLOW_FAILURE=true + - node_js: "iojs-v1.2" + env: TEST=true ALLOW_FAILURE=true + - node_js: "iojs-v1.1" + env: TEST=true ALLOW_FAILURE=true + - node_js: "iojs-v1.0" + env: TEST=true ALLOW_FAILURE=true + - node_js: "0.11" + env: TEST=true ALLOW_FAILURE=true + - node_js: "0.9" + env: TEST=true ALLOW_FAILURE=true + - node_js: "0.6" + env: TEST=true ALLOW_FAILURE=true + - node_js: "0.4" + env: TEST=true ALLOW_FAILURE=true + allow_failures: + - os: osx + - env: TEST=true ALLOW_FAILURE=true diff --git a/node_modules/extend/CHANGELOG.md b/node_modules/extend/CHANGELOG.md new file mode 100644 index 0000000..2cf7de6 --- /dev/null +++ b/node_modules/extend/CHANGELOG.md @@ -0,0 +1,83 @@ +3.0.2 / 2018-07-19 +================== + * [Fix] Prevent merging `__proto__` property (#48) + * [Dev Deps] update `eslint`, `@ljharb/eslint-config`, `tape` + * [Tests] up to `node` `v10.7`, `v9.11`, `v8.11`, `v7.10`, `v6.14`, `v4.9`; use `nvm install-latest-npm` + +3.0.1 / 2017-04-27 +================== + * [Fix] deep extending should work with a non-object (#46) + * [Dev Deps] update `tape`, `eslint`, `@ljharb/eslint-config` + * [Tests] up to `node` `v7.9`, `v6.10`, `v4.8`; improve matrix + * [Docs] Switch from vb.teelaun.ch to versionbadg.es for the npm version badge SVG. + * [Docs] Add example to readme (#34) + +3.0.0 / 2015-07-01 +================== + * [Possible breaking change] Use global "strict" directive (#32) + * [Tests] `int` is an ES3 reserved word + * [Tests] Test up to `io.js` `v2.3` + * [Tests] Add `npm run eslint` + * [Dev Deps] Update `covert`, `jscs` + +2.0.1 / 2015-04-25 +================== + * Use an inline `isArray` check, for ES3 browsers. (#27) + * Some old browsers fail when an identifier is `toString` + * Test latest `node` and `io.js` versions on `travis-ci`; speed up builds + * Add license info to package.json (#25) + * Update `tape`, `jscs` + * Adding a CHANGELOG + +2.0.0 / 2014-10-01 +================== + * Increase code coverage to 100%; run code coverage as part of tests + * Add `npm run lint`; Run linter as part of tests + * Remove nodeType and setInterval checks in isPlainObject + * Updating `tape`, `jscs`, `covert` + * General style and README cleanup + +1.3.0 / 2014-06-20 +================== + * Add component.json for browser support (#18) + * Use SVG for badges in README (#16) + * Updating `tape`, `covert` + * Updating travis-ci to work with multiple node versions + * Fix `deep === false` bug (returning target as {}) (#14) + * Fixing constructor checks in isPlainObject + * Adding additional test coverage + * Adding `npm run coverage` + * Add LICENSE (#13) + * Adding a warning about `false`, per #11 + * General style and whitespace cleanup + +1.2.1 / 2013-09-14 +================== + * Fixing hasOwnProperty bugs that would only have shown up in specific browsers. Fixes #8 + * Updating `tape` + +1.2.0 / 2013-09-02 +================== + * Updating the README: add badges + * Adding a missing variable reference. + * Using `tape` instead of `buster` for tests; add more tests (#7) + * Adding node 0.10 to Travis CI (#6) + * Enabling "npm test" and cleaning up package.json (#5) + * Add Travis CI. + +1.1.3 / 2012-12-06 +================== + * Added unit tests. + * Ensure extend function is named. (Looks nicer in a stack trace.) + * README cleanup. + +1.1.1 / 2012-11-07 +================== + * README cleanup. + * Added installation instructions. + * Added a missing semicolon + +1.0.0 / 2012-04-08 +================== + * Initial commit + diff --git a/node_modules/extend/LICENSE b/node_modules/extend/LICENSE new file mode 100644 index 0000000..e16d6a5 --- /dev/null +++ b/node_modules/extend/LICENSE @@ -0,0 +1,23 @@ +The MIT License (MIT) + +Copyright (c) 2014 Stefan Thomas + +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: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +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. + diff --git a/node_modules/extend/README.md b/node_modules/extend/README.md new file mode 100644 index 0000000..5b8249a --- /dev/null +++ b/node_modules/extend/README.md @@ -0,0 +1,81 @@ +[![Build Status][travis-svg]][travis-url] +[![dependency status][deps-svg]][deps-url] +[![dev dependency status][dev-deps-svg]][dev-deps-url] + +# extend() for Node.js [![Version Badge][npm-version-png]][npm-url] + +`node-extend` is a port of the classic extend() method from jQuery. It behaves as you expect. It is simple, tried and true. + +Notes: + +* Since Node.js >= 4, + [`Object.assign`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/assign) + now offers the same functionality natively (but without the "deep copy" option). + See [ECMAScript 2015 (ES6) in Node.js](https://nodejs.org/en/docs/es6). +* Some native implementations of `Object.assign` in both Node.js and many + browsers (since NPM modules are for the browser too) may not be fully + spec-compliant. + Check [`object.assign`](https://www.npmjs.com/package/object.assign) module for + a compliant candidate. + +## Installation + +This package is available on [npm][npm-url] as: `extend` + +``` sh +npm install extend +``` + +## Usage + +**Syntax:** extend **(** [`deep`], `target`, `object1`, [`objectN`] **)** + +*Extend one object with one or more others, returning the modified object.* + +**Example:** + +``` js +var extend = require('extend'); +extend(targetObject, object1, object2); +``` + +Keep in mind that the target object will be modified, and will be returned from extend(). + +If a boolean true is specified as the first argument, extend performs a deep copy, recursively copying any objects it finds. Otherwise, the copy will share structure with the original object(s). +Undefined properties are not copied. However, properties inherited from the object's prototype will be copied over. +Warning: passing `false` as the first argument is not supported. + +### Arguments + +* `deep` *Boolean* (optional) +If set, the merge becomes recursive (i.e. deep copy). +* `target` *Object* +The object to extend. +* `object1` *Object* +The object that will be merged into the first. +* `objectN` *Object* (Optional) +More objects to merge into the first. + +## License + +`node-extend` is licensed under the [MIT License][mit-license-url]. + +## Acknowledgements + +All credit to the jQuery authors for perfecting this amazing utility. + +Ported to Node.js by [Stefan Thomas][github-justmoon] with contributions by [Jonathan Buchanan][github-insin] and [Jordan Harband][github-ljharb]. + +[travis-svg]: https://travis-ci.org/justmoon/node-extend.svg +[travis-url]: https://travis-ci.org/justmoon/node-extend +[npm-url]: https://npmjs.org/package/extend +[mit-license-url]: http://opensource.org/licenses/MIT +[github-justmoon]: https://github.com/justmoon +[github-insin]: https://github.com/insin +[github-ljharb]: https://github.com/ljharb +[npm-version-png]: http://versionbadg.es/justmoon/node-extend.svg +[deps-svg]: https://david-dm.org/justmoon/node-extend.svg +[deps-url]: https://david-dm.org/justmoon/node-extend +[dev-deps-svg]: https://david-dm.org/justmoon/node-extend/dev-status.svg +[dev-deps-url]: https://david-dm.org/justmoon/node-extend#info=devDependencies + diff --git a/node_modules/extend/component.json b/node_modules/extend/component.json new file mode 100644 index 0000000..1500a2f --- /dev/null +++ b/node_modules/extend/component.json @@ -0,0 +1,32 @@ +{ + "name": "extend", + "author": "Stefan Thomas (http://www.justmoon.net)", + "version": "3.0.0", + "description": "Port of jQuery.extend for node.js and the browser.", + "scripts": [ + "index.js" + ], + "contributors": [ + { + "name": "Jordan Harband", + "url": "https://github.com/ljharb" + } + ], + "keywords": [ + "extend", + "clone", + "merge" + ], + "repository" : { + "type": "git", + "url": "https://github.com/justmoon/node-extend.git" + }, + "dependencies": { + }, + "devDependencies": { + "tape" : "~3.0.0", + "covert": "~0.4.0", + "jscs": "~1.6.2" + } +} + diff --git a/node_modules/extend/index.js b/node_modules/extend/index.js new file mode 100644 index 0000000..2aa3faa --- /dev/null +++ b/node_modules/extend/index.js @@ -0,0 +1,117 @@ +'use strict'; + +var hasOwn = Object.prototype.hasOwnProperty; +var toStr = Object.prototype.toString; +var defineProperty = Object.defineProperty; +var gOPD = Object.getOwnPropertyDescriptor; + +var isArray = function isArray(arr) { + if (typeof Array.isArray === 'function') { + return Array.isArray(arr); + } + + return toStr.call(arr) === '[object Array]'; +}; + +var isPlainObject = function isPlainObject(obj) { + if (!obj || toStr.call(obj) !== '[object Object]') { + return false; + } + + var hasOwnConstructor = hasOwn.call(obj, 'constructor'); + var hasIsPrototypeOf = obj.constructor && obj.constructor.prototype && hasOwn.call(obj.constructor.prototype, 'isPrototypeOf'); + // Not own constructor property must be Object + if (obj.constructor && !hasOwnConstructor && !hasIsPrototypeOf) { + return false; + } + + // Own properties are enumerated firstly, so to speed up, + // if last one is own, then all properties are own. + var key; + for (key in obj) { /**/ } + + return typeof key === 'undefined' || hasOwn.call(obj, key); +}; + +// If name is '__proto__', and Object.defineProperty is available, define __proto__ as an own property on target +var setProperty = function setProperty(target, options) { + if (defineProperty && options.name === '__proto__') { + defineProperty(target, options.name, { + enumerable: true, + configurable: true, + value: options.newValue, + writable: true + }); + } else { + target[options.name] = options.newValue; + } +}; + +// Return undefined instead of __proto__ if '__proto__' is not an own property +var getProperty = function getProperty(obj, name) { + if (name === '__proto__') { + if (!hasOwn.call(obj, name)) { + return void 0; + } else if (gOPD) { + // In early versions of node, obj['__proto__'] is buggy when obj has + // __proto__ as an own property. Object.getOwnPropertyDescriptor() works. + return gOPD(obj, name).value; + } + } + + return obj[name]; +}; + +module.exports = function extend() { + var options, name, src, copy, copyIsArray, clone; + var target = arguments[0]; + var i = 1; + var length = arguments.length; + var deep = false; + + // Handle a deep copy situation + if (typeof target === 'boolean') { + deep = target; + target = arguments[1] || {}; + // skip the boolean and the target + i = 2; + } + if (target == null || (typeof target !== 'object' && typeof target !== 'function')) { + target = {}; + } + + for (; i < length; ++i) { + options = arguments[i]; + // Only deal with non-null/undefined values + if (options != null) { + // Extend the base object + for (name in options) { + src = getProperty(target, name); + copy = getProperty(options, name); + + // Prevent never-ending loop + if (target !== copy) { + // Recurse if we're merging plain objects or arrays + if (deep && copy && (isPlainObject(copy) || (copyIsArray = isArray(copy)))) { + if (copyIsArray) { + copyIsArray = false; + clone = src && isArray(src) ? src : []; + } else { + clone = src && isPlainObject(src) ? src : {}; + } + + // Never move original objects, clone them + setProperty(target, { name: name, newValue: extend(deep, clone, copy) }); + + // Don't bring in undefined values + } else if (typeof copy !== 'undefined') { + setProperty(target, { name: name, newValue: copy }); + } + } + } + } + } + + // Return the modified object + return target; +}; diff --git a/node_modules/extend/package.json b/node_modules/extend/package.json new file mode 100644 index 0000000..82bbf2c --- /dev/null +++ b/node_modules/extend/package.json @@ -0,0 +1,75 @@ +{ + "_from": "extend@^3.0.0", + "_id": "extend@3.0.2", + "_inBundle": false, + "_integrity": "sha512-fjquC59cD7CyW6urNXK0FBufkZcoiGG80wTuPujX590cB5Ttln20E2UB4S/WARVqhXffZl2LNgS+gQdPIIim/g==", + "_location": "/extend", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "extend@^3.0.0", + "name": "extend", + "escapedName": "extend", + "rawSpec": "^3.0.0", + "saveSpec": null, + "fetchSpec": "^3.0.0" + }, + "_requiredBy": [ + "/unified" + ], + "_resolved": "https://registry.npmjs.org/extend/-/extend-3.0.2.tgz", + "_shasum": "f8b1136b4071fbd8eb140aff858b1019ec2915fa", + "_spec": "extend@^3.0.0", + "_where": "/Users/josh/Projects/slackify-markdown-action/node_modules/unified", + "author": { + "name": "Stefan Thomas", + "email": "justmoon@members.fsf.org", + "url": "http://www.justmoon.net" + }, + "bugs": { + "url": "https://github.com/justmoon/node-extend/issues" + }, + "bundleDependencies": false, + "contributors": [ + { + "name": "Jordan Harband", + "url": "https://github.com/ljharb" + } + ], + "dependencies": {}, + "deprecated": false, + "description": "Port of jQuery.extend for node.js and the browser", + "devDependencies": { + "@ljharb/eslint-config": "^12.2.1", + "covert": "^1.1.0", + "eslint": "^4.19.1", + "jscs": "^3.0.7", + "tape": "^4.9.1" + }, + "homepage": "https://github.com/justmoon/node-extend#readme", + "keywords": [ + "extend", + "clone", + "merge" + ], + "license": "MIT", + "main": "index", + "name": "extend", + "repository": { + "type": "git", + "url": "git+https://github.com/justmoon/node-extend.git" + }, + "scripts": { + "coverage": "covert test/index.js", + "coverage-quiet": "covert test/index.js --quiet", + "eslint": "eslint *.js */*.js", + "jscs": "jscs *.js */*.js", + "lint": "npm run jscs && npm run eslint", + "posttest": "npm run coverage-quiet", + "pretest": "npm run lint", + "test": "npm run tests-only", + "tests-only": "node test" + }, + "version": "3.0.2" +} diff --git a/node_modules/inherits/LICENSE b/node_modules/inherits/LICENSE new file mode 100644 index 0000000..dea3013 --- /dev/null +++ b/node_modules/inherits/LICENSE @@ -0,0 +1,16 @@ +The ISC License + +Copyright (c) Isaac Z. Schlueter + +Permission to use, copy, modify, and/or distribute this software for any +purpose with or without fee is hereby granted, provided that the above +copyright notice and this permission notice appear in all copies. + +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH +REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND +FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, +INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM +LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR +OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR +PERFORMANCE OF THIS SOFTWARE. + diff --git a/node_modules/inherits/README.md b/node_modules/inherits/README.md new file mode 100644 index 0000000..b1c5665 --- /dev/null +++ b/node_modules/inherits/README.md @@ -0,0 +1,42 @@ +Browser-friendly inheritance fully compatible with standard node.js +[inherits](http://nodejs.org/api/util.html#util_util_inherits_constructor_superconstructor). + +This package exports standard `inherits` from node.js `util` module in +node environment, but also provides alternative browser-friendly +implementation through [browser +field](https://gist.github.com/shtylman/4339901). Alternative +implementation is a literal copy of standard one located in standalone +module to avoid requiring of `util`. It also has a shim for old +browsers with no `Object.create` support. + +While keeping you sure you are using standard `inherits` +implementation in node.js environment, it allows bundlers such as +[browserify](https://github.com/substack/node-browserify) to not +include full `util` package to your client code if all you need is +just `inherits` function. It worth, because browser shim for `util` +package is large and `inherits` is often the single function you need +from it. + +It's recommended to use this package instead of +`require('util').inherits` for any code that has chances to be used +not only in node.js but in browser too. + +## usage + +```js +var inherits = require('inherits'); +// then use exactly as the standard one +``` + +## note on version ~1.0 + +Version ~1.0 had completely different motivation and is not compatible +neither with 2.0 nor with standard node.js `inherits`. + +If you are using version ~1.0 and planning to switch to ~2.0, be +careful: + +* new version uses `super_` instead of `super` for referencing + superclass +* new version overwrites current prototype while old one preserves any + existing fields on it diff --git a/node_modules/inherits/inherits.js b/node_modules/inherits/inherits.js new file mode 100644 index 0000000..f71f2d9 --- /dev/null +++ b/node_modules/inherits/inherits.js @@ -0,0 +1,9 @@ +try { + var util = require('util'); + /* istanbul ignore next */ + if (typeof util.inherits !== 'function') throw ''; + module.exports = util.inherits; +} catch (e) { + /* istanbul ignore next */ + module.exports = require('./inherits_browser.js'); +} diff --git a/node_modules/inherits/inherits_browser.js b/node_modules/inherits/inherits_browser.js new file mode 100644 index 0000000..86bbb3d --- /dev/null +++ b/node_modules/inherits/inherits_browser.js @@ -0,0 +1,27 @@ +if (typeof Object.create === 'function') { + // implementation from standard node.js 'util' module + module.exports = function inherits(ctor, superCtor) { + if (superCtor) { + ctor.super_ = superCtor + ctor.prototype = Object.create(superCtor.prototype, { + constructor: { + value: ctor, + enumerable: false, + writable: true, + configurable: true + } + }) + } + }; +} else { + // old school shim for old browsers + module.exports = function inherits(ctor, superCtor) { + if (superCtor) { + ctor.super_ = superCtor + var TempCtor = function () {} + TempCtor.prototype = superCtor.prototype + ctor.prototype = new TempCtor() + ctor.prototype.constructor = ctor + } + } +} diff --git a/node_modules/inherits/package.json b/node_modules/inherits/package.json new file mode 100644 index 0000000..b8dad77 --- /dev/null +++ b/node_modules/inherits/package.json @@ -0,0 +1,61 @@ +{ + "_from": "inherits@^2.0.0", + "_id": "inherits@2.0.4", + "_inBundle": false, + "_integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==", + "_location": "/inherits", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "inherits@^2.0.0", + "name": "inherits", + "escapedName": "inherits", + "rawSpec": "^2.0.0", + "saveSpec": null, + "fetchSpec": "^2.0.0" + }, + "_requiredBy": [ + "/unherit" + ], + "_resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", + "_shasum": "0fa2c64f932917c3433a0ded55363aae37416b7c", + "_spec": "inherits@^2.0.0", + "_where": "/Users/josh/Projects/slackify-markdown-action/node_modules/unherit", + "browser": "./inherits_browser.js", + "bugs": { + "url": "https://github.com/isaacs/inherits/issues" + }, + "bundleDependencies": false, + "deprecated": false, + "description": "Browser-friendly inheritance fully compatible with standard node.js inherits()", + "devDependencies": { + "tap": "^14.2.4" + }, + "files": [ + "inherits.js", + "inherits_browser.js" + ], + "homepage": "https://github.com/isaacs/inherits#readme", + "keywords": [ + "inheritance", + "class", + "klass", + "oop", + "object-oriented", + "inherits", + "browser", + "browserify" + ], + "license": "ISC", + "main": "./inherits.js", + "name": "inherits", + "repository": { + "type": "git", + "url": "git://github.com/isaacs/inherits.git" + }, + "scripts": { + "test": "tap" + }, + "version": "2.0.4" +} diff --git a/node_modules/is-alphabetical/index.js b/node_modules/is-alphabetical/index.js new file mode 100644 index 0000000..26d3650 --- /dev/null +++ b/node_modules/is-alphabetical/index.js @@ -0,0 +1,14 @@ +'use strict' + +module.exports = alphabetical + +// Check if the given character code, or the character code at the first +// character, is alphabetical. +function alphabetical(character) { + var code = typeof character === 'string' ? character.charCodeAt(0) : character + + return ( + (code >= 97 && code <= 122) /* a-z */ || + (code >= 65 && code <= 90) /* A-Z */ + ) +} diff --git a/node_modules/is-alphabetical/license b/node_modules/is-alphabetical/license new file mode 100644 index 0000000..8d8660d --- /dev/null +++ b/node_modules/is-alphabetical/license @@ -0,0 +1,22 @@ +(The MIT License) + +Copyright (c) 2016 Titus Wormer + +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: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +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. diff --git a/node_modules/is-alphabetical/package.json b/node_modules/is-alphabetical/package.json new file mode 100644 index 0000000..8ce36b3 --- /dev/null +++ b/node_modules/is-alphabetical/package.json @@ -0,0 +1,115 @@ +{ + "_from": "is-alphabetical@^1.0.0", + "_id": "is-alphabetical@1.0.4", + "_inBundle": false, + "_integrity": "sha512-DwzsA04LQ10FHTZuL0/grVDk4rFoVH1pjAToYwBrHSxcrBIGQuXrQMtD5U1b0U2XVgKZCTLLP8u2Qxqhy3l2Vg==", + "_location": "/is-alphabetical", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "is-alphabetical@^1.0.0", + "name": "is-alphabetical", + "escapedName": "is-alphabetical", + "rawSpec": "^1.0.0", + "saveSpec": null, + "fetchSpec": "^1.0.0" + }, + "_requiredBy": [ + "/is-alphanumerical", + "/remark-parse" + ], + "_resolved": "https://registry.npmjs.org/is-alphabetical/-/is-alphabetical-1.0.4.tgz", + "_shasum": "9e7d6b94916be22153745d184c298cbf986a686d", + "_spec": "is-alphabetical@^1.0.0", + "_where": "/Users/josh/Projects/slackify-markdown-action/node_modules/remark-parse", + "author": { + "name": "Titus Wormer", + "email": "tituswormer@gmail.com", + "url": "https://wooorm.com" + }, + "bugs": { + "url": "https://github.com/wooorm/is-alphabetical/issues" + }, + "bundleDependencies": false, + "contributors": [ + { + "name": "Titus Wormer", + "email": "tituswormer@gmail.com", + "url": "https://wooorm.com" + } + ], + "dependencies": {}, + "deprecated": false, + "description": "Check if a character is alphabetical", + "devDependencies": { + "browserify": "^16.0.0", + "nyc": "^15.0.0", + "prettier": "^1.0.0", + "remark-cli": "^7.0.0", + "remark-preset-wooorm": "^6.0.0", + "tape": "^4.0.0", + "tinyify": "^2.0.0", + "xo": "^0.25.0" + }, + "files": [ + "index.js" + ], + "funding": { + "type": "github", + "url": "https://github.com/sponsors/wooorm" + }, + "homepage": "https://github.com/wooorm/is-alphabetical#readme", + "keywords": [ + "string", + "character", + "char", + "code", + "alphabetical" + ], + "license": "MIT", + "name": "is-alphabetical", + "nyc": { + "check-coverage": true, + "lines": 100, + "functions": 100, + "branches": 100 + }, + "prettier": { + "tabWidth": 2, + "useTabs": false, + "singleQuote": true, + "bracketSpacing": false, + "semi": false, + "trailingComma": "none" + }, + "remarkConfig": { + "plugins": [ + "preset-wooorm" + ] + }, + "repository": { + "type": "git", + "url": "git+https://github.com/wooorm/is-alphabetical.git" + }, + "scripts": { + "build": "npm run build-bundle && npm run build-mangle", + "build-bundle": "browserify -s isAlphabetical -o is-alphabetical.js", + "build-mangle": "browserify -s isAlphabetical -p tinyify -o is-alphabetical.min.js", + "format": "remark . -qfo && prettier --write \"**/*.js\" && xo --fix", + "test": "npm run format && npm run build && npm run test-coverage", + "test-api": "node test", + "test-coverage": "nyc --reporter lcov tape test.js" + }, + "version": "1.0.4", + "xo": { + "prettier": true, + "esnext": false, + "rules": { + "capitalized-comments": "off" + }, + "ignores": [ + "is-alphabetical.js" + ] + } +} diff --git a/node_modules/is-alphabetical/readme.md b/node_modules/is-alphabetical/readme.md new file mode 100644 index 0000000..2a6064b --- /dev/null +++ b/node_modules/is-alphabetical/readme.md @@ -0,0 +1,70 @@ +# is-alphabetical + +[![Build][build-badge]][build] +[![Coverage][coverage-badge]][coverage] +[![Downloads][downloads-badge]][downloads] +[![Size][size-badge]][size] + +Check if a character is alphabetical. + +## Install + +[npm][]: + +```sh +npm install is-alphabetical +``` + +## Use + +```js +var alphabetical = require('is-alphabetical') + +alphabetical('a') // => true +alphabetical('B') // => true +alphabetical('0') // => false +alphabetical('💩') // => false +``` + +## API + +### `alphabetical(character|code)` + +Check whether the given character code (`number`), or the character code at the +first position (`string`), is alphabetical. + +## Related + +* [`is-decimal`](https://github.com/wooorm/is-decimal) +* [`is-hexadecimal`](https://github.com/wooorm/is-hexadecimal) +* [`is-alphanumerical`](https://github.com/wooorm/is-alphanumerical) +* [`is-whitespace-character`](https://github.com/wooorm/is-whitespace-character) +* [`is-word-character`](https://github.com/wooorm/is-word-character) + +## License + +[MIT][license] © [Titus Wormer][author] + + + +[build-badge]: https://img.shields.io/travis/wooorm/is-alphabetical.svg + +[build]: https://travis-ci.org/wooorm/is-alphabetical + +[coverage-badge]: https://img.shields.io/codecov/c/github/wooorm/is-alphabetical.svg + +[coverage]: https://codecov.io/github/wooorm/is-alphabetical + +[downloads-badge]: https://img.shields.io/npm/dm/is-alphabetical.svg + +[downloads]: https://www.npmjs.com/package/is-alphabetical + +[size-badge]: https://img.shields.io/bundlephobia/minzip/is-alphabetical.svg + +[size]: https://bundlephobia.com/result?p=is-alphabetical + +[npm]: https://docs.npmjs.com/cli/install + +[license]: license + +[author]: https://wooorm.com diff --git a/node_modules/is-alphanumeric/index.js b/node_modules/is-alphanumeric/index.js new file mode 100644 index 0000000..3deeea7 --- /dev/null +++ b/node_modules/is-alphanumeric/index.js @@ -0,0 +1,8 @@ +'use strict'; +module.exports = function (str) { + if (typeof str !== 'string') { + throw new TypeError('Expected a string'); + } + + return !/[^0-9a-z\xDF-\xFF]/.test(str.toLowerCase()); +}; diff --git a/node_modules/is-alphanumeric/license b/node_modules/is-alphanumeric/license new file mode 100644 index 0000000..e25c14a --- /dev/null +++ b/node_modules/is-alphanumeric/license @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) Arthur Verschaeve (arthurverschaeve.be) + +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: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +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. diff --git a/node_modules/is-alphanumeric/package.json b/node_modules/is-alphanumeric/package.json new file mode 100644 index 0000000..bcc1f63 --- /dev/null +++ b/node_modules/is-alphanumeric/package.json @@ -0,0 +1,73 @@ +{ + "_from": "is-alphanumeric@^1.0.0", + "_id": "is-alphanumeric@1.0.0", + "_inBundle": false, + "_integrity": "sha1-Spzvcdr0wAHB2B1j0UDPU/1oifQ=", + "_location": "/is-alphanumeric", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "is-alphanumeric@^1.0.0", + "name": "is-alphanumeric", + "escapedName": "is-alphanumeric", + "rawSpec": "^1.0.0", + "saveSpec": null, + "fetchSpec": "^1.0.0" + }, + "_requiredBy": [ + "/remark-stringify" + ], + "_resolved": "https://registry.npmjs.org/is-alphanumeric/-/is-alphanumeric-1.0.0.tgz", + "_shasum": "4a9cef71daf4c001c1d81d63d140cf53fd6889f4", + "_spec": "is-alphanumeric@^1.0.0", + "_where": "/Users/josh/Projects/slackify-markdown-action/node_modules/remark-stringify", + "author": { + "name": "Arthur Verschaeve", + "email": "contact@arthurverschaeve.be", + "url": "arthurverschaeve.be" + }, + "bugs": { + "url": "https://github.com/arthurvr/is-alphanumeric/issues" + }, + "bundleDependencies": false, + "deprecated": false, + "description": "Check if a string only contains alphanumeric characters", + "devDependencies": { + "mocha": "*" + }, + "engines": { + "node": ">=0.10.0" + }, + "files": [ + "index.js" + ], + "homepage": "https://github.com/arthurvr/is-alphanumeric#readme", + "keywords": [ + "numbers", + "numeric", + "alphabet", + "alphabetic", + "check", + "is", + "detect", + "latin", + "alphanumeric", + "string", + "text", + "letters", + "digit", + "arabic", + "alphameric" + ], + "license": "MIT", + "name": "is-alphanumeric", + "repository": { + "type": "git", + "url": "git+https://github.com/arthurvr/is-alphanumeric.git" + }, + "scripts": { + "test": "mocha" + }, + "version": "1.0.0" +} diff --git a/node_modules/is-alphanumeric/readme.md b/node_modules/is-alphanumeric/readme.md new file mode 100644 index 0000000..1ada8d3 --- /dev/null +++ b/node_modules/is-alphanumeric/readme.md @@ -0,0 +1,40 @@ +# is-alphanumeric [![Build Status](https://travis-ci.org/arthurvr/is-alphanumeric.svg?branch=master)](https://travis-ci.org/arthurvr/is-alphanumeric) + +> Check if a string only contains alphanumeric characters + + +## Install + +``` +$ npm install --save is-alphanumeric +``` + + +## Usage + +```js +var isAlphanumeric = require('is-alphanumeric'); + +isAlphanumeric('unicorns'); +//=> true + +isAlphanumeric('55'); +//=> true + +isAlphanumeric('ABC'); +//=> true + +isAlphanumeric('*unicorns'); +//=> false + +isAlphanumeric('{unicorns}'); +//=> false + +isAlphanumeric(' '); +//=> false +``` + + +## License + +MIT © [Arthur Verschaeve](http://arthurverschaeve.be) diff --git a/node_modules/is-alphanumerical/index.js b/node_modules/is-alphanumerical/index.js new file mode 100644 index 0000000..cd5edef --- /dev/null +++ b/node_modules/is-alphanumerical/index.js @@ -0,0 +1,12 @@ +'use strict' + +var alphabetical = require('is-alphabetical') +var decimal = require('is-decimal') + +module.exports = alphanumerical + +// Check if the given character code, or the character code at the first +// character, is alphanumerical. +function alphanumerical(character) { + return alphabetical(character) || decimal(character) +} diff --git a/node_modules/is-alphanumerical/license b/node_modules/is-alphanumerical/license new file mode 100644 index 0000000..8d8660d --- /dev/null +++ b/node_modules/is-alphanumerical/license @@ -0,0 +1,22 @@ +(The MIT License) + +Copyright (c) 2016 Titus Wormer + +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: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +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. diff --git a/node_modules/is-alphanumerical/package.json b/node_modules/is-alphanumerical/package.json new file mode 100644 index 0000000..761e894 --- /dev/null +++ b/node_modules/is-alphanumerical/package.json @@ -0,0 +1,117 @@ +{ + "_from": "is-alphanumerical@^1.0.0", + "_id": "is-alphanumerical@1.0.4", + "_inBundle": false, + "_integrity": "sha512-UzoZUr+XfVz3t3v4KyGEniVL9BDRoQtY7tOyrRybkVNjDFWyo1yhXNGrrBTQxp3ib9BLAWs7k2YKBQsFRkZG9A==", + "_location": "/is-alphanumerical", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "is-alphanumerical@^1.0.0", + "name": "is-alphanumerical", + "escapedName": "is-alphanumerical", + "rawSpec": "^1.0.0", + "saveSpec": null, + "fetchSpec": "^1.0.0" + }, + "_requiredBy": [ + "/parse-entities", + "/stringify-entities" + ], + "_resolved": "https://registry.npmjs.org/is-alphanumerical/-/is-alphanumerical-1.0.4.tgz", + "_shasum": "7eb9a2431f855f6b1ef1a78e326df515696c4dbf", + "_spec": "is-alphanumerical@^1.0.0", + "_where": "/Users/josh/Projects/slackify-markdown-action/node_modules/parse-entities", + "author": { + "name": "Titus Wormer", + "email": "tituswormer@gmail.com", + "url": "https://wooorm.com" + }, + "bugs": { + "url": "https://github.com/wooorm/is-alphanumerical/issues" + }, + "bundleDependencies": false, + "contributors": [ + { + "name": "Titus Wormer", + "email": "tituswormer@gmail.com", + "url": "https://wooorm.com" + } + ], + "dependencies": { + "is-alphabetical": "^1.0.0", + "is-decimal": "^1.0.0" + }, + "deprecated": false, + "description": "Check if a character is alphanumerical", + "devDependencies": { + "browserify": "^16.0.0", + "nyc": "^15.0.0", + "prettier": "^1.0.0", + "remark-cli": "^7.0.0", + "remark-preset-wooorm": "^6.0.0", + "tape": "^4.0.0", + "tinyify": "^2.0.0", + "xo": "^0.25.0" + }, + "files": [ + "index.js" + ], + "funding": { + "type": "github", + "url": "https://github.com/sponsors/wooorm" + }, + "homepage": "https://github.com/wooorm/is-alphanumerical#readme", + "keywords": [ + "string", + "character", + "char", + "code", + "alphabetical", + "numerical", + "alphanumerical" + ], + "license": "MIT", + "name": "is-alphanumerical", + "nyc": { + "check-coverage": true, + "lines": 100, + "functions": 100, + "branches": 100 + }, + "prettier": { + "tabWidth": 2, + "useTabs": false, + "singleQuote": true, + "bracketSpacing": false, + "semi": false, + "trailingComma": "none" + }, + "remarkConfig": { + "plugins": [ + "preset-wooorm" + ] + }, + "repository": { + "type": "git", + "url": "git+https://github.com/wooorm/is-alphanumerical.git" + }, + "scripts": { + "build": "npm run build-bundle && npm run build-mangle", + "build-bundle": "browserify . -s isAlphanumerical -o is-alphanumerical.js", + "build-mangle": "browserify . -s isAlphanumerical -p tinyify -o is-alphanumerical.min.js", + "format": "remark . -qfo && prettier --write \"**/*.js\" && xo --fix", + "test": "npm run format && npm run build && npm run test-coverage", + "test-api": "node test", + "test-coverage": "nyc --reporter lcov tape test.js" + }, + "version": "1.0.4", + "xo": { + "prettier": true, + "esnext": false, + "ignores": [ + "is-alphanumerical.js" + ] + } +} diff --git a/node_modules/is-alphanumerical/readme.md b/node_modules/is-alphanumerical/readme.md new file mode 100644 index 0000000..8496cad --- /dev/null +++ b/node_modules/is-alphanumerical/readme.md @@ -0,0 +1,71 @@ +# is-alphanumerical + +[![Build][build-badge]][build] +[![Coverage][coverage-badge]][coverage] +[![Downloads][downloads-badge]][downloads] +[![Size][size-badge]][size] + +Check if a character is alphanumerical (`[a-zA-Z0-9]`). + +## Install + +[npm][]: + +```sh +npm install is-alphanumerical +``` + +## Use + +```js +var alphanumerical = require('is-alphanumerical') + +alphanumerical('a') // => true +alphanumerical('Z') // => true +alphanumerical('0') // => true +alphanumerical(' ') // => false +alphanumerical('💩') // => false +``` + +## API + +### `alphanumerical(character)` + +Check whether the given character code (`number`), or the character code at the +first position (`string`), is alphanumerical. + +## Related + +* [`is-alphabetical`](https://github.com/wooorm/is-alphabetical) +* [`is-decimal`](https://github.com/wooorm/is-decimal) +* [`is-hexadecimal`](https://github.com/wooorm/is-hexadecimal) +* [`is-whitespace-character`](https://github.com/wooorm/is-whitespace-character) +* [`is-word-character`](https://github.com/wooorm/is-word-character) + +## License + +[MIT][license] © [Titus Wormer][author] + + + +[build-badge]: https://img.shields.io/travis/wooorm/is-alphanumerical.svg + +[build]: https://travis-ci.org/wooorm/is-alphanumerical + +[coverage-badge]: https://img.shields.io/codecov/c/github/wooorm/is-alphanumerical.svg + +[coverage]: https://codecov.io/github/wooorm/is-alphanumerical + +[downloads-badge]: https://img.shields.io/npm/dm/is-alphanumerical.svg + +[downloads]: https://www.npmjs.com/package/is-alphanumerical + +[size-badge]: https://img.shields.io/bundlephobia/minzip/is-alphanumerical.svg + +[size]: https://bundlephobia.com/result?p=is-alphanumerical + +[npm]: https://docs.npmjs.com/cli/install + +[license]: license + +[author]: https://wooorm.com diff --git a/node_modules/is-buffer/LICENSE b/node_modules/is-buffer/LICENSE new file mode 100644 index 0000000..0c068ce --- /dev/null +++ b/node_modules/is-buffer/LICENSE @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) Feross Aboukhadijeh + +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: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +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. diff --git a/node_modules/is-buffer/README.md b/node_modules/is-buffer/README.md new file mode 100644 index 0000000..685798d --- /dev/null +++ b/node_modules/is-buffer/README.md @@ -0,0 +1,56 @@ +# is-buffer [![travis][travis-image]][travis-url] [![npm][npm-image]][npm-url] [![downloads][downloads-image]][downloads-url] [![javascript style guide][standard-image]][standard-url] + +[travis-image]: https://img.shields.io/travis/feross/is-buffer/master.svg +[travis-url]: https://travis-ci.org/feross/is-buffer +[npm-image]: https://img.shields.io/npm/v/is-buffer.svg +[npm-url]: https://npmjs.org/package/is-buffer +[downloads-image]: https://img.shields.io/npm/dm/is-buffer.svg +[downloads-url]: https://npmjs.org/package/is-buffer +[standard-image]: https://img.shields.io/badge/code_style-standard-brightgreen.svg +[standard-url]: https://standardjs.com + +#### Determine if an object is a [`Buffer`](http://nodejs.org/api/buffer.html) (including the [browserify Buffer](https://github.com/feross/buffer)) + +[![saucelabs][saucelabs-image]][saucelabs-url] + +[saucelabs-image]: https://saucelabs.com/browser-matrix/is-buffer.svg +[saucelabs-url]: https://saucelabs.com/u/is-buffer + +## Why not use `Buffer.isBuffer`? + +This module lets you check if an object is a `Buffer` without using `Buffer.isBuffer` (which includes the whole [buffer](https://github.com/feross/buffer) module in [browserify](http://browserify.org/)). + +It's future-proof and works in node too! + +## install + +```bash +npm install is-buffer +``` + +[Get supported is-buffer with the Tidelift Subscription](https://tidelift.com/subscription/pkg/npm-is-buffer?utm_source=npm-is-buffer&utm_medium=referral&utm_campaign=readme) + +## usage + +```js +var isBuffer = require('is-buffer') + +isBuffer(new Buffer(4)) // true +isBuffer(Buffer.alloc(4)) //true + +isBuffer(undefined) // false +isBuffer(null) // false +isBuffer('') // false +isBuffer(true) // false +isBuffer(false) // false +isBuffer(0) // false +isBuffer(1) // false +isBuffer(1.0) // false +isBuffer('string') // false +isBuffer({}) // false +isBuffer(function foo () {}) // false +``` + +## license + +MIT. Copyright (C) [Feross Aboukhadijeh](http://feross.org). diff --git a/node_modules/is-buffer/index.d.ts b/node_modules/is-buffer/index.d.ts new file mode 100644 index 0000000..7065c69 --- /dev/null +++ b/node_modules/is-buffer/index.d.ts @@ -0,0 +1,2 @@ +declare function isBuffer(obj: any): boolean +export = isBuffer diff --git a/node_modules/is-buffer/index.js b/node_modules/is-buffer/index.js new file mode 100644 index 0000000..da9bfdd --- /dev/null +++ b/node_modules/is-buffer/index.js @@ -0,0 +1,11 @@ +/*! + * Determine if an object is a Buffer + * + * @author Feross Aboukhadijeh + * @license MIT + */ + +module.exports = function isBuffer (obj) { + return obj != null && obj.constructor != null && + typeof obj.constructor.isBuffer === 'function' && obj.constructor.isBuffer(obj) +} diff --git a/node_modules/is-buffer/package.json b/node_modules/is-buffer/package.json new file mode 100644 index 0000000..49faff0 --- /dev/null +++ b/node_modules/is-buffer/package.json @@ -0,0 +1,78 @@ +{ + "_from": "is-buffer@^2.0.0", + "_id": "is-buffer@2.0.4", + "_inBundle": false, + "_integrity": "sha512-Kq1rokWXOPXWuaMAqZiJW4XxsmD9zGx9q4aePabbn3qCRGedtH7Cm+zV8WETitMfu1wdh+Rvd6w5egwSngUX2A==", + "_location": "/is-buffer", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "is-buffer@^2.0.0", + "name": "is-buffer", + "escapedName": "is-buffer", + "rawSpec": "^2.0.0", + "saveSpec": null, + "fetchSpec": "^2.0.0" + }, + "_requiredBy": [ + "/unified", + "/vfile" + ], + "_resolved": "https://registry.npmjs.org/is-buffer/-/is-buffer-2.0.4.tgz", + "_shasum": "3e572f23c8411a5cfd9557c849e3665e0b290623", + "_spec": "is-buffer@^2.0.0", + "_where": "/Users/josh/Projects/slackify-markdown-action/node_modules/unified", + "author": { + "name": "Feross Aboukhadijeh", + "email": "feross@feross.org", + "url": "https://feross.org" + }, + "bugs": { + "url": "https://github.com/feross/is-buffer/issues" + }, + "bundleDependencies": false, + "dependencies": {}, + "deprecated": false, + "description": "Determine if an object is a Buffer", + "devDependencies": { + "airtap": "^2.0.3", + "standard": "*", + "tape": "^4.11.0" + }, + "engines": { + "node": ">=4" + }, + "homepage": "https://github.com/feross/is-buffer#readme", + "keywords": [ + "arraybuffer", + "browser", + "browser buffer", + "browserify", + "buffer", + "buffers", + "core buffer", + "dataview", + "float32array", + "float64array", + "int16array", + "int32array", + "type", + "typed array", + "uint32array" + ], + "license": "MIT", + "main": "index.js", + "name": "is-buffer", + "repository": { + "type": "git", + "url": "git://github.com/feross/is-buffer.git" + }, + "scripts": { + "test": "standard && npm run test-node && npm run test-browser", + "test-browser": "airtap -- test/*.js", + "test-browser-local": "airtap --local -- test/*.js", + "test-node": "tape test/*.js" + }, + "version": "2.0.4" +} diff --git a/node_modules/is-decimal/index.js b/node_modules/is-decimal/index.js new file mode 100644 index 0000000..a522104 --- /dev/null +++ b/node_modules/is-decimal/index.js @@ -0,0 +1,11 @@ +'use strict' + +module.exports = decimal + +// Check if the given character code, or the character code at the first +// character, is decimal. +function decimal(character) { + var code = typeof character === 'string' ? character.charCodeAt(0) : character + + return code >= 48 && code <= 57 /* 0-9 */ +} diff --git a/node_modules/is-decimal/license b/node_modules/is-decimal/license new file mode 100644 index 0000000..8d8660d --- /dev/null +++ b/node_modules/is-decimal/license @@ -0,0 +1,22 @@ +(The MIT License) + +Copyright (c) 2016 Titus Wormer + +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: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +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. diff --git a/node_modules/is-decimal/package.json b/node_modules/is-decimal/package.json new file mode 100644 index 0000000..7584fb6 --- /dev/null +++ b/node_modules/is-decimal/package.json @@ -0,0 +1,115 @@ +{ + "_from": "is-decimal@^1.0.0", + "_id": "is-decimal@1.0.4", + "_inBundle": false, + "_integrity": "sha512-RGdriMmQQvZ2aqaQq3awNA6dCGtKpiDFcOzrTWrDAT2MiWrKQVPmxLGHl7Y2nNu6led0kEyoX0enY0qXYsv9zw==", + "_location": "/is-decimal", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "is-decimal@^1.0.0", + "name": "is-decimal", + "escapedName": "is-decimal", + "rawSpec": "^1.0.0", + "saveSpec": null, + "fetchSpec": "^1.0.0" + }, + "_requiredBy": [ + "/is-alphanumerical", + "/parse-entities", + "/remark-parse", + "/remark-stringify", + "/stringify-entities" + ], + "_resolved": "https://registry.npmjs.org/is-decimal/-/is-decimal-1.0.4.tgz", + "_shasum": "65a3a5958a1c5b63a706e1b333d7cd9f630d3fa5", + "_spec": "is-decimal@^1.0.0", + "_where": "/Users/josh/Projects/slackify-markdown-action/node_modules/remark-parse", + "author": { + "name": "Titus Wormer", + "email": "tituswormer@gmail.com", + "url": "https://wooorm.com" + }, + "bugs": { + "url": "https://github.com/wooorm/is-decimal/issues" + }, + "bundleDependencies": false, + "contributors": [ + { + "name": "Titus Wormer", + "email": "tituswormer@gmail.com", + "url": "https://wooorm.com" + } + ], + "dependencies": {}, + "deprecated": false, + "description": "Check if a character is decimal", + "devDependencies": { + "browserify": "^16.0.0", + "nyc": "^15.0.0", + "prettier": "^1.0.0", + "remark-cli": "^7.0.0", + "remark-preset-wooorm": "^6.0.0", + "tape": "^4.0.0", + "tinyify": "^2.0.0", + "xo": "^0.25.0" + }, + "files": [ + "index.js" + ], + "funding": { + "type": "github", + "url": "https://github.com/sponsors/wooorm" + }, + "homepage": "https://github.com/wooorm/is-decimal#readme", + "keywords": [ + "string", + "character", + "char", + "code", + "decimal" + ], + "license": "MIT", + "name": "is-decimal", + "nyc": { + "check-coverage": true, + "lines": 100, + "functions": 100, + "branches": 100 + }, + "prettier": { + "tabWidth": 2, + "useTabs": false, + "singleQuote": true, + "bracketSpacing": false, + "semi": false, + "trailingComma": "none" + }, + "remarkConfig": { + "plugins": [ + "preset-wooorm" + ] + }, + "repository": { + "type": "git", + "url": "git+https://github.com/wooorm/is-decimal.git" + }, + "scripts": { + "build": "npm run build-bundle && npm run build-mangle", + "build-bundle": "browserify . -s isDecimal -o is-decimal.js", + "build-mangle": "browserify . -s isDecimal -p tinyify -o is-decimal.min.js", + "format": "remark . -qfo && prettier --write \"**/*.js\" && xo --fix", + "test": "npm run format && npm run build && npm run test-coverage", + "test-api": "node test", + "test-coverage": "nyc --reporter lcov tape test.js" + }, + "version": "1.0.4", + "xo": { + "prettier": true, + "esnext": false, + "ignores": [ + "is-decimal.js" + ] + } +} diff --git a/node_modules/is-decimal/readme.md b/node_modules/is-decimal/readme.md new file mode 100644 index 0000000..d24a3d2 --- /dev/null +++ b/node_modules/is-decimal/readme.md @@ -0,0 +1,69 @@ +# is-decimal + +[![Build][build-badge]][build] +[![Coverage][coverage-badge]][coverage] +[![Downloads][downloads-badge]][downloads] +[![Size][size-badge]][size] + +Check if a character is decimal. + +## Install + +[npm][]: + +```sh +npm install is-decimal +``` + +## Use + +```js +var decimal = require('is-decimal') + +decimal('0') // => true +decimal('9') // => true +decimal('a') // => false +decimal('💩') // => false +``` + +## API + +### `decimal(character|code)` + +Check whether the given character code (`number`), or the character code at the +first position (`string`), is decimal. + +## Related + +* [`is-alphabetical`](https://github.com/wooorm/is-alphabetical) +* [`is-hexadecimal`](https://github.com/wooorm/is-hexadecimal) +* [`is-whitespace-character`](https://github.com/wooorm/is-whitespace-character) +* [`is-word-character`](https://github.com/wooorm/is-word-character) + +## License + +[MIT][license] © [Titus Wormer][author] + + + +[build-badge]: https://img.shields.io/travis/wooorm/is-decimal.svg + +[build]: https://travis-ci.org/wooorm/is-decimal + +[coverage-badge]: https://img.shields.io/codecov/c/github/wooorm/is-decimal.svg + +[coverage]: https://codecov.io/github/wooorm/is-decimal + +[downloads-badge]: https://img.shields.io/npm/dm/is-decimal.svg + +[downloads]: https://www.npmjs.com/package/is-decimal + +[size-badge]: https://img.shields.io/bundlephobia/minzip/is-decimal.svg + +[size]: https://bundlephobia.com/result?p=is-decimal + +[npm]: https://docs.npmjs.com/cli/install + +[license]: license + +[author]: https://wooorm.com diff --git a/node_modules/is-hexadecimal/index.js b/node_modules/is-hexadecimal/index.js new file mode 100644 index 0000000..567c9d1 --- /dev/null +++ b/node_modules/is-hexadecimal/index.js @@ -0,0 +1,15 @@ +'use strict' + +module.exports = hexadecimal + +// Check if the given character code, or the character code at the first +// character, is hexadecimal. +function hexadecimal(character) { + var code = typeof character === 'string' ? character.charCodeAt(0) : character + + return ( + (code >= 97 /* a */ && code <= 102) /* z */ || + (code >= 65 /* A */ && code <= 70) /* Z */ || + (code >= 48 /* A */ && code <= 57) /* Z */ + ) +} diff --git a/node_modules/is-hexadecimal/license b/node_modules/is-hexadecimal/license new file mode 100644 index 0000000..8d8660d --- /dev/null +++ b/node_modules/is-hexadecimal/license @@ -0,0 +1,22 @@ +(The MIT License) + +Copyright (c) 2016 Titus Wormer + +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: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +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. diff --git a/node_modules/is-hexadecimal/package.json b/node_modules/is-hexadecimal/package.json new file mode 100644 index 0000000..fc5734c --- /dev/null +++ b/node_modules/is-hexadecimal/package.json @@ -0,0 +1,112 @@ +{ + "_from": "is-hexadecimal@^1.0.0", + "_id": "is-hexadecimal@1.0.4", + "_inBundle": false, + "_integrity": "sha512-gyPJuv83bHMpocVYoqof5VDiZveEoGoFL8m3BXNb2VW8Xs+rz9kqO8LOQ5DH6EsuvilT1ApazU0pyl+ytbPtlw==", + "_location": "/is-hexadecimal", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "is-hexadecimal@^1.0.0", + "name": "is-hexadecimal", + "escapedName": "is-hexadecimal", + "rawSpec": "^1.0.0", + "saveSpec": null, + "fetchSpec": "^1.0.0" + }, + "_requiredBy": [ + "/parse-entities", + "/stringify-entities" + ], + "_resolved": "https://registry.npmjs.org/is-hexadecimal/-/is-hexadecimal-1.0.4.tgz", + "_shasum": "cc35c97588da4bd49a8eedd6bc4082d44dcb23a7", + "_spec": "is-hexadecimal@^1.0.0", + "_where": "/Users/josh/Projects/slackify-markdown-action/node_modules/parse-entities", + "author": { + "name": "Titus Wormer", + "email": "tituswormer@gmail.com", + "url": "https://wooorm.com" + }, + "bugs": { + "url": "https://github.com/wooorm/is-hexadecimal/issues" + }, + "bundleDependencies": false, + "contributors": [ + { + "name": "Titus Wormer", + "email": "tituswormer@gmail.com", + "url": "https://wooorm.com" + } + ], + "dependencies": {}, + "deprecated": false, + "description": "Check if a character is hexadecimal", + "devDependencies": { + "browserify": "^16.0.0", + "nyc": "^15.0.0", + "prettier": "^1.0.0", + "remark-cli": "^7.0.0", + "remark-preset-wooorm": "^6.0.0", + "tape": "^4.0.0", + "tinyify": "^2.0.0", + "xo": "^0.25.0" + }, + "files": [ + "index.js" + ], + "funding": { + "type": "github", + "url": "https://github.com/sponsors/wooorm" + }, + "homepage": "https://github.com/wooorm/is-hexadecimal#readme", + "keywords": [ + "string", + "character", + "char", + "code", + "hexadecimal" + ], + "license": "MIT", + "name": "is-hexadecimal", + "nyc": { + "check-coverage": true, + "lines": 100, + "functions": 100, + "branches": 100 + }, + "prettier": { + "tabWidth": 2, + "useTabs": false, + "singleQuote": true, + "bracketSpacing": false, + "semi": false, + "trailingComma": "none" + }, + "remarkConfig": { + "plugins": [ + "preset-wooorm" + ] + }, + "repository": { + "type": "git", + "url": "git+https://github.com/wooorm/is-hexadecimal.git" + }, + "scripts": { + "build": "npm run build-bundle && npm run build-mangle", + "build-bundle": "browserify . -s isHexadecimal -o is-hexadecimal.js", + "build-mangle": "browserify . -s isHexadecimal -p tinyify -o is-hexadecimal.min.js", + "format": "remark . -qfo && prettier --write \"**/*.js\" && xo --fix", + "test": "npm run format && npm run build && npm run test-coverage", + "test-api": "node test", + "test-coverage": "nyc --reporter lcov tape test.js" + }, + "version": "1.0.4", + "xo": { + "prettier": true, + "esnext": false, + "ignores": [ + "is-hexadecimal.js" + ] + } +} diff --git a/node_modules/is-hexadecimal/readme.md b/node_modules/is-hexadecimal/readme.md new file mode 100644 index 0000000..7c82b1b --- /dev/null +++ b/node_modules/is-hexadecimal/readme.md @@ -0,0 +1,70 @@ +# is-hexadecimal + +[![Build][build-badge]][build] +[![Coverage][coverage-badge]][coverage] +[![Downloads][downloads-badge]][downloads] +[![Size][size-badge]][size] + +Check if a character is hexadecimal. + +## Install + +[npm][]: + +```sh +npm install is-hexadecimal +``` + +## Use + +```js +var hexadecimal = require('is-hexadecimal') + +hexadecimal('a') // => true +hexadecimal('0') // => true +hexadecimal('G') // => false +hexadecimal('💩') // => false +``` + +## API + +### `hexadecimal(character|code)` + +Check whether the given character code (`number`), or the character code at the +first position (`string`), is hexadecimal. + +## Related + +* [`is-alphabetical`](https://github.com/wooorm/is-alphabetical) +* [`is-alphanumerical`](https://github.com/wooorm/is-alphabetical) +* [`is-decimal`](https://github.com/wooorm/is-decimal) +* [`is-whitespace-character`](https://github.com/wooorm/is-whitespace-character) +* [`is-word-character`](https://github.com/wooorm/is-word-character) + +## License + +[MIT][license] © [Titus Wormer][author] + + + +[build-badge]: https://img.shields.io/travis/wooorm/is-hexadecimal.svg + +[build]: https://travis-ci.org/wooorm/is-hexadecimal + +[coverage-badge]: https://img.shields.io/codecov/c/github/wooorm/is-hexadecimal.svg + +[coverage]: https://codecov.io/github/wooorm/is-hexadecimal + +[downloads-badge]: https://img.shields.io/npm/dm/is-hexadecimal.svg + +[downloads]: https://www.npmjs.com/package/is-hexadecimal + +[size-badge]: https://img.shields.io/bundlephobia/minzip/is-hexadecimal.svg + +[size]: https://bundlephobia.com/result?p=is-hexadecimal + +[npm]: https://docs.npmjs.com/cli/install + +[license]: license + +[author]: https://wooorm.com diff --git a/node_modules/is-plain-obj/index.d.ts b/node_modules/is-plain-obj/index.d.ts new file mode 100644 index 0000000..ac2614d --- /dev/null +++ b/node_modules/is-plain-obj/index.d.ts @@ -0,0 +1,29 @@ +/** +Check if a value is a plain object. + +An object is plain if it's created by either `{}`, `new Object()`, or `Object.create(null)`. + +@example +``` +import isPlainObject = require('is-plain-obj'); + +isPlainObject({foo: 'bar'}); +//=> true + +isPlainObject(new Object()); +//=> true + +isPlainObject(Object.create(null)); +//=> true + +isPlainObject([1, 2, 3]); +//=> false + +class Unicorn {} +isPlainObject(new Unicorn()); +//=> false +``` +*/ +declare function isPlainObj(value: unknown): value is object; + +export = isPlainObj; diff --git a/node_modules/is-plain-obj/index.js b/node_modules/is-plain-obj/index.js new file mode 100644 index 0000000..95079ec --- /dev/null +++ b/node_modules/is-plain-obj/index.js @@ -0,0 +1,10 @@ +'use strict'; + +module.exports = value => { + if (Object.prototype.toString.call(value) !== '[object Object]') { + return false; + } + + const prototype = Object.getPrototypeOf(value); + return prototype === null || prototype === Object.prototype; +}; diff --git a/node_modules/is-plain-obj/license b/node_modules/is-plain-obj/license new file mode 100644 index 0000000..e7af2f7 --- /dev/null +++ b/node_modules/is-plain-obj/license @@ -0,0 +1,9 @@ +MIT License + +Copyright (c) Sindre Sorhus (sindresorhus.com) + +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: + +The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. + +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. diff --git a/node_modules/is-plain-obj/package.json b/node_modules/is-plain-obj/package.json new file mode 100644 index 0000000..6a21b8c --- /dev/null +++ b/node_modules/is-plain-obj/package.json @@ -0,0 +1,70 @@ +{ + "_from": "is-plain-obj@^2.0.0", + "_id": "is-plain-obj@2.1.0", + "_inBundle": false, + "_integrity": "sha512-YWnfyRwxL/+SsrWYfOpUtz5b3YD+nyfkHvjbcanzk8zgyO4ASD67uVMRt8k5bM4lLMDnXfriRhOpemw+NfT1eA==", + "_location": "/is-plain-obj", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "is-plain-obj@^2.0.0", + "name": "is-plain-obj", + "escapedName": "is-plain-obj", + "rawSpec": "^2.0.0", + "saveSpec": null, + "fetchSpec": "^2.0.0" + }, + "_requiredBy": [ + "/unified" + ], + "_resolved": "https://registry.npmjs.org/is-plain-obj/-/is-plain-obj-2.1.0.tgz", + "_shasum": "45e42e37fccf1f40da8e5f76ee21515840c09287", + "_spec": "is-plain-obj@^2.0.0", + "_where": "/Users/josh/Projects/slackify-markdown-action/node_modules/unified", + "author": { + "name": "Sindre Sorhus", + "email": "sindresorhus@gmail.com", + "url": "sindresorhus.com" + }, + "bugs": { + "url": "https://github.com/sindresorhus/is-plain-obj/issues" + }, + "bundleDependencies": false, + "deprecated": false, + "description": "Check if a value is a plain object", + "devDependencies": { + "ava": "^1.4.1", + "tsd": "^0.7.2", + "xo": "^0.24.0" + }, + "engines": { + "node": ">=8" + }, + "files": [ + "index.js", + "index.d.ts" + ], + "homepage": "https://github.com/sindresorhus/is-plain-obj#readme", + "keywords": [ + "object", + "is", + "check", + "test", + "type", + "plain", + "vanilla", + "pure", + "simple" + ], + "license": "MIT", + "name": "is-plain-obj", + "repository": { + "type": "git", + "url": "git+https://github.com/sindresorhus/is-plain-obj.git" + }, + "scripts": { + "test": "xo && ava && tsd" + }, + "version": "2.1.0" +} diff --git a/node_modules/is-plain-obj/readme.md b/node_modules/is-plain-obj/readme.md new file mode 100644 index 0000000..13571a8 --- /dev/null +++ b/node_modules/is-plain-obj/readme.md @@ -0,0 +1,54 @@ +# is-plain-obj [![Build Status](https://travis-ci.org/sindresorhus/is-plain-obj.svg?branch=master)](https://travis-ci.org/sindresorhus/is-plain-obj) + +> Check if a value is a plain object + +An object is plain if it's created by either `{}`, `new Object()`, or `Object.create(null)`. + + +## Install + +``` +$ npm install is-plain-obj +``` + + +## Usage + +```js +const isPlainObject = require('is-plain-obj'); + +isPlainObject({foo: 'bar'}); +//=> true + +isPlainObject(new Object()); +//=> true + +isPlainObject(Object.create(null)); +//=> true + +isPlainObject([1, 2, 3]); +//=> false + +class Unicorn {} +isPlainObject(new Unicorn()); +//=> false +``` + + +## Related + +- [is-obj](https://github.com/sindresorhus/is-obj) - Check if a value is an object +- [is](https://github.com/sindresorhus/is) - Type check values + + +--- + +
+ + Get professional support for this package with a Tidelift subscription + +
+ + Tidelift helps make open source sustainable for maintainers while giving companies
assurances about security, maintenance, and licensing for their dependencies. +
+
diff --git a/node_modules/is-whitespace-character/index.js b/node_modules/is-whitespace-character/index.js new file mode 100644 index 0000000..801c19f --- /dev/null +++ b/node_modules/is-whitespace-character/index.js @@ -0,0 +1,14 @@ +'use strict' + +module.exports = whitespace + +var fromCode = String.fromCharCode +var re = /\s/ + +// Check if the given character code, or the character code at the first +// character, is a whitespace character. +function whitespace(character) { + return re.test( + typeof character === 'number' ? fromCode(character) : character.charAt(0) + ) +} diff --git a/node_modules/is-whitespace-character/license b/node_modules/is-whitespace-character/license new file mode 100644 index 0000000..8d8660d --- /dev/null +++ b/node_modules/is-whitespace-character/license @@ -0,0 +1,22 @@ +(The MIT License) + +Copyright (c) 2016 Titus Wormer + +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: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +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. diff --git a/node_modules/is-whitespace-character/package.json b/node_modules/is-whitespace-character/package.json new file mode 100644 index 0000000..270d2f2 --- /dev/null +++ b/node_modules/is-whitespace-character/package.json @@ -0,0 +1,114 @@ +{ + "_from": "is-whitespace-character@^1.0.0", + "_id": "is-whitespace-character@1.0.4", + "_inBundle": false, + "_integrity": "sha512-SDweEzfIZM0SJV0EUga669UTKlmL0Pq8Lno0QDQsPnvECB3IM2aP0gdx5TrU0A01MAPfViaZiI2V1QMZLaKK5w==", + "_location": "/is-whitespace-character", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "is-whitespace-character@^1.0.0", + "name": "is-whitespace-character", + "escapedName": "is-whitespace-character", + "rawSpec": "^1.0.0", + "saveSpec": null, + "fetchSpec": "^1.0.0" + }, + "_requiredBy": [ + "/remark-parse", + "/remark-stringify" + ], + "_resolved": "https://registry.npmjs.org/is-whitespace-character/-/is-whitespace-character-1.0.4.tgz", + "_shasum": "0858edd94a95594c7c9dd0b5c174ec6e45ee4aa7", + "_spec": "is-whitespace-character@^1.0.0", + "_where": "/Users/josh/Projects/slackify-markdown-action/node_modules/remark-parse", + "author": { + "name": "Titus Wormer", + "email": "tituswormer@gmail.com", + "url": "https://wooorm.com" + }, + "bugs": { + "url": "https://github.com/wooorm/is-whitespace-character/issues" + }, + "bundleDependencies": false, + "contributors": [ + { + "name": "Titus Wormer", + "email": "tituswormer@gmail.com", + "url": "https://wooorm.com" + } + ], + "dependencies": {}, + "deprecated": false, + "description": "Check if a character is a whitespace character", + "devDependencies": { + "browserify": "^16.0.0", + "nyc": "^15.0.0", + "prettier": "^1.0.0", + "remark-cli": "^7.0.0", + "remark-preset-wooorm": "^6.0.0", + "tape": "^4.0.0", + "tinyify": "^2.0.0", + "xo": "^0.25.0" + }, + "files": [ + "index.js" + ], + "funding": { + "type": "github", + "url": "https://github.com/sponsors/wooorm" + }, + "homepage": "https://github.com/wooorm/is-whitespace-character#readme", + "keywords": [ + "string", + "character", + "char", + "code", + "whitespace", + "white", + "space" + ], + "license": "MIT", + "name": "is-whitespace-character", + "nyc": { + "check-coverage": true, + "lines": 100, + "functions": 100, + "branches": 100 + }, + "prettier": { + "tabWidth": 2, + "useTabs": false, + "singleQuote": true, + "bracketSpacing": false, + "semi": false, + "trailingComma": "none" + }, + "remarkConfig": { + "plugins": [ + "preset-wooorm" + ] + }, + "repository": { + "type": "git", + "url": "git+https://github.com/wooorm/is-whitespace-character.git" + }, + "scripts": { + "build": "npm run build-bundle && npm run build-mangle", + "build-bundle": "browserify . -s isWhitespaceCharacter -o is-whitespace-character.js", + "build-mangle": "browserify . -s isWhitespaceCharacter -p tinyify -o is-whitespace-character.min.js", + "format": "remark . -qfo && prettier --write \"**/*.js\" && xo --fix", + "test": "npm run format && npm run build && npm run test-coverage", + "test-api": "node test", + "test-coverage": "nyc --reporter lcov tape test.js" + }, + "version": "1.0.4", + "xo": { + "prettier": true, + "esnext": false, + "ignores": [ + "is-whitespace-character.js" + ] + } +} diff --git a/node_modules/is-whitespace-character/readme.md b/node_modules/is-whitespace-character/readme.md new file mode 100644 index 0000000..34d4f34 --- /dev/null +++ b/node_modules/is-whitespace-character/readme.md @@ -0,0 +1,74 @@ +# is-whitespace-character + +[![Build][build-badge]][build] +[![Coverage][coverage-badge]][coverage] +[![Downloads][downloads-badge]][downloads] +[![Size][size-badge]][size] + +Check if a character is a whitespace character: `\s`, which equals all Unicode +Space Separators (including `[ \t\v\f]`), the BOM (`\uFEFF`), and line +terminator (`[\n\r\u2028\u2029]`). + +## Install + +[npm][]: + +```sh +npm install is-whitespace-character +``` + +## Use + +```js +var whitespace = require('is-whitespace-character') + +whitespace(' ') // => true +whitespace('\n') // => true +whitespace('\uFEFF') // => true +whitespace('_') // => false +whitespace('a') // => false +whitespace('💩') // => false +``` + +## API + +### `whitespaceCharacter(character|code)` + +Check whether the given character code (`number`), or the character code at the +first position (`string`), is a whitespace character. + +## Related + +* [`is-alphabetical`](https://github.com/wooorm/is-alphabetical) +* [`is-alphanumerical`](https://github.com/wooorm/is-alphanumerical) +* [`is-decimal`](https://github.com/wooorm/is-decimal) +* [`is-hexadecimal`](https://github.com/wooorm/is-hexadecimal) +* [`is-word-character`](https://github.com/wooorm/is-word-character) + +## License + +[MIT][license] © [Titus Wormer][author] + + + +[build-badge]: https://img.shields.io/travis/wooorm/is-whitespace-character.svg + +[build]: https://travis-ci.org/wooorm/is-whitespace-character + +[coverage-badge]: https://img.shields.io/codecov/c/github/wooorm/is-whitespace-character.svg + +[coverage]: https://codecov.io/github/wooorm/is-whitespace-character + +[downloads-badge]: https://img.shields.io/npm/dm/is-whitespace-character.svg + +[downloads]: https://www.npmjs.com/package/is-whitespace-character + +[size-badge]: https://img.shields.io/bundlephobia/minzip/is-whitespace-character.svg + +[size]: https://bundlephobia.com/result?p=is-whitespace-character + +[npm]: https://docs.npmjs.com/cli/install + +[license]: license + +[author]: https://wooorm.com diff --git a/node_modules/is-word-character/index.js b/node_modules/is-word-character/index.js new file mode 100644 index 0000000..8c3537f --- /dev/null +++ b/node_modules/is-word-character/index.js @@ -0,0 +1,14 @@ +'use strict' + +module.exports = wordCharacter + +var fromCode = String.fromCharCode +var re = /\w/ + +// Check if the given character code, or the character code at the first +// character, is a word character. +function wordCharacter(character) { + return re.test( + typeof character === 'number' ? fromCode(character) : character.charAt(0) + ) +} diff --git a/node_modules/is-word-character/license b/node_modules/is-word-character/license new file mode 100644 index 0000000..8d8660d --- /dev/null +++ b/node_modules/is-word-character/license @@ -0,0 +1,22 @@ +(The MIT License) + +Copyright (c) 2016 Titus Wormer + +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: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +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. diff --git a/node_modules/is-word-character/package.json b/node_modules/is-word-character/package.json new file mode 100644 index 0000000..8ef7426 --- /dev/null +++ b/node_modules/is-word-character/package.json @@ -0,0 +1,111 @@ +{ + "_from": "is-word-character@^1.0.0", + "_id": "is-word-character@1.0.4", + "_inBundle": false, + "_integrity": "sha512-5SMO8RVennx3nZrqtKwCGyyetPE9VDba5ugvKLaD4KopPG5kR4mQ7tNt/r7feL5yt5h3lpuBbIUmCOG2eSzXHA==", + "_location": "/is-word-character", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "is-word-character@^1.0.0", + "name": "is-word-character", + "escapedName": "is-word-character", + "rawSpec": "^1.0.0", + "saveSpec": null, + "fetchSpec": "^1.0.0" + }, + "_requiredBy": [ + "/remark-parse" + ], + "_resolved": "https://registry.npmjs.org/is-word-character/-/is-word-character-1.0.4.tgz", + "_shasum": "ce0e73216f98599060592f62ff31354ddbeb0230", + "_spec": "is-word-character@^1.0.0", + "_where": "/Users/josh/Projects/slackify-markdown-action/node_modules/remark-parse", + "author": { + "name": "Titus Wormer", + "email": "tituswormer@gmail.com", + "url": "https://wooorm.com" + }, + "bugs": { + "url": "https://github.com/wooorm/is-word-character/issues" + }, + "bundleDependencies": false, + "contributors": [ + { + "name": "Titus Wormer", + "email": "tituswormer@gmail.com", + "url": "https://wooorm.com" + } + ], + "dependencies": {}, + "deprecated": false, + "description": "Check if a character is a word character", + "devDependencies": { + "browserify": "^16.0.0", + "nyc": "^15.0.0", + "prettier": "^1.0.0", + "remark-cli": "^7.0.0", + "remark-preset-wooorm": "^6.0.0", + "tape": "^4.0.0", + "tinyify": "^2.0.0", + "xo": "^0.25.0" + }, + "files": [ + "index.js" + ], + "funding": { + "type": "github", + "url": "https://github.com/sponsors/wooorm" + }, + "homepage": "https://github.com/wooorm/is-word-character#readme", + "keywords": [ + "string", + "character", + "char", + "code", + "word" + ], + "license": "MIT", + "name": "is-word-character", + "nyc": { + "check-coverage": true, + "lines": 100, + "functions": 100, + "branches": 100 + }, + "prettier": { + "tabWidth": 2, + "useTabs": false, + "singleQuote": true, + "bracketSpacing": false, + "semi": false, + "trailingComma": "none" + }, + "remarkConfig": { + "plugins": [ + "preset-wooorm" + ] + }, + "repository": { + "type": "git", + "url": "git+https://github.com/wooorm/is-word-character.git" + }, + "scripts": { + "build": "npm run build-bundle && npm run build-mangle", + "build-bundle": "browserify . -s isWordCharacter -o is-word-character.js", + "build-mangle": "browserify . -s isWordCharacter -p tinyify -o is-word-character.min.js", + "format": "remark . -qfo && prettier --write \"**/*.js\" && xo --fix", + "test": "npm run format && npm run build && npm run test-coverage", + "test-api": "node test", + "test-coverage": "nyc --reporter lcov tape test.js" + }, + "version": "1.0.4", + "xo": { + "prettier": true, + "esnext": false, + "ignores": [ + "is-word-character.js" + ] + } +} diff --git a/node_modules/is-word-character/readme.md b/node_modules/is-word-character/readme.md new file mode 100644 index 0000000..3c88ce9 --- /dev/null +++ b/node_modules/is-word-character/readme.md @@ -0,0 +1,72 @@ +# is-word-character + +[![Build][build-badge]][build] +[![Coverage][coverage-badge]][coverage] +[![Downloads][downloads-badge]][downloads] +[![Size][size-badge]][size] + +Check if a character is a word character (`\w`, which equals `[a-zA-Z0-9_]`). + +## Install + +[npm][]: + +```sh +npm install is-word-character +``` + +## Use + +```js +var wordCharacter = require('is-word-character') + +wordCharacter('a') // => true +wordCharacter('Z') // => true +wordCharacter('0') // => true +wordCharacter('_') // => true +wordCharacter(' ') // => false +wordCharacter('💩') // => false +``` + +## API + +### `wordCharacter(character|code)` + +Check whether the given character code (`number`), or the character code at the +first position (`string`), is a word character. + +## Related + +* [`is-alphabetical`](https://github.com/wooorm/is-alphabetical) +* [`is-alphanumerical`](https://github.com/wooorm/is-alphanumerical) +* [`is-decimal`](https://github.com/wooorm/is-decimal) +* [`is-hexadecimal`](https://github.com/wooorm/is-hexadecimal) +* [`is-whitespace-character`](https://github.com/wooorm/is-whitespace-character) + +## License + +[MIT][license] © [Titus Wormer][author] + + + +[build-badge]: https://img.shields.io/travis/wooorm/is-word-character.svg + +[build]: https://travis-ci.org/wooorm/is-word-character + +[coverage-badge]: https://img.shields.io/codecov/c/github/wooorm/is-word-character.svg + +[coverage]: https://codecov.io/github/wooorm/is-word-character + +[downloads-badge]: https://img.shields.io/npm/dm/is-word-character.svg + +[downloads]: https://www.npmjs.com/package/is-word-character + +[size-badge]: https://img.shields.io/bundlephobia/minzip/is-word-character.svg + +[size]: https://bundlephobia.com/result?p=is-word-character + +[npm]: https://docs.npmjs.com/cli/install + +[license]: license + +[author]: https://wooorm.com diff --git a/node_modules/longest-streak/index.js b/node_modules/longest-streak/index.js new file mode 100644 index 0000000..ec57987 --- /dev/null +++ b/node_modules/longest-streak/index.js @@ -0,0 +1,36 @@ +'use strict' + +module.exports = longestStreak + +// Get the count of the longest repeating streak of `character` in `value`. +function longestStreak(value, character) { + var count = 0 + var maximum = 0 + var expected + var index + + if (typeof character !== 'string' || character.length !== 1) { + throw new Error('Expected character') + } + + value = String(value) + index = value.indexOf(character) + expected = index + + while (index !== -1) { + count++ + + if (index === expected) { + if (count > maximum) { + maximum = count + } + } else { + count = 1 + } + + expected = index + 1 + index = value.indexOf(character, expected) + } + + return maximum +} diff --git a/node_modules/longest-streak/license b/node_modules/longest-streak/license new file mode 100644 index 0000000..611b675 --- /dev/null +++ b/node_modules/longest-streak/license @@ -0,0 +1,22 @@ +(The MIT License) + +Copyright (c) 2015 Titus Wormer + +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: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +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. diff --git a/node_modules/longest-streak/package.json b/node_modules/longest-streak/package.json new file mode 100644 index 0000000..bc8dd2d --- /dev/null +++ b/node_modules/longest-streak/package.json @@ -0,0 +1,112 @@ +{ + "_from": "longest-streak@^2.0.1", + "_id": "longest-streak@2.0.4", + "_inBundle": false, + "_integrity": "sha512-vM6rUVCVUJJt33bnmHiZEvr7wPT78ztX7rojL+LW51bHtLh6HTjx84LA5W4+oa6aKEJA7jJu5LR6vQRBpA5DVg==", + "_location": "/longest-streak", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "longest-streak@^2.0.1", + "name": "longest-streak", + "escapedName": "longest-streak", + "rawSpec": "^2.0.1", + "saveSpec": null, + "fetchSpec": "^2.0.1" + }, + "_requiredBy": [ + "/remark-stringify" + ], + "_resolved": "https://registry.npmjs.org/longest-streak/-/longest-streak-2.0.4.tgz", + "_shasum": "b8599957da5b5dab64dee3fe316fa774597d90e4", + "_spec": "longest-streak@^2.0.1", + "_where": "/Users/josh/Projects/slackify-markdown-action/node_modules/remark-stringify", + "author": { + "name": "Titus Wormer", + "email": "tituswormer@gmail.com", + "url": "https://wooorm.com" + }, + "bugs": { + "url": "https://github.com/wooorm/longest-streak/issues" + }, + "bundleDependencies": false, + "contributors": [ + { + "name": "Titus Wormer", + "email": "tituswormer@gmail.com", + "url": "https://wooorm.com" + } + ], + "dependencies": {}, + "deprecated": false, + "description": "Count the longest repeating streak of a character", + "devDependencies": { + "browserify": "^16.0.0", + "nyc": "^15.0.0", + "prettier": "^1.0.0", + "remark-cli": "^7.0.0", + "remark-preset-wooorm": "^6.0.0", + "tape": "^4.0.0", + "tinyify": "^2.0.0", + "xo": "^0.25.0" + }, + "files": [ + "index.js" + ], + "funding": { + "type": "github", + "url": "https://github.com/sponsors/wooorm" + }, + "homepage": "https://github.com/wooorm/longest-streak#readme", + "keywords": [ + "count", + "length", + "longest", + "repeating", + "streak", + "character" + ], + "license": "MIT", + "name": "longest-streak", + "nyc": { + "check-coverage": true, + "lines": 100, + "functions": 100, + "branches": 100 + }, + "prettier": { + "tabWidth": 2, + "useTabs": false, + "singleQuote": true, + "bracketSpacing": false, + "semi": false, + "trailingComma": "none" + }, + "remarkConfig": { + "plugins": [ + "preset-wooorm" + ] + }, + "repository": { + "type": "git", + "url": "git+https://github.com/wooorm/longest-streak.git" + }, + "scripts": { + "build": "npm run build-bundle && npm run build-mangle", + "build-bundle": "browserify . -s longestStreak -o longest-streak.js", + "build-mangle": "browserify . -s longestStreak -p tinyify -o longest-streak.min.js", + "format": "remark . -qfo && prettier --write \"**/*.js\" && xo --fix", + "test": "npm run format && npm run build && npm run test-coverage", + "test-api": "node test", + "test-coverage": "nyc --reporter lcov tape test.js" + }, + "version": "2.0.4", + "xo": { + "prettier": true, + "esnext": false, + "ignores": [ + "longest-streak.js" + ] + } +} diff --git a/node_modules/longest-streak/readme.md b/node_modules/longest-streak/readme.md new file mode 100644 index 0000000..80dfa26 --- /dev/null +++ b/node_modules/longest-streak/readme.md @@ -0,0 +1,72 @@ +# longest-streak + +[![Build][build-badge]][build] +[![Coverage][coverage-badge]][coverage] +[![Downloads][downloads-badge]][downloads] +[![Size][size-badge]][size] + +Count the longest repeating streak of a character. + +## Install + +[npm][]: + +```sh +npm install longest-streak +``` + +## Use + +```js +var longestStreak = require('longest-streak') + +longestStreak('` foo `` bar `', '`') // => 2 +``` + +## API + +### `longestStreak(value, character)` + +Get the count of the longest repeating streak of `character` in `value`. + +###### Parameters + +* `value` (`string`) — Content, coerced to string. +* `character` (`string`) — Single character to look for. + +###### Returns + +`number` — Number of characters at the place where `character` occurs in +its longest streak in `value`. + +###### Throws + +* `Error` — when `character` is not a single character string. + +## License + +[MIT][license] © [Titus Wormer][author] + + + +[build-badge]: https://img.shields.io/travis/wooorm/longest-streak.svg + +[build]: https://travis-ci.org/wooorm/longest-streak + +[coverage-badge]: https://img.shields.io/codecov/c/github/wooorm/longest-streak.svg + +[coverage]: https://codecov.io/github/wooorm/longest-streak + +[downloads-badge]: https://img.shields.io/npm/dm/longest-streak.svg + +[downloads]: https://www.npmjs.com/package/longest-streak + +[size-badge]: https://img.shields.io/bundlephobia/minzip/longest-streak.svg + +[size]: https://bundlephobia.com/result?p=longest-streak + +[npm]: https://docs.npmjs.com/cli/install + +[license]: license + +[author]: https://wooorm.com diff --git a/node_modules/markdown-escapes/index.js b/node_modules/markdown-escapes/index.js new file mode 100644 index 0000000..f8bea48 --- /dev/null +++ b/node_modules/markdown-escapes/index.js @@ -0,0 +1,57 @@ +'use strict' + +module.exports = escapes + +var defaults = [ + '\\', + '`', + '*', + '{', + '}', + '[', + ']', + '(', + ')', + '#', + '+', + '-', + '.', + '!', + '_', + '>' +] + +var gfm = defaults.concat(['~', '|']) + +var commonmark = gfm.concat([ + '\n', + '"', + '$', + '%', + '&', + "'", + ',', + '/', + ':', + ';', + '<', + '=', + '?', + '@', + '^' +]) + +escapes.default = defaults +escapes.gfm = gfm +escapes.commonmark = commonmark + +// Get markdown escapes. +function escapes(options) { + var settings = options || {} + + if (settings.commonmark) { + return commonmark + } + + return settings.gfm ? gfm : defaults +} diff --git a/node_modules/markdown-escapes/license b/node_modules/markdown-escapes/license new file mode 100644 index 0000000..8d8660d --- /dev/null +++ b/node_modules/markdown-escapes/license @@ -0,0 +1,22 @@ +(The MIT License) + +Copyright (c) 2016 Titus Wormer + +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: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +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. diff --git a/node_modules/markdown-escapes/package.json b/node_modules/markdown-escapes/package.json new file mode 100644 index 0000000..8ad0843 --- /dev/null +++ b/node_modules/markdown-escapes/package.json @@ -0,0 +1,112 @@ +{ + "_from": "markdown-escapes@^1.0.0", + "_id": "markdown-escapes@1.0.4", + "_inBundle": false, + "_integrity": "sha512-8z4efJYk43E0upd0NbVXwgSTQs6cT3T06etieCMEg7dRbzCbxUCK/GHlX8mhHRDcp+OLlHkPKsvqQTCvsRl2cg==", + "_location": "/markdown-escapes", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "markdown-escapes@^1.0.0", + "name": "markdown-escapes", + "escapedName": "markdown-escapes", + "rawSpec": "^1.0.0", + "saveSpec": null, + "fetchSpec": "^1.0.0" + }, + "_requiredBy": [ + "/remark-parse", + "/remark-stringify" + ], + "_resolved": "https://registry.npmjs.org/markdown-escapes/-/markdown-escapes-1.0.4.tgz", + "_shasum": "c95415ef451499d7602b91095f3c8e8975f78535", + "_spec": "markdown-escapes@^1.0.0", + "_where": "/Users/josh/Projects/slackify-markdown-action/node_modules/remark-parse", + "author": { + "name": "Titus Wormer", + "email": "tituswormer@gmail.com", + "url": "https://wooorm.com" + }, + "bugs": { + "url": "https://github.com/wooorm/markdown-escapes/issues" + }, + "bundleDependencies": false, + "contributors": [ + { + "name": "Titus Wormer", + "email": "tituswormer@gmail.com", + "url": "https://wooorm.com" + } + ], + "dependencies": {}, + "deprecated": false, + "description": "List of escapable characters in markdown", + "devDependencies": { + "browserify": "^16.0.0", + "nyc": "^14.0.0", + "prettier": "^1.0.0", + "remark-cli": "^7.0.0", + "remark-preset-wooorm": "^6.0.0", + "tape": "^4.0.0", + "tinyify": "^2.0.0", + "xo": "^0.25.0" + }, + "files": [ + "index.js" + ], + "funding": { + "type": "github", + "url": "https://github.com/sponsors/wooorm" + }, + "homepage": "https://github.com/wooorm/markdown-escapes#readme", + "keywords": [ + "markdown", + "escape", + "pedantic", + "gfm", + "commonmark" + ], + "license": "MIT", + "name": "markdown-escapes", + "nyc": { + "check-coverage": true, + "lines": 100, + "functions": 100, + "branches": 100 + }, + "prettier": { + "tabWidth": 2, + "useTabs": false, + "singleQuote": true, + "bracketSpacing": false, + "semi": false, + "trailingComma": "none" + }, + "remarkConfig": { + "plugins": [ + "preset-wooorm" + ] + }, + "repository": { + "type": "git", + "url": "git+https://github.com/wooorm/markdown-escapes.git" + }, + "scripts": { + "build": "npm run build-bundle && npm run build-mangle", + "build-bundle": "browserify . -s markdownEscapes -o markdown-escapes.js", + "build-mangle": "browserify . -s markdownEscapes -p tinyify -o markdown-escapes.min.js", + "format": "remark . -qfo && prettier --write \"**/*.js\" && xo --fix", + "test": "npm run format && npm run build && npm run test-coverage", + "test-api": "node test", + "test-coverage": "nyc --reporter lcov tape test.js" + }, + "version": "1.0.4", + "xo": { + "prettier": true, + "esnext": false, + "ignores": [ + "markdown-escapes.js" + ] + } +} diff --git a/node_modules/markdown-escapes/readme.md b/node_modules/markdown-escapes/readme.md new file mode 100644 index 0000000..a740452 --- /dev/null +++ b/node_modules/markdown-escapes/readme.md @@ -0,0 +1,80 @@ +# markdown-escapes + +[![Build][build-badge]][build] +[![Coverage][coverage-badge]][coverage] +[![Downloads][downloads-badge]][downloads] +[![Size][size-badge]][size] + +List of escapable characters in markdown. + +## Install + +[npm][]: + +```sh +npm install markdown-escapes +``` + +## Use + +```js +var escapes = require('markdown-escapes'); + +// Access by property: +escapes.commonmark; //=> ['\\', '`', ..., '@', '^'] + +// Access by options object: +escapes({gfm: true}); //=> ['\\', '`', ..., '~', '|'] +``` + +## API + +### `escapes([options])` + +Get escapes. +Supports `options.commonmark` and `options.gfm`, which when `true` returns the +extra escape characters supported by those flavors. + +###### Returns + +`Array.`. + +### `escapes.default` + +List of default escapable characters. + +### `escapes.gfm` + +List of escapable characters in GFM (which includes all `default`s). + +### `escapes.commonmark` + +List of escapable characters in CommonMark (which includes all `gfm`s). + +## License + +[MIT][license] © [Titus Wormer][author] + + + +[build-badge]: https://img.shields.io/travis/wooorm/markdown-escapes.svg + +[build]: https://travis-ci.org/wooorm/markdown-escapes + +[coverage-badge]: https://img.shields.io/codecov/c/github/wooorm/markdown-escapes.svg + +[coverage]: https://codecov.io/github/wooorm/markdown-escapes + +[downloads-badge]: https://img.shields.io/npm/dm/markdown-escapes.svg + +[downloads]: https://www.npmjs.com/package/markdown-escapes + +[size-badge]: https://img.shields.io/bundlephobia/minzip/markdown-escapes.svg + +[size]: https://bundlephobia.com/result?p=markdown-escapes + +[npm]: https://docs.npmjs.com/cli/install + +[license]: license + +[author]: https://wooorm.com diff --git a/node_modules/markdown-table/index.js b/node_modules/markdown-table/index.js new file mode 100644 index 0000000..ff2a0ce --- /dev/null +++ b/node_modules/markdown-table/index.js @@ -0,0 +1,249 @@ +'use strict' + +var repeat = require('repeat-string') + +module.exports = markdownTable + +var trailingWhitespace = / +$/ + +// Characters. +var space = ' ' +var lineFeed = '\n' +var dash = '-' +var colon = ':' +var verticalBar = '|' + +var x = 0 +var C = 67 +var L = 76 +var R = 82 +var c = 99 +var l = 108 +var r = 114 + +// Create a table from a matrix of strings. +function markdownTable(table, options) { + var settings = options || {} + var padding = settings.padding !== false + var start = settings.delimiterStart !== false + var end = settings.delimiterEnd !== false + var align = (settings.align || []).concat() + var alignDelimiters = settings.alignDelimiters !== false + var alignments = [] + var stringLength = settings.stringLength || defaultStringLength + var rowIndex = -1 + var rowLength = table.length + var cellMatrix = [] + var sizeMatrix = [] + var row = [] + var sizes = [] + var longestCellByColumn = [] + var mostCellsPerRow = 0 + var cells + var columnIndex + var columnLength + var largest + var size + var cell + var lines + var line + var before + var after + var code + + // This is a superfluous loop if we don’t align delimiters, but otherwise we’d + // do superfluous work when aligning, so optimize for aligning. + while (++rowIndex < rowLength) { + cells = table[rowIndex] + columnIndex = -1 + columnLength = cells.length + row = [] + sizes = [] + + if (columnLength > mostCellsPerRow) { + mostCellsPerRow = columnLength + } + + while (++columnIndex < columnLength) { + cell = serialize(cells[columnIndex]) + + if (alignDelimiters === true) { + size = stringLength(cell) + sizes[columnIndex] = size + + largest = longestCellByColumn[columnIndex] + + if (largest === undefined || size > largest) { + longestCellByColumn[columnIndex] = size + } + } + + row.push(cell) + } + + cellMatrix[rowIndex] = row + sizeMatrix[rowIndex] = sizes + } + + // Figure out which alignments to use. + columnIndex = -1 + columnLength = mostCellsPerRow + + if (typeof align === 'object' && 'length' in align) { + while (++columnIndex < columnLength) { + alignments[columnIndex] = toAlignment(align[columnIndex]) + } + } else { + code = toAlignment(align) + + while (++columnIndex < columnLength) { + alignments[columnIndex] = code + } + } + + // Inject the alignment row. + columnIndex = -1 + columnLength = mostCellsPerRow + row = [] + sizes = [] + + while (++columnIndex < columnLength) { + code = alignments[columnIndex] + before = '' + after = '' + + if (code === l) { + before = colon + } else if (code === r) { + after = colon + } else if (code === c) { + before = colon + after = colon + } + + // There *must* be at least one hyphen-minus in each alignment cell. + size = alignDelimiters + ? Math.max( + 1, + longestCellByColumn[columnIndex] - before.length - after.length + ) + : 1 + + cell = before + repeat(dash, size) + after + + if (alignDelimiters === true) { + size = before.length + size + after.length + + if (size > longestCellByColumn[columnIndex]) { + longestCellByColumn[columnIndex] = size + } + + sizes[columnIndex] = size + } + + row[columnIndex] = cell + } + + // Inject the alignment row. + cellMatrix.splice(1, 0, row) + sizeMatrix.splice(1, 0, sizes) + + rowIndex = -1 + rowLength = cellMatrix.length + lines = [] + + while (++rowIndex < rowLength) { + row = cellMatrix[rowIndex] + sizes = sizeMatrix[rowIndex] + columnIndex = -1 + columnLength = mostCellsPerRow + line = [] + + while (++columnIndex < columnLength) { + cell = row[columnIndex] || '' + before = '' + after = '' + + if (alignDelimiters === true) { + size = longestCellByColumn[columnIndex] - (sizes[columnIndex] || 0) + code = alignments[columnIndex] + + if (code === r) { + before = repeat(space, size) + } else if (code === c) { + if (size % 2 === 0) { + before = repeat(space, size / 2) + after = before + } else { + before = repeat(space, size / 2 + 0.5) + after = repeat(space, size / 2 - 0.5) + } + } else { + after = repeat(space, size) + } + } + + if (start === true && columnIndex === 0) { + line.push(verticalBar) + } + + if ( + padding === true && + // Don’t add the opening space if we’re not aligning and the cell is + // empty: there will be a closing space. + !(alignDelimiters === false && cell === '') && + (start === true || columnIndex !== 0) + ) { + line.push(space) + } + + if (alignDelimiters === true) { + line.push(before) + } + + line.push(cell) + + if (alignDelimiters === true) { + line.push(after) + } + + if (padding === true) { + line.push(space) + } + + if (end === true || columnIndex !== columnLength - 1) { + line.push(verticalBar) + } + } + + line = line.join('') + + if (end === false) { + line = line.replace(trailingWhitespace, '') + } + + lines.push(line) + } + + return lines.join(lineFeed) +} + +function serialize(value) { + return value === null || value === undefined ? '' : String(value) +} + +function defaultStringLength(value) { + return value.length +} + +function toAlignment(value) { + var code = typeof value === 'string' ? value.charCodeAt(0) : x + + return code === L || code === l + ? l + : code === R || code === r + ? r + : code === C || code === c + ? c + : x +} diff --git a/node_modules/markdown-table/license b/node_modules/markdown-table/license new file mode 100644 index 0000000..0c06d5b --- /dev/null +++ b/node_modules/markdown-table/license @@ -0,0 +1,22 @@ +(The MIT License) + +Copyright (c) 2014 Titus Wormer + +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: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +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. diff --git a/node_modules/markdown-table/package.json b/node_modules/markdown-table/package.json new file mode 100644 index 0000000..cee1b07 --- /dev/null +++ b/node_modules/markdown-table/package.json @@ -0,0 +1,119 @@ +{ + "_from": "markdown-table@^2.0.0", + "_id": "markdown-table@2.0.0", + "_inBundle": false, + "_integrity": "sha512-Ezda85ToJUBhM6WGaG6veasyym+Tbs3cMAw/ZhOPqXiYsr0jgocBV3j3nx+4lk47plLlIqjwuTm/ywVI+zjJ/A==", + "_location": "/markdown-table", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "markdown-table@^2.0.0", + "name": "markdown-table", + "escapedName": "markdown-table", + "rawSpec": "^2.0.0", + "saveSpec": null, + "fetchSpec": "^2.0.0" + }, + "_requiredBy": [ + "/remark-stringify" + ], + "_resolved": "https://registry.npmjs.org/markdown-table/-/markdown-table-2.0.0.tgz", + "_shasum": "194a90ced26d31fe753d8b9434430214c011865b", + "_spec": "markdown-table@^2.0.0", + "_where": "/Users/josh/Projects/slackify-markdown-action/node_modules/remark-stringify", + "author": { + "name": "Titus Wormer", + "email": "tituswormer@gmail.com", + "url": "https://wooorm.com" + }, + "bugs": { + "url": "https://github.com/wooorm/markdown-table/issues" + }, + "bundleDependencies": false, + "contributors": [ + { + "name": "Titus Wormer", + "email": "tituswormer@gmail.com", + "url": "https://wooorm.com" + } + ], + "dependencies": { + "repeat-string": "^1.0.0" + }, + "deprecated": false, + "description": "Markdown tables", + "devDependencies": { + "browserify": "^16.0.0", + "chalk": "^3.0.0", + "nyc": "^15.0.0", + "prettier": "^1.0.0", + "remark-cli": "^7.0.0", + "remark-preset-wooorm": "^6.0.0", + "strip-ansi": "^6.0.0", + "tape": "^4.0.0", + "tinyify": "^2.0.0", + "xo": "^0.25.0" + }, + "files": [ + "index.js" + ], + "funding": { + "type": "github", + "url": "https://github.com/sponsors/wooorm" + }, + "homepage": "https://github.com/wooorm/markdown-table#readme", + "keywords": [ + "text", + "markdown", + "table", + "align", + "rows", + "tabular" + ], + "license": "MIT", + "name": "markdown-table", + "nyc": { + "check-coverage": true, + "lines": 100, + "functions": 100, + "branches": 100 + }, + "prettier": { + "tabWidth": 2, + "useTabs": false, + "singleQuote": true, + "bracketSpacing": false, + "semi": false, + "trailingComma": "none" + }, + "remarkConfig": { + "plugins": [ + "preset-wooorm" + ] + }, + "repository": { + "type": "git", + "url": "git+https://github.com/wooorm/markdown-table.git" + }, + "scripts": { + "build": "npm run build-bundle && npm run build-mangle", + "build-bundle": "browserify . -s markdownTable -o markdown-table.js", + "build-mangle": "browserify . -s markdownTable -p tinyify -o markdown-table.min.js", + "format": "remark . -qfo && prettier --write \"**/*.js\" && xo --fix", + "test": "npm run format && npm run build && npm run test-coverage", + "test-api": "node test", + "test-coverage": "nyc --reporter lcov tape test.js" + }, + "version": "2.0.0", + "xo": { + "prettier": true, + "esnext": false, + "rules": { + "complexity": "off" + }, + "ignores": [ + "markdown-table.js" + ] + } +} diff --git a/node_modules/markdown-table/readme.md b/node_modules/markdown-table/readme.md new file mode 100644 index 0000000..19e823c --- /dev/null +++ b/node_modules/markdown-table/readme.md @@ -0,0 +1,259 @@ +# markdown-table + +[![Build][build-badge]][build] +[![Coverage][coverage-badge]][coverage] +[![Downloads][downloads-badge]][downloads] +[![Size][size-badge]][size] + +Generate fancy [Markdown][fancy] tables. + +## Install + +[npm][]: + +```sh +npm install markdown-table +``` + +## Use + +Typical usage (defaults to align left): + +```js +var table = require('markdown-table') + +table([ + ['Branch', 'Commit'], + ['master', '0123456789abcdef'], + ['staging', 'fedcba9876543210'] +]) +``` + +Yields: + +```markdown +| Branch | Commit | +| ------- | ---------------- | +| master | 0123456789abcdef | +| staging | fedcba9876543210 | +``` + +With align: + +```js +table( + [ + ['Beep', 'No.', 'Boop'], + ['beep', '1024', 'xyz'], + ['boop', '3388450', 'tuv'], + ['foo', '10106', 'qrstuv'], + ['bar', '45', 'lmno'] + ], + {align: ['l', 'c', 'r']} +) +``` + +Yields: + +```markdown +| Beep | No. | Boop | +| :--- | :-----: | -----: | +| beep | 1024 | xyz | +| boop | 3388450 | tuv | +| foo | 10106 | qrstuv | +| bar | 45 | lmno | +``` + +## API + +### `markdownTable(table[, options])` + +Turns a given matrix of strings (an array of arrays of strings) into a table. + +##### `options` + +###### `options.align` + +One style for all columns, or styles for their respective columns (`string` or +`Array.`). +Each style is either `'l'` (left), `'r'` (right), or `'c'` (center). +Other values are treated as `''`, which doesn’t place the colon in the alignment +row but does align left. +*Only the lowercased first character is used, so `Right` is fine.* + +###### `options.padding` + +Whether to add a space of padding between delimiters and cells (`boolean`, +default: `true`). + +When `true`, there is padding: + +```markdown +| Alpha | B | +| ----- | ----- | +| C | Delta | +``` + +When `false`, there is no padding: + +```markdown +|Alpha|B | +|-----|-----| +|C |Delta| +``` + +###### `options.delimiterStart` + +Whether to begin each row with the delimiter (`boolean`, default: `true`). + +Note: please don’t use this: it could create fragile structures that aren’t +understandable to some Markdown parsers. + +When `true`, there are starting delimiters: + +```markdown +| Alpha | B | +| ----- | ----- | +| C | Delta | +``` + +When `false`, there are no starting delimiters: + +```markdown +Alpha | B | +----- | ----- | +C | Delta | +``` + +###### `options.delimiterEnd` + +Whether to end each row with the delimiter (`boolean`, default: `true`). + +Note: please don’t use this: it could create fragile structures that aren’t +understandable to some Markdown parsers. + +When `true`, there are ending delimiters: + +```markdown +| Alpha | B | +| ----- | ----- | +| C | Delta | +``` + +When `false`, there are no ending delimiters: + +```markdown +| Alpha | B +| ----- | ----- +| C | Delta +``` + +###### `options.alignDelimiters` + +Whether to align the delimiters (`boolean`, default: `true`). +By default, they are aligned: + +```markdown +| Alpha | B | +| ----- | ----- | +| C | Delta | +``` + +Pass `false` to make them staggered: + +```markdown +| Alpha | B | +| - | - | +| C | Delta | +``` + +###### `options.stringLength` + +Method to detect the length of a cell (`Function`, default: `s => s.length`). + +Full-width characters and ANSI-sequences all mess up delimiter alignment +when viewing the Markdown source. +To fix this, you have to pass in a `stringLength` option to detect the “visible” +length of a cell (note that what is and isn’t visible depends on your editor). + +Without such a function, the following: + +```js +table([ + ['Alpha', 'Bravo'], + ['中文', 'Charlie'], + ['👩‍❤️‍👩', 'Delta'] +]) +``` + +Yields: + +```markdown +| Alpha | Bravo | +| - | - | +| 中文 | Charlie | +| 👩‍❤️‍👩 | Delta | +``` + +With [`string-width`][string-width]: + +```js +var width = require('string-width') + +table( + [ + ['Alpha', 'Bravo'], + ['中文', 'Charlie'], + ['👩‍❤️‍👩', 'Delta'] + ], + {stringLength: width} +) +``` + +Yields: + +```markdown +| Alpha | Bravo | +| ----- | ------- | +| 中文 | Charlie | +| 👩‍❤️‍👩 | Delta | +``` + +## Inspiration + +The original idea and basic implementation was inspired by James Halliday’s +[`text-table`][text-table] library. + +## License + +[MIT][license] © [Titus Wormer][author] + + + +[build-badge]: https://img.shields.io/travis/wooorm/markdown-table.svg + +[build]: https://travis-ci.org/wooorm/markdown-table + +[coverage-badge]: https://img.shields.io/codecov/c/github/wooorm/markdown-table.svg + +[coverage]: https://codecov.io/github/wooorm/markdown-table + +[downloads-badge]: https://img.shields.io/npm/dm/markdown-table.svg + +[downloads]: https://www.npmjs.com/package/markdown-table + +[size-badge]: https://img.shields.io/bundlephobia/minzip/markdown-table.svg + +[size]: https://bundlephobia.com/result?p=markdown-table + +[npm]: https://docs.npmjs.com/cli/install + +[license]: license + +[author]: https://wooorm.com + +[fancy]: https://help.github.com/articles/github-flavored-markdown/#tables + +[text-table]: https://github.com/substack/text-table + +[string-width]: https://github.com/sindresorhus/string-width diff --git a/node_modules/mdast-util-compact/index.js b/node_modules/mdast-util-compact/index.js new file mode 100644 index 0000000..eee0fdf --- /dev/null +++ b/node_modules/mdast-util-compact/index.js @@ -0,0 +1,61 @@ +'use strict' + +var visit = require('unist-util-visit') + +module.exports = compact + +// Make an mdast tree compact by merging adjacent text nodes. +function compact(tree, commonmark) { + visit(tree, visitor) + + return tree + + function visitor(child, index, parent) { + var siblings = parent ? parent.children : [] + var prev = index && siblings[index - 1] + + if ( + prev && + child.type === prev.type && + mergeable(prev, commonmark) && + mergeable(child, commonmark) + ) { + if (child.value) { + prev.value += child.value + } + + if (child.children) { + prev.children = prev.children.concat(child.children) + } + + siblings.splice(index, 1) + + if (prev.position && child.position) { + prev.position.end = child.position.end + } + + return index + } + } +} + +function mergeable(node, commonmark) { + var start + var end + + if (node.type === 'text') { + if (!node.position) { + return true + } + + start = node.position.start + end = node.position.end + + // Only merge nodes which occupy the same size as their `value`. + return ( + start.line !== end.line || end.column - start.column === node.value.length + ) + } + + return commonmark && node.type === 'blockquote' +} diff --git a/node_modules/mdast-util-compact/license b/node_modules/mdast-util-compact/license new file mode 100644 index 0000000..8d8660d --- /dev/null +++ b/node_modules/mdast-util-compact/license @@ -0,0 +1,22 @@ +(The MIT License) + +Copyright (c) 2016 Titus Wormer + +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: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +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. diff --git a/node_modules/mdast-util-compact/package.json b/node_modules/mdast-util-compact/package.json new file mode 100644 index 0000000..ffa925b --- /dev/null +++ b/node_modules/mdast-util-compact/package.json @@ -0,0 +1,117 @@ +{ + "_from": "mdast-util-compact@^2.0.0", + "_id": "mdast-util-compact@2.0.1", + "_inBundle": false, + "_integrity": "sha512-7GlnT24gEwDrdAwEHrU4Vv5lLWrEer4KOkAiKT9nYstsTad7Oc1TwqT2zIMKRdZF7cTuaf+GA1E4Kv7jJh8mPA==", + "_location": "/mdast-util-compact", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "mdast-util-compact@^2.0.0", + "name": "mdast-util-compact", + "escapedName": "mdast-util-compact", + "rawSpec": "^2.0.0", + "saveSpec": null, + "fetchSpec": "^2.0.0" + }, + "_requiredBy": [ + "/remark-stringify" + ], + "_resolved": "https://registry.npmjs.org/mdast-util-compact/-/mdast-util-compact-2.0.1.tgz", + "_shasum": "cabc69a2f43103628326f35b1acf735d55c99490", + "_spec": "mdast-util-compact@^2.0.0", + "_where": "/Users/josh/Projects/slackify-markdown-action/node_modules/remark-stringify", + "author": { + "name": "Titus Wormer", + "email": "tituswormer@gmail.com", + "url": "https://wooorm.com" + }, + "bugs": { + "url": "https://github.com/syntax-tree/mdast-util-compact/issues" + }, + "bundleDependencies": false, + "contributors": [ + { + "name": "Titus Wormer", + "email": "tituswormer@gmail.com", + "url": "https://wooorm.com" + } + ], + "dependencies": { + "unist-util-visit": "^2.0.0" + }, + "deprecated": false, + "description": "mdast utility to make a tree compact", + "devDependencies": { + "browserify": "^16.0.0", + "nyc": "^15.0.0", + "prettier": "^1.0.0", + "remark-cli": "^7.0.0", + "remark-preset-wooorm": "^6.0.0", + "tape": "^4.0.0", + "tinyify": "^2.0.0", + "unist-builder": "^2.0.0", + "xo": "^0.26.0" + }, + "files": [ + "index.js" + ], + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + }, + "homepage": "https://github.com/syntax-tree/mdast-util-compact#readme", + "keywords": [ + "unist", + "mdast", + "mdast-util", + "util", + "utility", + "tree", + "compact", + "node" + ], + "license": "MIT", + "name": "mdast-util-compact", + "nyc": { + "check-coverage": true, + "lines": 100, + "functions": 100, + "branches": 100 + }, + "prettier": { + "tabWidth": 2, + "useTabs": false, + "singleQuote": true, + "bracketSpacing": false, + "semi": false, + "trailingComma": "none" + }, + "remarkConfig": { + "plugins": [ + "preset-wooorm" + ] + }, + "repository": { + "type": "git", + "url": "git+https://github.com/syntax-tree/mdast-util-compact.git" + }, + "scripts": { + "build": "npm run build-bundle && npm run build-mangle", + "build-bundle": "browserify . -s mdastUtilCompact > mdast-util-compact.js", + "build-mangle": "browserify . -s mdastUtilCompact -p tinyify > mdast-util-compact.min.js", + "format": "remark . -qfo && prettier --write \"**/*.js\" && xo --fix", + "test": "npm run format && npm run build && npm run test-coverage", + "test-api": "node test", + "test-coverage": "nyc --reporter lcov tape test.js" + }, + "version": "2.0.1", + "xo": { + "prettier": true, + "esnext": false, + "ignores": [ + "mdast-util-compact.js" + ] + } +} diff --git a/node_modules/mdast-util-compact/readme.md b/node_modules/mdast-util-compact/readme.md new file mode 100644 index 0000000..fe08e44 --- /dev/null +++ b/node_modules/mdast-util-compact/readme.md @@ -0,0 +1,127 @@ +# mdast-util-compact + +[![Build][build-badge]][build] +[![Coverage][coverage-badge]][coverage] +[![Downloads][downloads-badge]][downloads] +[![Size][size-badge]][size] +[![Sponsors][sponsors-badge]][collective] +[![Backers][backers-badge]][collective] +[![Chat][chat-badge]][chat] + +[**mdast**][mdast] utility to make trees compact: collapse text nodes (when +possible) and blockquotes (in commonmark mode). + +## Install + +[npm][]: + +```sh +npm install mdast-util-compact +``` + +## Use + +```js +var u = require('unist-builder') +var compact = require('mdast-util-compact') + +var tree = u('strong', [u('text', 'alpha'), u('text', ' '), u('text', 'bravo')]) + +compact(tree) + +console.log(tree) +``` + +Yields: + +```js +{ type: 'strong', + children: [ { type: 'text', value: 'alpha bravo' } ] } +``` + +## API + +### `compact(tree[, commonmark])` + +Walk the [tree][] and collapse nodes. +Combines adjacent [text][]s (but not when they represent entities or escapes). +If `commonmark` is `true`, collapses [blockquote][]s. + +Handles [positional information][position-information] properly. + +###### Returns + +The given `tree`. + +## Security + +Use of `mdast-util-compact` does not involve [**hast**][hast] or user content +so there are no openings for [cross-site scripting (XSS)][xss] attacks. + +## Contribute + +See [`contributing.md` in `syntax-tree/.github`][contributing] for ways to get +started. +See [`support.md`][support] for ways to get help. + +This project has a [code of conduct][coc]. +By interacting with this repository, organization, or community you agree to +abide by its terms. + +## License + +[MIT][license] © [Titus Wormer][author] + + + +[build-badge]: https://img.shields.io/travis/syntax-tree/mdast-util-compact.svg + +[build]: https://travis-ci.org/syntax-tree/mdast-util-compact + +[coverage-badge]: https://img.shields.io/codecov/c/github/syntax-tree/mdast-util-compact.svg + +[coverage]: https://codecov.io/github/syntax-tree/mdast-util-compact + +[downloads-badge]: https://img.shields.io/npm/dm/mdast-util-compact.svg + +[downloads]: https://www.npmjs.com/package/mdast-util-compact + +[size-badge]: https://img.shields.io/bundlephobia/minzip/mdast-util-compact.svg + +[size]: https://bundlephobia.com/result?p=mdast-util-compact + +[sponsors-badge]: https://opencollective.com/unified/sponsors/badge.svg + +[backers-badge]: https://opencollective.com/unified/backers/badge.svg + +[collective]: https://opencollective.com/unified + +[chat-badge]: https://img.shields.io/badge/chat-spectrum-7b16ff.svg + +[chat]: https://spectrum.chat/unified/syntax-tree + +[npm]: https://docs.npmjs.com/cli/install + +[license]: license + +[author]: https://wooorm.com + +[contributing]: https://github.com/syntax-tree/.github/blob/master/contributing.md + +[support]: https://github.com/syntax-tree/.github/blob/master/support.md + +[coc]: https://github.com/syntax-tree/.github/blob/master/code-of-conduct.md + +[mdast]: https://github.com/syntax-tree/mdast + +[tree]: https://github.com/syntax-tree/unist#tree + +[position-information]: https://github.com/syntax-tree/unist#positional-information + +[text]: https://github.com/syntax-tree/mdast#text + +[blockquote]: https://github.com/syntax-tree/mdast#blockquote + +[xss]: https://en.wikipedia.org/wiki/Cross-site_scripting + +[hast]: https://github.com/syntax-tree/hast diff --git a/node_modules/parse-entities/decode-entity.browser.js b/node_modules/parse-entities/decode-entity.browser.js new file mode 100644 index 0000000..feb3266 --- /dev/null +++ b/node_modules/parse-entities/decode-entity.browser.js @@ -0,0 +1,30 @@ +'use strict' + +/* eslint-env browser */ + +var el + +var semicolon = 59 // ';' + +module.exports = decodeEntity + +function decodeEntity(characters) { + var entity = '&' + characters + ';' + var char + + el = el || document.createElement('i') + el.innerHTML = entity + char = el.textContent + + // Some entities do not require the closing semicolon (`¬` - for instance), + // which leads to situations where parsing the assumed entity of ¬it; will + // result in the string `¬it;`. When we encounter a trailing semicolon after + // parsing and the entity to decode was not a semicolon (`;`), we can + // assume that the matching was incomplete + if (char.charCodeAt(char.length - 1) === semicolon && characters !== 'semi') { + return false + } + + // If the decoded string is equal to the input, the entity was not valid + return char === entity ? false : char +} diff --git a/node_modules/parse-entities/decode-entity.js b/node_modules/parse-entities/decode-entity.js new file mode 100644 index 0000000..87c3b1e --- /dev/null +++ b/node_modules/parse-entities/decode-entity.js @@ -0,0 +1,13 @@ +'use strict' + +var characterEntities = require('character-entities') + +module.exports = decodeEntity + +var own = {}.hasOwnProperty + +function decodeEntity(characters) { + return own.call(characterEntities, characters) + ? characterEntities[characters] + : false +} diff --git a/node_modules/parse-entities/index.js b/node_modules/parse-entities/index.js new file mode 100644 index 0000000..106d6d8 --- /dev/null +++ b/node_modules/parse-entities/index.js @@ -0,0 +1,451 @@ +'use strict' + +var legacy = require('character-entities-legacy') +var invalid = require('character-reference-invalid') +var decimal = require('is-decimal') +var hexadecimal = require('is-hexadecimal') +var alphanumerical = require('is-alphanumerical') +var decodeEntity = require('./decode-entity') + +module.exports = parseEntities + +var own = {}.hasOwnProperty +var fromCharCode = String.fromCharCode +var noop = Function.prototype + +// Default settings. +var defaults = { + warning: null, + reference: null, + text: null, + warningContext: null, + referenceContext: null, + textContext: null, + position: {}, + additional: null, + attribute: false, + nonTerminated: true +} + +// Characters. +var tab = 9 // '\t' +var lineFeed = 10 // '\n' +var formFeed = 12 // '\f' +var space = 32 // ' ' +var ampersand = 38 // '&' +var semicolon = 59 // ';' +var lessThan = 60 // '<' +var equalsTo = 61 // '=' +var numberSign = 35 // '#' +var uppercaseX = 88 // 'X' +var lowercaseX = 120 // 'x' +var replacementCharacter = 65533 // '�' + +// Reference types. +var name = 'named' +var hexa = 'hexadecimal' +var deci = 'decimal' + +// Map of bases. +var bases = {} + +bases[hexa] = 16 +bases[deci] = 10 + +// Map of types to tests. +// Each type of character reference accepts different characters. +// This test is used to detect whether a reference has ended (as the semicolon +// is not strictly needed). +var tests = {} + +tests[name] = alphanumerical +tests[deci] = decimal +tests[hexa] = hexadecimal + +// Warning types. +var namedNotTerminated = 1 +var numericNotTerminated = 2 +var namedEmpty = 3 +var numericEmpty = 4 +var namedUnknown = 5 +var numericDisallowed = 6 +var numericProhibited = 7 + +// Warning messages. +var messages = {} + +messages[namedNotTerminated] = + 'Named character references must be terminated by a semicolon' +messages[numericNotTerminated] = + 'Numeric character references must be terminated by a semicolon' +messages[namedEmpty] = 'Named character references cannot be empty' +messages[numericEmpty] = 'Numeric character references cannot be empty' +messages[namedUnknown] = 'Named character references must be known' +messages[numericDisallowed] = + 'Numeric character references cannot be disallowed' +messages[numericProhibited] = + 'Numeric character references cannot be outside the permissible Unicode range' + +// Wrap to ensure clean parameters are given to `parse`. +function parseEntities(value, options) { + var settings = {} + var option + var key + + if (!options) { + options = {} + } + + for (key in defaults) { + option = options[key] + settings[key] = + option === null || option === undefined ? defaults[key] : option + } + + if (settings.position.indent || settings.position.start) { + settings.indent = settings.position.indent || [] + settings.position = settings.position.start + } + + return parse(value, settings) +} + +// Parse entities. +// eslint-disable-next-line complexity +function parse(value, settings) { + var additional = settings.additional + var nonTerminated = settings.nonTerminated + var handleText = settings.text + var handleReference = settings.reference + var handleWarning = settings.warning + var textContext = settings.textContext + var referenceContext = settings.referenceContext + var warningContext = settings.warningContext + var pos = settings.position + var indent = settings.indent || [] + var length = value.length + var index = 0 + var lines = -1 + var column = pos.column || 1 + var line = pos.line || 1 + var queue = '' + var result = [] + var entityCharacters + var namedEntity + var terminated + var characters + var character + var reference + var following + var warning + var reason + var output + var entity + var begin + var start + var type + var test + var prev + var next + var diff + var end + + if (typeof additional === 'string') { + additional = additional.charCodeAt(0) + } + + // Cache the current point. + prev = now() + + // Wrap `handleWarning`. + warning = handleWarning ? parseError : noop + + // Ensure the algorithm walks over the first character and the end + // (inclusive). + index-- + length++ + + while (++index < length) { + // If the previous character was a newline. + if (character === lineFeed) { + column = indent[lines] || 1 + } + + character = value.charCodeAt(index) + + if (character === ampersand) { + following = value.charCodeAt(index + 1) + + // The behaviour depends on the identity of the next character. + if ( + following === tab || + following === lineFeed || + following === formFeed || + following === space || + following === ampersand || + following === lessThan || + following !== following || + (additional && following === additional) + ) { + // Not a character reference. + // No characters are consumed, and nothing is returned. + // This is not an error, either. + queue += fromCharCode(character) + column++ + + continue + } + + start = index + 1 + begin = start + end = start + + if (following === numberSign) { + // Numerical entity. + end = ++begin + + // The behaviour further depends on the next character. + following = value.charCodeAt(end) + + if (following === uppercaseX || following === lowercaseX) { + // ASCII hex digits. + type = hexa + end = ++begin + } else { + // ASCII digits. + type = deci + } + } else { + // Named entity. + type = name + } + + entityCharacters = '' + entity = '' + characters = '' + test = tests[type] + end-- + + while (++end < length) { + following = value.charCodeAt(end) + + if (!test(following)) { + break + } + + characters += fromCharCode(following) + + // Check if we can match a legacy named reference. + // If so, we cache that as the last viable named reference. + // This ensures we do not need to walk backwards later. + if (type === name && own.call(legacy, characters)) { + entityCharacters = characters + entity = legacy[characters] + } + } + + terminated = value.charCodeAt(end) === semicolon + + if (terminated) { + end++ + + namedEntity = type === name ? decodeEntity(characters) : false + + if (namedEntity) { + entityCharacters = characters + entity = namedEntity + } + } + + diff = 1 + end - start + + if (!terminated && !nonTerminated) { + // Empty. + } else if (!characters) { + // An empty (possible) entity is valid, unless it’s numeric (thus an + // ampersand followed by an octothorp). + if (type !== name) { + warning(numericEmpty, diff) + } + } else if (type === name) { + // An ampersand followed by anything unknown, and not terminated, is + // invalid. + if (terminated && !entity) { + warning(namedUnknown, 1) + } else { + // If theres something after an entity name which is not known, cap + // the reference. + if (entityCharacters !== characters) { + end = begin + entityCharacters.length + diff = 1 + end - begin + terminated = false + } + + // If the reference is not terminated, warn. + if (!terminated) { + reason = entityCharacters ? namedNotTerminated : namedEmpty + + if (settings.attribute) { + following = value.charCodeAt(end) + + if (following === equalsTo) { + warning(reason, diff) + entity = null + } else if (alphanumerical(following)) { + entity = null + } else { + warning(reason, diff) + } + } else { + warning(reason, diff) + } + } + } + + reference = entity + } else { + if (!terminated) { + // All non-terminated numeric entities are not rendered, and trigger a + // warning. + warning(numericNotTerminated, diff) + } + + // When terminated and number, parse as either hexadecimal or decimal. + reference = parseInt(characters, bases[type]) + + // Trigger a warning when the parsed number is prohibited, and replace + // with replacement character. + if (prohibited(reference)) { + warning(numericProhibited, diff) + reference = fromCharCode(replacementCharacter) + } else if (reference in invalid) { + // Trigger a warning when the parsed number is disallowed, and replace + // by an alternative. + warning(numericDisallowed, diff) + reference = invalid[reference] + } else { + // Parse the number. + output = '' + + // Trigger a warning when the parsed number should not be used. + if (disallowed(reference)) { + warning(numericDisallowed, diff) + } + + // Stringify the number. + if (reference > 0xffff) { + reference -= 0x10000 + output += fromCharCode((reference >>> (10 & 0x3ff)) | 0xd800) + reference = 0xdc00 | (reference & 0x3ff) + } + + reference = output + fromCharCode(reference) + } + } + + // Found it! + // First eat the queued characters as normal text, then eat an entity. + if (reference) { + flush() + + prev = now() + index = end - 1 + column += end - start + 1 + result.push(reference) + next = now() + next.offset++ + + if (handleReference) { + handleReference.call( + referenceContext, + reference, + {start: prev, end: next}, + value.slice(start - 1, end) + ) + } + + prev = next + } else { + // If we could not find a reference, queue the checked characters (as + // normal characters), and move the pointer to their end. + // This is possible because we can be certain neither newlines nor + // ampersands are included. + characters = value.slice(start - 1, end) + queue += characters + column += characters.length + index = end - 1 + } + } else { + // Handle anything other than an ampersand, including newlines and EOF. + if ( + character === 10 // Line feed + ) { + line++ + lines++ + column = 0 + } + + if (character === character) { + queue += fromCharCode(character) + column++ + } else { + flush() + } + } + } + + // Return the reduced nodes. + return result.join('') + + // Get current position. + function now() { + return { + line: line, + column: column, + offset: index + (pos.offset || 0) + } + } + + // “Throw” a parse-error: a warning. + function parseError(code, offset) { + var position = now() + + position.column += offset + position.offset += offset + + handleWarning.call(warningContext, messages[code], position, code) + } + + // Flush `queue` (normal text). + // Macro invoked before each entity and at the end of `value`. + // Does nothing when `queue` is empty. + function flush() { + if (queue) { + result.push(queue) + + if (handleText) { + handleText.call(textContext, queue, {start: prev, end: now()}) + } + + queue = '' + } + } +} + +// Check if `character` is outside the permissible unicode range. +function prohibited(code) { + return (code >= 0xd800 && code <= 0xdfff) || code > 0x10ffff +} + +// Check if `character` is disallowed. +function disallowed(code) { + return ( + (code >= 0x0001 && code <= 0x0008) || + code === 0x000b || + (code >= 0x000d && code <= 0x001f) || + (code >= 0x007f && code <= 0x009f) || + (code >= 0xfdd0 && code <= 0xfdef) || + (code & 0xffff) === 0xffff || + (code & 0xffff) === 0xfffe + ) +} diff --git a/node_modules/parse-entities/license b/node_modules/parse-entities/license new file mode 100644 index 0000000..611b675 --- /dev/null +++ b/node_modules/parse-entities/license @@ -0,0 +1,22 @@ +(The MIT License) + +Copyright (c) 2015 Titus Wormer + +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: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +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. diff --git a/node_modules/parse-entities/package.json b/node_modules/parse-entities/package.json new file mode 100644 index 0000000..76a6d60 --- /dev/null +++ b/node_modules/parse-entities/package.json @@ -0,0 +1,139 @@ +{ + "_from": "parse-entities@^2.0.0", + "_id": "parse-entities@2.0.0", + "_inBundle": false, + "_integrity": "sha512-kkywGpCcRYhqQIchaWqZ875wzpS/bMKhz5HnN3p7wveJTkTtyAB/AlnS0f8DFSqYW1T82t6yEAkEcB+A1I3MbQ==", + "_location": "/parse-entities", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "parse-entities@^2.0.0", + "name": "parse-entities", + "escapedName": "parse-entities", + "rawSpec": "^2.0.0", + "saveSpec": null, + "fetchSpec": "^2.0.0" + }, + "_requiredBy": [ + "/remark-parse", + "/remark-stringify" + ], + "_resolved": "https://registry.npmjs.org/parse-entities/-/parse-entities-2.0.0.tgz", + "_shasum": "53c6eb5b9314a1f4ec99fa0fdf7ce01ecda0cbe8", + "_spec": "parse-entities@^2.0.0", + "_where": "/Users/josh/Projects/slackify-markdown-action/node_modules/remark-parse", + "author": { + "name": "Titus Wormer", + "email": "tituswormer@gmail.com", + "url": "https://wooorm.com" + }, + "browser": { + "./decode-entity.js": "./decode-entity.browser.js" + }, + "bugs": { + "url": "https://github.com/wooorm/parse-entities/issues" + }, + "bundleDependencies": false, + "contributors": [ + { + "name": "Titus Wormer", + "email": "tituswormer@gmail.com", + "url": "https://wooorm.com" + } + ], + "dependencies": { + "character-entities": "^1.0.0", + "character-entities-legacy": "^1.0.0", + "character-reference-invalid": "^1.0.0", + "is-alphanumerical": "^1.0.0", + "is-decimal": "^1.0.0", + "is-hexadecimal": "^1.0.0" + }, + "deprecated": false, + "description": "Parse HTML character references: fast, spec-compliant, positional information", + "devDependencies": { + "browserify": "^16.0.0", + "dtslint": "^2.0.0", + "nyc": "^15.0.0", + "prettier": "^1.0.0", + "remark-cli": "^7.0.0", + "remark-preset-wooorm": "^6.0.0", + "tape": "^4.0.0", + "tape-run": "^6.0.0", + "tinyify": "^2.0.0", + "xo": "^0.25.0" + }, + "files": [ + "index.js", + "decode-entity.js", + "decode-entity.browser.js", + "types/index.d.ts" + ], + "funding": { + "type": "github", + "url": "https://github.com/sponsors/wooorm" + }, + "homepage": "https://github.com/wooorm/parse-entities#readme", + "keywords": [ + "parse", + "html", + "character", + "reference", + "entity", + "entities" + ], + "license": "MIT", + "name": "parse-entities", + "nyc": { + "check-coverage": true, + "lines": 100, + "functions": 100, + "branches": 100 + }, + "prettier": { + "tabWidth": 2, + "useTabs": false, + "singleQuote": true, + "bracketSpacing": false, + "semi": false, + "trailingComma": "none" + }, + "react-native": { + "./decode-entity.js": "./decode-entity.js" + }, + "remarkConfig": { + "plugins": [ + "preset-wooorm" + ] + }, + "repository": { + "type": "git", + "url": "git+https://github.com/wooorm/parse-entities.git" + }, + "scripts": { + "build": "npm run build-bundle && npm run build-mangle", + "build-bundle": "browserify . -s parseEntities > parse-entities.js", + "build-mangle": "browserify . -s parseEntities -p tinyify > parse-entities.min.js", + "format": "remark . -qfo && prettier --write \"**/*.{js,ts}\" && xo --fix", + "test": "npm run format && npm run build && npm run test-coverage && npm run test-types", + "test-api": "node test", + "test-browser": "browserify test.js | tape-run", + "test-coverage": "nyc --reporter lcov tape test.js", + "test-types": "dtslint types" + }, + "types": "types/index.d.ts", + "version": "2.0.0", + "xo": { + "prettier": true, + "esnext": false, + "rules": { + "no-self-compare": "off", + "guard-for-in": "off", + "max-depth": "off" + }, + "ignores": [ + "parse-entities.js" + ] + } +} diff --git a/node_modules/parse-entities/readme.md b/node_modules/parse-entities/readme.md new file mode 100644 index 0000000..5ca60e7 --- /dev/null +++ b/node_modules/parse-entities/readme.md @@ -0,0 +1,217 @@ +# parse-entities + +[![Build][build-badge]][build] +[![Coverage][coverage-badge]][coverage] +[![Downloads][downloads-badge]][downloads] +[![Size][size-badge]][size] + +Parse HTML character references: fast, spec-compliant, positional +information. + +## Install + +[npm][]: + +```sh +npm install parse-entities +``` + +## Use + +```js +var decode = require('parse-entities') + +decode('alpha & bravo') +// => alpha & bravo + +decode('charlie ©cat; delta') +// => charlie ©cat; delta + +decode('echo © foxtrot ≠ golf 𝌆 hotel') +// => echo © foxtrot ≠ golf 𝌆 hotel +``` + +## API + +## `parseEntities(value[, options])` + +##### `options` + +###### `options.additional` + +Additional character to accept (`string?`, default: `''`). +This allows other characters, without error, when following an ampersand. + +###### `options.attribute` + +Whether to parse `value` as an attribute value (`boolean?`, default: +`false`). + +###### `options.nonTerminated` + +Whether to allow non-terminated entities (`boolean`, default: `true`). +For example, `©cat` for `©cat`. This behaviour is spec-compliant but +can lead to unexpected results. + +###### `options.warning` + +Error handler ([`Function?`][warning]). + +###### `options.text` + +Text handler ([`Function?`][text]). + +###### `options.reference` + +Reference handler ([`Function?`][reference]). + +###### `options.warningContext` + +Context used when invoking `warning` (`'*'`, optional). + +###### `options.textContext` + +Context used when invoking `text` (`'*'`, optional). + +###### `options.referenceContext` + +Context used when invoking `reference` (`'*'`, optional) + +###### `options.position` + +Starting `position` of `value` (`Location` or `Position`, optional). Useful +when dealing with values nested in some sort of syntax tree. The default is: + +```js +{ + start: {line: 1, column: 1, offset: 0}, + indent: [] +} +``` + +##### Returns + +`string` — Decoded `value`. + +### `function warning(reason, position, code)` + +Error handler. + +##### Context + +`this` refers to `warningContext` when given to `parseEntities`. + +##### Parameters + +###### `reason` + +Human-readable reason for triggering a parse error (`string`). + +###### `position` + +Place at which the parse error occurred (`Position`). + +###### `code` + +Identifier of reason for triggering a parse error (`number`). + +The following codes are used: + +| Code | Example | Note | +| ---- | ------------------ | --------------------------------------------- | +| `1` | `foo & bar` | Missing semicolon (named) | +| `2` | `foo { bar` | Missing semicolon (numeric) | +| `3` | `Foo &bar baz` | Ampersand did not start a reference | +| `4` | `Foo &#` | Empty reference | +| `5` | `Foo &bar; baz` | Unknown entity | +| `6` | `Foo € baz` | [Disallowed reference][invalid] | +| `7` | `Foo � baz` | Prohibited: outside permissible unicode range | + +### `function text(value, location)` + +Text handler. + +##### Context + +`this` refers to `textContext` when given to `parseEntities`. + +##### Parameters + +###### `value` + +String of content (`string`). + +###### `location` + +Location at which `value` starts and ends (`Location`). + +### `function reference(value, location, source)` + +Character reference handler. + +##### Context + +`this` refers to `referenceContext` when given to `parseEntities`. + +##### Parameters + +###### `value` + +Encoded character reference (`string`). + +###### `location` + +Location at which `value` starts and ends (`Location`). + +###### `source` + +Source of character reference (`Location`). + +## Related + +* [`stringify-entities`](https://github.com/wooorm/stringify-entities) + — Encode HTML character references +* [`character-entities`](https://github.com/wooorm/character-entities) + — Info on character entities +* [`character-entities-html4`](https://github.com/wooorm/character-entities-html4) + — Info on HTML4 character entities +* [`character-entities-legacy`](https://github.com/wooorm/character-entities-legacy) + — Info on legacy character entities +* [`character-reference-invalid`](https://github.com/wooorm/character-reference-invalid) + — Info on invalid numeric character references + +## License + +[MIT][license] © [Titus Wormer][author] + + + +[build-badge]: https://img.shields.io/travis/wooorm/parse-entities.svg + +[build]: https://travis-ci.org/wooorm/parse-entities + +[coverage-badge]: https://img.shields.io/codecov/c/github/wooorm/parse-entities.svg + +[coverage]: https://codecov.io/github/wooorm/parse-entities + +[downloads-badge]: https://img.shields.io/npm/dm/parse-entities.svg + +[downloads]: https://www.npmjs.com/package/parse-entities + +[size-badge]: https://img.shields.io/bundlephobia/minzip/parse-entities.svg + +[size]: https://bundlephobia.com/result?p=parse-entities + +[npm]: https://docs.npmjs.com/cli/install + +[license]: license + +[author]: https://wooorm.com + +[warning]: #function-warningreason-position-code + +[text]: #function-textvalue-location + +[reference]: #function-referencevalue-location-source + +[invalid]: https://github.com/wooorm/character-reference-invalid diff --git a/node_modules/parse-entities/types/index.d.ts b/node_modules/parse-entities/types/index.d.ts new file mode 100644 index 0000000..1a494d7 --- /dev/null +++ b/node_modules/parse-entities/types/index.d.ts @@ -0,0 +1,157 @@ +// TypeScript Version: 3.4 + +declare namespace parseEntities { + interface ParseEntitiesOptions< + WC = typeof globalThis, + TC = typeof globalThis, + RC = typeof globalThis + > { + /** + * Additional character to accept (`string?`, default: `''`). + * This allows other characters, without error, when following an ampersand. + */ + additional: string + + /** + * Whether to parse `value` as an attribute value (`boolean?`, default: `false`). + */ + attribute: boolean + + /** + * Whether to allow non-terminated entities (`boolean`, default: `true`). + * For example, `©cat` for `©cat`. This behaviour is spec-compliant but can lead to unexpected results. + */ + nonTerminated: boolean + + /** + * Error handler (`Function?`). + */ + warning: ErrorHandler + + /** + * Text handler (`Function?`). + */ + text: TextHandler + + /** + * Reference handler (`Function?`). + */ + reference: ReferenceHandler + + /** + * Context used when invoking `warning` (`'*'`, optional). + */ + warningContext: WC + + /** + * Context used when invoking `text` (`'*'`, optional). + */ + textContext: TC + + /** + * Context used when invoking `reference` (`'*'`, optional) + */ + referenceContext: RC + + /** + * Starting `position` of `value` (`Location` or `Position`, optional). Useful when dealing with values nested in some sort of syntax tree. + */ + position: Position + } + + /** + * Error handler. + */ + type ErrorHandler = ( + /** + * `this` refers to `warningContext` when given to `parseEntities`. + */ + this: C, + + /** + * Human-readable reason for triggering a parse error (`string`). + */ + reason: string, + + /** + * Place at which the parse error occurred (`Position`). + */ + position: Position, + + /** + * Identifier of reason for triggering a parse error (`number`). + */ + code: number + ) => void + + /** + * Text handler. + */ + type TextHandler = ( + /** + * `this` refers to `textContext` when given to `parseEntities`. + */ + this: C, + + /** + * String of content (`string`). + */ + value: string, + + /** + * Location at which `value` starts and ends (`Location`). + */ + location: Location + ) => void + + /** + * Character reference handler. + */ + type ReferenceHandler = ( + /** + * `this` refers to `textContext` when given to `parseEntities`. + */ + this: C, + + /** + * String of content (`string`). + */ + value: string, + + /** + * Location at which `value` starts and ends (`Location`). + */ + location: Location, + + /** + * Source of character reference (`Location`). + */ + source: Location + ) => void + + interface Position { + line: number + column: number + offset: number + indent?: number[] + } + + interface Location { + start: Position + end: Position + } +} + +/** + * Decode special characters in `value`. + */ +declare function parseEntities< + WC = typeof globalThis, + TC = typeof globalThis, + RC = typeof globalThis +>( + value: string, + options?: Partial> +): string + +export = parseEntities diff --git a/node_modules/remark-parse/index.js b/node_modules/remark-parse/index.js new file mode 100644 index 0000000..39cc24a --- /dev/null +++ b/node_modules/remark-parse/index.js @@ -0,0 +1,17 @@ +'use strict' + +var unherit = require('unherit') +var xtend = require('xtend') +var Parser = require('./lib/parser.js') + +module.exports = parse +parse.Parser = Parser + +function parse(options) { + var settings = this.data('settings') + var Local = unherit(Parser) + + Local.prototype.options = xtend(Local.prototype.options, settings, options) + + this.Parser = Local +} diff --git a/node_modules/remark-parse/lib/block-elements.js b/node_modules/remark-parse/lib/block-elements.js new file mode 100644 index 0000000..c73efac --- /dev/null +++ b/node_modules/remark-parse/lib/block-elements.js @@ -0,0 +1,70 @@ +'use strict' + +module.exports = [ + 'address', + 'article', + 'aside', + 'base', + 'basefont', + 'blockquote', + 'body', + 'caption', + 'center', + 'col', + 'colgroup', + 'dd', + 'details', + 'dialog', + 'dir', + 'div', + 'dl', + 'dt', + 'fieldset', + 'figcaption', + 'figure', + 'footer', + 'form', + 'frame', + 'frameset', + 'h1', + 'h2', + 'h3', + 'h4', + 'h5', + 'h6', + 'head', + 'header', + 'hgroup', + 'hr', + 'html', + 'iframe', + 'legend', + 'li', + 'link', + 'main', + 'menu', + 'menuitem', + 'meta', + 'nav', + 'noframes', + 'ol', + 'optgroup', + 'option', + 'p', + 'param', + 'pre', + 'section', + 'source', + 'title', + 'summary', + 'table', + 'tbody', + 'td', + 'tfoot', + 'th', + 'thead', + 'title', + 'tr', + 'track', + 'ul' +] diff --git a/node_modules/remark-parse/lib/decode.js b/node_modules/remark-parse/lib/decode.js new file mode 100644 index 0000000..3a1edc0 --- /dev/null +++ b/node_modules/remark-parse/lib/decode.js @@ -0,0 +1,58 @@ +'use strict' + +var xtend = require('xtend') +var entities = require('parse-entities') + +module.exports = factory + +// Factory to create an entity decoder. +function factory(ctx) { + decoder.raw = decodeRaw + + return decoder + + // Normalize `position` to add an `indent`. + function normalize(position) { + var offsets = ctx.offset + var line = position.line + var result = [] + + while (++line) { + if (!(line in offsets)) { + break + } + + result.push((offsets[line] || 0) + 1) + } + + return {start: position, indent: result} + } + + // Decode `value` (at `position`) into text-nodes. + function decoder(value, position, handler) { + entities(value, { + position: normalize(position), + warning: handleWarning, + text: handler, + reference: handler, + textContext: ctx, + referenceContext: ctx + }) + } + + // Decode `value` (at `position`) into a string. + function decodeRaw(value, position, options) { + return entities( + value, + xtend(options, {position: normalize(position), warning: handleWarning}) + ) + } + + // Handle a warning. + // See for the warnings. + function handleWarning(reason, position, code) { + if (code !== 3) { + ctx.file.message(reason, position) + } + } +} diff --git a/node_modules/remark-parse/lib/defaults.js b/node_modules/remark-parse/lib/defaults.js new file mode 100644 index 0000000..76443a5 --- /dev/null +++ b/node_modules/remark-parse/lib/defaults.js @@ -0,0 +1,9 @@ +'use strict' + +module.exports = { + position: true, + gfm: true, + commonmark: false, + pedantic: false, + blocks: require('./block-elements') +} diff --git a/node_modules/remark-parse/lib/locate/break.js b/node_modules/remark-parse/lib/locate/break.js new file mode 100644 index 0000000..f5479e7 --- /dev/null +++ b/node_modules/remark-parse/lib/locate/break.js @@ -0,0 +1,17 @@ +'use strict' + +module.exports = locate + +function locate(value, fromIndex) { + var index = value.indexOf('\n', fromIndex) + + while (index > fromIndex) { + if (value.charAt(index - 1) !== ' ') { + break + } + + index-- + } + + return index +} diff --git a/node_modules/remark-parse/lib/locate/code-inline.js b/node_modules/remark-parse/lib/locate/code-inline.js new file mode 100644 index 0000000..2419717 --- /dev/null +++ b/node_modules/remark-parse/lib/locate/code-inline.js @@ -0,0 +1,7 @@ +'use strict' + +module.exports = locate + +function locate(value, fromIndex) { + return value.indexOf('`', fromIndex) +} diff --git a/node_modules/remark-parse/lib/locate/delete.js b/node_modules/remark-parse/lib/locate/delete.js new file mode 100644 index 0000000..18b2f63 --- /dev/null +++ b/node_modules/remark-parse/lib/locate/delete.js @@ -0,0 +1,7 @@ +'use strict' + +module.exports = locate + +function locate(value, fromIndex) { + return value.indexOf('~~', fromIndex) +} diff --git a/node_modules/remark-parse/lib/locate/email.js b/node_modules/remark-parse/lib/locate/email.js new file mode 100644 index 0000000..bd3105d --- /dev/null +++ b/node_modules/remark-parse/lib/locate/email.js @@ -0,0 +1,51 @@ +'use strict' + +var decimal = require('is-decimal') +var alphabetical = require('is-alphabetical') + +var plusSign = 43 // '+' +var dash = 45 // '-' +var dot = 46 // '.' +var underscore = 95 // '_' + +module.exports = locate + +// See: +function locate(value, fromIndex) { + var self = this + var at + var position + + if (!this.options.gfm) { + return -1 + } + + at = value.indexOf('@', fromIndex) + + if (at === -1) { + return -1 + } + + position = at + + if (position === fromIndex || !isGfmAtext(value.charCodeAt(position - 1))) { + return locate.call(self, value, at + 1) + } + + while (position > fromIndex && isGfmAtext(value.charCodeAt(position - 1))) { + position-- + } + + return position +} + +function isGfmAtext(code) { + return ( + decimal(code) || + alphabetical(code) || + code === plusSign || + code === dash || + code === dot || + code === underscore + ) +} diff --git a/node_modules/remark-parse/lib/locate/emphasis.js b/node_modules/remark-parse/lib/locate/emphasis.js new file mode 100644 index 0000000..afec4ff --- /dev/null +++ b/node_modules/remark-parse/lib/locate/emphasis.js @@ -0,0 +1,18 @@ +'use strict' + +module.exports = locate + +function locate(value, fromIndex) { + var asterisk = value.indexOf('*', fromIndex) + var underscore = value.indexOf('_', fromIndex) + + if (underscore === -1) { + return asterisk + } + + if (asterisk === -1) { + return underscore + } + + return underscore < asterisk ? underscore : asterisk +} diff --git a/node_modules/remark-parse/lib/locate/escape.js b/node_modules/remark-parse/lib/locate/escape.js new file mode 100644 index 0000000..9f61acf --- /dev/null +++ b/node_modules/remark-parse/lib/locate/escape.js @@ -0,0 +1,7 @@ +'use strict' + +module.exports = locate + +function locate(value, fromIndex) { + return value.indexOf('\\', fromIndex) +} diff --git a/node_modules/remark-parse/lib/locate/link.js b/node_modules/remark-parse/lib/locate/link.js new file mode 100644 index 0000000..df7b33b --- /dev/null +++ b/node_modules/remark-parse/lib/locate/link.js @@ -0,0 +1,16 @@ +'use strict' + +module.exports = locate + +function locate(value, fromIndex) { + var link = value.indexOf('[', fromIndex) + var image = value.indexOf('![', fromIndex) + + if (image === -1) { + return link + } + + // Link can never be `-1` if an image is found, so we don’t need to check + // for that :) + return link < image ? link : image +} diff --git a/node_modules/remark-parse/lib/locate/strong.js b/node_modules/remark-parse/lib/locate/strong.js new file mode 100644 index 0000000..44b95cd --- /dev/null +++ b/node_modules/remark-parse/lib/locate/strong.js @@ -0,0 +1,18 @@ +'use strict' + +module.exports = locate + +function locate(value, fromIndex) { + var asterisk = value.indexOf('**', fromIndex) + var underscore = value.indexOf('__', fromIndex) + + if (underscore === -1) { + return asterisk + } + + if (asterisk === -1) { + return underscore + } + + return underscore < asterisk ? underscore : asterisk +} diff --git a/node_modules/remark-parse/lib/locate/tag.js b/node_modules/remark-parse/lib/locate/tag.js new file mode 100644 index 0000000..6a5d210 --- /dev/null +++ b/node_modules/remark-parse/lib/locate/tag.js @@ -0,0 +1,7 @@ +'use strict' + +module.exports = locate + +function locate(value, fromIndex) { + return value.indexOf('<', fromIndex) +} diff --git a/node_modules/remark-parse/lib/locate/url.js b/node_modules/remark-parse/lib/locate/url.js new file mode 100644 index 0000000..c2cc1be --- /dev/null +++ b/node_modules/remark-parse/lib/locate/url.js @@ -0,0 +1,29 @@ +'use strict' + +module.exports = locate + +var values = ['www.', 'http://', 'https://'] + +function locate(value, fromIndex) { + var min = -1 + var index + var length + var position + + if (!this.options.gfm) { + return min + } + + length = values.length + index = -1 + + while (++index < length) { + position = value.indexOf(values[index], fromIndex) + + if (position !== -1 && (min === -1 || position < min)) { + min = position + } + } + + return min +} diff --git a/node_modules/remark-parse/lib/parse.js b/node_modules/remark-parse/lib/parse.js new file mode 100644 index 0000000..59aac69 --- /dev/null +++ b/node_modules/remark-parse/lib/parse.js @@ -0,0 +1,42 @@ +'use strict' + +var xtend = require('xtend') +var removePosition = require('unist-util-remove-position') + +module.exports = parse + +var lineFeed = '\n' +var lineBreaksExpression = /\r\n|\r/g + +// Parse the bound file. +function parse() { + var self = this + var value = String(self.file) + var start = {line: 1, column: 1, offset: 0} + var content = xtend(start) + var node + + // Clean non-unix newlines: `\r\n` and `\r` are all changed to `\n`. + // This should not affect positional information. + value = value.replace(lineBreaksExpression, lineFeed) + + // BOM. + if (value.charCodeAt(0) === 0xfeff) { + value = value.slice(1) + + content.column++ + content.offset++ + } + + node = { + type: 'root', + children: self.tokenizeBlock(value, content), + position: {start: start, end: self.eof || xtend(start)} + } + + if (!self.options.position) { + removePosition(node, true) + } + + return node +} diff --git a/node_modules/remark-parse/lib/parser.js b/node_modules/remark-parse/lib/parser.js new file mode 100644 index 0000000..fca2cd1 --- /dev/null +++ b/node_modules/remark-parse/lib/parser.js @@ -0,0 +1,147 @@ +'use strict' + +var xtend = require('xtend') +var toggle = require('state-toggle') +var vfileLocation = require('vfile-location') +var unescape = require('./unescape') +var decode = require('./decode') +var tokenizer = require('./tokenizer') + +module.exports = Parser + +function Parser(doc, file) { + this.file = file + this.offset = {} + this.options = xtend(this.options) + this.setOptions({}) + + this.inList = false + this.inBlock = false + this.inLink = false + this.atStart = true + + this.toOffset = vfileLocation(file).toOffset + this.unescape = unescape(this, 'escape') + this.decode = decode(this) +} + +var proto = Parser.prototype + +// Expose core. +proto.setOptions = require('./set-options') +proto.parse = require('./parse') + +// Expose `defaults`. +proto.options = require('./defaults') + +// Enter and exit helpers. +proto.exitStart = toggle('atStart', true) +proto.enterList = toggle('inList', false) +proto.enterLink = toggle('inLink', false) +proto.enterBlock = toggle('inBlock', false) + +// Nodes that can interupt a paragraph: +// +// ```markdown +// A paragraph, followed by a thematic break. +// ___ +// ``` +// +// In the above example, the thematic break “interupts” the paragraph. +proto.interruptParagraph = [ + ['thematicBreak'], + ['list'], + ['atxHeading'], + ['fencedCode'], + ['blockquote'], + ['html'], + ['setextHeading', {commonmark: false}], + ['definition', {commonmark: false}] +] + +// Nodes that can interupt a list: +// +// ```markdown +// - One +// ___ +// ``` +// +// In the above example, the thematic break “interupts” the list. +proto.interruptList = [ + ['atxHeading', {pedantic: false}], + ['fencedCode', {pedantic: false}], + ['thematicBreak', {pedantic: false}], + ['definition', {commonmark: false}] +] + +// Nodes that can interupt a blockquote: +// +// ```markdown +// > A paragraph. +// ___ +// ``` +// +// In the above example, the thematic break “interupts” the blockquote. +proto.interruptBlockquote = [ + ['indentedCode', {commonmark: true}], + ['fencedCode', {commonmark: true}], + ['atxHeading', {commonmark: true}], + ['setextHeading', {commonmark: true}], + ['thematicBreak', {commonmark: true}], + ['html', {commonmark: true}], + ['list', {commonmark: true}], + ['definition', {commonmark: false}] +] + +// Handlers. +proto.blockTokenizers = { + blankLine: require('./tokenize/blank-line'), + indentedCode: require('./tokenize/code-indented'), + fencedCode: require('./tokenize/code-fenced'), + blockquote: require('./tokenize/blockquote'), + atxHeading: require('./tokenize/heading-atx'), + thematicBreak: require('./tokenize/thematic-break'), + list: require('./tokenize/list'), + setextHeading: require('./tokenize/heading-setext'), + html: require('./tokenize/html-block'), + definition: require('./tokenize/definition'), + table: require('./tokenize/table'), + paragraph: require('./tokenize/paragraph') +} + +proto.inlineTokenizers = { + escape: require('./tokenize/escape'), + autoLink: require('./tokenize/auto-link'), + url: require('./tokenize/url'), + email: require('./tokenize/email'), + html: require('./tokenize/html-inline'), + link: require('./tokenize/link'), + reference: require('./tokenize/reference'), + strong: require('./tokenize/strong'), + emphasis: require('./tokenize/emphasis'), + deletion: require('./tokenize/delete'), + code: require('./tokenize/code-inline'), + break: require('./tokenize/break'), + text: require('./tokenize/text') +} + +// Expose precedence. +proto.blockMethods = keys(proto.blockTokenizers) +proto.inlineMethods = keys(proto.inlineTokenizers) + +// Tokenizers. +proto.tokenizeBlock = tokenizer('block') +proto.tokenizeInline = tokenizer('inline') +proto.tokenizeFactory = tokenizer + +// Get all keys in `value`. +function keys(value) { + var result = [] + var key + + for (key in value) { + result.push(key) + } + + return result +} diff --git a/node_modules/remark-parse/lib/set-options.js b/node_modules/remark-parse/lib/set-options.js new file mode 100644 index 0000000..5877099 --- /dev/null +++ b/node_modules/remark-parse/lib/set-options.js @@ -0,0 +1,46 @@ +'use strict' + +var xtend = require('xtend') +var escapes = require('markdown-escapes') +var defaults = require('./defaults') + +module.exports = setOptions + +function setOptions(options) { + var self = this + var current = self.options + var key + var value + + if (options == null) { + options = {} + } else if (typeof options === 'object') { + options = xtend(options) + } else { + throw new Error('Invalid value `' + options + '` for setting `options`') + } + + for (key in defaults) { + value = options[key] + + if (value == null) { + value = current[key] + } + + if ( + (key !== 'blocks' && typeof value !== 'boolean') || + (key === 'blocks' && typeof value !== 'object') + ) { + throw new Error( + 'Invalid value `' + value + '` for setting `options.' + key + '`' + ) + } + + options[key] = value + } + + self.options = options + self.escape = escapes(options) + + return self +} diff --git a/node_modules/remark-parse/lib/tokenize/auto-link.js b/node_modules/remark-parse/lib/tokenize/auto-link.js new file mode 100644 index 0000000..f5bcb89 --- /dev/null +++ b/node_modules/remark-parse/lib/tokenize/auto-link.js @@ -0,0 +1,133 @@ +'use strict' + +var whitespace = require('is-whitespace-character') +var decode = require('parse-entities') +var locate = require('../locate/tag') + +module.exports = autoLink +autoLink.locator = locate +autoLink.notInLink = true + +var lessThan = '<' +var greaterThan = '>' +var atSign = '@' +var slash = '/' +var mailto = 'mailto:' +var mailtoLength = mailto.length + +function autoLink(eat, value, silent) { + var self = this + var subvalue = '' + var length = value.length + var index = 0 + var queue = '' + var hasAtCharacter = false + var link = '' + var character + var now + var content + var tokenizers + var exit + + if (value.charAt(0) !== lessThan) { + return + } + + index++ + subvalue = lessThan + + while (index < length) { + character = value.charAt(index) + + if ( + whitespace(character) || + character === greaterThan || + character === atSign || + (character === ':' && value.charAt(index + 1) === slash) + ) { + break + } + + queue += character + index++ + } + + if (!queue) { + return + } + + link += queue + queue = '' + + character = value.charAt(index) + link += character + index++ + + if (character === atSign) { + hasAtCharacter = true + } else { + if (character !== ':' || value.charAt(index + 1) !== slash) { + return + } + + link += slash + index++ + } + + while (index < length) { + character = value.charAt(index) + + if (whitespace(character) || character === greaterThan) { + break + } + + queue += character + index++ + } + + character = value.charAt(index) + + if (!queue || character !== greaterThan) { + return + } + + /* istanbul ignore if - never used (yet) */ + if (silent) { + return true + } + + link += queue + content = link + subvalue += link + character + now = eat.now() + now.column++ + now.offset++ + + if (hasAtCharacter) { + if (link.slice(0, mailtoLength).toLowerCase() === mailto) { + content = content.slice(mailtoLength) + now.column += mailtoLength + now.offset += mailtoLength + } else { + link = mailto + link + } + } + + // Temporarily remove all tokenizers except text in autolinks. + tokenizers = self.inlineTokenizers + self.inlineTokenizers = {text: tokenizers.text} + + exit = self.enterLink() + + content = self.tokenizeInline(content, now) + + self.inlineTokenizers = tokenizers + exit() + + return eat(subvalue)({ + type: 'link', + title: null, + url: decode(link, {nonTerminated: false}), + children: content + }) +} diff --git a/node_modules/remark-parse/lib/tokenize/blank-line.js b/node_modules/remark-parse/lib/tokenize/blank-line.js new file mode 100644 index 0000000..387fd45 --- /dev/null +++ b/node_modules/remark-parse/lib/tokenize/blank-line.js @@ -0,0 +1,43 @@ +'use strict' + +// A line containing no characters, or a line containing only spaces (U+0020) or +// tabs (U+0009), is called a blank line. +// See . +var reBlankLine = /^[ \t]*(\n|$)/ + +// Note that though blank lines play a special role in lists to determine +// whether the list is tight or loose +// (), it’s done by the list +// tokenizer and this blank line tokenizer does not have to be responsible for +// that. +// Therefore, configs such as `blankLine.notInList` do not have to be set here. +module.exports = blankLine + +function blankLine(eat, value, silent) { + var match + var subvalue = '' + var index = 0 + var length = value.length + + while (index < length) { + match = reBlankLine.exec(value.slice(index)) + + if (match == null) { + break + } + + index += match[0].length + subvalue += match[0] + } + + if (subvalue === '') { + return + } + + /* istanbul ignore if - never used (yet) */ + if (silent) { + return true + } + + eat(subvalue) +} diff --git a/node_modules/remark-parse/lib/tokenize/blockquote.js b/node_modules/remark-parse/lib/tokenize/blockquote.js new file mode 100644 index 0000000..2960e85 --- /dev/null +++ b/node_modules/remark-parse/lib/tokenize/blockquote.js @@ -0,0 +1,124 @@ +'use strict' + +var trim = require('trim') +var interrupt = require('../util/interrupt') + +module.exports = blockquote + +var lineFeed = '\n' +var tab = '\t' +var space = ' ' +var greaterThan = '>' + +function blockquote(eat, value, silent) { + var self = this + var offsets = self.offset + var tokenizers = self.blockTokenizers + var interruptors = self.interruptBlockquote + var now = eat.now() + var currentLine = now.line + var length = value.length + var values = [] + var contents = [] + var indents = [] + var add + var index = 0 + var character + var rest + var nextIndex + var content + var line + var startIndex + var prefixed + var exit + + while (index < length) { + character = value.charAt(index) + + if (character !== space && character !== tab) { + break + } + + index++ + } + + if (value.charAt(index) !== greaterThan) { + return + } + + if (silent) { + return true + } + + index = 0 + + while (index < length) { + nextIndex = value.indexOf(lineFeed, index) + startIndex = index + prefixed = false + + if (nextIndex === -1) { + nextIndex = length + } + + while (index < length) { + character = value.charAt(index) + + if (character !== space && character !== tab) { + break + } + + index++ + } + + if (value.charAt(index) === greaterThan) { + index++ + prefixed = true + + if (value.charAt(index) === space) { + index++ + } + } else { + index = startIndex + } + + content = value.slice(index, nextIndex) + + if (!prefixed && !trim(content)) { + index = startIndex + break + } + + if (!prefixed) { + rest = value.slice(index) + + // Check if the following code contains a possible block. + if (interrupt(interruptors, tokenizers, self, [eat, rest, true])) { + break + } + } + + line = startIndex === index ? content : value.slice(startIndex, nextIndex) + + indents.push(index - startIndex) + values.push(line) + contents.push(content) + + index = nextIndex + 1 + } + + index = -1 + length = indents.length + add = eat(values.join(lineFeed)) + + while (++index < length) { + offsets[currentLine] = (offsets[currentLine] || 0) + indents[index] + currentLine++ + } + + exit = self.enterBlock() + contents = self.tokenizeBlock(contents.join(lineFeed), now) + exit() + + return add({type: 'blockquote', children: contents}) +} diff --git a/node_modules/remark-parse/lib/tokenize/break.js b/node_modules/remark-parse/lib/tokenize/break.js new file mode 100644 index 0000000..b68ca6d --- /dev/null +++ b/node_modules/remark-parse/lib/tokenize/break.js @@ -0,0 +1,42 @@ +'use strict' + +var locate = require('../locate/break') + +module.exports = hardBreak +hardBreak.locator = locate + +var space = ' ' +var lineFeed = '\n' +var minBreakLength = 2 + +function hardBreak(eat, value, silent) { + var length = value.length + var index = -1 + var queue = '' + var character + + while (++index < length) { + character = value.charAt(index) + + if (character === lineFeed) { + if (index < minBreakLength) { + return + } + + /* istanbul ignore if - never used (yet) */ + if (silent) { + return true + } + + queue += character + + return eat(queue)({type: 'break'}) + } + + if (character !== space) { + return + } + + queue += character + } +} diff --git a/node_modules/remark-parse/lib/tokenize/code-fenced.js b/node_modules/remark-parse/lib/tokenize/code-fenced.js new file mode 100644 index 0000000..e690814 --- /dev/null +++ b/node_modules/remark-parse/lib/tokenize/code-fenced.js @@ -0,0 +1,253 @@ +'use strict' + +module.exports = fencedCode + +var lineFeed = '\n' +var tab = '\t' +var space = ' ' +var tilde = '~' +var graveAccent = '`' + +var minFenceCount = 3 +var tabSize = 4 + +function fencedCode(eat, value, silent) { + var self = this + var gfm = self.options.gfm + var length = value.length + 1 + var index = 0 + var subvalue = '' + var fenceCount + var marker + var character + var flag + var lang + var meta + var queue + var content + var exdentedContent + var closing + var exdentedClosing + var indent + var now + + if (!gfm) { + return + } + + // Eat initial spacing. + while (index < length) { + character = value.charAt(index) + + if (character !== space && character !== tab) { + break + } + + subvalue += character + index++ + } + + indent = index + + // Eat the fence. + character = value.charAt(index) + + if (character !== tilde && character !== graveAccent) { + return + } + + index++ + marker = character + fenceCount = 1 + subvalue += character + + while (index < length) { + character = value.charAt(index) + + if (character !== marker) { + break + } + + subvalue += character + fenceCount++ + index++ + } + + if (fenceCount < minFenceCount) { + return + } + + // Eat spacing before flag. + while (index < length) { + character = value.charAt(index) + + if (character !== space && character !== tab) { + break + } + + subvalue += character + index++ + } + + // Eat flag. + flag = '' + queue = '' + + while (index < length) { + character = value.charAt(index) + + if ( + character === lineFeed || + (marker === graveAccent && character === marker) + ) { + break + } + + if (character === space || character === tab) { + queue += character + } else { + flag += queue + character + queue = '' + } + + index++ + } + + character = value.charAt(index) + + if (character && character !== lineFeed) { + return + } + + if (silent) { + return true + } + + now = eat.now() + now.column += subvalue.length + now.offset += subvalue.length + + subvalue += flag + flag = self.decode.raw(self.unescape(flag), now) + + if (queue) { + subvalue += queue + } + + queue = '' + closing = '' + exdentedClosing = '' + content = '' + exdentedContent = '' + var skip = true + + // Eat content. + while (index < length) { + character = value.charAt(index) + content += closing + exdentedContent += exdentedClosing + closing = '' + exdentedClosing = '' + + if (character !== lineFeed) { + content += character + exdentedClosing += character + index++ + continue + } + + // The first line feed is ignored. Others aren’t. + if (skip) { + subvalue += character + skip = false + } else { + closing += character + exdentedClosing += character + } + + queue = '' + index++ + + while (index < length) { + character = value.charAt(index) + + if (character !== space) { + break + } + + queue += character + index++ + } + + closing += queue + exdentedClosing += queue.slice(indent) + + if (queue.length >= tabSize) { + continue + } + + queue = '' + + while (index < length) { + character = value.charAt(index) + + if (character !== marker) { + break + } + + queue += character + index++ + } + + closing += queue + exdentedClosing += queue + + if (queue.length < fenceCount) { + continue + } + + queue = '' + + while (index < length) { + character = value.charAt(index) + + if (character !== space && character !== tab) { + break + } + + closing += character + exdentedClosing += character + index++ + } + + if (!character || character === lineFeed) { + break + } + } + + subvalue += content + closing + + // Get lang and meta from the flag. + index = -1 + length = flag.length + + while (++index < length) { + character = flag.charAt(index) + + if (character === space || character === tab) { + if (!lang) { + lang = flag.slice(0, index) + } + } else if (lang) { + meta = flag.slice(index) + break + } + } + + return eat(subvalue)({ + type: 'code', + lang: lang || flag || null, + meta: meta || null, + value: exdentedContent + }) +} diff --git a/node_modules/remark-parse/lib/tokenize/code-indented.js b/node_modules/remark-parse/lib/tokenize/code-indented.js new file mode 100644 index 0000000..53a666f --- /dev/null +++ b/node_modules/remark-parse/lib/tokenize/code-indented.js @@ -0,0 +1,98 @@ +'use strict' + +var repeat = require('repeat-string') +var trim = require('trim-trailing-lines') + +module.exports = indentedCode + +var lineFeed = '\n' +var tab = '\t' +var space = ' ' + +var tabSize = 4 +var codeIndent = repeat(space, tabSize) + +function indentedCode(eat, value, silent) { + var index = -1 + var length = value.length + var subvalue = '' + var content = '' + var subvalueQueue = '' + var contentQueue = '' + var character + var blankQueue + var indent + + while (++index < length) { + character = value.charAt(index) + + if (indent) { + indent = false + + subvalue += subvalueQueue + content += contentQueue + subvalueQueue = '' + contentQueue = '' + + if (character === lineFeed) { + subvalueQueue = character + contentQueue = character + } else { + subvalue += character + content += character + + while (++index < length) { + character = value.charAt(index) + + if (!character || character === lineFeed) { + contentQueue = character + subvalueQueue = character + break + } + + subvalue += character + content += character + } + } + } else if ( + character === space && + value.charAt(index + 1) === character && + value.charAt(index + 2) === character && + value.charAt(index + 3) === character + ) { + subvalueQueue += codeIndent + index += 3 + indent = true + } else if (character === tab) { + subvalueQueue += character + indent = true + } else { + blankQueue = '' + + while (character === tab || character === space) { + blankQueue += character + character = value.charAt(++index) + } + + if (character !== lineFeed) { + break + } + + subvalueQueue += blankQueue + character + contentQueue += character + } + } + + if (content) { + if (silent) { + return true + } + + return eat(subvalue)({ + type: 'code', + lang: null, + meta: null, + value: trim(content) + }) + } +} diff --git a/node_modules/remark-parse/lib/tokenize/code-inline.js b/node_modules/remark-parse/lib/tokenize/code-inline.js new file mode 100644 index 0000000..66da0f3 --- /dev/null +++ b/node_modules/remark-parse/lib/tokenize/code-inline.js @@ -0,0 +1,109 @@ +'use strict' + +var locate = require('../locate/code-inline') + +module.exports = inlineCode +inlineCode.locator = locate + +var lineFeed = 10 // '\n' +var space = 32 // ' ' +var graveAccent = 96 // '`' + +function inlineCode(eat, value, silent) { + var length = value.length + var index = 0 + var openingFenceEnd + var closingFenceStart + var closingFenceEnd + var code + var next + var found + + while (index < length) { + if (value.charCodeAt(index) !== graveAccent) { + break + } + + index++ + } + + if (index === 0 || index === length) { + return + } + + openingFenceEnd = index + next = value.charCodeAt(index) + + while (index < length) { + code = next + next = value.charCodeAt(index + 1) + + if (code === graveAccent) { + if (closingFenceStart === undefined) { + closingFenceStart = index + } + + closingFenceEnd = index + 1 + + if ( + next !== graveAccent && + closingFenceEnd - closingFenceStart === openingFenceEnd + ) { + found = true + break + } + } else if (closingFenceStart !== undefined) { + closingFenceStart = undefined + closingFenceEnd = undefined + } + + index++ + } + + if (!found) { + return + } + + /* istanbul ignore if - never used (yet) */ + if (silent) { + return true + } + + // Remove the initial and final space (or line feed), iff they exist and there + // are non-space characters in the content. + index = openingFenceEnd + length = closingFenceStart + code = value.charCodeAt(index) + next = value.charCodeAt(length - 1) + found = false + + if ( + length - index > 2 && + (code === space || code === lineFeed) && + (next === space || next === lineFeed) + ) { + index++ + length-- + + while (index < length) { + code = value.charCodeAt(index) + + if (code !== space && code !== lineFeed) { + found = true + break + } + + index++ + } + + if (found === true) { + openingFenceEnd++ + closingFenceStart-- + } + } + + return eat(value.slice(0, closingFenceEnd))({ + type: 'inlineCode', + value: value.slice(openingFenceEnd, closingFenceStart) + }) +} diff --git a/node_modules/remark-parse/lib/tokenize/definition.js b/node_modules/remark-parse/lib/tokenize/definition.js new file mode 100644 index 0000000..ec56f0c --- /dev/null +++ b/node_modules/remark-parse/lib/tokenize/definition.js @@ -0,0 +1,273 @@ +'use strict' + +var whitespace = require('is-whitespace-character') +var normalize = require('../util/normalize') + +module.exports = definition + +var quotationMark = '"' +var apostrophe = "'" +var backslash = '\\' +var lineFeed = '\n' +var tab = '\t' +var space = ' ' +var leftSquareBracket = '[' +var rightSquareBracket = ']' +var leftParenthesis = '(' +var rightParenthesis = ')' +var colon = ':' +var lessThan = '<' +var greaterThan = '>' + +function definition(eat, value, silent) { + var self = this + var commonmark = self.options.commonmark + var index = 0 + var length = value.length + var subvalue = '' + var beforeURL + var beforeTitle + var queue + var character + var test + var identifier + var url + var title + + while (index < length) { + character = value.charAt(index) + + if (character !== space && character !== tab) { + break + } + + subvalue += character + index++ + } + + character = value.charAt(index) + + if (character !== leftSquareBracket) { + return + } + + index++ + subvalue += character + queue = '' + + while (index < length) { + character = value.charAt(index) + + if (character === rightSquareBracket) { + break + } else if (character === backslash) { + queue += character + index++ + character = value.charAt(index) + } + + queue += character + index++ + } + + if ( + !queue || + value.charAt(index) !== rightSquareBracket || + value.charAt(index + 1) !== colon + ) { + return + } + + identifier = queue + subvalue += queue + rightSquareBracket + colon + index = subvalue.length + queue = '' + + while (index < length) { + character = value.charAt(index) + + if (character !== tab && character !== space && character !== lineFeed) { + break + } + + subvalue += character + index++ + } + + character = value.charAt(index) + queue = '' + beforeURL = subvalue + + if (character === lessThan) { + index++ + + while (index < length) { + character = value.charAt(index) + + if (!isEnclosedURLCharacter(character)) { + break + } + + queue += character + index++ + } + + character = value.charAt(index) + + if (character === isEnclosedURLCharacter.delimiter) { + subvalue += lessThan + queue + character + index++ + } else { + if (commonmark) { + return + } + + index -= queue.length + 1 + queue = '' + } + } + + if (!queue) { + while (index < length) { + character = value.charAt(index) + + if (!isUnclosedURLCharacter(character)) { + break + } + + queue += character + index++ + } + + subvalue += queue + } + + if (!queue) { + return + } + + url = queue + queue = '' + + while (index < length) { + character = value.charAt(index) + + if (character !== tab && character !== space && character !== lineFeed) { + break + } + + queue += character + index++ + } + + character = value.charAt(index) + test = null + + if (character === quotationMark) { + test = quotationMark + } else if (character === apostrophe) { + test = apostrophe + } else if (character === leftParenthesis) { + test = rightParenthesis + } + + if (!test) { + queue = '' + index = subvalue.length + } else if (queue) { + subvalue += queue + character + index = subvalue.length + queue = '' + + while (index < length) { + character = value.charAt(index) + + if (character === test) { + break + } + + if (character === lineFeed) { + index++ + character = value.charAt(index) + + if (character === lineFeed || character === test) { + return + } + + queue += lineFeed + } + + queue += character + index++ + } + + character = value.charAt(index) + + if (character !== test) { + return + } + + beforeTitle = subvalue + subvalue += queue + character + index++ + title = queue + queue = '' + } else { + return + } + + while (index < length) { + character = value.charAt(index) + + if (character !== tab && character !== space) { + break + } + + subvalue += character + index++ + } + + character = value.charAt(index) + + if (!character || character === lineFeed) { + if (silent) { + return true + } + + beforeURL = eat(beforeURL).test().end + url = self.decode.raw(self.unescape(url), beforeURL, {nonTerminated: false}) + + if (title) { + beforeTitle = eat(beforeTitle).test().end + title = self.decode.raw(self.unescape(title), beforeTitle) + } + + return eat(subvalue)({ + type: 'definition', + identifier: normalize(identifier), + label: identifier, + title: title || null, + url: url + }) + } +} + +// Check if `character` can be inside an enclosed URI. +function isEnclosedURLCharacter(character) { + return ( + character !== greaterThan && + character !== leftSquareBracket && + character !== rightSquareBracket + ) +} + +isEnclosedURLCharacter.delimiter = greaterThan + +// Check if `character` can be inside an unclosed URI. +function isUnclosedURLCharacter(character) { + return ( + character !== leftSquareBracket && + character !== rightSquareBracket && + !whitespace(character) + ) +} diff --git a/node_modules/remark-parse/lib/tokenize/delete.js b/node_modules/remark-parse/lib/tokenize/delete.js new file mode 100644 index 0000000..3513634 --- /dev/null +++ b/node_modules/remark-parse/lib/tokenize/delete.js @@ -0,0 +1,60 @@ +'use strict' + +var whitespace = require('is-whitespace-character') +var locate = require('../locate/delete') + +module.exports = strikethrough +strikethrough.locator = locate + +var tilde = '~' +var fence = '~~' + +function strikethrough(eat, value, silent) { + var self = this + var character = '' + var previous = '' + var preceding = '' + var subvalue = '' + var index + var length + var now + + if ( + !self.options.gfm || + value.charAt(0) !== tilde || + value.charAt(1) !== tilde || + whitespace(value.charAt(2)) + ) { + return + } + + index = 1 + length = value.length + now = eat.now() + now.column += 2 + now.offset += 2 + + while (++index < length) { + character = value.charAt(index) + + if ( + character === tilde && + previous === tilde && + (!preceding || !whitespace(preceding)) + ) { + /* istanbul ignore if - never used (yet) */ + if (silent) { + return true + } + + return eat(fence + subvalue + fence)({ + type: 'delete', + children: self.tokenizeInline(subvalue, now) + }) + } + + subvalue += previous + preceding = previous + previous = character + } +} diff --git a/node_modules/remark-parse/lib/tokenize/email.js b/node_modules/remark-parse/lib/tokenize/email.js new file mode 100644 index 0000000..08a34c9 --- /dev/null +++ b/node_modules/remark-parse/lib/tokenize/email.js @@ -0,0 +1,114 @@ +'use strict' + +var decode = require('parse-entities') +var decimal = require('is-decimal') +var alphabetical = require('is-alphabetical') +var locate = require('../locate/email') + +module.exports = email +email.locator = locate +email.notInLink = true + +var plusSign = 43 // '+' +var dash = 45 // '-' +var dot = 46 // '.' +var atSign = 64 // '@' +var underscore = 95 // '_' + +function email(eat, value, silent) { + var self = this + var gfm = self.options.gfm + var tokenizers = self.inlineTokenizers + var index = 0 + var length = value.length + var firstDot = -1 + var code + var content + var children + var exit + + if (!gfm) { + return + } + + code = value.charCodeAt(index) + + while ( + decimal(code) || + alphabetical(code) || + code === plusSign || + code === dash || + code === dot || + code === underscore + ) { + code = value.charCodeAt(++index) + } + + if (index === 0) { + return + } + + if (code !== atSign) { + return + } + + index++ + + while (index < length) { + code = value.charCodeAt(index) + + if ( + decimal(code) || + alphabetical(code) || + code === dash || + code === dot || + code === underscore + ) { + index++ + + if (firstDot === -1 && code === dot) { + firstDot = index + } + + continue + } + + break + } + + if ( + firstDot === -1 || + firstDot === index || + code === dash || + code === underscore + ) { + return + } + + if (code === dot) { + index-- + } + + content = value.slice(0, index) + + /* istanbul ignore if - never used (yet) */ + if (silent) { + return true + } + + exit = self.enterLink() + + // Temporarily remove all tokenizers except text in url. + self.inlineTokenizers = {text: tokenizers.text} + children = self.tokenizeInline(content, eat.now()) + self.inlineTokenizers = tokenizers + + exit() + + return eat(content)({ + type: 'link', + title: null, + url: 'mailto:' + decode(content, {nonTerminated: false}), + children: children + }) +} diff --git a/node_modules/remark-parse/lib/tokenize/emphasis.js b/node_modules/remark-parse/lib/tokenize/emphasis.js new file mode 100644 index 0000000..9484b5c --- /dev/null +++ b/node_modules/remark-parse/lib/tokenize/emphasis.js @@ -0,0 +1,86 @@ +'use strict' + +var trim = require('trim') +var word = require('is-word-character') +var whitespace = require('is-whitespace-character') +var locate = require('../locate/emphasis') + +module.exports = emphasis +emphasis.locator = locate + +var asterisk = '*' +var underscore = '_' +var backslash = '\\' + +function emphasis(eat, value, silent) { + var self = this + var index = 0 + var character = value.charAt(index) + var now + var pedantic + var marker + var queue + var subvalue + var length + var previous + + if (character !== asterisk && character !== underscore) { + return + } + + pedantic = self.options.pedantic + subvalue = character + marker = character + length = value.length + index++ + queue = '' + character = '' + + if (pedantic && whitespace(value.charAt(index))) { + return + } + + while (index < length) { + previous = character + character = value.charAt(index) + + if (character === marker && (!pedantic || !whitespace(previous))) { + character = value.charAt(++index) + + if (character !== marker) { + if (!trim(queue) || previous === marker) { + return + } + + if (!pedantic && marker === underscore && word(character)) { + queue += marker + continue + } + + /* istanbul ignore if - never used (yet) */ + if (silent) { + return true + } + + now = eat.now() + now.column++ + now.offset++ + + return eat(subvalue + queue + marker)({ + type: 'emphasis', + children: self.tokenizeInline(queue, now) + }) + } + + queue += marker + } + + if (!pedantic && character === backslash) { + queue += character + character = value.charAt(++index) + } + + queue += character + index++ + } +} diff --git a/node_modules/remark-parse/lib/tokenize/escape.js b/node_modules/remark-parse/lib/tokenize/escape.js new file mode 100644 index 0000000..1cac353 --- /dev/null +++ b/node_modules/remark-parse/lib/tokenize/escape.js @@ -0,0 +1,34 @@ +'use strict' + +var locate = require('../locate/escape') + +module.exports = escape +escape.locator = locate + +var lineFeed = '\n' +var backslash = '\\' + +function escape(eat, value, silent) { + var self = this + var character + var node + + if (value.charAt(0) === backslash) { + character = value.charAt(1) + + if (self.escape.indexOf(character) !== -1) { + /* istanbul ignore if - never used (yet) */ + if (silent) { + return true + } + + if (character === lineFeed) { + node = {type: 'break'} + } else { + node = {type: 'text', value: character} + } + + return eat(backslash + character)(node) + } + } +} diff --git a/node_modules/remark-parse/lib/tokenize/heading-atx.js b/node_modules/remark-parse/lib/tokenize/heading-atx.js new file mode 100644 index 0000000..dfa2849 --- /dev/null +++ b/node_modules/remark-parse/lib/tokenize/heading-atx.js @@ -0,0 +1,135 @@ +'use strict' + +module.exports = atxHeading + +var lineFeed = '\n' +var tab = '\t' +var space = ' ' +var numberSign = '#' + +var maxFenceCount = 6 + +function atxHeading(eat, value, silent) { + var self = this + var pedantic = self.options.pedantic + var length = value.length + 1 + var index = -1 + var now = eat.now() + var subvalue = '' + var content = '' + var character + var queue + var depth + + // Eat initial spacing. + while (++index < length) { + character = value.charAt(index) + + if (character !== space && character !== tab) { + index-- + break + } + + subvalue += character + } + + // Eat hashes. + depth = 0 + + while (++index <= length) { + character = value.charAt(index) + + if (character !== numberSign) { + index-- + break + } + + subvalue += character + depth++ + } + + if (depth > maxFenceCount) { + return + } + + if (!depth || (!pedantic && value.charAt(index + 1) === numberSign)) { + return + } + + length = value.length + 1 + + // Eat intermediate white-space. + queue = '' + + while (++index < length) { + character = value.charAt(index) + + if (character !== space && character !== tab) { + index-- + break + } + + queue += character + } + + // Exit when not in pedantic mode without spacing. + if (!pedantic && queue.length === 0 && character && character !== lineFeed) { + return + } + + if (silent) { + return true + } + + // Eat content. + subvalue += queue + queue = '' + content = '' + + while (++index < length) { + character = value.charAt(index) + + if (!character || character === lineFeed) { + break + } + + if (character !== space && character !== tab && character !== numberSign) { + content += queue + character + queue = '' + continue + } + + while (character === space || character === tab) { + queue += character + character = value.charAt(++index) + } + + // `#` without a queue is part of the content. + if (!pedantic && content && !queue && character === numberSign) { + content += character + continue + } + + while (character === numberSign) { + queue += character + character = value.charAt(++index) + } + + while (character === space || character === tab) { + queue += character + character = value.charAt(++index) + } + + index-- + } + + now.column += subvalue.length + now.offset += subvalue.length + subvalue += content + queue + + return eat(subvalue)({ + type: 'heading', + depth: depth, + children: self.tokenizeInline(content, now) + }) +} diff --git a/node_modules/remark-parse/lib/tokenize/heading-setext.js b/node_modules/remark-parse/lib/tokenize/heading-setext.js new file mode 100644 index 0000000..1427623 --- /dev/null +++ b/node_modules/remark-parse/lib/tokenize/heading-setext.js @@ -0,0 +1,102 @@ +'use strict' + +module.exports = setextHeading + +var lineFeed = '\n' +var tab = '\t' +var space = ' ' +var equalsTo = '=' +var dash = '-' + +var maxIndent = 3 + +var equalsToDepth = 1 +var dashDepth = 2 + +function setextHeading(eat, value, silent) { + var self = this + var now = eat.now() + var length = value.length + var index = -1 + var subvalue = '' + var content + var queue + var character + var marker + var depth + + // Eat initial indentation. + while (++index < length) { + character = value.charAt(index) + + if (character !== space || index >= maxIndent) { + index-- + break + } + + subvalue += character + } + + // Eat content. + content = '' + queue = '' + + while (++index < length) { + character = value.charAt(index) + + if (character === lineFeed) { + index-- + break + } + + if (character === space || character === tab) { + queue += character + } else { + content += queue + character + queue = '' + } + } + + now.column += subvalue.length + now.offset += subvalue.length + subvalue += content + queue + + // Ensure the content is followed by a newline and a valid marker. + character = value.charAt(++index) + marker = value.charAt(++index) + + if (character !== lineFeed || (marker !== equalsTo && marker !== dash)) { + return + } + + subvalue += character + + // Eat Setext-line. + queue = marker + depth = marker === equalsTo ? equalsToDepth : dashDepth + + while (++index < length) { + character = value.charAt(index) + + if (character !== marker) { + if (character !== lineFeed) { + return + } + + index-- + break + } + + queue += character + } + + if (silent) { + return true + } + + return eat(subvalue + queue)({ + type: 'heading', + depth: depth, + children: self.tokenizeInline(content, now) + }) +} diff --git a/node_modules/remark-parse/lib/tokenize/html-block.js b/node_modules/remark-parse/lib/tokenize/html-block.js new file mode 100644 index 0000000..33571f6 --- /dev/null +++ b/node_modules/remark-parse/lib/tokenize/html-block.js @@ -0,0 +1,111 @@ +'use strict' + +var openCloseTag = require('../util/html').openCloseTag + +module.exports = blockHtml + +var tab = '\t' +var space = ' ' +var lineFeed = '\n' +var lessThan = '<' + +var rawOpenExpression = /^<(script|pre|style)(?=(\s|>|$))/i +var rawCloseExpression = /<\/(script|pre|style)>/i +var commentOpenExpression = /^/ +var instructionOpenExpression = /^<\?/ +var instructionCloseExpression = /\?>/ +var directiveOpenExpression = /^/ +var cdataOpenExpression = /^/ +var elementCloseExpression = /^$/ +var otherElementOpenExpression = new RegExp(openCloseTag.source + '\\s*$') + +function blockHtml(eat, value, silent) { + var self = this + var blocks = self.options.blocks.join('|') + var elementOpenExpression = new RegExp( + '^|$))', + 'i' + ) + var length = value.length + var index = 0 + var next + var line + var offset + var character + var count + var sequence + var subvalue + + var sequences = [ + [rawOpenExpression, rawCloseExpression, true], + [commentOpenExpression, commentCloseExpression, true], + [instructionOpenExpression, instructionCloseExpression, true], + [directiveOpenExpression, directiveCloseExpression, true], + [cdataOpenExpression, cdataCloseExpression, true], + [elementOpenExpression, elementCloseExpression, true], + [otherElementOpenExpression, elementCloseExpression, false] + ] + + // Eat initial spacing. + while (index < length) { + character = value.charAt(index) + + if (character !== tab && character !== space) { + break + } + + index++ + } + + if (value.charAt(index) !== lessThan) { + return + } + + next = value.indexOf(lineFeed, index + 1) + next = next === -1 ? length : next + line = value.slice(index, next) + offset = -1 + count = sequences.length + + while (++offset < count) { + if (sequences[offset][0].test(line)) { + sequence = sequences[offset] + break + } + } + + if (!sequence) { + return + } + + if (silent) { + return sequence[2] + } + + index = next + + if (!sequence[1].test(line)) { + while (index < length) { + next = value.indexOf(lineFeed, index + 1) + next = next === -1 ? length : next + line = value.slice(index + 1, next) + + if (sequence[1].test(line)) { + if (line) { + index = next + } + + break + } + + index = next + } + } + + subvalue = value.slice(0, index) + + return eat(subvalue)({type: 'html', value: subvalue}) +} diff --git a/node_modules/remark-parse/lib/tokenize/html-inline.js b/node_modules/remark-parse/lib/tokenize/html-inline.js new file mode 100644 index 0000000..cca4fb4 --- /dev/null +++ b/node_modules/remark-parse/lib/tokenize/html-inline.js @@ -0,0 +1,59 @@ +'use strict' + +var alphabetical = require('is-alphabetical') +var locate = require('../locate/tag') +var tag = require('../util/html').tag + +module.exports = inlineHTML +inlineHTML.locator = locate + +var lessThan = '<' +var questionMark = '?' +var exclamationMark = '!' +var slash = '/' + +var htmlLinkOpenExpression = /^/i + +function inlineHTML(eat, value, silent) { + var self = this + var length = value.length + var character + var subvalue + + if (value.charAt(0) !== lessThan || length < 3) { + return + } + + character = value.charAt(1) + + if ( + !alphabetical(character) && + character !== questionMark && + character !== exclamationMark && + character !== slash + ) { + return + } + + subvalue = value.match(tag) + + if (!subvalue) { + return + } + + /* istanbul ignore if - not used yet. */ + if (silent) { + return true + } + + subvalue = subvalue[0] + + if (!self.inLink && htmlLinkOpenExpression.test(subvalue)) { + self.inLink = true + } else if (self.inLink && htmlLinkCloseExpression.test(subvalue)) { + self.inLink = false + } + + return eat(subvalue)({type: 'html', value: subvalue}) +} diff --git a/node_modules/remark-parse/lib/tokenize/link.js b/node_modules/remark-parse/lib/tokenize/link.js new file mode 100644 index 0000000..e9a0f6d --- /dev/null +++ b/node_modules/remark-parse/lib/tokenize/link.js @@ -0,0 +1,367 @@ +'use strict' + +var whitespace = require('is-whitespace-character') +var locate = require('../locate/link') + +module.exports = link +link.locator = locate + +var lineFeed = '\n' +var exclamationMark = '!' +var quotationMark = '"' +var apostrophe = "'" +var leftParenthesis = '(' +var rightParenthesis = ')' +var lessThan = '<' +var greaterThan = '>' +var leftSquareBracket = '[' +var backslash = '\\' +var rightSquareBracket = ']' +var graveAccent = '`' + +function link(eat, value, silent) { + var self = this + var subvalue = '' + var index = 0 + var character = value.charAt(0) + var pedantic = self.options.pedantic + var commonmark = self.options.commonmark + var gfm = self.options.gfm + var closed + var count + var opening + var beforeURL + var beforeTitle + var subqueue + var hasMarker + var isImage + var content + var marker + var length + var title + var depth + var queue + var url + var now + var exit + var node + + // Detect whether this is an image. + if (character === exclamationMark) { + isImage = true + subvalue = character + character = value.charAt(++index) + } + + // Eat the opening. + if (character !== leftSquareBracket) { + return + } + + // Exit when this is a link and we’re already inside a link. + if (!isImage && self.inLink) { + return + } + + subvalue += character + queue = '' + index++ + + // Eat the content. + length = value.length + now = eat.now() + depth = 0 + + now.column += index + now.offset += index + + while (index < length) { + character = value.charAt(index) + subqueue = character + + if (character === graveAccent) { + // Inline-code in link content. + count = 1 + + while (value.charAt(index + 1) === graveAccent) { + subqueue += character + index++ + count++ + } + + if (!opening) { + opening = count + } else if (count >= opening) { + opening = 0 + } + } else if (character === backslash) { + // Allow brackets to be escaped. + index++ + subqueue += value.charAt(index) + } else if ((!opening || gfm) && character === leftSquareBracket) { + // In GFM mode, brackets in code still count. In all other modes, + // they don’t. + depth++ + } else if ((!opening || gfm) && character === rightSquareBracket) { + if (depth) { + depth-- + } else { + if (value.charAt(index + 1) !== leftParenthesis) { + return + } + + subqueue += leftParenthesis + closed = true + index++ + + break + } + } + + queue += subqueue + subqueue = '' + index++ + } + + // Eat the content closing. + if (!closed) { + return + } + + content = queue + subvalue += queue + subqueue + index++ + + // Eat white-space. + while (index < length) { + character = value.charAt(index) + + if (!whitespace(character)) { + break + } + + subvalue += character + index++ + } + + // Eat the URL. + character = value.charAt(index) + queue = '' + beforeURL = subvalue + + if (character === lessThan) { + index++ + beforeURL += lessThan + + while (index < length) { + character = value.charAt(index) + + if (character === greaterThan) { + break + } + + if (commonmark && character === lineFeed) { + return + } + + queue += character + index++ + } + + if (value.charAt(index) !== greaterThan) { + return + } + + subvalue += lessThan + queue + greaterThan + url = queue + index++ + } else { + character = null + subqueue = '' + + while (index < length) { + character = value.charAt(index) + + if ( + subqueue && + (character === quotationMark || + character === apostrophe || + (commonmark && character === leftParenthesis)) + ) { + break + } + + if (whitespace(character)) { + if (!pedantic) { + break + } + + subqueue += character + } else { + if (character === leftParenthesis) { + depth++ + } else if (character === rightParenthesis) { + if (depth === 0) { + break + } + + depth-- + } + + queue += subqueue + subqueue = '' + + if (character === backslash) { + queue += backslash + character = value.charAt(++index) + } + + queue += character + } + + index++ + } + + subvalue += queue + url = queue + index = subvalue.length + } + + // Eat white-space. + queue = '' + + while (index < length) { + character = value.charAt(index) + + if (!whitespace(character)) { + break + } + + queue += character + index++ + } + + character = value.charAt(index) + subvalue += queue + + // Eat the title. + if ( + queue && + (character === quotationMark || + character === apostrophe || + (commonmark && character === leftParenthesis)) + ) { + index++ + subvalue += character + queue = '' + marker = character === leftParenthesis ? rightParenthesis : character + beforeTitle = subvalue + + // In commonmark-mode, things are pretty easy: the marker cannot occur + // inside the title. Non-commonmark does, however, support nested + // delimiters. + if (commonmark) { + while (index < length) { + character = value.charAt(index) + + if (character === marker) { + break + } + + if (character === backslash) { + queue += backslash + character = value.charAt(++index) + } + + index++ + queue += character + } + + character = value.charAt(index) + + if (character !== marker) { + return + } + + title = queue + subvalue += queue + character + index++ + + while (index < length) { + character = value.charAt(index) + + if (!whitespace(character)) { + break + } + + subvalue += character + index++ + } + } else { + subqueue = '' + + while (index < length) { + character = value.charAt(index) + + if (character === marker) { + if (hasMarker) { + queue += marker + subqueue + subqueue = '' + } + + hasMarker = true + } else if (!hasMarker) { + queue += character + } else if (character === rightParenthesis) { + subvalue += queue + marker + subqueue + title = queue + break + } else if (whitespace(character)) { + subqueue += character + } else { + queue += marker + subqueue + character + subqueue = '' + hasMarker = false + } + + index++ + } + } + } + + if (value.charAt(index) !== rightParenthesis) { + return + } + + /* istanbul ignore if - never used (yet) */ + if (silent) { + return true + } + + subvalue += rightParenthesis + + url = self.decode.raw(self.unescape(url), eat(beforeURL).test().end, { + nonTerminated: false + }) + + if (title) { + beforeTitle = eat(beforeTitle).test().end + title = self.decode.raw(self.unescape(title), beforeTitle) + } + + node = { + type: isImage ? 'image' : 'link', + title: title || null, + url: url + } + + if (isImage) { + node.alt = self.decode.raw(self.unescape(content), now) || null + } else { + exit = self.enterLink() + node.children = self.tokenizeInline(content, now) + exit() + } + + return eat(subvalue)(node) +} diff --git a/node_modules/remark-parse/lib/tokenize/list.js b/node_modules/remark-parse/lib/tokenize/list.js new file mode 100644 index 0000000..d5b54ef --- /dev/null +++ b/node_modules/remark-parse/lib/tokenize/list.js @@ -0,0 +1,446 @@ +'use strict' + +var trim = require('trim') +var repeat = require('repeat-string') +var decimal = require('is-decimal') +var getIndent = require('../util/get-indentation') +var removeIndent = require('../util/remove-indentation') +var interrupt = require('../util/interrupt') + +module.exports = list + +var asterisk = '*' +var underscore = '_' +var plusSign = '+' +var dash = '-' +var dot = '.' +var space = ' ' +var lineFeed = '\n' +var tab = '\t' +var rightParenthesis = ')' +var lowercaseX = 'x' + +var tabSize = 4 +var looseListItemExpression = /\n\n(?!\s*$)/ +var taskItemExpression = /^\[([ X\tx])][ \t]/ +var bulletExpression = /^([ \t]*)([*+-]|\d+[.)])( {1,4}(?! )| |\t|$|(?=\n))([^\n]*)/ +var pedanticBulletExpression = /^([ \t]*)([*+-]|\d+[.)])([ \t]+)/ +var initialIndentExpression = /^( {1,4}|\t)?/gm + +function list(eat, value, silent) { + var self = this + var commonmark = self.options.commonmark + var pedantic = self.options.pedantic + var tokenizers = self.blockTokenizers + var interuptors = self.interruptList + var index = 0 + var length = value.length + var start = null + var size + var queue + var ordered + var character + var marker + var nextIndex + var startIndex + var prefixed + var currentMarker + var content + var line + var previousEmpty + var empty + var items + var allLines + var emptyLines + var item + var enterTop + var exitBlockquote + var spread = false + var node + var now + var end + var indented + + while (index < length) { + character = value.charAt(index) + + if (character !== tab && character !== space) { + break + } + + index++ + } + + character = value.charAt(index) + + if (character === asterisk || character === plusSign || character === dash) { + marker = character + ordered = false + } else { + ordered = true + queue = '' + + while (index < length) { + character = value.charAt(index) + + if (!decimal(character)) { + break + } + + queue += character + index++ + } + + character = value.charAt(index) + + if ( + !queue || + !(character === dot || (commonmark && character === rightParenthesis)) + ) { + return + } + + /* Slightly abusing `silent` mode, whose goal is to make interrupting + * paragraphs work. + * Well, that’s exactly what we want to do here: don’t interrupt: + * 2. here, because the “list” doesn’t start with `1`. */ + if (silent && queue !== '1') { + return + } + + start = parseInt(queue, 10) + marker = character + } + + character = value.charAt(++index) + + if ( + character !== space && + character !== tab && + (pedantic || (character !== lineFeed && character !== '')) + ) { + return + } + + if (silent) { + return true + } + + index = 0 + items = [] + allLines = [] + emptyLines = [] + + while (index < length) { + nextIndex = value.indexOf(lineFeed, index) + startIndex = index + prefixed = false + indented = false + + if (nextIndex === -1) { + nextIndex = length + } + + size = 0 + + while (index < length) { + character = value.charAt(index) + + if (character === tab) { + size += tabSize - (size % tabSize) + } else if (character === space) { + size++ + } else { + break + } + + index++ + } + + if (item && size >= item.indent) { + indented = true + } + + character = value.charAt(index) + currentMarker = null + + if (!indented) { + if ( + character === asterisk || + character === plusSign || + character === dash + ) { + currentMarker = character + index++ + size++ + } else { + queue = '' + + while (index < length) { + character = value.charAt(index) + + if (!decimal(character)) { + break + } + + queue += character + index++ + } + + character = value.charAt(index) + index++ + + if ( + queue && + (character === dot || (commonmark && character === rightParenthesis)) + ) { + currentMarker = character + size += queue.length + 1 + } + } + + if (currentMarker) { + character = value.charAt(index) + + if (character === tab) { + size += tabSize - (size % tabSize) + index++ + } else if (character === space) { + end = index + tabSize + + while (index < end) { + if (value.charAt(index) !== space) { + break + } + + index++ + size++ + } + + if (index === end && value.charAt(index) === space) { + index -= tabSize - 1 + size -= tabSize - 1 + } + } else if (character !== lineFeed && character !== '') { + currentMarker = null + } + } + } + + if (currentMarker) { + if (!pedantic && marker !== currentMarker) { + break + } + + prefixed = true + } else { + if (!commonmark && !indented && value.charAt(startIndex) === space) { + indented = true + } else if (commonmark && item) { + indented = size >= item.indent || size > tabSize + } + + prefixed = false + index = startIndex + } + + line = value.slice(startIndex, nextIndex) + content = startIndex === index ? line : value.slice(index, nextIndex) + + if ( + currentMarker === asterisk || + currentMarker === underscore || + currentMarker === dash + ) { + if (tokenizers.thematicBreak.call(self, eat, line, true)) { + break + } + } + + previousEmpty = empty + empty = !prefixed && !trim(content).length + + if (indented && item) { + item.value = item.value.concat(emptyLines, line) + allLines = allLines.concat(emptyLines, line) + emptyLines = [] + } else if (prefixed) { + if (emptyLines.length !== 0) { + spread = true + item.value.push('') + item.trail = emptyLines.concat() + } + + item = { + value: [line], + indent: size, + trail: [] + } + + items.push(item) + allLines = allLines.concat(emptyLines, line) + emptyLines = [] + } else if (empty) { + if (previousEmpty && !commonmark) { + break + } + + emptyLines.push(line) + } else { + if (previousEmpty) { + break + } + + if (interrupt(interuptors, tokenizers, self, [eat, line, true])) { + break + } + + item.value = item.value.concat(emptyLines, line) + allLines = allLines.concat(emptyLines, line) + emptyLines = [] + } + + index = nextIndex + 1 + } + + node = eat(allLines.join(lineFeed)).reset({ + type: 'list', + ordered: ordered, + start: start, + spread: spread, + children: [] + }) + + enterTop = self.enterList() + exitBlockquote = self.enterBlock() + index = -1 + length = items.length + + while (++index < length) { + item = items[index].value.join(lineFeed) + now = eat.now() + + eat(item)(listItem(self, item, now), node) + + item = items[index].trail.join(lineFeed) + + if (index !== length - 1) { + item += lineFeed + } + + eat(item) + } + + enterTop() + exitBlockquote() + + return node +} + +function listItem(ctx, value, position) { + var offsets = ctx.offset + var fn = ctx.options.pedantic ? pedanticListItem : normalListItem + var checked = null + var task + var indent + + value = fn.apply(null, arguments) + + if (ctx.options.gfm) { + task = value.match(taskItemExpression) + + if (task) { + indent = task[0].length + checked = task[1].toLowerCase() === lowercaseX + offsets[position.line] += indent + value = value.slice(indent) + } + } + + return { + type: 'listItem', + spread: looseListItemExpression.test(value), + checked: checked, + children: ctx.tokenizeBlock(value, position) + } +} + +// Create a list-item using overly simple mechanics. +function pedanticListItem(ctx, value, position) { + var offsets = ctx.offset + var line = position.line + + // Remove the list-item’s bullet. + value = value.replace(pedanticBulletExpression, replacer) + + // The initial line was also matched by the below, so we reset the `line`. + line = position.line + + return value.replace(initialIndentExpression, replacer) + + // A simple replacer which removed all matches, and adds their length to + // `offset`. + function replacer($0) { + offsets[line] = (offsets[line] || 0) + $0.length + line++ + + return '' + } +} + +// Create a list-item using sane mechanics. +function normalListItem(ctx, value, position) { + var offsets = ctx.offset + var line = position.line + var max + var bullet + var rest + var lines + var trimmedLines + var index + var length + + // Remove the list-item’s bullet. + value = value.replace(bulletExpression, replacer) + + lines = value.split(lineFeed) + + trimmedLines = removeIndent(value, getIndent(max).indent).split(lineFeed) + + // We replaced the initial bullet with something else above, which was used + // to trick `removeIndentation` into removing some more characters when + // possible. However, that could result in the initial line to be stripped + // more than it should be. + trimmedLines[0] = rest + + offsets[line] = (offsets[line] || 0) + bullet.length + line++ + + index = 0 + length = lines.length + + while (++index < length) { + offsets[line] = + (offsets[line] || 0) + lines[index].length - trimmedLines[index].length + line++ + } + + return trimmedLines.join(lineFeed) + + /* eslint-disable-next-line max-params */ + function replacer($0, $1, $2, $3, $4) { + bullet = $1 + $2 + $3 + rest = $4 + + // Make sure that the first nine numbered list items can indent with an + // extra space. That is, when the bullet did not receive an extra final + // space. + if (Number($2) < 10 && bullet.length % 2 === 1) { + $2 = space + $2 + } + + max = $1 + repeat(space, $2.length) + $3 + + return max + rest + } +} diff --git a/node_modules/remark-parse/lib/tokenize/paragraph.js b/node_modules/remark-parse/lib/tokenize/paragraph.js new file mode 100644 index 0000000..e8d03a9 --- /dev/null +++ b/node_modules/remark-parse/lib/tokenize/paragraph.js @@ -0,0 +1,98 @@ +'use strict' + +var trim = require('trim') +var trimTrailingLines = require('trim-trailing-lines') +var interrupt = require('../util/interrupt') + +module.exports = paragraph + +var tab = '\t' +var lineFeed = '\n' +var space = ' ' + +var tabSize = 4 + +// Tokenise paragraph. +function paragraph(eat, value, silent) { + var self = this + var settings = self.options + var commonmark = settings.commonmark + var tokenizers = self.blockTokenizers + var interruptors = self.interruptParagraph + var index = value.indexOf(lineFeed) + var length = value.length + var position + var subvalue + var character + var size + var now + + while (index < length) { + // Eat everything if there’s no following newline. + if (index === -1) { + index = length + break + } + + // Stop if the next character is NEWLINE. + if (value.charAt(index + 1) === lineFeed) { + break + } + + // In commonmark-mode, following indented lines are part of the paragraph. + if (commonmark) { + size = 0 + position = index + 1 + + while (position < length) { + character = value.charAt(position) + + if (character === tab) { + size = tabSize + break + } else if (character === space) { + size++ + } else { + break + } + + position++ + } + + if (size >= tabSize && character !== lineFeed) { + index = value.indexOf(lineFeed, index + 1) + continue + } + } + + subvalue = value.slice(index + 1) + + // Check if the following code contains a possible block. + if (interrupt(interruptors, tokenizers, self, [eat, subvalue, true])) { + break + } + + position = index + index = value.indexOf(lineFeed, index + 1) + + if (index !== -1 && trim(value.slice(position, index)) === '') { + index = position + break + } + } + + subvalue = value.slice(0, index) + + /* istanbul ignore if - never used (yet) */ + if (silent) { + return true + } + + now = eat.now() + subvalue = trimTrailingLines(subvalue) + + return eat(subvalue)({ + type: 'paragraph', + children: self.tokenizeInline(subvalue, now) + }) +} diff --git a/node_modules/remark-parse/lib/tokenize/reference.js b/node_modules/remark-parse/lib/tokenize/reference.js new file mode 100644 index 0000000..420b04d --- /dev/null +++ b/node_modules/remark-parse/lib/tokenize/reference.js @@ -0,0 +1,188 @@ +'use strict' + +var whitespace = require('is-whitespace-character') +var locate = require('../locate/link') +var normalize = require('../util/normalize') + +module.exports = reference +reference.locator = locate + +var link = 'link' +var image = 'image' +var shortcut = 'shortcut' +var collapsed = 'collapsed' +var full = 'full' +var exclamationMark = '!' +var leftSquareBracket = '[' +var backslash = '\\' +var rightSquareBracket = ']' + +function reference(eat, value, silent) { + var self = this + var commonmark = self.options.commonmark + var character = value.charAt(0) + var index = 0 + var length = value.length + var subvalue = '' + var intro = '' + var type = link + var referenceType = shortcut + var content + var identifier + var now + var node + var exit + var queue + var bracketed + var depth + + // Check whether we’re eating an image. + if (character === exclamationMark) { + type = image + intro = character + character = value.charAt(++index) + } + + if (character !== leftSquareBracket) { + return + } + + index++ + intro += character + queue = '' + + // Eat the text. + depth = 0 + + while (index < length) { + character = value.charAt(index) + + if (character === leftSquareBracket) { + bracketed = true + depth++ + } else if (character === rightSquareBracket) { + if (!depth) { + break + } + + depth-- + } + + if (character === backslash) { + queue += backslash + character = value.charAt(++index) + } + + queue += character + index++ + } + + subvalue = queue + content = queue + character = value.charAt(index) + + if (character !== rightSquareBracket) { + return + } + + index++ + subvalue += character + queue = '' + + if (!commonmark) { + // The original markdown syntax definition explicitly allows for whitespace + // between the link text and link label; commonmark departs from this, in + // part to improve support for shortcut reference links + while (index < length) { + character = value.charAt(index) + + if (!whitespace(character)) { + break + } + + queue += character + index++ + } + } + + character = value.charAt(index) + + if (character === leftSquareBracket) { + identifier = '' + queue += character + index++ + + while (index < length) { + character = value.charAt(index) + + if (character === leftSquareBracket || character === rightSquareBracket) { + break + } + + if (character === backslash) { + identifier += backslash + character = value.charAt(++index) + } + + identifier += character + index++ + } + + character = value.charAt(index) + + if (character === rightSquareBracket) { + referenceType = identifier ? full : collapsed + queue += identifier + character + index++ + } else { + identifier = '' + } + + subvalue += queue + queue = '' + } else { + if (!content) { + return + } + + identifier = content + } + + // Brackets cannot be inside the identifier. + if (referenceType !== full && bracketed) { + return + } + + subvalue = intro + subvalue + + if (type === link && self.inLink) { + return null + } + + /* istanbul ignore if - never used (yet) */ + if (silent) { + return true + } + + now = eat.now() + now.column += intro.length + now.offset += intro.length + identifier = referenceType === full ? identifier : content + + node = { + type: type + 'Reference', + identifier: normalize(identifier), + label: identifier, + referenceType: referenceType + } + + if (type === link) { + exit = self.enterLink() + node.children = self.tokenizeInline(content, now) + exit() + } else { + node.alt = self.decode.raw(self.unescape(content), now) || null + } + + return eat(subvalue)(node) +} diff --git a/node_modules/remark-parse/lib/tokenize/strong.js b/node_modules/remark-parse/lib/tokenize/strong.js new file mode 100644 index 0000000..62d5524 --- /dev/null +++ b/node_modules/remark-parse/lib/tokenize/strong.js @@ -0,0 +1,85 @@ +'use strict' + +var trim = require('trim') +var whitespace = require('is-whitespace-character') +var locate = require('../locate/strong') + +module.exports = strong +strong.locator = locate + +var backslash = '\\' +var asterisk = '*' +var underscore = '_' + +function strong(eat, value, silent) { + var self = this + var index = 0 + var character = value.charAt(index) + var now + var pedantic + var marker + var queue + var subvalue + var length + var previous + + if ( + (character !== asterisk && character !== underscore) || + value.charAt(++index) !== character + ) { + return + } + + pedantic = self.options.pedantic + marker = character + subvalue = marker + marker + length = value.length + index++ + queue = '' + character = '' + + if (pedantic && whitespace(value.charAt(index))) { + return + } + + while (index < length) { + previous = character + character = value.charAt(index) + + if ( + character === marker && + value.charAt(index + 1) === marker && + (!pedantic || !whitespace(previous)) + ) { + character = value.charAt(index + 2) + + if (character !== marker) { + if (!trim(queue)) { + return + } + + /* istanbul ignore if - never used (yet) */ + if (silent) { + return true + } + + now = eat.now() + now.column += 2 + now.offset += 2 + + return eat(subvalue + queue + subvalue)({ + type: 'strong', + children: self.tokenizeInline(queue, now) + }) + } + } + + if (!pedantic && character === backslash) { + queue += character + character = value.charAt(++index) + } + + queue += character + index++ + } +} diff --git a/node_modules/remark-parse/lib/tokenize/table.js b/node_modules/remark-parse/lib/tokenize/table.js new file mode 100644 index 0000000..4a35892 --- /dev/null +++ b/node_modules/remark-parse/lib/tokenize/table.js @@ -0,0 +1,232 @@ +'use strict' + +var whitespace = require('is-whitespace-character') + +module.exports = table + +var tab = '\t' +var lineFeed = '\n' +var space = ' ' +var dash = '-' +var colon = ':' +var backslash = '\\' +var verticalBar = '|' + +var minColumns = 1 +var minRows = 2 + +var left = 'left' +var center = 'center' +var right = 'right' + +function table(eat, value, silent) { + var self = this + var index + var alignments + var alignment + var subvalue + var row + var length + var lines + var queue + var character + var hasDash + var align + var cell + var preamble + var now + var position + var lineCount + var line + var rows + var table + var lineIndex + var pipeIndex + var first + + // Exit when not in gfm-mode. + if (!self.options.gfm) { + return + } + + // Get the rows. + // Detecting tables soon is hard, so there are some checks for performance + // here, such as the minimum number of rows, and allowed characters in the + // alignment row. + index = 0 + lineCount = 0 + length = value.length + 1 + lines = [] + + while (index < length) { + lineIndex = value.indexOf(lineFeed, index) + pipeIndex = value.indexOf(verticalBar, index + 1) + + if (lineIndex === -1) { + lineIndex = value.length + } + + if (pipeIndex === -1 || pipeIndex > lineIndex) { + if (lineCount < minRows) { + return + } + + break + } + + lines.push(value.slice(index, lineIndex)) + lineCount++ + index = lineIndex + 1 + } + + // Parse the alignment row. + subvalue = lines.join(lineFeed) + alignments = lines.splice(1, 1)[0] || [] + index = 0 + length = alignments.length + lineCount-- + alignment = false + align = [] + + while (index < length) { + character = alignments.charAt(index) + + if (character === verticalBar) { + hasDash = null + + if (alignment === false) { + if (first === false) { + return + } + } else { + align.push(alignment) + alignment = false + } + + first = false + } else if (character === dash) { + hasDash = true + alignment = alignment || null + } else if (character === colon) { + if (alignment === left) { + alignment = center + } else if (hasDash && alignment === null) { + alignment = right + } else { + alignment = left + } + } else if (!whitespace(character)) { + return + } + + index++ + } + + if (alignment !== false) { + align.push(alignment) + } + + // Exit when without enough columns. + if (align.length < minColumns) { + return + } + + /* istanbul ignore if - never used (yet) */ + if (silent) { + return true + } + + // Parse the rows. + position = -1 + rows = [] + + table = eat(subvalue).reset({type: 'table', align: align, children: rows}) + + while (++position < lineCount) { + line = lines[position] + row = {type: 'tableRow', children: []} + + // Eat a newline character when this is not the first row. + if (position) { + eat(lineFeed) + } + + // Eat the row. + eat(line).reset(row, table) + + length = line.length + 1 + index = 0 + queue = '' + cell = '' + preamble = true + + while (index < length) { + character = line.charAt(index) + + if (character === tab || character === space) { + if (cell) { + queue += character + } else { + eat(character) + } + + index++ + continue + } + + if (character === '' || character === verticalBar) { + if (preamble) { + eat(character) + } else { + if ((cell || character) && !preamble) { + subvalue = cell + + if (queue.length > 1) { + if (character) { + subvalue += queue.slice(0, -1) + queue = queue.charAt(queue.length - 1) + } else { + subvalue += queue + queue = '' + } + } + + now = eat.now() + + eat(subvalue)( + {type: 'tableCell', children: self.tokenizeInline(cell, now)}, + row + ) + } + + eat(queue + character) + + queue = '' + cell = '' + } + } else { + if (queue) { + cell += queue + queue = '' + } + + cell += character + + if (character === backslash && index !== length - 2) { + cell += line.charAt(index + 1) + index++ + } + } + + preamble = false + index++ + } + + // Eat the alignment row. + if (!position) { + eat(lineFeed + alignments) + } + } + + return table +} diff --git a/node_modules/remark-parse/lib/tokenize/text.js b/node_modules/remark-parse/lib/tokenize/text.js new file mode 100644 index 0000000..c9085ee --- /dev/null +++ b/node_modules/remark-parse/lib/tokenize/text.js @@ -0,0 +1,57 @@ +'use strict' + +module.exports = text + +function text(eat, value, silent) { + var self = this + var methods + var tokenizers + var index + var length + var subvalue + var position + var tokenizer + var name + var min + var now + + /* istanbul ignore if - never used (yet) */ + if (silent) { + return true + } + + methods = self.inlineMethods + length = methods.length + tokenizers = self.inlineTokenizers + index = -1 + min = value.length + + while (++index < length) { + name = methods[index] + + if (name === 'text' || !tokenizers[name]) { + continue + } + + tokenizer = tokenizers[name].locator + + if (!tokenizer) { + eat.file.fail('Missing locator: `' + name + '`') + } + + position = tokenizer.call(self, value, 1) + + if (position !== -1 && position < min) { + min = position + } + } + + subvalue = value.slice(0, min) + now = eat.now() + + self.decode(subvalue, now, handler) + + function handler(content, position, source) { + eat(source || content)({type: 'text', value: content}) + } +} diff --git a/node_modules/remark-parse/lib/tokenize/thematic-break.js b/node_modules/remark-parse/lib/tokenize/thematic-break.js new file mode 100644 index 0000000..6844c8c --- /dev/null +++ b/node_modules/remark-parse/lib/tokenize/thematic-break.js @@ -0,0 +1,70 @@ +'use strict' + +module.exports = thematicBreak + +var tab = '\t' +var lineFeed = '\n' +var space = ' ' +var asterisk = '*' +var dash = '-' +var underscore = '_' + +var maxCount = 3 + +function thematicBreak(eat, value, silent) { + var index = -1 + var length = value.length + 1 + var subvalue = '' + var character + var marker + var markerCount + var queue + + while (++index < length) { + character = value.charAt(index) + + if (character !== tab && character !== space) { + break + } + + subvalue += character + } + + if ( + character !== asterisk && + character !== dash && + character !== underscore + ) { + return + } + + marker = character + subvalue += character + markerCount = 1 + queue = '' + + while (++index < length) { + character = value.charAt(index) + + if (character === marker) { + markerCount++ + subvalue += queue + marker + queue = '' + } else if (character === space) { + queue += character + } else if ( + markerCount >= maxCount && + (!character || character === lineFeed) + ) { + subvalue += queue + + if (silent) { + return true + } + + return eat(subvalue)({type: 'thematicBreak'}) + } else { + return + } + } +} diff --git a/node_modules/remark-parse/lib/tokenize/url.js b/node_modules/remark-parse/lib/tokenize/url.js new file mode 100644 index 0000000..30077ca --- /dev/null +++ b/node_modules/remark-parse/lib/tokenize/url.js @@ -0,0 +1,210 @@ +'use strict' + +var ccount = require('ccount') +var decode = require('parse-entities') +var decimal = require('is-decimal') +var alphabetical = require('is-alphabetical') +var whitespace = require('is-whitespace-character') +var locate = require('../locate/url') + +module.exports = url +url.locator = locate +url.notInLink = true + +var exclamationMark = 33 // '!' +var ampersand = 38 // '&' +var rightParenthesis = 41 // ')' +var asterisk = 42 // '*' +var comma = 44 // ',' +var dash = 45 // '-' +var dot = 46 // '.' +var colon = 58 // ':' +var semicolon = 59 // ';' +var questionMark = 63 // '?' +var lessThan = 60 // '<' +var underscore = 95 // '_' +var tilde = 126 // '~' + +var leftParenthesisCharacter = '(' +var rightParenthesisCharacter = ')' + +function url(eat, value, silent) { + var self = this + var gfm = self.options.gfm + var tokenizers = self.inlineTokenizers + var length = value.length + var previousDot = -1 + var protocolless = false + var dots + var lastTwoPartsStart + var start + var index + var pathStart + var path + var code + var end + var leftCount + var rightCount + var content + var children + var url + var exit + + if (!gfm) { + return + } + + // `WWW.` doesn’t work. + if (value.slice(0, 4) === 'www.') { + protocolless = true + index = 4 + } else if (value.slice(0, 7).toLowerCase() === 'http://') { + index = 7 + } else if (value.slice(0, 8).toLowerCase() === 'https://') { + index = 8 + } else { + return + } + + // Act as if the starting boundary is a dot. + previousDot = index - 1 + + // Parse a valid domain. + start = index + dots = [] + + while (index < length) { + code = value.charCodeAt(index) + + if (code === dot) { + // Dots may not appear after each other. + if (previousDot === index - 1) { + break + } + + dots.push(index) + previousDot = index + index++ + continue + } + + if ( + decimal(code) || + alphabetical(code) || + code === dash || + code === underscore + ) { + index++ + continue + } + + break + } + + // Ignore a final dot: + if (code === dot) { + dots.pop() + index-- + } + + // If there are not dots, exit. + if (dots[0] === undefined) { + return + } + + // If there is an underscore in the last two domain parts, exit: + // `www.example.c_m` and `www.ex_ample.com` are not OK, but + // `www.sub_domain.example.com` is. + lastTwoPartsStart = dots.length < 2 ? start : dots[dots.length - 2] + 1 + + if (value.slice(lastTwoPartsStart, index).indexOf('_') !== -1) { + return + } + + /* istanbul ignore if - never used (yet) */ + if (silent) { + return true + } + + end = index + pathStart = index + + // Parse a path. + while (index < length) { + code = value.charCodeAt(index) + + if (whitespace(code) || code === lessThan) { + break + } + + index++ + + if ( + code === exclamationMark || + code === asterisk || + code === comma || + code === dot || + code === colon || + code === questionMark || + code === underscore || + code === tilde + ) { + // Empty + } else { + end = index + } + } + + index = end + + // If the path ends in a closing paren, and the count of closing parens is + // higher than the opening count, then remove the supefluous closing parens. + if (value.charCodeAt(index - 1) === rightParenthesis) { + path = value.slice(pathStart, index) + leftCount = ccount(path, leftParenthesisCharacter) + rightCount = ccount(path, rightParenthesisCharacter) + + while (rightCount > leftCount) { + index = pathStart + path.lastIndexOf(rightParenthesisCharacter) + path = value.slice(pathStart, index) + rightCount-- + } + } + + if (value.charCodeAt(index - 1) === semicolon) { + // GitHub doesn’t document this, but final semicolons aren’t paret of the + // URL either. + index-- + + // // If the path ends in what looks like an entity, it’s not part of the path. + if (alphabetical(value.charCodeAt(index - 1))) { + end = index - 2 + + while (alphabetical(value.charCodeAt(end))) { + end-- + } + + if (value.charCodeAt(end) === ampersand) { + index = end + } + } + } + + content = value.slice(0, index) + url = decode(content, {nonTerminated: false}) + + if (protocolless) { + url = 'http://' + url + } + + exit = self.enterLink() + + // Temporarily remove all tokenizers except text in url. + self.inlineTokenizers = {text: tokenizers.text} + children = self.tokenizeInline(content, eat.now()) + self.inlineTokenizers = tokenizers + + exit() + + return eat(content)({type: 'link', title: null, url: url, children: children}) +} diff --git a/node_modules/remark-parse/lib/tokenizer.js b/node_modules/remark-parse/lib/tokenizer.js new file mode 100644 index 0000000..42d3cf1 --- /dev/null +++ b/node_modules/remark-parse/lib/tokenizer.js @@ -0,0 +1,318 @@ +'use strict' + +module.exports = factory + +// Construct a tokenizer. This creates both `tokenizeInline` and `tokenizeBlock`. +function factory(type) { + return tokenize + + // Tokenizer for a bound `type`. + function tokenize(value, location) { + var self = this + var offset = self.offset + var tokens = [] + var methods = self[type + 'Methods'] + var tokenizers = self[type + 'Tokenizers'] + var line = location.line + var column = location.column + var index + var length + var method + var name + var matched + var valueLength + + // Trim white space only lines. + if (!value) { + return tokens + } + + // Expose on `eat`. + eat.now = now + eat.file = self.file + + // Sync initial offset. + updatePosition('') + + // Iterate over `value`, and iterate over all tokenizers. When one eats + // something, re-iterate with the remaining value. If no tokenizer eats, + // something failed (should not happen) and an exception is thrown. + while (value) { + index = -1 + length = methods.length + matched = false + + while (++index < length) { + name = methods[index] + method = tokenizers[name] + + // Previously, we had constructs such as footnotes and YAML that used + // these properties. + // Those are now external (plus there are userland extensions), that may + // still use them. + if ( + method && + /* istanbul ignore next */ (!method.onlyAtStart || self.atStart) && + /* istanbul ignore next */ (!method.notInList || !self.inList) && + /* istanbul ignore next */ (!method.notInBlock || !self.inBlock) && + (!method.notInLink || !self.inLink) + ) { + valueLength = value.length + + method.apply(self, [eat, value]) + + matched = valueLength !== value.length + + if (matched) { + break + } + } + } + + /* istanbul ignore if */ + if (!matched) { + self.file.fail(new Error('Infinite loop'), eat.now()) + } + } + + self.eof = now() + + return tokens + + // Update line, column, and offset based on `value`. + function updatePosition(subvalue) { + var lastIndex = -1 + var index = subvalue.indexOf('\n') + + while (index !== -1) { + line++ + lastIndex = index + index = subvalue.indexOf('\n', index + 1) + } + + if (lastIndex === -1) { + column += subvalue.length + } else { + column = subvalue.length - lastIndex + } + + if (line in offset) { + if (lastIndex !== -1) { + column += offset[line] + } else if (column <= offset[line]) { + column = offset[line] + 1 + } + } + } + + // Get offset. Called before the first character is eaten to retrieve the + // range’s offsets. + function getOffset() { + var indentation = [] + var pos = line + 1 + + // Done. Called when the last character is eaten to retrieve the range’s + // offsets. + return function () { + var last = line + 1 + + while (pos < last) { + indentation.push((offset[pos] || 0) + 1) + + pos++ + } + + return indentation + } + } + + // Get the current position. + function now() { + var pos = {line: line, column: column} + + pos.offset = self.toOffset(pos) + + return pos + } + + // Store position information for a node. + function Position(start) { + this.start = start + this.end = now() + } + + // Throw when a value is incorrectly eaten. This shouldn’t happen but will + // throw on new, incorrect rules. + function validateEat(subvalue) { + /* istanbul ignore if */ + if (value.slice(0, subvalue.length) !== subvalue) { + // Capture stack-trace. + self.file.fail( + new Error( + 'Incorrectly eaten value: please report this warning on https://git.io/vg5Ft' + ), + now() + ) + } + } + + // Mark position and patch `node.position`. + function position() { + var before = now() + + return update + + // Add the position to a node. + function update(node, indent) { + var previous = node.position + var start = previous ? previous.start : before + var combined = [] + var n = previous && previous.end.line + var l = before.line + + node.position = new Position(start) + + // If there was already a `position`, this node was merged. Fixing + // `start` wasn’t hard, but the indent is different. Especially + // because some information, the indent between `n` and `l` wasn’t + // tracked. Luckily, that space is (should be?) empty, so we can + // safely check for it now. + if (previous && indent && previous.indent) { + combined = previous.indent + + if (n < l) { + while (++n < l) { + combined.push((offset[n] || 0) + 1) + } + + combined.push(before.column) + } + + indent = combined.concat(indent) + } + + node.position.indent = indent || [] + + return node + } + } + + // Add `node` to `parent`s children or to `tokens`. Performs merges where + // possible. + function add(node, parent) { + var children = parent ? parent.children : tokens + var previous = children[children.length - 1] + var fn + + if ( + previous && + node.type === previous.type && + (node.type === 'text' || node.type === 'blockquote') && + mergeable(previous) && + mergeable(node) + ) { + fn = node.type === 'text' ? mergeText : mergeBlockquote + node = fn.call(self, previous, node) + } + + if (node !== previous) { + children.push(node) + } + + if (self.atStart && tokens.length !== 0) { + self.exitStart() + } + + return node + } + + // Remove `subvalue` from `value`. `subvalue` must be at the start of + // `value`. + function eat(subvalue) { + var indent = getOffset() + var pos = position() + var current = now() + + validateEat(subvalue) + + apply.reset = reset + reset.test = test + apply.test = test + + value = value.slice(subvalue.length) + + updatePosition(subvalue) + + indent = indent() + + return apply + + // Add the given arguments, add `position` to the returned node, and + // return the node. + function apply(node, parent) { + return pos(add(pos(node), parent), indent) + } + + // Functions just like apply, but resets the content: the line and + // column are reversed, and the eaten value is re-added. This is + // useful for nodes with a single type of content, such as lists and + // tables. See `apply` above for what parameters are expected. + function reset() { + var node = apply.apply(null, arguments) + + line = current.line + column = current.column + value = subvalue + value + + return node + } + + // Test the position, after eating, and reverse to a not-eaten state. + function test() { + var result = pos({}) + + line = current.line + column = current.column + value = subvalue + value + + return result.position + } + } + } +} + +// Check whether a node is mergeable with adjacent nodes. +function mergeable(node) { + var start + var end + + if (node.type !== 'text' || !node.position) { + return true + } + + start = node.position.start + end = node.position.end + + // Only merge nodes which occupy the same size as their `value`. + return ( + start.line !== end.line || end.column - start.column === node.value.length + ) +} + +// Merge two text nodes: `node` into `prev`. +function mergeText(previous, node) { + previous.value += node.value + + return previous +} + +// Merge two blockquotes: `node` into `prev`, unless in CommonMark or gfm modes. +function mergeBlockquote(previous, node) { + if (this.options.commonmark || this.options.gfm) { + return node + } + + previous.children = previous.children.concat(node.children) + + return previous +} diff --git a/node_modules/remark-parse/lib/unescape.js b/node_modules/remark-parse/lib/unescape.js new file mode 100644 index 0000000..18fe269 --- /dev/null +++ b/node_modules/remark-parse/lib/unescape.js @@ -0,0 +1,36 @@ +'use strict' + +module.exports = factory + +var backslash = '\\' + +// Factory to de-escape a value, based on a list at `key` in `ctx`. +function factory(ctx, key) { + return unescape + + // De-escape a string using the expression at `key` in `ctx`. + function unescape(value) { + var previous = 0 + var index = value.indexOf(backslash) + var escape = ctx[key] + var queue = [] + var character + + while (index !== -1) { + queue.push(value.slice(previous, index)) + previous = index + 1 + character = value.charAt(previous) + + // If the following character is not a valid escape, add the slash. + if (!character || escape.indexOf(character) === -1) { + queue.push(backslash) + } + + index = value.indexOf(backslash, previous + 1) + } + + queue.push(value.slice(previous)) + + return queue.join('') + } +} diff --git a/node_modules/remark-parse/lib/util/get-indentation.js b/node_modules/remark-parse/lib/util/get-indentation.js new file mode 100644 index 0000000..14466f4 --- /dev/null +++ b/node_modules/remark-parse/lib/util/get-indentation.js @@ -0,0 +1,37 @@ +'use strict' + +module.exports = indentation + +var tab = '\t' +var space = ' ' + +var spaceSize = 1 +var tabSize = 4 + +// Gets indentation information for a line. +function indentation(value) { + var index = 0 + var indent = 0 + var character = value.charAt(index) + var stops = {} + var size + var lastIndent = 0 + + while (character === tab || character === space) { + size = character === tab ? tabSize : spaceSize + + indent += size + + if (size > 1) { + indent = Math.floor(indent / size) * size + } + + while (lastIndent < indent) { + stops[++lastIndent] = index + } + + character = value.charAt(++index) + } + + return {indent: indent, stops: stops} +} diff --git a/node_modules/remark-parse/lib/util/html.js b/node_modules/remark-parse/lib/util/html.js new file mode 100644 index 0000000..49b7a38 --- /dev/null +++ b/node_modules/remark-parse/lib/util/html.js @@ -0,0 +1,34 @@ +'use strict' + +var attributeName = '[a-zA-Z_:][a-zA-Z0-9:._-]*' +var unquoted = '[^"\'=<>`\\u0000-\\u0020]+' +var singleQuoted = "'[^']*'" +var doubleQuoted = '"[^"]*"' +var attributeValue = + '(?:' + unquoted + '|' + singleQuoted + '|' + doubleQuoted + ')' +var attribute = + '(?:\\s+' + attributeName + '(?:\\s*=\\s*' + attributeValue + ')?)' +var openTag = '<[A-Za-z][A-Za-z0-9\\-]*' + attribute + '*\\s*\\/?>' +var closeTag = '<\\/[A-Za-z][A-Za-z0-9\\-]*\\s*>' +var comment = '|' +var processing = '<[?].*?[?]>' +var declaration = ']*>' +var cdata = '' + +exports.openCloseTag = new RegExp('^(?:' + openTag + '|' + closeTag + ')') + +exports.tag = new RegExp( + '^(?:' + + openTag + + '|' + + closeTag + + '|' + + comment + + '|' + + processing + + '|' + + declaration + + '|' + + cdata + + ')' +) diff --git a/node_modules/remark-parse/lib/util/interrupt.js b/node_modules/remark-parse/lib/util/interrupt.js new file mode 100644 index 0000000..22a839f --- /dev/null +++ b/node_modules/remark-parse/lib/util/interrupt.js @@ -0,0 +1,35 @@ +'use strict' + +module.exports = interrupt + +function interrupt(interruptors, tokenizers, ctx, parameters) { + var length = interruptors.length + var index = -1 + var interruptor + var config + + while (++index < length) { + interruptor = interruptors[index] + config = interruptor[1] || {} + + if ( + config.pedantic !== undefined && + config.pedantic !== ctx.options.pedantic + ) { + continue + } + + if ( + config.commonmark !== undefined && + config.commonmark !== ctx.options.commonmark + ) { + continue + } + + if (tokenizers[interruptor[0]].apply(ctx, parameters)) { + return true + } + } + + return false +} diff --git a/node_modules/remark-parse/lib/util/is-markdown-whitespace-character.js b/node_modules/remark-parse/lib/util/is-markdown-whitespace-character.js new file mode 100644 index 0000000..ff6f4bb --- /dev/null +++ b/node_modules/remark-parse/lib/util/is-markdown-whitespace-character.js @@ -0,0 +1,27 @@ +'use strict' + +module.exports = whitespace + +var tab = 9 // '\t' +var lineFeed = 10 // '\n' +var lineTabulation = 11 // '\v' +var formFeed = 12 // '\f' +var carriageReturn = 13 // '\r' +var space = 32 // ' ' + +function whitespace(char) { + /* istanbul ignore next - `number` handling for future */ + var code = typeof char === 'number' ? char : char.charCodeAt(0) + + switch (code) { + case tab: + case lineFeed: + case lineTabulation: + case formFeed: + case carriageReturn: + case space: + return true + default: + return false + } +} diff --git a/node_modules/remark-parse/lib/util/normalize.js b/node_modules/remark-parse/lib/util/normalize.js new file mode 100644 index 0000000..7057c0a --- /dev/null +++ b/node_modules/remark-parse/lib/util/normalize.js @@ -0,0 +1,11 @@ +'use strict' + +var collapseWhiteSpace = require('collapse-white-space') + +module.exports = normalize + +// Normalize an identifier. Collapses multiple white space characters into a +// single space, and removes casing. +function normalize(value) { + return collapseWhiteSpace(value).toLowerCase() +} diff --git a/node_modules/remark-parse/lib/util/remove-indentation.js b/node_modules/remark-parse/lib/util/remove-indentation.js new file mode 100644 index 0000000..f232e67 --- /dev/null +++ b/node_modules/remark-parse/lib/util/remove-indentation.js @@ -0,0 +1,64 @@ +'use strict' + +var trim = require('trim') +var repeat = require('repeat-string') +var getIndent = require('./get-indentation') + +module.exports = indentation + +var lineFeed = '\n' +var space = ' ' +var exclamationMark = '!' + +// Remove the minimum indent from every line in `value`. Supports both tab, +// spaced, and mixed indentation (as well as possible). +function indentation(value, maximum) { + var values = value.split(lineFeed) + var position = values.length + 1 + var minIndent = Infinity + var matrix = [] + var index + var indentation + var stops + + values.unshift(repeat(space, maximum) + exclamationMark) + + while (position--) { + indentation = getIndent(values[position]) + + matrix[position] = indentation.stops + + if (trim(values[position]).length === 0) { + continue + } + + if (indentation.indent) { + if (indentation.indent > 0 && indentation.indent < minIndent) { + minIndent = indentation.indent + } + } else { + minIndent = Infinity + + break + } + } + + if (minIndent !== Infinity) { + position = values.length + + while (position--) { + stops = matrix[position] + index = minIndent + + while (index && !(index in stops)) { + index-- + } + + values[position] = values[position].slice(stops[index] + 1) + } + } + + values.shift() + + return values.join(lineFeed) +} diff --git a/node_modules/remark-parse/package.json b/node_modules/remark-parse/package.json new file mode 100644 index 0000000..df220e7 --- /dev/null +++ b/node_modules/remark-parse/package.json @@ -0,0 +1,112 @@ +{ + "_from": "remark-parse@^8.0.2", + "_id": "remark-parse@8.0.2", + "_inBundle": false, + "_integrity": "sha512-eMI6kMRjsAGpMXXBAywJwiwAse+KNpmt+BK55Oofy4KvBZEqUDj6mWbGLJZrujoPIPPxDXzn3T9baRlpsm2jnQ==", + "_location": "/remark-parse", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "remark-parse@^8.0.2", + "name": "remark-parse", + "escapedName": "remark-parse", + "rawSpec": "^8.0.2", + "saveSpec": null, + "fetchSpec": "^8.0.2" + }, + "_requiredBy": [ + "/slackify-markdown" + ], + "_resolved": "https://registry.npmjs.org/remark-parse/-/remark-parse-8.0.2.tgz", + "_shasum": "5999bc0b9c2e3edc038800a64ff103d0890b318b", + "_spec": "remark-parse@^8.0.2", + "_where": "/Users/josh/Projects/slackify-markdown-action/node_modules/slackify-markdown", + "author": { + "name": "Titus Wormer", + "email": "tituswormer@gmail.com", + "url": "https://wooorm.com" + }, + "bugs": { + "url": "https://github.com/remarkjs/remark/issues" + }, + "bundleDependencies": false, + "contributors": [ + { + "name": "Titus Wormer", + "email": "tituswormer@gmail.com", + "url": "https://wooorm.com" + }, + { + "name": "Eugene Sharygin", + "email": "eush77@gmail.com" + }, + { + "name": "Junyoung Choi", + "email": "fluke8259@gmail.com" + }, + { + "name": "Elijah Hamovitz", + "email": "elijahhamovitz@gmail.com" + }, + { + "name": "Ika", + "email": "ikatyang@gmail.com" + } + ], + "dependencies": { + "ccount": "^1.0.0", + "collapse-white-space": "^1.0.2", + "is-alphabetical": "^1.0.0", + "is-decimal": "^1.0.0", + "is-whitespace-character": "^1.0.0", + "is-word-character": "^1.0.0", + "markdown-escapes": "^1.0.0", + "parse-entities": "^2.0.0", + "repeat-string": "^1.5.4", + "state-toggle": "^1.0.0", + "trim": "0.0.1", + "trim-trailing-lines": "^1.0.0", + "unherit": "^1.0.4", + "unist-util-remove-position": "^2.0.0", + "vfile-location": "^3.0.0", + "xtend": "^4.0.1" + }, + "deprecated": false, + "description": "remark plugin to parse Markdown", + "files": [ + "index.js", + "lib", + "types/index.d.ts" + ], + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + }, + "homepage": "https://remark.js.org", + "keywords": [ + "unified", + "remark", + "remark-plugin", + "plugin", + "markdown", + "mdast", + "abstract", + "syntax", + "tree", + "ast", + "parse" + ], + "license": "MIT", + "name": "remark-parse", + "repository": { + "type": "git", + "url": "https://github.com/remarkjs/remark/tree/master/packages/remark-parse" + }, + "scripts": { + "test": "tape test.js" + }, + "types": "types/index.d.ts", + "version": "8.0.2", + "xo": false +} diff --git a/node_modules/remark-parse/readme.md b/node_modules/remark-parse/readme.md new file mode 100644 index 0000000..c0e13af --- /dev/null +++ b/node_modules/remark-parse/readme.md @@ -0,0 +1,572 @@ +# remark-parse + +[![Build][build-badge]][build] +[![Coverage][coverage-badge]][coverage] +[![Downloads][downloads-badge]][downloads] +[![Size][size-badge]][size] +[![Sponsors][sponsors-badge]][collective] +[![Backers][backers-badge]][collective] +[![Chat][chat-badge]][chat] + +[Parser][] for [**unified**][unified]. +Parses Markdown to [**mdast**][mdast] syntax trees. +Used in the [**remark** processor][remark] but can be used on its own as well. +Can be [extended][extend] to change how Markdown is parsed. + +## Sponsors + + + + + + + + + + + + + + + +
+ Gatsby
🥇

+ +
+ Vercel
🥇

+ + +
+ Netlify
🥇

+ + +
+ Holloway


+ +
+ ThemeIsle
🥉

+ +
+ BoostIO
🥉

+ +
+



+ You? +
+ +## Install + +[npm][]: + +```sh +npm install remark-parse +``` + +## Use + +```js +var unified = require('unified') +var createStream = require('unified-stream') +var markdown = require('remark-parse') +var remark2rehype = require('remark-rehype') +var html = require('rehype-stringify') + +var processor = unified() + .use(markdown, {commonmark: true}) + .use(remark2rehype) + .use(html) + +process.stdin.pipe(createStream(processor)).pipe(process.stdout) +``` + +[See **unified** for more examples »][unified] + +## Contents + +* [API](#api) + * [`processor().use(parse[, options])`](#processoruseparse-options) + * [`parse.Parser`](#parseparser) +* [Extending the `Parser`](#extending-the-parser) + * [`Parser#blockTokenizers`](#parserblocktokenizers) + * [`Parser#blockMethods`](#parserblockmethods) + * [`Parser#inlineTokenizers`](#parserinlinetokenizers) + * [`Parser#inlineMethods`](#parserinlinemethods) + * [`function tokenizer(eat, value, silent)`](#function-tokenizereat-value-silent) + * [`tokenizer.locator(value, fromIndex)`](#tokenizerlocatorvalue-fromindex) + * [`eat(subvalue)`](#eatsubvalue) + * [`add(node[, parent])`](#addnode-parent) + * [`add.test()`](#addtest) + * [`add.reset(node[, parent])`](#addresetnode-parent) + * [Turning off a tokenizer](#turning-off-a-tokenizer) +* [Security](#security) +* [Contribute](#contribute) +* [License](#license) + +## API + +[See **unified** for API docs »][unified] + +### `processor().use(parse[, options])` + +Configure the `processor` to read Markdown as input and process +[**mdast**][mdast] syntax trees. + +##### `options` + +Options can be passed directly, or passed later through +[`processor.data()`][data]. + +###### `options.gfm` + +GFM mode (`boolean`, default: `true`). + +```markdown +hello ~~hi~~ world +``` + +Turns on: + +* [Fenced code blocks](https://help.github.com/articles/creating-and-highlighting-code-blocks#fenced-code-blocks) +* [Autolinking of URLs](https://help.github.com/articles/autolinked-references-and-urls) +* [Deletions (strikethrough)](https://help.github.com/articles/basic-writing-and-formatting-syntax#styling-text) +* [Task lists](https://help.github.com/articles/basic-writing-and-formatting-syntax#task-lists) +* [Tables](https://help.github.com/articles/organizing-information-with-tables) + +###### `options.commonmark` + +CommonMark mode (`boolean`, default: `false`). + +```markdown +This is a paragraph + and this is also part of the preceding paragraph. +``` + +Allows: + +* Empty lines to split block quotes +* Parentheses (`(` and `)`) around link and image titles +* Any escaped [ASCII punctuation][escapes] character +* Closing parenthesis (`)`) as an ordered list marker +* URL definitions in block quotes + +Disallows: + +* Indented code blocks directly following a paragraph +* ATX headings (`# Hash headings`) without spacing after opening hashes or and + before closing hashes +* Setext headings (`Underline headings\n---`) when following a paragraph +* Newlines in link and image titles +* White space in link and image URLs in auto-links (links in brackets, `<` and + `>`) +* Lazy block quote continuation, lines not preceded by a greater than + character (`>`), for lists, code, and thematic breaks + +###### `options.pedantic` + +⚠️ Pedantic was previously used to mimic old-style Markdown mode: no tables, no +fenced code, and with many bugs. +It’s currently still “working”, but please do not use it, it’ll be removed in +the future. + +###### `options.blocks` + +Blocks (`Array.`, default: list of [block HTML elements][blocks]). + +```markdown +foo + +``` + +Defines which HTML elements are seen as block level. + +### `parse.Parser` + +Access to the [parser][], if you need it. + +## Extending the `Parser` + +Typically, using [*transformers*][transformer] to manipulate a syntax tree +produces the desired output. +Sometimes, such as when introducing new syntactic entities with a certain +precedence, interfacing with the parser is necessary. + +If the `remark-parse` plugin is used, it adds a [`Parser`][parser] constructor +function to the `processor`. +Other plugins can add tokenizers to its prototype to change how Markdown is +parsed. + +The below plugin adds a [tokenizer][] for at-mentions. + +```js +module.exports = mentions + +function mentions() { + var Parser = this.Parser + var tokenizers = Parser.prototype.inlineTokenizers + var methods = Parser.prototype.inlineMethods + + // Add an inline tokenizer (defined in the following example). + tokenizers.mention = tokenizeMention + + // Run it just before `text`. + methods.splice(methods.indexOf('text'), 0, 'mention') +} +``` + +### `Parser#blockTokenizers` + +Map of names to [tokenizer][]s (`Object.`). +These tokenizers (such as `fencedCode`, `table`, and `paragraph`) eat from the +start of a value to a line ending. + +See `#blockMethods` below for a list of methods that are included by default. + +### `Parser#blockMethods` + +List of `blockTokenizers` names (`Array.`). +Specifies the order in which tokenizers run. + +Precedence of default block methods is as follows: + + + +* `blankLine` +* `indentedCode` +* `fencedCode` +* `blockquote` +* `atxHeading` +* `thematicBreak` +* `list` +* `setextHeading` +* `html` +* `definition` +* `table` +* `paragraph` + + + +### `Parser#inlineTokenizers` + +Map of names to [tokenizer][]s (`Object.`). +These tokenizers (such as `url`, `reference`, and `emphasis`) eat from the start +of a value. +To increase performance, they depend on [locator][]s. + +See `#inlineMethods` below for a list of methods that are included by default. + +### `Parser#inlineMethods` + +List of `inlineTokenizers` names (`Array.`). +Specifies the order in which tokenizers run. + +Precedence of default inline methods is as follows: + + + +* `escape` +* `autoLink` +* `url` +* `email` +* `html` +* `link` +* `reference` +* `strong` +* `emphasis` +* `deletion` +* `code` +* `break` +* `text` + + + +### `function tokenizer(eat, value, silent)` + +There are two types of tokenizers: block level and inline level. +Both are functions, and work the same, but inline tokenizers must have a +[locator][]. + +The following example shows an inline tokenizer that is added by the mentions +plugin above. + +```js +tokenizeMention.notInLink = true +tokenizeMention.locator = locateMention + +function tokenizeMention(eat, value, silent) { + var match = /^@(\w+)/.exec(value) + + if (match) { + if (silent) { + return true + } + + return eat(match[0])({ + type: 'link', + url: 'https://social-network/' + match[1], + children: [{type: 'text', value: match[0]}] + }) + } +} +``` + +Tokenizers *test* whether a document starts with a certain syntactic entity. +In *silent* mode, they return whether that test passes. +In *normal* mode, they consume that token, a process which is called “eating”. + +Locators enable inline tokenizers to function faster by providing where the next +entity may occur. + +###### Signatures + +* `Node? = tokenizer(eat, value)` +* `boolean? = tokenizer(eat, value, silent)` + +###### Parameters + +* `eat` ([`Function`][eat]) — Eat, when applicable, an entity +* `value` (`string`) — Value which may start an entity +* `silent` (`boolean`, optional) — Whether to detect or consume + +###### Properties + +* `locator` ([`Function`][locator]) — Required for inline tokenizers +* `onlyAtStart` (`boolean`) — Whether nodes can only be found at the beginning + of the document +* `notInBlock` (`boolean`) — Whether nodes cannot be in block quotes or lists +* `notInList` (`boolean`) — Whether nodes cannot be in lists +* `notInLink` (`boolean`) — Whether nodes cannot be in links + +###### Returns + +* `boolean?`, in *silent* mode — whether a node can be found at the start of + `value` +* [`Node?`][node], In *normal* mode — If it can be found at the start of + `value` + +### `tokenizer.locator(value, fromIndex)` + +Locators are required for inline tokenizers. +Their role is to keep parsing performant. + +The following example shows a locator that is added by the mentions tokenizer +above. + +```js +function locateMention(value, fromIndex) { + return value.indexOf('@', fromIndex) +} +``` + +Locators enable inline tokenizers to function faster by providing information on +where the next entity *may* occur. +Locators may be wrong, it’s OK if there actually isn’t a node to be found at the +index they return. + +###### Parameters + +* `value` (`string`) — Value which may contain an entity +* `fromIndex` (`number`) — Position to start searching at + +###### Returns + +`number` — Index at which an entity may start, and `-1` otherwise. + +### `eat(subvalue)` + +```js +var add = eat('foo') +``` + +Eat `subvalue`, which is a string at the start of the [tokenized][tokenizer] +`value`. + +###### Parameters + +* `subvalue` (`string`) - Value to eat + +###### Returns + +[`add`][add]. + +### `add(node[, parent])` + +```js +var add = eat('foo') + +add({type: 'text', value: 'foo'}) +``` + +Add [positional information][position] to `node` and add `node` to `parent`. + +###### Parameters + +* `node` ([`Node`][node]) - Node to patch position on and to add +* `parent` ([`Parent`][parent], optional) - Place to add `node` to in the + syntax tree. + Defaults to the currently processed node + +###### Returns + +[`Node`][node] — The given `node`. + +### `add.test()` + +Get the [positional information][position] that would be patched on `node` by +`add`. + +###### Returns + +[`Position`][position]. + +### `add.reset(node[, parent])` + +`add`, but resets the internal position. +Useful for example in lists, where the same content is first eaten for a list, +and later for list items. + +###### Parameters + +* `node` ([`Node`][node]) - Node to patch position on and insert +* `parent` ([`Node`][node], optional) - Place to add `node` to in + the syntax tree. + Defaults to the currently processed node + +###### Returns + +[`Node`][node] — The given node. + +### Turning off a tokenizer + +In some situations, you may want to turn off a tokenizer to avoid parsing that +syntactic feature. + +Preferably, use the [`remark-disable-tokenizers`][remark-disable-tokenizers] +plugin to turn off tokenizers. + +Alternatively, this can be done by replacing the tokenizer from +`blockTokenizers` (or `blockMethods`) or `inlineTokenizers` (or +`inlineMethods`). + +The following example turns off indented code blocks: + +```js +remarkParse.Parser.prototype.blockTokenizers.indentedCode = indentedCode + +function indentedCode() { + return true +} +``` + +## Security + +As Markdown is sometimes used for HTML, and improper use of HTML can open you up +to a [cross-site scripting (XSS)][xss] attack, use of remark can also be unsafe. +When going to HTML, use remark in combination with the [**rehype**][rehype] +ecosystem, and use [`rehype-sanitize`][sanitize] to make the tree safe. + +Use of remark plugins could also open you up to other attacks. +Carefully assess each plugin and the risks involved in using them. + +## Contribute + +See [`contributing.md`][contributing] in [`remarkjs/.github`][health] for ways +to get started. +See [`support.md`][support] for ways to get help. +Ideas for new plugins and tools can be posted in [`remarkjs/ideas`][ideas]. + +A curated list of awesome remark resources can be found in [**awesome +remark**][awesome]. + +This project has a [code of conduct][coc]. +By interacting with this repository, organization, or community you agree to +abide by its terms. + +## License + +[MIT][license] © [Titus Wormer][author] + + + +[build-badge]: https://img.shields.io/travis/remarkjs/remark.svg + +[build]: https://travis-ci.org/remarkjs/remark + +[coverage-badge]: https://img.shields.io/codecov/c/github/remarkjs/remark.svg + +[coverage]: https://codecov.io/github/remarkjs/remark + +[downloads-badge]: https://img.shields.io/npm/dm/remark-parse.svg + +[downloads]: https://www.npmjs.com/package/remark-parse + +[size-badge]: https://img.shields.io/bundlephobia/minzip/remark-parse.svg + +[size]: https://bundlephobia.com/result?p=remark-parse + +[sponsors-badge]: https://opencollective.com/unified/sponsors/badge.svg + +[backers-badge]: https://opencollective.com/unified/backers/badge.svg + +[collective]: https://opencollective.com/unified + +[chat-badge]: https://img.shields.io/badge/chat-spectrum-7b16ff.svg + +[chat]: https://spectrum.chat/unified/remark + +[health]: https://github.com/remarkjs/.github + +[contributing]: https://github.com/remarkjs/.github/blob/master/contributing.md + +[support]: https://github.com/remarkjs/.github/blob/master/support.md + +[coc]: https://github.com/remarkjs/.github/blob/master/code-of-conduct.md + +[ideas]: https://github.com/remarkjs/ideas + +[awesome]: https://github.com/remarkjs/awesome-remark + +[license]: https://github.com/remarkjs/remark/blob/master/license + +[author]: https://wooorm.com + +[npm]: https://docs.npmjs.com/cli/install + +[unified]: https://github.com/unifiedjs/unified + +[data]: https://github.com/unifiedjs/unified#processordatakey-value + +[remark]: https://github.com/remarkjs/remark/tree/master/packages/remark + +[blocks]: https://github.com/remarkjs/remark/blob/master/packages/remark-parse/lib/block-elements.js + +[mdast]: https://github.com/syntax-tree/mdast + +[escapes]: https://spec.commonmark.org/0.29/#backslash-escapes + +[node]: https://github.com/syntax-tree/unist#node + +[parent]: https://github.com/syntax-tree/unist#parent + +[position]: https://github.com/syntax-tree/unist#position + +[parser]: https://github.com/unifiedjs/unified#processorparser + +[transformer]: https://github.com/unifiedjs/unified#function-transformernode-file-next + +[extend]: #extending-the-parser + +[tokenizer]: #function-tokenizereat-value-silent + +[locator]: #tokenizerlocatorvalue-fromindex + +[eat]: #eatsubvalue + +[add]: #addnode-parent + +[remark-disable-tokenizers]: https://github.com/zestedesavoir/zmarkdown/tree/master/packages/remark-disable-tokenizers + +[xss]: https://en.wikipedia.org/wiki/Cross-site_scripting + +[rehype]: https://github.com/rehypejs/rehype + +[sanitize]: https://github.com/rehypejs/rehype-sanitize diff --git a/node_modules/remark-parse/types/index.d.ts b/node_modules/remark-parse/types/index.d.ts new file mode 100644 index 0000000..7847ffa --- /dev/null +++ b/node_modules/remark-parse/types/index.d.ts @@ -0,0 +1,107 @@ +// TypeScript Version: 3.0 + +import {Node, Parent, Position} from 'unist' +import {Parser, Plugin} from 'unified' + +declare class RemarkParser implements Parser { + parse(): Node + blockMethods: string[] + inlineTokenizers: { + [key: string]: remarkParse.Tokenizer + } + + inlineMethods: string[] +} + +declare namespace remarkParse { + interface Parse extends Plugin<[PartialRemarkParseOptions?]> { + (options: PartialRemarkParseOptions): void + Parser: typeof RemarkParser + } + + type Parser = RemarkParser + + interface RemarkParseOptions { + /** + * GFM mode + * + * Turns on: + * * Fenced code blocks + * * Autolinking of URLs + * * Deletions (strikethrough) + * * Task lists + * * Tables + * + * @defaultValue `true` + */ + gfm: boolean + + /** + * CommonMark mode + * + * Allows: + * * Empty lines to split blockquotes + * * Parentheses (`(` and `)`) around link and image titles + * * Any escaped ASCII punctuation character + * * Closing parenthesis (`)`) as an ordered list marker + * * URL definitions in blockquotes + * + * Disallows: + * * Indented code blocks directly following a paragraph + * * ATX headings (# Hash headings) without spacing after opening hashes or and before closing hashes + * * Setext headings (`Underline headings\n---`) when following a paragraph + * * Newlines in link and image titles + * * White space in link and image URLs in auto-links (links in brackets, `<` and `>`) + * * Lazy blockquote continuation, lines not preceded by a greater than character (`>`), for lists, code, and thematic breaks + * + * @defaultValue `false` + */ + commonmark: boolean + + /** + * Defines which HTML elements are seen as block level. + * + * @defaultValue blocks listed in + */ + blocks: string[] + + /** + * Pedantic mode + * + * Turns on: + * * Emphasis (`_alpha_`) and importance (`__bravo__`) with underscores in words + * * Unordered lists with different markers (`*`, `-`, `+`) + * * If commonmark is also turned on, ordered lists with different markers (`.`, `)`) + * * And removes less spaces in list items (at most four, instead of the whole indent) + * + * @defaultValue `false` + * @deprecated pedantic mode is buggy. It won’t be in micromark, which will be the basis of a future version of remark. + */ + pedantic: boolean + } + + type PartialRemarkParseOptions = Partial + + interface Add { + (node: Node, parent?: Parent): Node + test(): Position + reset(node: Node, parent?: Node): Node + } + + type Eat = (value: string) => Add + + type Locator = (value: string, fromIndex: number) => number + + interface Tokenizer { + (eat: Eat, value: string, silent: true): boolean | void + (eat: Eat, value: string): Node | void + locator?: Locator + onlyAtStart?: boolean + notInBlock?: boolean + notInList?: boolean + notInLink?: boolean + } +} +declare const remarkParse: remarkParse.Parse + +export = remarkParse diff --git a/node_modules/remark-stringify/index.js b/node_modules/remark-stringify/index.js new file mode 100644 index 0000000..baf7ca4 --- /dev/null +++ b/node_modules/remark-stringify/index.js @@ -0,0 +1,18 @@ +'use strict' + +var unherit = require('unherit') +var xtend = require('xtend') +var Compiler = require('./lib/compiler.js') + +module.exports = stringify +stringify.Compiler = Compiler + +function stringify(options) { + var Local = unherit(Compiler) + Local.prototype.options = xtend( + Local.prototype.options, + this.data('settings'), + options + ) + this.Compiler = Local +} diff --git a/node_modules/remark-stringify/lib/compiler.js b/node_modules/remark-stringify/lib/compiler.js new file mode 100644 index 0000000..6c5a221 --- /dev/null +++ b/node_modules/remark-stringify/lib/compiler.js @@ -0,0 +1,60 @@ +'use strict' + +var xtend = require('xtend') +var toggle = require('state-toggle') + +module.exports = Compiler + +// Construct a new compiler. +function Compiler(tree, file) { + this.inLink = false + this.inTable = false + this.tree = tree + this.file = file + this.options = xtend(this.options) + this.setOptions({}) +} + +var proto = Compiler.prototype + +// Enter and exit helpers. */ +proto.enterLink = toggle('inLink', false) +proto.enterTable = toggle('inTable', false) +proto.enterLinkReference = require('./util/enter-link-reference') + +// Configuration. +proto.options = require('./defaults') +proto.setOptions = require('./set-options') + +proto.compile = require('./macro/compile') +proto.visit = require('./macro/one') +proto.all = require('./macro/all') +proto.block = require('./macro/block') +proto.visitOrderedItems = require('./macro/ordered-items') +proto.visitUnorderedItems = require('./macro/unordered-items') + +// Expose visitors. +proto.visitors = { + root: require('./visitors/root'), + text: require('./visitors/text'), + heading: require('./visitors/heading'), + paragraph: require('./visitors/paragraph'), + blockquote: require('./visitors/blockquote'), + list: require('./visitors/list'), + listItem: require('./visitors/list-item'), + inlineCode: require('./visitors/inline-code'), + code: require('./visitors/code'), + html: require('./visitors/html'), + thematicBreak: require('./visitors/thematic-break'), + strong: require('./visitors/strong'), + emphasis: require('./visitors/emphasis'), + break: require('./visitors/break'), + delete: require('./visitors/delete'), + link: require('./visitors/link'), + linkReference: require('./visitors/link-reference'), + imageReference: require('./visitors/image-reference'), + definition: require('./visitors/definition'), + image: require('./visitors/image'), + table: require('./visitors/table'), + tableCell: require('./visitors/table-cell') +} diff --git a/node_modules/remark-stringify/lib/defaults.js b/node_modules/remark-stringify/lib/defaults.js new file mode 100644 index 0000000..217ae7f --- /dev/null +++ b/node_modules/remark-stringify/lib/defaults.js @@ -0,0 +1,28 @@ +'use strict' + +module.exports = { + gfm: true, + commonmark: false, + pedantic: false, + entities: 'false', + setext: false, + closeAtx: false, + tableCellPadding: true, + tablePipeAlign: true, + stringLength: stringLength, + incrementListMarker: true, + tightDefinitions: false, + fences: false, + fence: '`', + bullet: '-', + listItemIndent: 'tab', + rule: '*', + ruleSpaces: true, + ruleRepetition: 3, + strong: '*', + emphasis: '_' +} + +function stringLength(value) { + return value.length +} diff --git a/node_modules/remark-stringify/lib/escape.js b/node_modules/remark-stringify/lib/escape.js new file mode 100644 index 0000000..3343d82 --- /dev/null +++ b/node_modules/remark-stringify/lib/escape.js @@ -0,0 +1,297 @@ +'use strict' + +var decimal = require('is-decimal') +var alphanumeric = require('is-alphanumeric') +var whitespace = require('is-whitespace-character') +var escapes = require('markdown-escapes') +var prefix = require('./util/entity-prefix-length') + +module.exports = factory + +var tab = '\t' +var lineFeed = '\n' +var space = ' ' +var numberSign = '#' +var ampersand = '&' +var leftParenthesis = '(' +var rightParenthesis = ')' +var asterisk = '*' +var plusSign = '+' +var dash = '-' +var dot = '.' +var colon = ':' +var lessThan = '<' +var greaterThan = '>' +var leftSquareBracket = '[' +var backslash = '\\' +var rightSquareBracket = ']' +var underscore = '_' +var graveAccent = '`' +var verticalBar = '|' +var tilde = '~' +var exclamationMark = '!' + +var entities = { + '<': '<', + ':': ':', + '&': '&', + '|': '|', + '~': '~' +} + +var shortcut = 'shortcut' +var mailto = 'mailto' +var https = 'https' +var http = 'http' + +var blankExpression = /\n\s*$/ + +// Factory to escape characters. +function factory(options) { + return escape + + // Escape punctuation characters in a node’s value. + function escape(value, node, parent) { + var self = this + var gfm = options.gfm + var commonmark = options.commonmark + var pedantic = options.pedantic + var markers = commonmark ? [dot, rightParenthesis] : [dot] + var siblings = parent && parent.children + var index = siblings && siblings.indexOf(node) + var previous = siblings && siblings[index - 1] + var next = siblings && siblings[index + 1] + var length = value.length + var escapable = escapes(options) + var position = -1 + var queue = [] + var escaped = queue + var afterNewLine + var character + var wordCharBefore + var wordCharAfter + var offset + var replace + + if (previous) { + afterNewLine = text(previous) && blankExpression.test(previous.value) + } else { + afterNewLine = + !parent || parent.type === 'root' || parent.type === 'paragraph' + } + + while (++position < length) { + character = value.charAt(position) + replace = false + + if (character === '\n') { + afterNewLine = true + } else if ( + character === backslash || + character === graveAccent || + character === asterisk || + character === leftSquareBracket || + character === lessThan || + (character === ampersand && prefix(value.slice(position)) > 0) || + (character === rightSquareBracket && self.inLink) || + (gfm && character === tilde && value.charAt(position + 1) === tilde) || + (gfm && + character === verticalBar && + (self.inTable || alignment(value, position))) || + (character === underscore && + // Delegate leading/trailing underscores to the multinode version below. + position > 0 && + position < length - 1 && + (pedantic || + !alphanumeric(value.charAt(position - 1)) || + !alphanumeric(value.charAt(position + 1)))) || + (gfm && !self.inLink && character === colon && protocol(queue.join(''))) + ) { + replace = true + } else if (afterNewLine) { + if ( + character === greaterThan || + character === numberSign || + character === asterisk || + character === dash || + character === plusSign + ) { + replace = true + } else if (decimal(character)) { + offset = position + 1 + + while (offset < length) { + if (!decimal(value.charAt(offset))) { + break + } + + offset++ + } + + if (markers.indexOf(value.charAt(offset)) !== -1) { + next = value.charAt(offset + 1) + + if (!next || next === space || next === tab || next === lineFeed) { + queue.push(value.slice(position, offset)) + position = offset + character = value.charAt(position) + replace = true + } + } + } + } + + if (afterNewLine && !whitespace(character)) { + afterNewLine = false + } + + queue.push(replace ? one(character) : character) + } + + // Multi-node versions. + if (siblings && text(node)) { + // Check for an opening parentheses after a link-reference (which can be + // joined by white-space). + if (previous && previous.referenceType === shortcut) { + position = -1 + length = escaped.length + + while (++position < length) { + character = escaped[position] + + if (character === space || character === tab) { + continue + } + + if (character === leftParenthesis || character === colon) { + escaped[position] = one(character) + } + + break + } + + // If the current node is all spaces / tabs, preceded by a shortcut, + // and followed by a text starting with `(`, escape it. + if ( + text(next) && + position === length && + next.value.charAt(0) === leftParenthesis + ) { + escaped.push(backslash) + } + } + + // Ensure non-auto-links are not seen as links. This pattern needs to + // check the preceding nodes too. + if ( + gfm && + !self.inLink && + text(previous) && + value.charAt(0) === colon && + protocol(previous.value.slice(-6)) + ) { + escaped[0] = one(colon) + } + + // Escape ampersand if it would otherwise start an entity. + if ( + text(next) && + value.charAt(length - 1) === ampersand && + prefix(ampersand + next.value) !== 0 + ) { + escaped[escaped.length - 1] = one(ampersand) + } + + // Escape exclamation marks immediately followed by links. + if ( + next && + next.type === 'link' && + value.charAt(length - 1) === exclamationMark + ) { + escaped[escaped.length - 1] = one(exclamationMark) + } + + // Escape double tildes in GFM. + if ( + gfm && + text(next) && + value.charAt(length - 1) === tilde && + next.value.charAt(0) === tilde + ) { + escaped.splice(-1, 0, backslash) + } + + // Escape underscores, but not mid-word (unless in pedantic mode). + wordCharBefore = text(previous) && alphanumeric(previous.value.slice(-1)) + wordCharAfter = text(next) && alphanumeric(next.value.charAt(0)) + + if (length === 1) { + if ( + value === underscore && + (pedantic || !wordCharBefore || !wordCharAfter) + ) { + escaped.unshift(backslash) + } + } else { + if ( + value.charAt(0) === underscore && + (pedantic || !wordCharBefore || !alphanumeric(value.charAt(1))) + ) { + escaped.unshift(backslash) + } + + if ( + value.charAt(length - 1) === underscore && + (pedantic || + !wordCharAfter || + !alphanumeric(value.charAt(length - 2))) + ) { + escaped.splice(-1, 0, backslash) + } + } + } + + return escaped.join('') + + function one(character) { + return escapable.indexOf(character) === -1 + ? entities[character] + : backslash + character + } + } +} + +// Check if `index` in `value` is inside an alignment row. +function alignment(value, index) { + var start = value.lastIndexOf(lineFeed, index) + var end = value.indexOf(lineFeed, index) + var char + + end = end === -1 ? value.length : end + + while (++start < end) { + char = value.charAt(start) + + if ( + char !== colon && + char !== dash && + char !== space && + char !== verticalBar + ) { + return false + } + } + + return true +} + +// Check if `node` is a text node. +function text(node) { + return node && node.type === 'text' +} + +// Check if `value` ends in a protocol. +function protocol(value) { + var tail = value.slice(-6).toLowerCase() + return tail === mailto || tail.slice(-5) === https || tail.slice(-4) === http +} diff --git a/node_modules/remark-stringify/lib/macro/all.js b/node_modules/remark-stringify/lib/macro/all.js new file mode 100644 index 0000000..ae470ee --- /dev/null +++ b/node_modules/remark-stringify/lib/macro/all.js @@ -0,0 +1,18 @@ +'use strict' + +module.exports = all + +// Visit all children of `parent`. +function all(parent) { + var self = this + var children = parent.children + var length = children.length + var results = [] + var index = -1 + + while (++index < length) { + results[index] = self.visit(children[index], parent) + } + + return results +} diff --git a/node_modules/remark-stringify/lib/macro/block.js b/node_modules/remark-stringify/lib/macro/block.js new file mode 100644 index 0000000..3e7eb85 --- /dev/null +++ b/node_modules/remark-stringify/lib/macro/block.js @@ -0,0 +1,60 @@ +'use strict' + +module.exports = block + +var lineFeed = '\n' + +var blank = lineFeed + lineFeed +var triple = blank + lineFeed +var comment = blank + '' + blank + +// Stringify a block node with block children (e.g., `root` or `blockquote`). +// Knows about code following a list, or adjacent lists with similar bullets, +// and places an extra line feed between them. +function block(node) { + var self = this + var options = self.options + var fences = options.fences + var gap = options.commonmark ? comment : triple + var definitionGap = options.tightDefinitions ? lineFeed : blank + var values = [] + var children = node.children + var length = children.length + var index = -1 + var previous + var child + + while (++index < length) { + previous = child + child = children[index] + + if (previous) { + // A list preceding another list that are equally ordered, or a + // list preceding an indented code block, need a gap between them, + // so as not to see them as one list, or content of the list, + // respectively. + // + // In commonmark, only something that breaks both up can do that, + // so we opt for an empty, invisible comment. In other flavours, + // two blank lines are fine. + if ( + previous.type === 'list' && + ((child.type === 'list' && previous.ordered === child.ordered) || + (child.type === 'code' && !child.lang && !fences)) + ) { + values.push(gap) + } else if ( + previous.type === 'definition' && + child.type === 'definition' + ) { + values.push(definitionGap) + } else { + values.push(blank) + } + } + + values.push(self.visit(child, node)) + } + + return values.join('') +} diff --git a/node_modules/remark-stringify/lib/macro/compile.js b/node_modules/remark-stringify/lib/macro/compile.js new file mode 100644 index 0000000..8c85304 --- /dev/null +++ b/node_modules/remark-stringify/lib/macro/compile.js @@ -0,0 +1,10 @@ +'use strict' + +var compact = require('mdast-util-compact') + +module.exports = compile + +// Stringify the given tree. +function compile() { + return this.visit(compact(this.tree, this.options.commonmark)) +} diff --git a/node_modules/remark-stringify/lib/macro/one.js b/node_modules/remark-stringify/lib/macro/one.js new file mode 100644 index 0000000..38e5782 --- /dev/null +++ b/node_modules/remark-stringify/lib/macro/one.js @@ -0,0 +1,20 @@ +'use strict' + +module.exports = one + +function one(node, parent) { + var self = this + var visitors = self.visitors + + // Fail on unknown nodes. + if (typeof visitors[node.type] !== 'function') { + self.file.fail( + new Error( + 'Missing compiler for node of type `' + node.type + '`: `' + node + '`' + ), + node + ) + } + + return visitors[node.type].call(self, node, parent) +} diff --git a/node_modules/remark-stringify/lib/macro/ordered-items.js b/node_modules/remark-stringify/lib/macro/ordered-items.js new file mode 100644 index 0000000..2e2fee2 --- /dev/null +++ b/node_modules/remark-stringify/lib/macro/ordered-items.js @@ -0,0 +1,43 @@ +'use strict' + +module.exports = orderedItems + +var lineFeed = '\n' +var dot = '.' + +var blank = lineFeed + lineFeed + +// Visit ordered list items. +// +// Starts the list with +// `node.start` and increments each following list item +// bullet by one: +// +// 2. foo +// 3. bar +// +// In `incrementListMarker: false` mode, does not increment +// each marker and stays on `node.start`: +// +// 1. foo +// 1. bar +function orderedItems(node) { + var self = this + var fn = self.visitors.listItem + var increment = self.options.incrementListMarker + var values = [] + var start = node.start + var children = node.children + var length = children.length + var index = -1 + var bullet + + start = start == null ? 1 : start + + while (++index < length) { + bullet = (increment ? start + index : start) + dot + values[index] = fn.call(self, children[index], node, index, bullet) + } + + return values.join(node.spread ? blank : lineFeed) +} diff --git a/node_modules/remark-stringify/lib/macro/unordered-items.js b/node_modules/remark-stringify/lib/macro/unordered-items.js new file mode 100644 index 0000000..4780014 --- /dev/null +++ b/node_modules/remark-stringify/lib/macro/unordered-items.js @@ -0,0 +1,24 @@ +'use strict' + +module.exports = unorderedItems + +var lineFeed = '\n' + +var blank = lineFeed + lineFeed + +// Visit unordered list items. Uses `options.bullet` as each item’s bullet. +function unorderedItems(node) { + var self = this + var bullet = self.options.bullet + var fn = self.visitors.listItem + var children = node.children + var length = children.length + var index = -1 + var values = [] + + while (++index < length) { + values[index] = fn.call(self, children[index], node, index, bullet) + } + + return values.join(node.spread ? blank : lineFeed) +} diff --git a/node_modules/remark-stringify/lib/set-options.js b/node_modules/remark-stringify/lib/set-options.js new file mode 100644 index 0000000..1f5c343 --- /dev/null +++ b/node_modules/remark-stringify/lib/set-options.js @@ -0,0 +1,160 @@ +'use strict' + +var xtend = require('xtend') +var encode = require('stringify-entities') +var defaults = require('./defaults') +var escapeFactory = require('./escape') +var identity = require('./util/identity') + +module.exports = setOptions + +// Map of applicable enums. +var maps = { + entities: {true: true, false: true, numbers: true, escape: true}, + bullet: {'*': true, '-': true, '+': true}, + rule: {'-': true, _: true, '*': true}, + listItemIndent: {tab: true, mixed: true, 1: true}, + emphasis: {_: true, '*': true}, + strong: {_: true, '*': true}, + fence: {'`': true, '~': true} +} + +// Expose `validate`. +var validate = { + boolean: validateBoolean, + string: validateString, + number: validateNumber, + function: validateFunction +} + +// Set options. Does not overwrite previously set options. +function setOptions(options) { + var self = this + var current = self.options + var ruleRepetition + var key + + if (options == null) { + options = {} + } else if (typeof options === 'object') { + options = xtend(options) + } else { + throw new Error('Invalid value `' + options + '` for setting `options`') + } + + for (key in defaults) { + validate[typeof defaults[key]](options, key, current[key], maps[key]) + } + + ruleRepetition = options.ruleRepetition + + if (ruleRepetition && ruleRepetition < 3) { + raise(ruleRepetition, 'options.ruleRepetition') + } + + self.encode = encodeFactory(String(options.entities)) + self.escape = escapeFactory(options) + + self.options = options + + return self +} + +// Validate a value to be boolean. Defaults to `def`. Raises an exception with +// `context[name]` when not a boolean. +function validateBoolean(context, name, def) { + var value = context[name] + + if (value == null) { + value = def + } + + if (typeof value !== 'boolean') { + raise(value, 'options.' + name) + } + + context[name] = value +} + +// Validate a value to be boolean. Defaults to `def`. Raises an exception with +// `context[name]` when not a boolean. +function validateNumber(context, name, def) { + var value = context[name] + + if (value == null) { + value = def + } + + if (isNaN(value)) { + raise(value, 'options.' + name) + } + + context[name] = value +} + +// Validate a value to be in `map`. Defaults to `def`. Raises an exception +// with `context[name]` when not in `map`. +function validateString(context, name, def, map) { + var value = context[name] + + if (value == null) { + value = def + } + + value = String(value) + + if (!(value in map)) { + raise(value, 'options.' + name) + } + + context[name] = value +} + +// Validate a value to be function. Defaults to `def`. Raises an exception +// with `context[name]` when not a function. +function validateFunction(context, name, def) { + var value = context[name] + + if (value == null) { + value = def + } + + if (typeof value !== 'function') { + raise(value, 'options.' + name) + } + + context[name] = value +} + +// Factory to encode HTML entities. Creates a no-operation function when +// `type` is `'false'`, a function which encodes using named references when +// `type` is `'true'`, and a function which encodes using numbered references +// when `type` is `'numbers'`. +function encodeFactory(type) { + var options = {} + + if (type === 'false') { + return identity + } + + if (type === 'true') { + options.useNamedReferences = true + } + + if (type === 'escape') { + options.escapeOnly = true + options.useNamedReferences = true + } + + return wrapped + + // Encode HTML entities using the bound options. + function wrapped(value) { + return encode(value, options) + } +} + +// Throw an exception with in its `message` `value` and `name`. +function raise(value, name) { + throw new Error('Invalid value `' + value + '` for setting `' + name + '`') +} diff --git a/node_modules/remark-stringify/lib/util/copy-identifier-encoding.js b/node_modules/remark-stringify/lib/util/copy-identifier-encoding.js new file mode 100644 index 0000000..a3de269 --- /dev/null +++ b/node_modules/remark-stringify/lib/util/copy-identifier-encoding.js @@ -0,0 +1,67 @@ +'use strict' + +var entityPrefixLength = require('./entity-prefix-length') + +module.exports = copy + +var ampersand = '&' + +var punctuationExppresion = /[-!"#$%&'()*+,./:;<=>?@[\\\]^`{|}~_]/ + +// For shortcut and collapsed reference links, the contents is also an +// identifier, so we need to restore the original encoding and escaping +// that were present in the source string. +// +// This function takes the unescaped & unencoded value from shortcut’s +// child nodes and the identifier and encodes the former according to +// the latter. +function copy(value, identifier) { + var length = value.length + var count = identifier.length + var result = [] + var position = 0 + var index = 0 + var start + + while (index < length) { + // Take next non-punctuation characters from `value`. + start = index + + while (index < length && !punctuationExppresion.test(value.charAt(index))) { + index += 1 + } + + result.push(value.slice(start, index)) + + // Advance `position` to the next punctuation character. + while ( + position < count && + !punctuationExppresion.test(identifier.charAt(position)) + ) { + position += 1 + } + + // Take next punctuation characters from `identifier`. + start = position + + while ( + position < count && + punctuationExppresion.test(identifier.charAt(position)) + ) { + if (identifier.charAt(position) === ampersand) { + position += entityPrefixLength(identifier.slice(position)) + } + + position += 1 + } + + result.push(identifier.slice(start, position)) + + // Advance `index` to the next non-punctuation character. + while (index < length && punctuationExppresion.test(value.charAt(index))) { + index += 1 + } + } + + return result.join('') +} diff --git a/node_modules/remark-stringify/lib/util/enclose-title.js b/node_modules/remark-stringify/lib/util/enclose-title.js new file mode 100644 index 0000000..f11639f --- /dev/null +++ b/node_modules/remark-stringify/lib/util/enclose-title.js @@ -0,0 +1,17 @@ +'use strict' + +module.exports = enclose + +var quotationMark = '"' +var apostrophe = "'" + +// There is currently no way to support nested delimiters across Markdown.pl, +// CommonMark, and GitHub (RedCarpet). The following code supports Markdown.pl +// and GitHub. +// CommonMark is not supported when mixing double- and single quotes inside a +// title. +function enclose(title) { + var delimiter = + title.indexOf(quotationMark) === -1 ? quotationMark : apostrophe + return delimiter + title + delimiter +} diff --git a/node_modules/remark-stringify/lib/util/enclose-uri.js b/node_modules/remark-stringify/lib/util/enclose-uri.js new file mode 100644 index 0000000..d162de9 --- /dev/null +++ b/node_modules/remark-stringify/lib/util/enclose-uri.js @@ -0,0 +1,33 @@ +'use strict' + +var count = require('ccount') + +module.exports = enclose + +var leftParenthesis = '(' +var rightParenthesis = ')' +var lessThan = '<' +var greaterThan = '>' + +var expression = /\s/ + +// Wrap `url` in angle brackets when needed, or when +// forced. +// In links, images, and definitions, the URL part needs +// to be enclosed when it: +// +// - has a length of `0` +// - contains white-space +// - has more or less opening than closing parentheses +function enclose(uri, always) { + if ( + always || + uri.length === 0 || + expression.test(uri) || + count(uri, leftParenthesis) !== count(uri, rightParenthesis) + ) { + return lessThan + uri + greaterThan + } + + return uri +} diff --git a/node_modules/remark-stringify/lib/util/enter-link-reference.js b/node_modules/remark-stringify/lib/util/enter-link-reference.js new file mode 100644 index 0000000..d0fe557 --- /dev/null +++ b/node_modules/remark-stringify/lib/util/enter-link-reference.js @@ -0,0 +1,33 @@ +'use strict' + +var identity = require('./identity') + +module.exports = enter + +// Shortcut and collapsed link references need no escaping and encoding during +// the processing of child nodes (it must be implied from identifier). +// +// This toggler turns encoding and escaping off for shortcut and collapsed +// references. +// +// Implies `enterLink`. +function enter(compiler, node) { + var encode = compiler.encode + var escape = compiler.escape + var exitLink = compiler.enterLink() + + if (node.referenceType !== 'shortcut' && node.referenceType !== 'collapsed') { + return exitLink + } + + compiler.escape = identity + compiler.encode = identity + + return exit + + function exit() { + compiler.encode = encode + compiler.escape = escape + exitLink() + } +} diff --git a/node_modules/remark-stringify/lib/util/entity-prefix-length.js b/node_modules/remark-stringify/lib/util/entity-prefix-length.js new file mode 100644 index 0000000..2ba771c --- /dev/null +++ b/node_modules/remark-stringify/lib/util/entity-prefix-length.js @@ -0,0 +1,23 @@ +'use strict' + +var decode = require('parse-entities') + +module.exports = length + +var ampersand = '&' + +// Returns the length of HTML entity that is a prefix of the given string +// (excluding the ampersand), 0 if it does not start with an entity. +function length(value) { + var prefix + + /* istanbul ignore if - Currently also tested for at implemention, but we + * keep it here because that’s proper. */ + if (value.charAt(0) !== ampersand) { + return 0 + } + + prefix = value.split(ampersand, 2).join(ampersand) + + return prefix.length - decode(prefix).length +} diff --git a/node_modules/remark-stringify/lib/util/identity.js b/node_modules/remark-stringify/lib/util/identity.js new file mode 100644 index 0000000..45a34f7 --- /dev/null +++ b/node_modules/remark-stringify/lib/util/identity.js @@ -0,0 +1,7 @@ +'use strict' + +module.exports = identity + +function identity(value) { + return value +} diff --git a/node_modules/remark-stringify/lib/util/label.js b/node_modules/remark-stringify/lib/util/label.js new file mode 100644 index 0000000..5718d79 --- /dev/null +++ b/node_modules/remark-stringify/lib/util/label.js @@ -0,0 +1,27 @@ +'use strict' + +module.exports = label + +var leftSquareBracket = '[' +var rightSquareBracket = ']' + +var shortcut = 'shortcut' +var collapsed = 'collapsed' + +// Stringify a reference label. +// Because link references are easily, mistakingly, created (for example, +// `[foo]`), reference nodes have an extra property depicting how it looked in +// the original document, so stringification can cause minimal changes. +function label(node) { + var type = node.referenceType + + if (type === shortcut) { + return '' + } + + return ( + leftSquareBracket + + (type === collapsed ? '' : node.label || node.identifier) + + rightSquareBracket + ) +} diff --git a/node_modules/remark-stringify/lib/util/pad.js b/node_modules/remark-stringify/lib/util/pad.js new file mode 100644 index 0000000..8f9d085 --- /dev/null +++ b/node_modules/remark-stringify/lib/util/pad.js @@ -0,0 +1,26 @@ +'use strict' + +var repeat = require('repeat-string') + +module.exports = pad + +var lineFeed = '\n' +var space = ' ' + +var tabSize = 4 + +// Pad `value` with `level * tabSize` spaces. Respects lines. Ignores empty +// lines. +function pad(value, level) { + var values = value.split(lineFeed) + var index = values.length + var padding = repeat(space, level * tabSize) + + while (index--) { + if (values[index].length !== 0) { + values[index] = padding + values[index] + } + } + + return values.join(lineFeed) +} diff --git a/node_modules/remark-stringify/lib/visitors/blockquote.js b/node_modules/remark-stringify/lib/visitors/blockquote.js new file mode 100644 index 0000000..6b5187a --- /dev/null +++ b/node_modules/remark-stringify/lib/visitors/blockquote.js @@ -0,0 +1,22 @@ +'use strict' + +module.exports = blockquote + +var lineFeed = '\n' +var space = ' ' +var greaterThan = '>' + +function blockquote(node) { + var values = this.block(node).split(lineFeed) + var result = [] + var length = values.length + var index = -1 + var value + + while (++index < length) { + value = values[index] + result[index] = (value ? space : '') + value + } + + return greaterThan + result.join(lineFeed + greaterThan) +} diff --git a/node_modules/remark-stringify/lib/visitors/break.js b/node_modules/remark-stringify/lib/visitors/break.js new file mode 100644 index 0000000..86e8c16 --- /dev/null +++ b/node_modules/remark-stringify/lib/visitors/break.js @@ -0,0 +1,14 @@ +'use strict' + +module.exports = lineBreak + +var backslash = '\\' +var lineFeed = '\n' +var space = ' ' + +var commonmark = backslash + lineFeed +var normal = space + space + lineFeed + +function lineBreak() { + return this.options.commonmark ? commonmark : normal +} diff --git a/node_modules/remark-stringify/lib/visitors/code.js b/node_modules/remark-stringify/lib/visitors/code.js new file mode 100644 index 0000000..71c0fef --- /dev/null +++ b/node_modules/remark-stringify/lib/visitors/code.js @@ -0,0 +1,93 @@ +'use strict' + +var streak = require('longest-streak') +var repeat = require('repeat-string') +var pad = require('../util/pad') + +module.exports = code + +var lineFeed = '\n' +var space = ' ' +var tilde = '~' +var graveAccent = '`' + +// Stringify code. +// Creates indented code when: +// +// - No language tag exists +// - Not in `fences: true` mode +// - A non-empty value exists +// +// Otherwise, GFM fenced code is created: +// +// ````markdown +// ```js +// foo(); +// ``` +// ```` +// +// When in ``fence: `~` `` mode, uses tildes as fences: +// +// ```markdown +// ~~~js +// foo(); +// ~~~ +// ``` +// +// Knows about internal fences: +// +// `````markdown +// ````markdown +// ```javascript +// foo(); +// ``` +// ```` +// ````` +function code(node, parent) { + var self = this + var value = node.value + var options = self.options + var marker = options.fence + var info = node.lang || '' + var fence + + if (info && node.meta) { + info += space + node.meta + } + + info = self.encode(self.escape(info, node)) + + // Without (needed) fences. + if ( + !info && + !options.fences && + value && + value.charAt(0) !== lineFeed && + value.charAt(value.length - 1) !== lineFeed + ) { + // Throw when pedantic, in a list item which isn’t compiled using a tab. + if ( + parent && + parent.type === 'listItem' && + options.listItemIndent !== 'tab' && + options.pedantic + ) { + self.file.fail( + 'Cannot indent code properly. See https://git.io/fxKR8', + node.position + ) + } + + return pad(value, 1) + } + + // Backticks in the info string don’t work with backtick fenced code. + // Backticks (and tildes) are fine in tilde fenced code. + if (marker === graveAccent && info.indexOf(graveAccent) !== -1) { + marker = tilde + } + + fence = repeat(marker, Math.max(streak(value, marker) + 1, 3)) + + return fence + info + lineFeed + value + lineFeed + fence +} diff --git a/node_modules/remark-stringify/lib/visitors/definition.js b/node_modules/remark-stringify/lib/visitors/definition.js new file mode 100644 index 0000000..11bd7af --- /dev/null +++ b/node_modules/remark-stringify/lib/visitors/definition.js @@ -0,0 +1,36 @@ +'use strict' + +var uri = require('../util/enclose-uri') +var title = require('../util/enclose-title') + +module.exports = definition + +var space = ' ' +var colon = ':' +var leftSquareBracket = '[' +var rightSquareBracket = ']' + +// Stringify an URL definition. +// +// Is smart about enclosing `url` (see `encloseURI()`) and `title` (see +// `encloseTitle()`). +// +// ```markdown +// [foo]: 'An "example" e-mail' +// ``` +function definition(node) { + var content = uri(node.url) + + if (node.title) { + content += space + title(node.title) + } + + return ( + leftSquareBracket + + (node.label || node.identifier) + + rightSquareBracket + + colon + + space + + content + ) +} diff --git a/node_modules/remark-stringify/lib/visitors/delete.js b/node_modules/remark-stringify/lib/visitors/delete.js new file mode 100644 index 0000000..0586a98 --- /dev/null +++ b/node_modules/remark-stringify/lib/visitors/delete.js @@ -0,0 +1,11 @@ +'use strict' + +module.exports = strikethrough + +var tilde = '~' + +var fence = tilde + tilde + +function strikethrough(node) { + return fence + this.all(node).join('') + fence +} diff --git a/node_modules/remark-stringify/lib/visitors/emphasis.js b/node_modules/remark-stringify/lib/visitors/emphasis.js new file mode 100644 index 0000000..d2fec56 --- /dev/null +++ b/node_modules/remark-stringify/lib/visitors/emphasis.js @@ -0,0 +1,38 @@ +'use strict' + +module.exports = emphasis + +var underscore = '_' +var asterisk = '*' + +// Stringify an `emphasis`. +// +// The marker used is configurable through `emphasis`, which defaults to an +// underscore (`'_'`) but also accepts an asterisk (`'*'`): +// +// ```markdown +// *foo* +// ``` +// +// In `pedantic` mode, text which itself contains an underscore will cause the +// marker to default to an asterisk instead: +// +// ```markdown +// *foo_bar* +// ``` +function emphasis(node) { + var marker = this.options.emphasis + var content = this.all(node).join('') + + // When in pedantic mode, prevent using underscore as the marker when there + // are underscores in the content. + if ( + this.options.pedantic && + marker === underscore && + content.indexOf(marker) !== -1 + ) { + marker = asterisk + } + + return marker + content + marker +} diff --git a/node_modules/remark-stringify/lib/visitors/heading.js b/node_modules/remark-stringify/lib/visitors/heading.js new file mode 100644 index 0000000..9f432d2 --- /dev/null +++ b/node_modules/remark-stringify/lib/visitors/heading.js @@ -0,0 +1,51 @@ +'use strict' + +var repeat = require('repeat-string') + +module.exports = heading + +var lineFeed = '\n' +var space = ' ' +var numberSign = '#' +var dash = '-' +var equalsTo = '=' + +// Stringify a heading. +// +// In `setext: true` mode and when `depth` is smaller than three, creates a +// setext header: +// +// ```markdown +// Foo +// === +// ``` +// +// Otherwise, an ATX header is generated: +// +// ```markdown +// ### Foo +// ``` +// +// In `closeAtx: true` mode, the header is closed with hashes: +// +// ```markdown +// ### Foo ### +// ``` +function heading(node) { + var self = this + var depth = node.depth + var setext = self.options.setext + var closeAtx = self.options.closeAtx + var content = self.all(node).join('') + var prefix + + if (setext && depth < 3) { + return ( + content + lineFeed + repeat(depth === 1 ? equalsTo : dash, content.length) + ) + } + + prefix = repeat(numberSign, node.depth) + + return prefix + space + content + (closeAtx ? space + prefix : '') +} diff --git a/node_modules/remark-stringify/lib/visitors/html.js b/node_modules/remark-stringify/lib/visitors/html.js new file mode 100644 index 0000000..105cb37 --- /dev/null +++ b/node_modules/remark-stringify/lib/visitors/html.js @@ -0,0 +1,7 @@ +'use strict' + +module.exports = html + +function html(node) { + return node.value +} diff --git a/node_modules/remark-stringify/lib/visitors/image-reference.js b/node_modules/remark-stringify/lib/visitors/image-reference.js new file mode 100644 index 0000000..f78be47 --- /dev/null +++ b/node_modules/remark-stringify/lib/visitors/image-reference.js @@ -0,0 +1,19 @@ +'use strict' + +var label = require('../util/label') + +module.exports = imageReference + +var leftSquareBracket = '[' +var rightSquareBracket = ']' +var exclamationMark = '!' + +function imageReference(node) { + return ( + exclamationMark + + leftSquareBracket + + (this.encode(node.alt, node) || '') + + rightSquareBracket + + label(node) + ) +} diff --git a/node_modules/remark-stringify/lib/visitors/image.js b/node_modules/remark-stringify/lib/visitors/image.js new file mode 100644 index 0000000..cc5cebb --- /dev/null +++ b/node_modules/remark-stringify/lib/visitors/image.js @@ -0,0 +1,47 @@ +'use strict' + +var uri = require('../util/enclose-uri') +var title = require('../util/enclose-title') + +module.exports = image + +var space = ' ' +var leftParenthesis = '(' +var rightParenthesis = ')' +var leftSquareBracket = '[' +var rightSquareBracket = ']' +var exclamationMark = '!' + +// Stringify an image. +// +// Is smart about enclosing `url` (see `encloseURI()`) and `title` (see +// `encloseTitle()`). +// +// ```markdown +// ![foo]( 'My "favourite" icon') +// ``` +// +// Supports named entities in `url`, `alt`, and `title` when in +// `settings.encode` mode. +function image(node) { + var self = this + var content = uri(self.encode(node.url || '', node)) + var exit = self.enterLink() + var alt = self.encode(self.escape(node.alt || '', node)) + + exit() + + if (node.title) { + content += space + title(self.encode(node.title, node)) + } + + return ( + exclamationMark + + leftSquareBracket + + alt + + rightSquareBracket + + leftParenthesis + + content + + rightParenthesis + ) +} diff --git a/node_modules/remark-stringify/lib/visitors/inline-code.js b/node_modules/remark-stringify/lib/visitors/inline-code.js new file mode 100644 index 0000000..51f5b11 --- /dev/null +++ b/node_modules/remark-stringify/lib/visitors/inline-code.js @@ -0,0 +1,63 @@ +'use strict' + +var streak = require('longest-streak') +var repeat = require('repeat-string') + +module.exports = inlineCode + +var graveAccentChar = '`' +var lineFeed = 10 // '\n' +var space = 32 // ' ' +var graveAccent = 96 // '`' + +// Stringify inline code. +// +// Knows about internal ticks (`\``), and ensures one more tick is used to +// enclose the inline code: +// +// ````markdown +// ```foo ``bar`` baz``` +// ```` +// +// Even knows about inital and final ticks: +// +// ``markdown +// `` `foo `` +// `` foo` `` +// ``` +function inlineCode(node) { + var value = node.value + var ticks = repeat(graveAccentChar, streak(value, graveAccentChar) + 1) + var start = ticks + var end = ticks + var head = value.charCodeAt(0) + var tail = value.charCodeAt(value.length - 1) + var wrap = false + var index + var length + + if (head === graveAccent || tail === graveAccent) { + wrap = true + } else if (value.length > 2 && ws(head) && ws(tail)) { + index = 1 + length = value.length - 1 + + while (++index < length) { + if (!ws(value.charCodeAt(index))) { + wrap = true + break + } + } + } + + if (wrap) { + start += ' ' + end = ' ' + end + } + + return start + value + end +} + +function ws(code) { + return code === lineFeed || code === space +} diff --git a/node_modules/remark-stringify/lib/visitors/link-reference.js b/node_modules/remark-stringify/lib/visitors/link-reference.js new file mode 100644 index 0000000..2785bc6 --- /dev/null +++ b/node_modules/remark-stringify/lib/visitors/link-reference.js @@ -0,0 +1,27 @@ +'use strict' + +var copy = require('../util/copy-identifier-encoding') +var label = require('../util/label') + +module.exports = linkReference + +var leftSquareBracket = '[' +var rightSquareBracket = ']' + +var shortcut = 'shortcut' +var collapsed = 'collapsed' + +function linkReference(node) { + var self = this + var type = node.referenceType + var exit = self.enterLinkReference(self, node) + var value = self.all(node).join('') + + exit() + + if (type === shortcut || type === collapsed) { + value = copy(value, node.label || node.identifier) + } + + return leftSquareBracket + value + rightSquareBracket + label(node) +} diff --git a/node_modules/remark-stringify/lib/visitors/link.js b/node_modules/remark-stringify/lib/visitors/link.js new file mode 100644 index 0000000..4cbde1b --- /dev/null +++ b/node_modules/remark-stringify/lib/visitors/link.js @@ -0,0 +1,65 @@ +'use strict' + +var uri = require('../util/enclose-uri') +var title = require('../util/enclose-title') + +module.exports = link + +var space = ' ' +var leftSquareBracket = '[' +var rightSquareBracket = ']' +var leftParenthesis = '(' +var rightParenthesis = ')' + +// Expression for a protocol: +// See . +var protocol = /^[a-z][a-z+.-]+:\/?/i + +// Stringify a link. +// +// When no title exists, the compiled `children` equal `url`, and `url` starts +// with a protocol, an auto link is created: +// +// ```markdown +// +// ``` +// +// Otherwise, is smart about enclosing `url` (see `encloseURI()`) and `title` +// (see `encloseTitle()`). +// ``` +// +// ```markdown +// [foo]( 'An "example" e-mail') +// ``` +// +// Supports named entities in the `url` and `title` when in `settings.encode` +// mode. +function link(node) { + var self = this + var content = self.encode(node.url || '', node) + var exit = self.enterLink() + var escaped = self.encode(self.escape(node.url || '', node)) + var value = self.all(node).join('') + + exit() + + if (node.title == null && protocol.test(content) && escaped === value) { + // Backslash escapes do not work in autolinks, so we do not escape. + return uri(self.encode(node.url), true) + } + + content = uri(content) + + if (node.title) { + content += space + title(self.encode(self.escape(node.title, node), node)) + } + + return ( + leftSquareBracket + + value + + rightSquareBracket + + leftParenthesis + + content + + rightParenthesis + ) +} diff --git a/node_modules/remark-stringify/lib/visitors/list-item.js b/node_modules/remark-stringify/lib/visitors/list-item.js new file mode 100644 index 0000000..15de8f8 --- /dev/null +++ b/node_modules/remark-stringify/lib/visitors/list-item.js @@ -0,0 +1,75 @@ +'use strict' + +var repeat = require('repeat-string') +var pad = require('../util/pad') + +module.exports = listItem + +var lineFeed = '\n' +var space = ' ' +var leftSquareBracket = '[' +var rightSquareBracket = ']' +var lowercaseX = 'x' + +var ceil = Math.ceil +var blank = lineFeed + lineFeed + +var tabSize = 4 + +// Stringify a list item. +// +// Prefixes the content with a checked checkbox when `checked: true`: +// +// ```markdown +// [x] foo +// ``` +// +// Prefixes the content with an unchecked checkbox when `checked: false`: +// +// ```markdown +// [ ] foo +// ``` +function listItem(node, parent, position, bullet) { + var self = this + var style = self.options.listItemIndent + var marker = bullet || self.options.bullet + var spread = node.spread == null ? true : node.spread + var checked = node.checked + var children = node.children + var length = children.length + var values = [] + var index = -1 + var value + var indent + var spacing + + while (++index < length) { + values[index] = self.visit(children[index], node) + } + + value = values.join(spread ? blank : lineFeed) + + if (typeof checked === 'boolean') { + // Note: I’d like to be able to only add the space between the check and + // the value, but unfortunately github does not support empty list-items + // with a checkbox :( + value = + leftSquareBracket + + (checked ? lowercaseX : space) + + rightSquareBracket + + space + + value + } + + if (style === '1' || (style === 'mixed' && value.indexOf(lineFeed) === -1)) { + indent = marker.length + 1 + spacing = space + } else { + indent = ceil((marker.length + 1) / tabSize) * tabSize + spacing = repeat(space, indent - marker.length) + } + + return value + ? marker + spacing + pad(value, indent / tabSize).slice(indent) + : marker +} diff --git a/node_modules/remark-stringify/lib/visitors/list.js b/node_modules/remark-stringify/lib/visitors/list.js new file mode 100644 index 0000000..a394ab8 --- /dev/null +++ b/node_modules/remark-stringify/lib/visitors/list.js @@ -0,0 +1,8 @@ +'use strict' + +module.exports = list + +function list(node) { + var fn = node.ordered ? this.visitOrderedItems : this.visitUnorderedItems + return fn.call(this, node) +} diff --git a/node_modules/remark-stringify/lib/visitors/paragraph.js b/node_modules/remark-stringify/lib/visitors/paragraph.js new file mode 100644 index 0000000..a9654e3 --- /dev/null +++ b/node_modules/remark-stringify/lib/visitors/paragraph.js @@ -0,0 +1,7 @@ +'use strict' + +module.exports = paragraph + +function paragraph(node) { + return this.all(node).join('') +} diff --git a/node_modules/remark-stringify/lib/visitors/root.js b/node_modules/remark-stringify/lib/visitors/root.js new file mode 100644 index 0000000..88e3c45 --- /dev/null +++ b/node_modules/remark-stringify/lib/visitors/root.js @@ -0,0 +1,17 @@ +'use strict' + +module.exports = root + +var lineFeed = '\n' + +// Stringify a root. +// Adds a final newline to ensure valid POSIX files. */ +function root(node) { + var doc = this.block(node) + + if (doc.charAt(doc.length - 1) !== lineFeed) { + doc += lineFeed + } + + return doc +} diff --git a/node_modules/remark-stringify/lib/visitors/strong.js b/node_modules/remark-stringify/lib/visitors/strong.js new file mode 100644 index 0000000..b7445ac --- /dev/null +++ b/node_modules/remark-stringify/lib/visitors/strong.js @@ -0,0 +1,18 @@ +'use strict' + +var repeat = require('repeat-string') + +module.exports = strong + +// Stringify a `strong`. +// +// The marker used is configurable by `strong`, which defaults to an asterisk +// (`'*'`) but also accepts an underscore (`'_'`): +// +// ```markdown +// __foo__ +// ``` +function strong(node) { + var marker = repeat(this.options.strong, 2) + return marker + this.all(node).join('') + marker +} diff --git a/node_modules/remark-stringify/lib/visitors/table-cell.js b/node_modules/remark-stringify/lib/visitors/table-cell.js new file mode 100644 index 0000000..9de3dbf --- /dev/null +++ b/node_modules/remark-stringify/lib/visitors/table-cell.js @@ -0,0 +1,9 @@ +'use strict' + +module.exports = tableCell + +var lineFeed = /\r?\n/g + +function tableCell(node) { + return this.all(node).join('').replace(lineFeed, ' ') +} diff --git a/node_modules/remark-stringify/lib/visitors/table.js b/node_modules/remark-stringify/lib/visitors/table.js new file mode 100644 index 0000000..3377150 --- /dev/null +++ b/node_modules/remark-stringify/lib/visitors/table.js @@ -0,0 +1,49 @@ +'use strict' + +var markdownTable = require('markdown-table') + +module.exports = table + +// Stringify table. +// +// Creates a fenced table. +// The table has aligned delimiters by default, but not in +// `tablePipeAlign: false`: +// +// ```markdown +// | Header 1 | Header 2 | +// | :-: | - | +// | Alpha | Bravo | +// ``` +// +// The table is spaced by default, but not in `tableCellPadding: false`: +// +// ```markdown +// |Foo|Bar| +// |:-:|---| +// |Baz|Qux| +// ``` +function table(node) { + var self = this + var options = self.options + var padding = options.tableCellPadding + var alignDelimiters = options.tablePipeAlign + var stringLength = options.stringLength + var rows = node.children + var index = rows.length + var exit = self.enterTable() + var result = [] + + while (index--) { + result[index] = self.all(rows[index]) + } + + exit() + + return markdownTable(result, { + align: node.align, + alignDelimiters: alignDelimiters, + padding: padding, + stringLength: stringLength + }) +} diff --git a/node_modules/remark-stringify/lib/visitors/text.js b/node_modules/remark-stringify/lib/visitors/text.js new file mode 100644 index 0000000..53d0aff --- /dev/null +++ b/node_modules/remark-stringify/lib/visitors/text.js @@ -0,0 +1,19 @@ +'use strict' + +module.exports = text + +// Stringify text. +// Supports named entities in `settings.encode: true` mode: +// +// ```markdown +// AT&T +// ``` +// +// Supports numbered entities in `settings.encode: numbers` mode: +// +// ```markdown +// AT&T +// ``` +function text(node, parent) { + return this.encode(this.escape(node.value, node, parent), node) +} diff --git a/node_modules/remark-stringify/lib/visitors/thematic-break.js b/node_modules/remark-stringify/lib/visitors/thematic-break.js new file mode 100644 index 0000000..4cd249f --- /dev/null +++ b/node_modules/remark-stringify/lib/visitors/thematic-break.js @@ -0,0 +1,31 @@ +'use strict' + +var repeat = require('repeat-string') + +module.exports = thematic + +var space = ' ' + +// Stringify a `thematic-break`. +// The character used is configurable through `rule`: (`'_'`): +// +// ```markdown +// ___ +// ``` +// +// The number of repititions is defined through `ruleRepetition` (`6`): +// +// ```markdown +// ****** +// ``` +// +// Whether spaces delimit each character, is configured through `ruleSpaces` +// (`true`): +// ```markdown +// * * * +// ``` +function thematic() { + var options = this.options + var rule = repeat(options.rule, options.ruleRepetition) + return options.ruleSpaces ? rule.split('').join(space) : rule +} diff --git a/node_modules/remark-stringify/package.json b/node_modules/remark-stringify/package.json new file mode 100644 index 0000000..7c69444 --- /dev/null +++ b/node_modules/remark-stringify/package.json @@ -0,0 +1,101 @@ +{ + "_from": "remark-stringify@^8.0.0", + "_id": "remark-stringify@8.1.0", + "_inBundle": false, + "_integrity": "sha512-FSPZv1ds76oAZjurhhuV5qXSUSoz6QRPuwYK38S41sLHwg4oB7ejnmZshj7qwjgYLf93kdz6BOX9j5aidNE7rA==", + "_location": "/remark-stringify", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "remark-stringify@^8.0.0", + "name": "remark-stringify", + "escapedName": "remark-stringify", + "rawSpec": "^8.0.0", + "saveSpec": null, + "fetchSpec": "^8.0.0" + }, + "_requiredBy": [ + "/slackify-markdown" + ], + "_resolved": "https://registry.npmjs.org/remark-stringify/-/remark-stringify-8.1.0.tgz", + "_shasum": "1e555f4402e445c364fb23d12fc5f5e0337ec8b7", + "_spec": "remark-stringify@^8.0.0", + "_where": "/Users/josh/Projects/slackify-markdown-action/node_modules/slackify-markdown", + "author": { + "name": "Titus Wormer", + "email": "tituswormer@gmail.com", + "url": "https://wooorm.com" + }, + "bugs": { + "url": "https://github.com/remarkjs/remark/issues" + }, + "bundleDependencies": false, + "contributors": [ + { + "name": "Titus Wormer", + "email": "tituswormer@gmail.com", + "url": "https://wooorm.com" + }, + { + "name": "Eugene Sharygin", + "email": "eush77@gmail.com" + } + ], + "dependencies": { + "ccount": "^1.0.0", + "is-alphanumeric": "^1.0.0", + "is-decimal": "^1.0.0", + "is-whitespace-character": "^1.0.0", + "longest-streak": "^2.0.1", + "markdown-escapes": "^1.0.0", + "markdown-table": "^2.0.0", + "mdast-util-compact": "^2.0.0", + "parse-entities": "^2.0.0", + "repeat-string": "^1.5.4", + "state-toggle": "^1.0.0", + "stringify-entities": "^3.0.0", + "unherit": "^1.0.4", + "xtend": "^4.0.1" + }, + "deprecated": false, + "description": "remark plugin to compile Markdown", + "files": [ + "index.js", + "lib", + "types/index.d.ts" + ], + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + }, + "homepage": "https://remark.js.org", + "keywords": [ + "unified", + "remark", + "remark-plugin", + "plugin", + "markdown", + "mdast", + "markdown", + "abstract", + "syntax", + "tree", + "ast", + "stringify", + "serialize", + "compile" + ], + "license": "MIT", + "name": "remark-stringify", + "repository": { + "type": "git", + "url": "https://github.com/remarkjs/remark/tree/master/packages/remark-stringify" + }, + "scripts": { + "test": "tape test.js" + }, + "types": "types/index.d.ts", + "version": "8.1.0", + "xo": false +} diff --git a/node_modules/remark-stringify/readme.md b/node_modules/remark-stringify/readme.md new file mode 100644 index 0000000..dfce310 --- /dev/null +++ b/node_modules/remark-stringify/readme.md @@ -0,0 +1,389 @@ +# remark-stringify + +[![Build][build-badge]][build] +[![Coverage][coverage-badge]][coverage] +[![Downloads][downloads-badge]][downloads] +[![Size][size-badge]][size] +[![Chat][chat-badge]][chat] +[![Sponsors][sponsors-badge]][collective] +[![Backers][backers-badge]][collective] + +[Compiler][] for [**unified**][unified]. +Serializes [**mdast**][mdast] syntax trees to Markdown. +Used in the [**remark** processor][remark] but can be used on its own as well. +Can be [extended][extend] to change how Markdown is serialized. + +## Sponsors + + + + + + + + + + + + + + + +
+ Gatsby
🥇

+ +
+ Vercel
🥇

+ + +
+ Netlify
🥇

+ + +
+ Holloway


+ +
+ ThemeIsle
🥉

+ +
+ BoostIO
🥉

+ +
+



+ You? +
+ +## Install + +[npm][]: + +```sh +npm install remark-stringify +``` + +## Use + +```js +var unified = require('unified') +var createStream = require('unified-stream') +var html = require('rehype-parse') +var rehype2remark = require('rehype-remark') +var stringify = require('remark-stringify') + +var processor = unified() + .use(html) + .use(rehype2remark) + .use(stringify, { + bullet: '*', + fence: '~', + fences: true, + incrementListMarker: false + }) + +process.stdin.pipe(createStream(processor)).pipe(process.stdout) +``` + +[See **unified** for more examples »][unified] + +## Contents + +* [API](#api) + * [`processor().use(stringify[, options])`](#processorusestringify-options) + * [`stringify.Compiler`](#stringifycompiler) +* [Extending the `Compiler`](#extending-the-compiler) + * [`Compiler#visitors`](#compilervisitors) + * [`function visitor(node[, parent])`](#function-visitornode-parent) +* [Security](#security) +* [Contribute](#contribute) +* [License](#license) + +## API + +[See **unified** for API docs »][unified] + +### `processor().use(stringify[, options])` + +Configure the `processor` to serialize [**mdast**][mdast] syntax trees to +Markdown. + +##### `options` + +Options can be passed directly, or passed later through +[`processor.data()`][data]. + +###### `options.gfm` + +Serialize with the required escapes for GFM compatible Markdown (`boolean`, +default: `true`). + +* Escape pipes (`|`, for tables) +* Escape colons (`:`, for literal URLs) +* Escape tildes (`~`, for strike-through) + +###### `options.commonmark` + +Serialize for CommonMark compatible Markdown (`boolean`, default: `false`). + +* Serialize adjacent block quotes separately +* Escape more characters using slashes, instead of as entities + +###### `options.pedantic` + +⚠️ Pedantic was previously used to mimic old-style Markdown mode: no tables, no +fenced code, and with many bugs. +It’s currently still “working”, but please do not use it, it’ll be removed in +the future. + +###### `options.entities` + +How to serialize entities (`string` or `boolean`, default: `false`): + +* `true` — Entities are generated for special HTML characters (`&` > `&`) + and non-ASCII characters (`©` > `©`). + If named entities are not (widely) supported, numbered character references + are used (`’` > `’`) +* `'numbers'` — Numbered entities are generated (`&` > `&`) for special + HTML characters and non-ASCII characters +* `'escape'` — Special HTML characters are encoded (`&` > `&`, `’` > + `’`), non-ASCII characters not (ö persists) + +###### `options.setext` + +Serialize headings, when possible, in Setext-style (`boolean`, default: `false`). +Uses `=` for level one headings and `-` for level two headings. +Other heading levels are serialized as ATX (respecting `closeAtx`). + +###### `options.closeAtx` + +Serialize ATX headings with the same amount of closing hashes as opening hashes +(`boolean`, default: `false`). + +###### `options.tableCellPadding` + +Create tables with a space between cell delimiters (`|`) and content (`boolean`, +default: `true`). + +###### `options.tablePipeAlign` + +Align the delimiters (`|`) between table cells so that they all align nicely and +form a grid (`boolean`, default: `true`). + +###### `options.stringLength` + +Function passed to [`markdown-table`][markdown-table] to detect the length of a +table cell (`Function`, default: [`s => s.length`][string-length]). +Used to pad tables. + +###### `options.fence` + +Marker to use for fenced code blocks (`'~'` or ``'`'``, default: ``'`'``). + +###### `options.fences` + +Create code blocks with a fence instead of indentation if they have no info +string (`boolean`, default: `false`). + +When `false`, code blocks are indented. +Code blocks with an info string are always fenced. + +###### `options.bullet` + +Marker to use for the bullet of unordered list items (`'-'`, `'*'`, or `'+'`, +default: `'-'`). + +###### `options.listItemIndent` + +Style of indentation for list items (`'tab'`, `'mixed'` or `'1'`, default: +`'tab'`). + +* `'tab'`: use a tab stops (4 spaces) +* `'1'`: use one space +* `'mixed'`: use `1` for tight and `tab` for loose list items + +###### `options.incrementListMarker` + +Increment ordered list item numbers (`boolean`, default: `true`). + +When `false`, all list item numbers will be the same. + +###### `options.tightDefinitions` + +Separate definitions with a single line feed (`boolean`, default: `false`). + +When `false`, definitions will have blank lines between them, similar to other +blocks. + +###### `options.rule` + +Marker to use for thematic breaks / horizontal rules (`'-'`, `'*'`, or `'_'`, +default: `'*'`). + +###### `options.ruleRepetition` + +Number of markers to use for thematic breaks / horizontal rules (`number`, +default: `3`). +Musts be `3` or more. + +###### `options.ruleSpaces` + +Place a space between thematic break (horizontal rule) markers (`boolean`, +default `true`). + +###### `options.strong` + +Marker to use for importance (`'_'` or `'*'`, default `'*'`). + +###### `options.emphasis` + +Marker to use for emphasis (`'_'` or `'*'`, default `'_'`). + +### `stringify.Compiler` + +Access to the [compiler][], if you need it. + +## Extending the `Compiler` + +If the `remark-stringify` plugin is used, it adds a [`Compiler`][compiler] +constructor function to the `processor`. +Other plugins can add visitors to its prototype to change how Markdown is +serialized. + +The below plugin modifies a [visitor][] to add an extra blank line before +headings with a rank of `2`. + +```js +module.exports = gap + +function gap() { + var Compiler = this.Compiler + var visitors = Compiler.prototype.visitors + var original = visitors.heading + + visitors.heading = heading + + function heading(node) { + return (node.depth === 2 ? '\n' : '') + original.apply(this, arguments) + } +} +``` + +### `Compiler#visitors` + +Map of types to [visitor][]s (`Object.`). + +### `function visitor(node[, parent])` + +Serialize `node`. + +###### Parameters + +* `node` ([`Node`][node]) — Node to compile +* `parent` ([`Parent`][parent], optional) — Parent of `node`. + Not available on the root node + +###### Returns + +`string` — Serialized given `node`. + +## Security + +As Markdown is sometimes used for HTML, and improper use of HTML can open you up +to a [cross-site scripting (XSS)][xss] attack, use of remark can also be unsafe. +When going to HTML, use remark in combination with the [**rehype**][rehype] +ecosystem, and use [`rehype-sanitize`][sanitize] to make the tree safe. + +Use of remark plugins could also open you up to other attacks. +Carefully assess each plugin and the risks involved in using them. + +## Contribute + +See [`contributing.md`][contributing] in [`remarkjs/.github`][health] for ways +to get started. +See [`support.md`][support] for ways to get help. +Ideas for new plugins and tools can be posted in [`remarkjs/ideas`][ideas]. + +A curated list of awesome remark resources can be found in [**awesome +remark**][awesome]. + +This project has a [code of conduct][coc]. +By interacting with this repository, organization, or community you agree to +abide by its terms. + +## License + +[MIT][license] © [Titus Wormer][author] + + + +[build-badge]: https://img.shields.io/travis/remarkjs/remark.svg + +[build]: https://travis-ci.org/remarkjs/remark + +[coverage-badge]: https://img.shields.io/codecov/c/github/remarkjs/remark.svg + +[coverage]: https://codecov.io/github/remarkjs/remark + +[downloads-badge]: https://img.shields.io/npm/dm/remark-stringify.svg + +[downloads]: https://www.npmjs.com/package/remark-stringify + +[size-badge]: https://img.shields.io/bundlephobia/minzip/remark-stringify.svg + +[size]: https://bundlephobia.com/result?p=remark-stringify + +[sponsors-badge]: https://opencollective.com/unified/sponsors/badge.svg + +[backers-badge]: https://opencollective.com/unified/backers/badge.svg + +[collective]: https://opencollective.com/unified + +[chat-badge]: https://img.shields.io/badge/chat-spectrum-7b16ff.svg + +[chat]: https://spectrum.chat/unified/remark + +[health]: https://github.com/remarkjs/.github + +[contributing]: https://github.com/remarkjs/.github/blob/master/contributing.md + +[support]: https://github.com/remarkjs/.github/blob/master/support.md + +[coc]: https://github.com/remarkjs/.github/blob/master/code-of-conduct.md + +[ideas]: https://github.com/remarkjs/ideas + +[awesome]: https://github.com/remarkjs/awesome-remark + +[license]: https://github.com/remarkjs/remark/blob/master/license + +[author]: https://wooorm.com + +[npm]: https://docs.npmjs.com/cli/install + +[unified]: https://github.com/unifiedjs/unified + +[data]: https://github.com/unifiedjs/unified#processordatakey-value + +[remark]: https://github.com/remarkjs/remark/tree/master/packages/remark + +[compiler]: https://github.com/unifiedjs/unified#processorcompiler + +[mdast]: https://github.com/syntax-tree/mdast + +[node]: https://github.com/syntax-tree/unist#node + +[parent]: https://github.com/syntax-tree/unist#parent + +[extend]: #extending-the-compiler + +[visitor]: #function-visitornode-parent + +[markdown-table]: https://github.com/wooorm/markdown-table + +[string-length]: https://github.com/wooorm/markdown-table#stringlengthcell + +[xss]: https://en.wikipedia.org/wiki/Cross-site_scripting + +[rehype]: https://github.com/rehypejs/rehype + +[sanitize]: https://github.com/rehypejs/rehype-sanitize diff --git a/node_modules/remark-stringify/types/index.d.ts b/node_modules/remark-stringify/types/index.d.ts new file mode 100644 index 0000000..6cadfa8 --- /dev/null +++ b/node_modules/remark-stringify/types/index.d.ts @@ -0,0 +1,50 @@ +// TypeScript Version: 3.0 + +import {Compiler, Processor, Plugin} from 'unified' +import {Node, Parent} from 'unist' + +declare class RemarkCompiler implements Compiler { + compile(): string + visitors: { + [key: string]: remarkStringify.Visitor + } +} + +declare namespace remarkStringify { + interface Stringify extends Plugin<[PartialRemarkStringifyOptions?]> { + Compiler: typeof RemarkCompiler + (this: Processor, options?: PartialRemarkStringifyOptions): void + } + + type Compiler = RemarkCompiler + + interface RemarkStringifyOptions { + gfm: boolean + commonmark: boolean + entities: boolean | 'numbers' | 'escape' + setext: boolean + closeAtx: boolean + tableCellPadding: boolean + tablePipeAlign: boolean + stringLength: (s: string) => number + fence: '~' | '`' + fences: boolean + bullet: '-' | '*' | '+' + listItemIndent: 'tab' | '1' | 'mixed' + incrementListMarker: boolean + tightDefinitions: boolean + rule: '-' | '_' | '*' + ruleRepetition: number + ruleSpaces: boolean + strong: '_' | '*' + emphasis: '_' | '*' + } + + type PartialRemarkStringifyOptions = Partial + + type Visitor = (node: Node, parent?: Parent) => string +} + +declare const remarkStringify: remarkStringify.Stringify + +export = remarkStringify diff --git a/node_modules/repeat-string/LICENSE b/node_modules/repeat-string/LICENSE new file mode 100644 index 0000000..39245ac --- /dev/null +++ b/node_modules/repeat-string/LICENSE @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) 2014-2016, Jon Schlinkert. + +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: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +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. diff --git a/node_modules/repeat-string/README.md b/node_modules/repeat-string/README.md new file mode 100644 index 0000000..aaa5e91 --- /dev/null +++ b/node_modules/repeat-string/README.md @@ -0,0 +1,136 @@ +# repeat-string [![NPM version](https://img.shields.io/npm/v/repeat-string.svg?style=flat)](https://www.npmjs.com/package/repeat-string) [![NPM monthly downloads](https://img.shields.io/npm/dm/repeat-string.svg?style=flat)](https://npmjs.org/package/repeat-string) [![NPM total downloads](https://img.shields.io/npm/dt/repeat-string.svg?style=flat)](https://npmjs.org/package/repeat-string) [![Linux Build Status](https://img.shields.io/travis/jonschlinkert/repeat-string.svg?style=flat&label=Travis)](https://travis-ci.org/jonschlinkert/repeat-string) + +> Repeat the given string n times. Fastest implementation for repeating a string. + +## Install + +Install with [npm](https://www.npmjs.com/): + +```sh +$ npm install --save repeat-string +``` + +## Usage + +### [repeat](index.js#L41) + +Repeat the given `string` the specified `number` of times. + +**Example:** + +**Example** + +```js +var repeat = require('repeat-string'); +repeat('A', 5); +//=> AAAAA +``` + +**Params** + +* `string` **{String}**: The string to repeat +* `number` **{Number}**: The number of times to repeat the string +* `returns` **{String}**: Repeated string + +## Benchmarks + +Repeat string is significantly faster than the native method (which is itself faster than [repeating](https://github.com/sindresorhus/repeating)): + +```sh +# 2x +repeat-string █████████████████████████ (26,953,977 ops/sec) +repeating █████████ (9,855,695 ops/sec) +native ██████████████████ (19,453,895 ops/sec) + +# 3x +repeat-string █████████████████████████ (19,445,252 ops/sec) +repeating ███████████ (8,661,565 ops/sec) +native ████████████████████ (16,020,598 ops/sec) + +# 10x +repeat-string █████████████████████████ (23,792,521 ops/sec) +repeating █████████ (8,571,332 ops/sec) +native ███████████████ (14,582,955 ops/sec) + +# 50x +repeat-string █████████████████████████ (23,640,179 ops/sec) +repeating █████ (5,505,509 ops/sec) +native ██████████ (10,085,557 ops/sec) + +# 250x +repeat-string █████████████████████████ (23,489,618 ops/sec) +repeating ████ (3,962,937 ops/sec) +native ████████ (7,724,892 ops/sec) + +# 2000x +repeat-string █████████████████████████ (20,315,172 ops/sec) +repeating ████ (3,297,079 ops/sec) +native ███████ (6,203,331 ops/sec) + +# 20000x +repeat-string █████████████████████████ (23,382,915 ops/sec) +repeating ███ (2,980,058 ops/sec) +native █████ (5,578,808 ops/sec) +``` + +**Run the benchmarks** + +Install dev dependencies: + +```sh +npm i -d && node benchmark +``` + +## About + +### Related projects + +[repeat-element](https://www.npmjs.com/package/repeat-element): Create an array by repeating the given value n times. | [homepage](https://github.com/jonschlinkert/repeat-element "Create an array by repeating the given value n times.") + +### Contributing + +Pull requests and stars are always welcome. For bugs and feature requests, [please create an issue](../../issues/new). + +### Contributors + +| **Commits** | **Contributor**
| +| --- | --- | +| 51 | [jonschlinkert](https://github.com/jonschlinkert) | +| 2 | [LinusU](https://github.com/LinusU) | +| 2 | [tbusser](https://github.com/tbusser) | +| 1 | [doowb](https://github.com/doowb) | +| 1 | [wooorm](https://github.com/wooorm) | + +### Building docs + +_(This document was generated by [verb-generate-readme](https://github.com/verbose/verb-generate-readme) (a [verb](https://github.com/verbose/verb) generator), please don't edit the readme directly. Any changes to the readme must be made in [.verb.md](.verb.md).)_ + +To generate the readme and API documentation with [verb](https://github.com/verbose/verb): + +```sh +$ npm install -g verb verb-generate-readme && verb +``` + +### Running tests + +Install dev dependencies: + +```sh +$ npm install -d && npm test +``` + +### Author + +**Jon Schlinkert** + +* [github/jonschlinkert](https://github.com/jonschlinkert) +* [twitter/jonschlinkert](http://twitter.com/jonschlinkert) + +### License + +Copyright © 2016, [Jon Schlinkert](http://github.com/jonschlinkert). +Released under the [MIT license](https://github.com/jonschlinkert/repeat-string/blob/master/LICENSE). + +*** + +_This file was generated by [verb-generate-readme](https://github.com/verbose/verb-generate-readme), v0.2.0, on October 23, 2016._ \ No newline at end of file diff --git a/node_modules/repeat-string/index.js b/node_modules/repeat-string/index.js new file mode 100644 index 0000000..4459afd --- /dev/null +++ b/node_modules/repeat-string/index.js @@ -0,0 +1,70 @@ +/*! + * repeat-string + * + * Copyright (c) 2014-2015, Jon Schlinkert. + * Licensed under the MIT License. + */ + +'use strict'; + +/** + * Results cache + */ + +var res = ''; +var cache; + +/** + * Expose `repeat` + */ + +module.exports = repeat; + +/** + * Repeat the given `string` the specified `number` + * of times. + * + * **Example:** + * + * ```js + * var repeat = require('repeat-string'); + * repeat('A', 5); + * //=> AAAAA + * ``` + * + * @param {String} `string` The string to repeat + * @param {Number} `number` The number of times to repeat the string + * @return {String} Repeated string + * @api public + */ + +function repeat(str, num) { + if (typeof str !== 'string') { + throw new TypeError('expected a string'); + } + + // cover common, quick use cases + if (num === 1) return str; + if (num === 2) return str + str; + + var max = str.length * num; + if (cache !== str || typeof cache === 'undefined') { + cache = str; + res = ''; + } else if (res.length >= max) { + return res.substr(0, max); + } + + while (max > res.length && num > 1) { + if (num & 1) { + res += str; + } + + num >>= 1; + str += str; + } + + res += str; + res = res.substr(0, max); + return res; +} diff --git a/node_modules/repeat-string/package.json b/node_modules/repeat-string/package.json new file mode 100644 index 0000000..07a60a8 --- /dev/null +++ b/node_modules/repeat-string/package.json @@ -0,0 +1,130 @@ +{ + "_from": "repeat-string@^1.5.4", + "_id": "repeat-string@1.6.1", + "_inBundle": false, + "_integrity": "sha1-jcrkcOHIirwtYA//Sndihtp15jc=", + "_location": "/repeat-string", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "repeat-string@^1.5.4", + "name": "repeat-string", + "escapedName": "repeat-string", + "rawSpec": "^1.5.4", + "saveSpec": null, + "fetchSpec": "^1.5.4" + }, + "_requiredBy": [ + "/markdown-table", + "/remark-parse", + "/remark-stringify" + ], + "_resolved": "https://registry.npmjs.org/repeat-string/-/repeat-string-1.6.1.tgz", + "_shasum": "8dcae470e1c88abc2d600fff4a776286da75e637", + "_spec": "repeat-string@^1.5.4", + "_where": "/Users/josh/Projects/slackify-markdown-action/node_modules/remark-parse", + "author": { + "name": "Jon Schlinkert", + "url": "http://github.com/jonschlinkert" + }, + "bugs": { + "url": "https://github.com/jonschlinkert/repeat-string/issues" + }, + "bundleDependencies": false, + "contributors": [ + { + "name": "Brian Woodward", + "email": "brian.woodward@gmail.com", + "url": "https://github.com/doowb" + }, + { + "name": "Jon Schlinkert", + "email": "jon.schlinkert@sellside.com", + "url": "http://twitter.com/jonschlinkert" + }, + { + "name": "Linus Unnebäck", + "email": "linus@folkdatorn.se", + "url": "http://linus.unnebäck.se" + }, + { + "name": "Thijs Busser", + "email": "tbusser@gmail.com", + "url": "http://tbusser.net" + }, + { + "name": "Titus", + "email": "tituswormer@gmail.com", + "url": "wooorm.com" + } + ], + "deprecated": false, + "description": "Repeat the given string n times. Fastest implementation for repeating a string.", + "devDependencies": { + "ansi-cyan": "^0.1.1", + "benchmarked": "^0.2.5", + "gulp-format-md": "^0.1.11", + "isobject": "^2.1.0", + "mocha": "^3.1.2", + "repeating": "^3.0.0", + "text-table": "^0.2.0", + "yargs-parser": "^4.0.2" + }, + "engines": { + "node": ">=0.10" + }, + "files": [ + "index.js" + ], + "homepage": "https://github.com/jonschlinkert/repeat-string", + "keywords": [ + "fast", + "fastest", + "fill", + "left", + "left-pad", + "multiple", + "pad", + "padding", + "repeat", + "repeating", + "repetition", + "right", + "right-pad", + "string", + "times" + ], + "license": "MIT", + "main": "index.js", + "name": "repeat-string", + "repository": { + "type": "git", + "url": "git+https://github.com/jonschlinkert/repeat-string.git" + }, + "scripts": { + "test": "mocha" + }, + "verb": { + "toc": false, + "layout": "default", + "tasks": [ + "readme" + ], + "plugins": [ + "gulp-format-md" + ], + "related": { + "list": [ + "repeat-element" + ] + }, + "helpers": [ + "./benchmark/helper.js" + ], + "reflinks": [ + "verb" + ] + }, + "version": "1.6.1" +} diff --git a/node_modules/replace-ext/LICENSE b/node_modules/replace-ext/LICENSE new file mode 100755 index 0000000..fd38d69 --- /dev/null +++ b/node_modules/replace-ext/LICENSE @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) 2014 Blaine Bublitz , Eric Schoffstall and other contributors + +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: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +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. diff --git a/node_modules/replace-ext/README.md b/node_modules/replace-ext/README.md new file mode 100644 index 0000000..8775983 --- /dev/null +++ b/node_modules/replace-ext/README.md @@ -0,0 +1,50 @@ +

+ + + +

+ +# replace-ext + +[![NPM version][npm-image]][npm-url] [![Downloads][downloads-image]][npm-url] [![Build Status][travis-image]][travis-url] [![AppVeyor Build Status][appveyor-image]][appveyor-url] [![Coveralls Status][coveralls-image]][coveralls-url] [![Gitter chat][gitter-image]][gitter-url] + +Replaces a file extension with another one. + +## Usage + +```js +var replaceExt = require('replace-ext'); + +var path = '/some/dir/file.js'; +var newPath = replaceExt(path, '.coffee'); + +console.log(newPath); // /some/dir/file.coffee +``` + +## API + +### `replaceExt(path, extension)` + +Replaces the extension from `path` with `extension` and returns the updated path string. + +Does not replace the extension if `path` is not a string or is empty. + +## License + +MIT + +[downloads-image]: http://img.shields.io/npm/dm/replace-ext.svg +[npm-url]: https://www.npmjs.com/package/replace-ext +[npm-image]: http://img.shields.io/npm/v/replace-ext.svg + +[travis-url]: https://travis-ci.org/gulpjs/replace-ext +[travis-image]: http://img.shields.io/travis/gulpjs/replace-ext.svg?label=travis-ci + +[appveyor-url]: https://ci.appveyor.com/project/gulpjs/replace-ext +[appveyor-image]: https://img.shields.io/appveyor/ci/gulpjs/replace-ext.svg?label=appveyor + +[coveralls-url]: https://coveralls.io/r/gulpjs/replace-ext +[coveralls-image]: http://img.shields.io/coveralls/gulpjs/replace-ext/master.svg + +[gitter-url]: https://gitter.im/gulpjs/gulp +[gitter-image]: https://badges.gitter.im/gulpjs/gulp.svg diff --git a/node_modules/replace-ext/index.js b/node_modules/replace-ext/index.js new file mode 100644 index 0000000..7cb7789 --- /dev/null +++ b/node_modules/replace-ext/index.js @@ -0,0 +1,18 @@ +'use strict'; + +var path = require('path'); + +function replaceExt(npath, ext) { + if (typeof npath !== 'string') { + return npath; + } + + if (npath.length === 0) { + return npath; + } + + var nFileName = path.basename(npath, path.extname(npath)) + ext; + return path.join(path.dirname(npath), nFileName); +} + +module.exports = replaceExt; diff --git a/node_modules/replace-ext/package.json b/node_modules/replace-ext/package.json new file mode 100644 index 0000000..1e9093b --- /dev/null +++ b/node_modules/replace-ext/package.json @@ -0,0 +1,86 @@ +{ + "_from": "replace-ext@1.0.0", + "_id": "replace-ext@1.0.0", + "_inBundle": false, + "_integrity": "sha1-3mMSg3P8v3w8z6TeWkgMRaZ5WOs=", + "_location": "/replace-ext", + "_phantomChildren": {}, + "_requested": { + "type": "version", + "registry": true, + "raw": "replace-ext@1.0.0", + "name": "replace-ext", + "escapedName": "replace-ext", + "rawSpec": "1.0.0", + "saveSpec": null, + "fetchSpec": "1.0.0" + }, + "_requiredBy": [ + "/vfile" + ], + "_resolved": "https://registry.npmjs.org/replace-ext/-/replace-ext-1.0.0.tgz", + "_shasum": "de63128373fcbf7c3ccfa4de5a480c45a67958eb", + "_spec": "replace-ext@1.0.0", + "_where": "/Users/josh/Projects/slackify-markdown-action/node_modules/vfile", + "author": { + "name": "Gulp Team", + "email": "team@gulpjs.com", + "url": "http://gulpjs.com/" + }, + "bugs": { + "url": "https://github.com/gulpjs/replace-ext/issues" + }, + "bundleDependencies": false, + "contributors": [ + { + "name": "Eric Schoffstall", + "email": "yo@contra.io" + }, + { + "name": "Blaine Bublitz", + "email": "blaine.bublitz@gmail.com" + } + ], + "dependencies": {}, + "deprecated": false, + "description": "Replaces a file extension with another one", + "devDependencies": { + "eslint": "^1.10.3", + "eslint-config-gulp": "^2.0.0", + "expect": "^1.16.0", + "istanbul": "^0.4.3", + "istanbul-coveralls": "^1.0.3", + "jscs": "^2.3.5", + "jscs-preset-gulp": "^1.0.0", + "mocha": "^2.4.5" + }, + "engines": { + "node": ">= 0.10" + }, + "files": [ + "LICENSE", + "index.js" + ], + "homepage": "https://github.com/gulpjs/replace-ext#readme", + "keywords": [ + "gulp", + "extensions", + "filepath", + "basename" + ], + "license": "MIT", + "main": "index.js", + "name": "replace-ext", + "repository": { + "type": "git", + "url": "git+https://github.com/gulpjs/replace-ext.git" + }, + "scripts": { + "cover": "istanbul cover node_modules/mocha/bin/_mocha --report lcovonly", + "coveralls": "npm run cover && istanbul-coveralls", + "lint": "eslint . && jscs index.js test/", + "pretest": "npm run lint", + "test": "mocha --async-only" + }, + "version": "1.0.0" +} diff --git a/node_modules/slackify-markdown/LICENSE b/node_modules/slackify-markdown/LICENSE new file mode 100644 index 0000000..625e363 --- /dev/null +++ b/node_modules/slackify-markdown/LICENSE @@ -0,0 +1,22 @@ +Copyright (c) 2018 Yevhenii Baraniuk + +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: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +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. \ No newline at end of file diff --git a/node_modules/slackify-markdown/README.md b/node_modules/slackify-markdown/README.md new file mode 100644 index 0000000..6319ee8 --- /dev/null +++ b/node_modules/slackify-markdown/README.md @@ -0,0 +1,53 @@ +# Slackify-Markdown + +[![Build Status](https://travis-ci.org/jsarafajr/slackify-markdown.svg?branch=master)](https://travis-ci.org/jsarafajr/slackify-markdown) +[![codecov](https://codecov.io/gh/jsarafajr/slackify-markdown/branch/master/graph/badge.svg)](https://codecov.io/gh/jsarafajr/slackify-markdown) [![Known Vulnerabilities](https://snyk.io/test/github/jsarafajr/slackify-markdown/badge.svg)](https://snyk.io/test/github/jsarafajr/slackify-markdown) + + +Slackify-Markdown is a Markdown to [Slack-specific-markdown](https://api.slack.com/docs/message-formatting#message_formatting) converter, based on [Unified](https://github.com/unifiedjs/unified) and [Remark](https://github.com/remarkjs/remark/). + +## Install + +```bash +npm install slackify-markdown +``` + +## Usage + +```js +const slackifyMarkdown = require('slackify-markdown'); +const markdown = ` +# List of items + +* item 1 +* item 2 +* item 3 + +[here is an example](https://example.com) +`; + +slackifyMarkdown(markdown); +/* + *List of items* + + • item 1 + • item 2 + • item 3 + + +/* +``` + +### NodeJS version < 10 + +Use slackify-markdown v2 if you use nodejs version 9 and lower. + +```bash +npm install slackify-markdown@2 +``` + +### Copyright and License + +Copyright Yevhenii Baraniuk, 2019 + +[MIT Licence](LICENSE) diff --git a/node_modules/slackify-markdown/index.d.ts b/node_modules/slackify-markdown/index.d.ts new file mode 100644 index 0000000..1f54293 --- /dev/null +++ b/node_modules/slackify-markdown/index.d.ts @@ -0,0 +1,4 @@ +declare module "slackify-markdown" { + function slackify(markdown: string): string; + export default slackify; +} \ No newline at end of file diff --git a/node_modules/slackify-markdown/index.js b/node_modules/slackify-markdown/index.js new file mode 100644 index 0000000..f472c54 --- /dev/null +++ b/node_modules/slackify-markdown/index.js @@ -0,0 +1 @@ +module.exports = require('./src/index'); diff --git a/node_modules/slackify-markdown/package.json b/node_modules/slackify-markdown/package.json new file mode 100644 index 0000000..e427a50 --- /dev/null +++ b/node_modules/slackify-markdown/package.json @@ -0,0 +1,80 @@ +{ + "_from": "slackify-markdown@^3.0.3", + "_id": "slackify-markdown@3.0.3", + "_inBundle": false, + "_integrity": "sha512-XRXmbeOizWBpECWXy0gOBdc3+9GdSw0JImW1p1QXNwAnkcuNGMwt3os4fOxq/OVGevIK0phMthSai39bKcV+HQ==", + "_location": "/slackify-markdown", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "slackify-markdown@^3.0.3", + "name": "slackify-markdown", + "escapedName": "slackify-markdown", + "rawSpec": "^3.0.3", + "saveSpec": null, + "fetchSpec": "^3.0.3" + }, + "_requiredBy": [ + "/" + ], + "_resolved": "https://registry.npmjs.org/slackify-markdown/-/slackify-markdown-3.0.3.tgz", + "_shasum": "277056dead143f785e4f0421bb2e1d2400308484", + "_spec": "slackify-markdown@^3.0.3", + "_where": "/Users/josh/Projects/slackify-markdown-action", + "author": { + "name": "Yevhenii Baraniuk", + "url": "https://github.com/jsarafajr" + }, + "bugs": { + "url": "https://github.com/jsarafajr/slackify-markdown/issues" + }, + "bundleDependencies": false, + "dependencies": { + "remark-parse": "^8.0.2", + "remark-stringify": "^8.0.0", + "unified": "^9.0.0" + }, + "deprecated": false, + "description": "Convert markdown into Slack-specific markdown", + "devDependencies": { + "codecov": "^3.7.0", + "eslint": "^7.2.0", + "eslint-config-airbnb-base": "^14.1.0", + "eslint-plugin-import": "^2.20.2", + "jest": "^26.0.1" + }, + "files": [ + "README.md", + "src/*", + "index.js", + "index.d.ts", + "LICENSE" + ], + "homepage": "https://github.com/jsarafajr/slackify-markdown#readme", + "jest": { + "testURL": "http://localhost/" + }, + "keywords": [ + "slack", + "markdown", + "slackify", + "parser", + "remark", + "unified" + ], + "license": "MIT", + "main": "index.js", + "name": "slackify-markdown", + "repository": { + "type": "git", + "url": "git://github.com/jsarafajr/slackify-markdown.git" + }, + "scripts": { + "lint": "eslint .", + "test": "jest", + "test:coverage": "jest --coverage" + }, + "types": "index.d.ts", + "version": "3.0.3" +} diff --git a/node_modules/slackify-markdown/src/index.js b/node_modules/slackify-markdown/src/index.js new file mode 100644 index 0000000..01a31d5 --- /dev/null +++ b/node_modules/slackify-markdown/src/index.js @@ -0,0 +1,9 @@ +const unified = require('unified'); +const parse = require('remark-parse'); +const slackify = require('./slackify'); + +module.exports = (markdown, options) => unified() + .use(parse, options) + .use(slackify) + .processSync(markdown) + .toString(); diff --git a/node_modules/slackify-markdown/src/slackify.js b/node_modules/slackify-markdown/src/slackify.js new file mode 100644 index 0000000..31d77b8 --- /dev/null +++ b/node_modules/slackify-markdown/src/slackify.js @@ -0,0 +1,80 @@ +const { Compiler } = require('remark-stringify'); +const { wrap, isURL } = require('./utils'); + +// fixes slack in-word formatting (e.g. hel*l*o) +const zeroWidthSpace = String.fromCharCode(0x200B); + +const visitors = { + heading(node) { + // make headers to be just *strong* + return wrap(this.content(node), '*'); + }, + + strong(node) { + return wrap(this.content(node), zeroWidthSpace, '*'); + }, + + delete(node) { + return wrap(this.content(node), zeroWidthSpace, '~'); + }, + + emphasis(node) { + return wrap(this.content(node), zeroWidthSpace, '_'); + }, + + list(node) { + const listItem = this.visitors.listItem.bind(this); + + return node.children.map((child, index) => { + const bullet = node.ordered + ? `${node.start + index}.` + : '•'; + return listItem(child, node, index, bullet); + }).join('\n'); + }, + + code(node) { + // delete language prefix for deprecated markdown formatters (old Bitbucket Editor) + const content = node.value.replace(/^#![a-z]+\n/, ''); // ```\n#!javascript\ncode block\n``` + return wrap(content, '```', '\n'); + }, + + link(node) { + const text = node.title || this.content(node); + return this.visitors.url.call(this, node, text); + }, + + image(node) { + const text = node.title || node.alt; + return this.visitors.url.call(this, node, text); + }, + + url(node, text) { + const url = this.encode(node.url || '', node); + if (!isURL(url)) return url; + return text ? `<${url}|${text}>` : `<${url}>`; + }, +}; + +class SlackCompiler extends Compiler { + constructor(...args) { + super(...args); + this.visitors = Object.assign(this.visitors, visitors); + this.escape = this.slackEscape.bind(this); + } + + slackEscape(value, node, parent) { + return value + .replace(/&/g, '&') + .replace(//g, '>'); + } + + content(node) { + return this.all(node).join(''); + } +} + +module.exports = function slackify() { + this.Compiler = SlackCompiler; +}; diff --git a/node_modules/slackify-markdown/src/utils.js b/node_modules/slackify-markdown/src/utils.js new file mode 100644 index 0000000..ab0894b --- /dev/null +++ b/node_modules/slackify-markdown/src/utils.js @@ -0,0 +1,19 @@ +const { URL } = require('url'); + +module.exports = { + wrap(string, ...wrappers) { + return [ + ...wrappers, + string, + ...wrappers.reverse(), + ].join(''); + }, + + isURL(string) { + try { + return Boolean(new URL(string)); + } catch (error) { + return false; + } + }, +}; diff --git a/node_modules/state-toggle/index.js b/node_modules/state-toggle/index.js new file mode 100644 index 0000000..aceee00 --- /dev/null +++ b/node_modules/state-toggle/index.js @@ -0,0 +1,23 @@ +'use strict' + +module.exports = factory + +// Construct a state `toggler`: a function which inverses `property` in context +// based on its current value. +// The by `toggler` returned function restores that value. +function factory(key, state, ctx) { + return enter + + function enter() { + var context = ctx || this + var current = context[key] + + context[key] = !state + + return exit + + function exit() { + context[key] = current + } + } +} diff --git a/node_modules/state-toggle/license b/node_modules/state-toggle/license new file mode 100644 index 0000000..8d8660d --- /dev/null +++ b/node_modules/state-toggle/license @@ -0,0 +1,22 @@ +(The MIT License) + +Copyright (c) 2016 Titus Wormer + +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: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +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. diff --git a/node_modules/state-toggle/package.json b/node_modules/state-toggle/package.json new file mode 100644 index 0000000..6933bdf --- /dev/null +++ b/node_modules/state-toggle/package.json @@ -0,0 +1,110 @@ +{ + "_from": "state-toggle@^1.0.0", + "_id": "state-toggle@1.0.3", + "_inBundle": false, + "_integrity": "sha512-d/5Z4/2iiCnHw6Xzghyhb+GcmF89bxwgXG60wjIiZaxnymbyOmI8Hk4VqHXiVVp6u2ysaskFfXg3ekCj4WNftQ==", + "_location": "/state-toggle", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "state-toggle@^1.0.0", + "name": "state-toggle", + "escapedName": "state-toggle", + "rawSpec": "^1.0.0", + "saveSpec": null, + "fetchSpec": "^1.0.0" + }, + "_requiredBy": [ + "/remark-parse", + "/remark-stringify" + ], + "_resolved": "https://registry.npmjs.org/state-toggle/-/state-toggle-1.0.3.tgz", + "_shasum": "e123b16a88e143139b09c6852221bc9815917dfe", + "_spec": "state-toggle@^1.0.0", + "_where": "/Users/josh/Projects/slackify-markdown-action/node_modules/remark-parse", + "author": { + "name": "Titus Wormer", + "email": "tituswormer@gmail.com", + "url": "https://wooorm.com" + }, + "bugs": { + "url": "https://github.com/wooorm/state-toggle/issues" + }, + "bundleDependencies": false, + "contributors": [ + { + "name": "Titus Wormer", + "email": "tituswormer@gmail.com", + "url": "https://wooorm.com" + } + ], + "dependencies": {}, + "deprecated": false, + "description": "Enter/exit a state", + "devDependencies": { + "browserify": "^16.0.0", + "nyc": "^15.0.0", + "prettier": "^1.0.0", + "remark-cli": "^7.0.0", + "remark-preset-wooorm": "^6.0.0", + "tape": "^4.0.0", + "tinyify": "^2.0.0", + "xo": "^0.25.0" + }, + "files": [ + "index.js" + ], + "funding": { + "type": "github", + "url": "https://github.com/sponsors/wooorm" + }, + "homepage": "https://github.com/wooorm/state-toggle#readme", + "keywords": [ + "enter", + "exit", + "state" + ], + "license": "MIT", + "name": "state-toggle", + "nyc": { + "check-coverage": true, + "lines": 100, + "functions": 100, + "branches": 100 + }, + "prettier": { + "tabWidth": 2, + "useTabs": false, + "singleQuote": true, + "bracketSpacing": false, + "semi": false, + "trailingComma": "none" + }, + "remarkConfig": { + "plugins": [ + "preset-wooorm" + ] + }, + "repository": { + "type": "git", + "url": "git+https://github.com/wooorm/state-toggle.git" + }, + "scripts": { + "build": "npm run build-bundle && npm run build-mangle", + "build-bundle": "browserify . -s stateToggle -o state-toggle.js", + "build-mangle": "browserify . -s stateToggle -p tinyify -o state-toggle.min.js", + "format": "remark . -qfo && prettier --write \"**/*.js\" && xo --fix", + "test": "npm run format && npm run build && npm run test-coverage", + "test-api": "node test", + "test-coverage": "nyc --reporter lcov tape test.js" + }, + "version": "1.0.3", + "xo": { + "prettier": true, + "esnext": false, + "ignores": [ + "state-toggle.js" + ] + } +} diff --git a/node_modules/state-toggle/readme.md b/node_modules/state-toggle/readme.md new file mode 100644 index 0000000..9fcca1e --- /dev/null +++ b/node_modules/state-toggle/readme.md @@ -0,0 +1,95 @@ +# state-toggle + +[![Build][build-badge]][build] +[![Coverage][coverage-badge]][coverage] +[![Downloads][downloads-badge]][downloads] +[![Size][size-badge]][size] + +Enter/exit a state. + +## Install + +[npm][]: + +```sh +npm install state-toggle +``` + +## Use + +```js +var toggle = require('state-toggle') + +var ctx = {on: false} +var enter = toggle('on', ctx.on, ctx) +var exit + +// Entering: +exit = enter() +console.log(ctx.on) // => true + +// Exiting: +exit() +console.log(ctx.on) // => false +``` + +## API + +### `toggle(key, initial[, ctx])` + +Create a toggle, which when entering toggles `key` on `ctx` (or `this`, if `ctx` +is not given) to `!initial`, and when exiting, sets `key` on the context back to +the value it had before entering. + +###### Returns + +`Function` — [`enter`][enter]. + +### `enter()` + +Enter the state. + +###### Context + +If no `ctx` was given to `toggle`, the context object (`this`) of `enter()` is +used to toggle. + +###### Returns + +`Function` — [`exit`][exit]. + +### `exit()` + +Exit the state, reverting `key` to the value it had before entering. + +## License + +[MIT][license] © [Titus Wormer][author] + + + +[build-badge]: https://img.shields.io/travis/wooorm/state-toggle.svg + +[build]: https://travis-ci.org/wooorm/state-toggle + +[coverage-badge]: https://img.shields.io/codecov/c/github/wooorm/state-toggle.svg + +[coverage]: https://codecov.io/github/wooorm/state-toggle + +[downloads-badge]: https://img.shields.io/npm/dm/state-toggle.svg + +[downloads]: https://www.npmjs.com/package/state-toggle + +[size-badge]: https://img.shields.io/bundlephobia/minzip/state-toggle.svg + +[size]: https://bundlephobia.com/result?p=state-toggle + +[npm]: https://docs.npmjs.com/cli/install + +[license]: license + +[author]: https://wooorm.com + +[enter]: #enter + +[exit]: #exit diff --git a/node_modules/stringify-entities/dangerous.json b/node_modules/stringify-entities/dangerous.json new file mode 100644 index 0000000..9147982 --- /dev/null +++ b/node_modules/stringify-entities/dangerous.json @@ -0,0 +1,10 @@ +[ + "cent", + "copy", + "divide", + "gt", + "lt", + "not", + "para", + "times" +] diff --git a/node_modules/stringify-entities/index.js b/node_modules/stringify-entities/index.js new file mode 100644 index 0000000..ca465c9 --- /dev/null +++ b/node_modules/stringify-entities/index.js @@ -0,0 +1,159 @@ +'use strict' + +var entities = require('character-entities-html4') +var legacy = require('character-entities-legacy') +var hexadecimal = require('is-hexadecimal') +var decimal = require('is-decimal') +var alphanumerical = require('is-alphanumerical') +var dangerous = require('./dangerous.json') + +module.exports = encode +encode.escape = escape + +var own = {}.hasOwnProperty + +// Characters +var equalsTo = 61 + +// List of enforced escapes. +var escapes = ['"', "'", '<', '>', '&', '`'] + +// Map of characters to names. +var characters = construct() + +// Default escapes. +var defaultEscapes = toExpression(escapes) + +// Surrogate pairs. +var surrogatePair = /[\uD800-\uDBFF][\uDC00-\uDFFF]/g + +// Non-ASCII characters. +// eslint-disable-next-line no-control-regex, unicorn/no-hex-escape +var bmp = /[\x01-\t\x0B\f\x0E-\x1F\x7F\x81\x8D\x8F\x90\x9D\xA0-\uFFFF]/g + +// Encode special characters in `value`. +function encode(value, options) { + var settings = options || {} + var subset = settings.subset + var set = subset ? toExpression(subset) : defaultEscapes + var escapeOnly = settings.escapeOnly + var omit = settings.omitOptionalSemicolons + + value = value.replace(set, replace) + + if (subset || escapeOnly) { + return value + } + + return value + .replace(surrogatePair, replaceSurrogatePair) + .replace(bmp, replace) + + function replaceSurrogatePair(pair, pos, slice) { + return toHexReference( + (pair.charCodeAt(0) - 0xd800) * 0x400 + + pair.charCodeAt(1) - + 0xdc00 + + 0x10000, + slice.charCodeAt(pos + 2), + omit + ) + } + + function replace(char, pos, slice) { + return one(char, slice.charCodeAt(pos + 1), settings) + } +} + +// Shortcut to escape special characters in HTML. +function escape(value) { + return encode(value, {escapeOnly: true, useNamedReferences: true}) +} + +// Encode `char` according to `options`. +function one(char, next, options) { + var shortest = options.useShortestReferences + var omit = options.omitOptionalSemicolons + var named + var code + var numeric + var decimal + + if ((shortest || options.useNamedReferences) && own.call(characters, char)) { + named = toNamed(characters[char], next, omit, options.attribute) + } + + if (shortest || !named) { + code = char.charCodeAt(0) + numeric = toHexReference(code, next, omit) + + // Use the shortest numeric reference when requested. + // A simple algorithm would use decimal for all code points under 100, as + // those are shorter than hexadecimal: + // + // * `c` vs `c` (decimal shorter) + // * `d` vs `d` (equal) + // + // However, because we take `next` into consideration when `omit` is used, + // And it would be possible that decimals are shorter on bigger values as + // well if `next` is hexadecimal but not decimal, we instead compare both. + if (shortest) { + decimal = toDecimalReference(code, next, omit) + + if (decimal.length < numeric.length) { + numeric = decimal + } + } + } + + if (named && (!shortest || named.length < numeric.length)) { + return named + } + + return numeric +} + +// Transform `code` into an entity. +function toNamed(name, next, omit, attribute) { + var value = '&' + name + + if ( + omit && + own.call(legacy, name) && + dangerous.indexOf(name) === -1 && + (!attribute || (next && next !== equalsTo && !alphanumerical(next))) + ) { + return value + } + + return value + ';' +} + +// Transform `code` into a hexadecimal character reference. +function toHexReference(code, next, omit) { + var value = '&#x' + code.toString(16).toUpperCase() + return omit && next && !hexadecimal(next) ? value : value + ';' +} + +// Transform `code` into a decimal character reference. +function toDecimalReference(code, next, omit) { + var value = '&#' + String(code) + return omit && next && !decimal(next) ? value : value + ';' +} + +// Create an expression for `characters`. +function toExpression(characters) { + return new RegExp('[' + characters.join('') + ']', 'g') +} + +// Construct the map. +function construct() { + var chars = {} + var name + + for (name in entities) { + chars[entities[name]] = name + } + + return chars +} diff --git a/node_modules/stringify-entities/license b/node_modules/stringify-entities/license new file mode 100644 index 0000000..611b675 --- /dev/null +++ b/node_modules/stringify-entities/license @@ -0,0 +1,22 @@ +(The MIT License) + +Copyright (c) 2015 Titus Wormer + +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: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +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. diff --git a/node_modules/stringify-entities/package.json b/node_modules/stringify-entities/package.json new file mode 100644 index 0000000..ba03f11 --- /dev/null +++ b/node_modules/stringify-entities/package.json @@ -0,0 +1,130 @@ +{ + "_from": "stringify-entities@^3.0.0", + "_id": "stringify-entities@3.0.1", + "_inBundle": false, + "_integrity": "sha512-Lsk3ISA2++eJYqBMPKcr/8eby1I6L0gP0NlxF8Zja6c05yr/yCYyb2c9PwXjd08Ib3If1vn1rbs1H5ZtVuOfvQ==", + "_location": "/stringify-entities", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "stringify-entities@^3.0.0", + "name": "stringify-entities", + "escapedName": "stringify-entities", + "rawSpec": "^3.0.0", + "saveSpec": null, + "fetchSpec": "^3.0.0" + }, + "_requiredBy": [ + "/remark-stringify" + ], + "_resolved": "https://registry.npmjs.org/stringify-entities/-/stringify-entities-3.0.1.tgz", + "_shasum": "32154b91286ab0869ab2c07696223bd23b6dbfc0", + "_spec": "stringify-entities@^3.0.0", + "_where": "/Users/josh/Projects/slackify-markdown-action/node_modules/remark-stringify", + "author": { + "name": "Titus Wormer", + "email": "tituswormer@gmail.com", + "url": "https://wooorm.com" + }, + "bugs": { + "url": "https://github.com/wooorm/stringify-entities/issues" + }, + "bundleDependencies": false, + "contributors": [ + { + "name": "Titus Wormer", + "email": "tituswormer@gmail.com", + "url": "https://wooorm.com" + } + ], + "dependencies": { + "character-entities-html4": "^1.0.0", + "character-entities-legacy": "^1.0.0", + "is-alphanumerical": "^1.0.0", + "is-decimal": "^1.0.2", + "is-hexadecimal": "^1.0.0" + }, + "deprecated": false, + "description": "Encode HTML character references and character entities", + "devDependencies": { + "browserify": "^16.0.0", + "character-entities": "^1.0.0", + "dtslint": "^3.0.0", + "nyc": "^15.0.0", + "remark-cli": "^8.0.0", + "remark-preset-wooorm": "^7.0.0", + "tape": "^5.0.0", + "tinyify": "^2.0.0", + "xo": "^0.30.0" + }, + "files": [ + "dangerous.json", + "index.js", + "types/index.d.ts" + ], + "funding": { + "type": "github", + "url": "https://github.com/sponsors/wooorm" + }, + "homepage": "https://github.com/wooorm/stringify-entities#readme", + "keywords": [ + "stringify", + "encode", + "escape", + "html", + "character", + "reference", + "entity", + "entities" + ], + "license": "MIT", + "name": "stringify-entities", + "nyc": { + "check-coverage": true, + "lines": 100, + "functions": 100, + "branches": 100 + }, + "prettier": { + "tabWidth": 2, + "useTabs": false, + "singleQuote": true, + "bracketSpacing": false, + "semi": false, + "trailingComma": "none" + }, + "remarkConfig": { + "plugins": [ + "preset-wooorm" + ] + }, + "repository": { + "type": "git", + "url": "git+https://github.com/wooorm/stringify-entities.git" + }, + "scripts": { + "build": "npm run build-bundle && npm run build-mangle", + "build-bundle": "browserify . -s stringifyEntities -o stringify-entities.js", + "build-mangle": "browserify . -s stringifyEntities -p tinyify -o stringify-entities.min.js", + "format": "remark . -qfo && prettier --write . && xo --fix", + "generate": "node build", + "test": "npm run format && npm run build && npm run test-coverage && npm run test-types", + "test-api": "node test", + "test-coverage": "nyc --reporter lcov tape test.js", + "test-types": "dtslint types" + }, + "types": "types/index.d.ts", + "version": "3.0.1", + "xo": { + "prettier": true, + "esnext": false, + "rules": { + "unicorn/prefer-includes": "off", + "guard-for-in": "off" + }, + "ignores": [ + "stringify-entities.js" + ] + } +} diff --git a/node_modules/stringify-entities/readme.md b/node_modules/stringify-entities/readme.md new file mode 100644 index 0000000..1d90b9c --- /dev/null +++ b/node_modules/stringify-entities/readme.md @@ -0,0 +1,143 @@ +# stringify-entities + +[![Build Status][build-badge]][build-status] +[![Coverage Status][coverage-badge]][coverage-status] +[![Downloads][downloads-badge]][downloads] +[![Size][size-badge]][size] + +Encode HTML character references and character entities. + +* [x] Very fast +* [x] Just the encoding part +* [x] Reliable: ``'`'`` characters are escaped to ensure no scripts + run in Internet Explorer 6 to 8. + Additionally, only named entities recognized by HTML4 are encoded, meaning + the infamous `'` (which people think is a [virus][]) won’t show up + +## Algorithm + +By default, all dangerous, non-ASCII, and non-printable ASCII characters are +encoded. +A [subset][] of characters can be given to encode just those characters. +Alternatively, pass [`escapeOnly`][escapeonly] to escape just the dangerous +characters (`"`, `'`, `<`, `>`, `&`, `` ` ``). +By default, numeric entities are used. +Pass [`useNamedReferences`][named] to use named entities when possible, or +[`useShortestReferences`][short] to use them if that results in less bytes. + +## Install + +[npm][]: + +```sh +npm install stringify-entities +``` + +## Use + +```js +var stringify = require('stringify-entities') + +stringify('alpha © bravo ≠ charlie 𝌆 delta') +// => 'alpha © bravo ≠ charlie 𝌆 delta' + +stringify('alpha © bravo ≠ charlie 𝌆 delta', {useNamedReferences: true}) +// => 'alpha © bravo ≠ charlie 𝌆 delta' +``` + +## API + +### `stringifyEntities(value[, options])` + +Encode special characters in `value`. + +##### `options` + +###### `options.escapeOnly` + +Whether to only escape possibly dangerous characters (`boolean`, +default: `false`). +Those characters are `"`, `'`, `<`, `>` `&`, and `` ` ``. + +###### `options.subset` + +Whether to only escape the given subset of characters (`Array.`). + +###### `options.useNamedReferences` + +Whether to use named entities where possible (`boolean?`, default: `false`). + +###### `options.useShortestReferences` + +Whether to use named entities, where possible, if that results in less bytes +(`boolean?`, default: `false`). +**Note**: `useNamedReferences` can be omitted when using `useShortestReferences`. + +###### `options.omitOptionalSemicolons` + +Whether to omit semicolons when possible (`boolean?`, default: `false`). +**Note**: This creates parse errors, don’t use this except when building a +minifier. + +Omitting semicolons is possible for [certain][dangerous] [legacy][] named +references, and numeric entities, in some cases. + +###### `options.attribute` + +Only needed when operating dangerously with `omitOptionalSemicolons: true`. +Create entities which don’t fail in attributes (`boolean?`, default: `false`). + +## Related + +* [`parse-entities`](https://github.com/wooorm/parse-entities) + — Parse HTML character references +* [`character-entities`](https://github.com/wooorm/character-entities) + — Info on character entities +* [`character-entities-html4`](https://github.com/wooorm/character-entities-html4) + — Info on HTML4 character entities +* [`character-entities-legacy`](https://github.com/wooorm/character-entities-legacy) + — Info on legacy character entities +* [`character-reference-invalid`](https://github.com/wooorm/character-reference-invalid) + — Info on invalid numeric character references + +## License + +[MIT][license] © [Titus Wormer][author] + + + +[build-badge]: https://img.shields.io/travis/wooorm/stringify-entities.svg + +[build-status]: https://travis-ci.org/wooorm/stringify-entities + +[coverage-badge]: https://img.shields.io/codecov/c/github/wooorm/stringify-entities.svg + +[coverage-status]: https://codecov.io/github/wooorm/stringify-entities + +[downloads-badge]: https://img.shields.io/npm/dm/stringify-entities.svg + +[downloads]: https://www.npmjs.com/package/stringify-entities + +[size-badge]: https://img.shields.io/bundlephobia/minzip/stringify-entities.svg + +[size]: https://bundlephobia.com/result?p=stringify-entities + +[license]: license + +[author]: https://wooorm.com + +[npm]: https://docs.npmjs.com/cli/install + +[virus]: https://www.telegraph.co.uk/technology/advice/10516839/Why-do-some-apostrophes-get-replaced-with-andapos.html + +[dangerous]: dangerous.json + +[legacy]: https://github.com/wooorm/character-entities-legacy + +[subset]: #optionssubset + +[escapeonly]: #optionsescapeonly + +[named]: #optionsusenamedreferences + +[short]: #optionsuseshortestreferences diff --git a/node_modules/stringify-entities/types/index.d.ts b/node_modules/stringify-entities/types/index.d.ts new file mode 100644 index 0000000..847cb8d --- /dev/null +++ b/node_modules/stringify-entities/types/index.d.ts @@ -0,0 +1,51 @@ +// TypeScript Version: 3.0 + +declare namespace stringifyEntities { + interface StringifyEntitiesOptions { + /** + * Whether to only escape possibly dangerous characters (`boolean`, default: `false`). + * Those characters are `"`, `'`, `<`, `>` `&`, and `` ` ``. + */ + escapeOnly?: boolean + + /** + * Whether to only escape the given subset of characters (`Array.`). + */ + subset?: string[] + + /** + * Whether to use named entities where possible (`boolean?`, default: `false`). + */ + useNamedReferences?: boolean + + /** + * Whether to use named entities, where possible, if that results in less bytes (`boolean?`, default: `false`). + * **Note**: `useNamedReferences` can be omitted when using `useShortestReferences`. + */ + useShortestReferences?: boolean + + /** + * Whether to omit semi-colons when possible (`boolean?`, default: `false`). + * **Note**: This creates parse errors, don’t use this except when building a minifier. + * + * Omitting semi-colons is possible for certain legacy named references, and numeric entities, in some cases. + */ + omitOptionalSemicolons?: boolean + + /** + * Only needed when operating dangerously with `omitOptionalSemicolons: true`. + * Create entities which don’t fail in attributes (`boolean?`, default: `false`). + */ + attribute?: boolean + } +} + +/** + * Encode special characters in `value`. + */ +declare function stringifyEntities( + value: string, + options?: stringifyEntities.StringifyEntitiesOptions +): string + +export = stringifyEntities diff --git a/node_modules/trim-trailing-lines/index.js b/node_modules/trim-trailing-lines/index.js new file mode 100644 index 0000000..0f2d48b --- /dev/null +++ b/node_modules/trim-trailing-lines/index.js @@ -0,0 +1,17 @@ +'use strict' + +module.exports = trimTrailingLines + +var line = '\n' + +// Remove final newline characters from `value`. +function trimTrailingLines(value) { + var val = String(value) + var index = val.length + + while (val.charAt(--index) === line) { + // Empty + } + + return val.slice(0, index + 1) +} diff --git a/node_modules/trim-trailing-lines/license b/node_modules/trim-trailing-lines/license new file mode 100644 index 0000000..611b675 --- /dev/null +++ b/node_modules/trim-trailing-lines/license @@ -0,0 +1,22 @@ +(The MIT License) + +Copyright (c) 2015 Titus Wormer + +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: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +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. diff --git a/node_modules/trim-trailing-lines/package.json b/node_modules/trim-trailing-lines/package.json new file mode 100644 index 0000000..9476341 --- /dev/null +++ b/node_modules/trim-trailing-lines/package.json @@ -0,0 +1,111 @@ +{ + "_from": "trim-trailing-lines@^1.0.0", + "_id": "trim-trailing-lines@1.1.3", + "_inBundle": false, + "_integrity": "sha512-4ku0mmjXifQcTVfYDfR5lpgV7zVqPg6zV9rdZmwOPqq0+Zq19xDqEgagqVbc4pOOShbncuAOIs59R3+3gcF3ZA==", + "_location": "/trim-trailing-lines", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "trim-trailing-lines@^1.0.0", + "name": "trim-trailing-lines", + "escapedName": "trim-trailing-lines", + "rawSpec": "^1.0.0", + "saveSpec": null, + "fetchSpec": "^1.0.0" + }, + "_requiredBy": [ + "/remark-parse" + ], + "_resolved": "https://registry.npmjs.org/trim-trailing-lines/-/trim-trailing-lines-1.1.3.tgz", + "_shasum": "7f0739881ff76657b7776e10874128004b625a94", + "_spec": "trim-trailing-lines@^1.0.0", + "_where": "/Users/josh/Projects/slackify-markdown-action/node_modules/remark-parse", + "author": { + "name": "Titus Wormer", + "email": "tituswormer@gmail.com", + "url": "https://wooorm.com" + }, + "bugs": { + "url": "https://github.com/wooorm/trim-trailing-lines/issues" + }, + "bundleDependencies": false, + "contributors": [ + { + "name": "Titus Wormer", + "email": "tituswormer@gmail.com", + "url": "https://wooorm.com" + } + ], + "dependencies": {}, + "deprecated": false, + "description": "Remove final line feeds from a string", + "devDependencies": { + "browserify": "^16.0.0", + "nyc": "^15.0.0", + "prettier": "^1.0.0", + "remark-cli": "^7.0.0", + "remark-preset-wooorm": "^6.0.0", + "tape": "^4.0.0", + "tinyify": "^2.0.0", + "xo": "^0.25.0" + }, + "files": [ + "index.js" + ], + "funding": { + "type": "github", + "url": "https://github.com/sponsors/wooorm" + }, + "homepage": "https://github.com/wooorm/trim-trailing-lines#readme", + "keywords": [ + "trim", + "final", + "line", + "newline", + "characters" + ], + "license": "MIT", + "name": "trim-trailing-lines", + "nyc": { + "check-coverage": true, + "lines": 100, + "functions": 100, + "branches": 100 + }, + "prettier": { + "tabWidth": 2, + "useTabs": false, + "singleQuote": true, + "bracketSpacing": false, + "semi": false, + "trailingComma": "none" + }, + "remarkConfig": { + "plugins": [ + "preset-wooorm" + ] + }, + "repository": { + "type": "git", + "url": "git+https://github.com/wooorm/trim-trailing-lines.git" + }, + "scripts": { + "build": "npm run build-bundle && npm run build-mangle", + "build-bundle": "browserify . -s trimTrailingLines -o trim-trailing-lines.js", + "build-mangle": "browserify . -s trimTrailingLines -p tinyify -o trim-trailing-lines.min.js", + "format": "remark . -qfo && prettier --write \"**/*.js\" && xo --fix", + "test": "npm run format && npm run build && npm run test-coverage", + "test-api": "node test", + "test-coverage": "nyc --reporter lcov tape test.js" + }, + "version": "1.1.3", + "xo": { + "prettier": true, + "esnext": false, + "ignores": [ + "trim-trailing-lines.js" + ] + } +} diff --git a/node_modules/trim-trailing-lines/readme.md b/node_modules/trim-trailing-lines/readme.md new file mode 100644 index 0000000..a9c1f44 --- /dev/null +++ b/node_modules/trim-trailing-lines/readme.md @@ -0,0 +1,68 @@ +# trim-trailing-lines + +[![Build][build-badge]][build] +[![Coverage][coverage-badge]][coverage] +[![Downloads][downloads-badge]][downloads] +[![Size][size-badge]][size] + +Remove final line feeds from a string. + +## Install + +[npm][]: + +```sh +npm install trim-trailing-lines +``` + +## Use + +```js +var trimTrailingLines = require('trim-trailing-lines') + +trimTrailingLines('foo\nbar') // => 'foo\nbar' +trimTrailingLines('foo\nbar\n') // => 'foo\nbar' +trimTrailingLines('foo\nbar\n\n') // => 'foo\nbar' +``` + +## API + +### `trimTrailingLines(value)` + +Remove final line feed characters from `value`. + +###### Parameters + +* `value` (`string`) — Value with trailing line feeds, coerced to string. + +###### Returns + +`string` — Value without trailing newlines. + +## License + +[MIT][license] © [Titus Wormer][author] + + + +[build-badge]: https://img.shields.io/travis/wooorm/trim-trailing-lines.svg + +[build]: https://travis-ci.org/wooorm/trim-trailing-lines + +[coverage-badge]: https://img.shields.io/codecov/c/github/wooorm/trim-trailing-lines.svg + +[coverage]: https://codecov.io/github/wooorm/trim-trailing-lines + +[downloads-badge]: https://img.shields.io/npm/dm/trim-trailing-lines.svg + +[downloads]: https://www.npmjs.com/package/trim-trailing-lines + +[size-badge]: https://img.shields.io/bundlephobia/minzip/trim-trailing-lines.svg + +[size]: https://bundlephobia.com/result?p=trim-trailing-lines + +[npm]: https://docs.npmjs.com/cli/install + +[license]: license + +[author]: https://wooorm.com diff --git a/node_modules/trim/.npmignore b/node_modules/trim/.npmignore new file mode 100644 index 0000000..f1250e5 --- /dev/null +++ b/node_modules/trim/.npmignore @@ -0,0 +1,4 @@ +support +test +examples +*.sock diff --git a/node_modules/trim/History.md b/node_modules/trim/History.md new file mode 100644 index 0000000..c8aa68f --- /dev/null +++ b/node_modules/trim/History.md @@ -0,0 +1,5 @@ + +0.0.1 / 2010-01-03 +================== + + * Initial release diff --git a/node_modules/trim/Makefile b/node_modules/trim/Makefile new file mode 100644 index 0000000..4e9c8d3 --- /dev/null +++ b/node_modules/trim/Makefile @@ -0,0 +1,7 @@ + +test: + @./node_modules/.bin/mocha \ + --require should \ + --reporter spec + +.PHONY: test \ No newline at end of file diff --git a/node_modules/trim/Readme.md b/node_modules/trim/Readme.md new file mode 100644 index 0000000..3460f52 --- /dev/null +++ b/node_modules/trim/Readme.md @@ -0,0 +1,69 @@ + +# trim + + Trims string whitespace. + +## Installation + +``` +$ npm install trim +$ component install component/trim +``` + +## API + + - [trim(str)](#trimstr) + - [.left(str)](#leftstr) + - [.right(str)](#rightstr) + + + +### trim(str) +should trim leading / trailing whitespace. + +```js +trim(' foo bar ').should.equal('foo bar'); +trim('\n\n\nfoo bar\n\r\n\n').should.equal('foo bar'); +``` + + +### .left(str) +should trim leading whitespace. + +```js +trim.left(' foo bar ').should.equal('foo bar '); +``` + + +### .right(str) +should trim trailing whitespace. + +```js +trim.right(' foo bar ').should.equal(' foo bar'); +``` + + +## License + +(The MIT License) + +Copyright (c) 2012 TJ Holowaychuk <tj@vision-media.ca> + +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: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +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. \ No newline at end of file diff --git a/node_modules/trim/component.json b/node_modules/trim/component.json new file mode 100644 index 0000000..560b258 --- /dev/null +++ b/node_modules/trim/component.json @@ -0,0 +1,7 @@ +{ + "name": "trim", + "version": "0.0.1", + "description": "Trim string whitespace", + "keywords": ["string", "trim"], + "scripts": ["index.js"] +} \ No newline at end of file diff --git a/node_modules/trim/index.js b/node_modules/trim/index.js new file mode 100644 index 0000000..640c24c --- /dev/null +++ b/node_modules/trim/index.js @@ -0,0 +1,14 @@ + +exports = module.exports = trim; + +function trim(str){ + return str.replace(/^\s*|\s*$/g, ''); +} + +exports.left = function(str){ + return str.replace(/^\s*/, ''); +}; + +exports.right = function(str){ + return str.replace(/\s*$/, ''); +}; diff --git a/node_modules/trim/package.json b/node_modules/trim/package.json new file mode 100644 index 0000000..16fd807 --- /dev/null +++ b/node_modules/trim/package.json @@ -0,0 +1,49 @@ +{ + "_from": "trim@0.0.1", + "_id": "trim@0.0.1", + "_inBundle": false, + "_integrity": "sha1-WFhUf2spB1fulczMZm+1AITEYN0=", + "_location": "/trim", + "_phantomChildren": {}, + "_requested": { + "type": "version", + "registry": true, + "raw": "trim@0.0.1", + "name": "trim", + "escapedName": "trim", + "rawSpec": "0.0.1", + "saveSpec": null, + "fetchSpec": "0.0.1" + }, + "_requiredBy": [ + "/remark-parse" + ], + "_resolved": "https://registry.npmjs.org/trim/-/trim-0.0.1.tgz", + "_shasum": "5858547f6b290757ee95cccc666fb50084c460dd", + "_spec": "trim@0.0.1", + "_where": "/Users/josh/Projects/slackify-markdown-action/node_modules/remark-parse", + "author": { + "name": "TJ Holowaychuk", + "email": "tj@vision-media.ca" + }, + "bundleDependencies": false, + "component": { + "scripts": { + "trim/index.js": "index.js" + } + }, + "dependencies": {}, + "deprecated": false, + "description": "Trim string whitespace", + "devDependencies": { + "mocha": "*", + "should": "*" + }, + "keywords": [ + "string", + "trim" + ], + "main": "index", + "name": "trim", + "version": "0.0.1" +} diff --git a/node_modules/trough/index.js b/node_modules/trough/index.js new file mode 100644 index 0000000..2b73d86 --- /dev/null +++ b/node_modules/trough/index.js @@ -0,0 +1,74 @@ +'use strict' + +var wrap = require('./wrap.js') + +module.exports = trough + +trough.wrap = wrap + +var slice = [].slice + +// Create new middleware. +function trough() { + var fns = [] + var middleware = {} + + middleware.run = run + middleware.use = use + + return middleware + + // Run `fns`. Last argument must be a completion handler. + function run() { + var index = -1 + var input = slice.call(arguments, 0, -1) + var done = arguments[arguments.length - 1] + + if (typeof done !== 'function') { + throw new Error('Expected function as last argument, not ' + done) + } + + next.apply(null, [null].concat(input)) + + // Run the next `fn`, if any. + function next(err) { + var fn = fns[++index] + var params = slice.call(arguments, 0) + var values = params.slice(1) + var length = input.length + var pos = -1 + + if (err) { + done(err) + return + } + + // Copy non-nully input into values. + while (++pos < length) { + if (values[pos] === null || values[pos] === undefined) { + values[pos] = input[pos] + } + } + + input = values + + // Next or done. + if (fn) { + wrap(fn, next).apply(null, input) + } else { + done.apply(null, [null].concat(input)) + } + } + } + + // Add `fn` to the list. + function use(fn) { + if (typeof fn !== 'function') { + throw new Error('Expected `fn` to be a function, not ' + fn) + } + + fns.push(fn) + + return middleware + } +} diff --git a/node_modules/trough/license b/node_modules/trough/license new file mode 100644 index 0000000..3f0166f --- /dev/null +++ b/node_modules/trough/license @@ -0,0 +1,21 @@ +(The MIT License) + +Copyright (c) 2016 Titus Wormer + +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: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +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. diff --git a/node_modules/trough/package.json b/node_modules/trough/package.json new file mode 100644 index 0000000..824d0d4 --- /dev/null +++ b/node_modules/trough/package.json @@ -0,0 +1,114 @@ +{ + "_from": "trough@^1.0.0", + "_id": "trough@1.0.5", + "_inBundle": false, + "_integrity": "sha512-rvuRbTarPXmMb79SmzEp8aqXNKcK+y0XaB298IXueQ8I2PsrATcPBCSPyK/dDNa2iWOhKlfNnOjdAOTBU/nkFA==", + "_location": "/trough", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "trough@^1.0.0", + "name": "trough", + "escapedName": "trough", + "rawSpec": "^1.0.0", + "saveSpec": null, + "fetchSpec": "^1.0.0" + }, + "_requiredBy": [ + "/unified" + ], + "_resolved": "https://registry.npmjs.org/trough/-/trough-1.0.5.tgz", + "_shasum": "b8b639cefad7d0bb2abd37d433ff8293efa5f406", + "_spec": "trough@^1.0.0", + "_where": "/Users/josh/Projects/slackify-markdown-action/node_modules/unified", + "author": { + "name": "Titus Wormer", + "email": "tituswormer@gmail.com", + "url": "https://wooorm.com" + }, + "bugs": { + "url": "https://github.com/wooorm/trough/issues" + }, + "bundleDependencies": false, + "contributors": [ + { + "name": "Titus Wormer", + "email": "tituswormer@gmail.com", + "url": "https://wooorm.com" + } + ], + "dependencies": {}, + "deprecated": false, + "description": "Middleware: a channel used to convey a liquid", + "devDependencies": { + "browserify": "^16.0.0", + "nyc": "^15.0.0", + "prettier": "^1.0.0", + "remark-cli": "^7.0.0", + "remark-preset-wooorm": "^6.0.0", + "tape": "^4.0.0", + "tinyify": "^2.0.0", + "xo": "^0.25.0" + }, + "files": [ + "index.js", + "wrap.js" + ], + "funding": { + "type": "github", + "url": "https://github.com/sponsors/wooorm" + }, + "homepage": "https://github.com/wooorm/trough#readme", + "keywords": [ + "middleware", + "ware" + ], + "license": "MIT", + "name": "trough", + "nyc": { + "check-coverage": true, + "lines": 100, + "functions": 100, + "branches": 100 + }, + "prettier": { + "tabWidth": 2, + "useTabs": false, + "singleQuote": true, + "bracketSpacing": false, + "semi": false, + "trailingComma": "none" + }, + "remarkConfig": { + "plugins": [ + "preset-wooorm" + ] + }, + "repository": { + "type": "git", + "url": "git+https://github.com/wooorm/trough.git" + }, + "scripts": { + "build": "npm run build-bundle && npm run build-mangle", + "build-bundle": "browserify index.js -s trough > trough.js", + "build-mangle": "browserify index.js -s trough -p tinyify > trough.min.js", + "format": "remark . -qfo && prettier --write \"**/*.js\" && xo --fix", + "test": "npm run format && npm run build && npm run test-coverage", + "test-api": "node test", + "test-coverage": "nyc --reporter lcov tape test.js" + }, + "version": "1.0.5", + "xo": { + "prettier": true, + "esnext": false, + "rules": { + "unicorn/prefer-reflect-apply": "off", + "unicorn/prefer-type-error": "off", + "guard-for-in": "off" + }, + "ignores": [ + "trough.js" + ] + } +} diff --git a/node_modules/trough/readme.md b/node_modules/trough/readme.md new file mode 100644 index 0000000..ce3d38b --- /dev/null +++ b/node_modules/trough/readme.md @@ -0,0 +1,330 @@ +# trough + +[![Build][build-badge]][build] +[![Coverage][coverage-badge]][coverage] +[![Downloads][downloads-badge]][downloads] +[![Size][size-badge]][size] + +> **trough** /trôf/ — a channel used to convey a liquid. + +`trough` is like [`ware`][ware] with less sugar, and middleware functions can +change the input of the next. + +## Install + +[npm][]: + +```sh +npm install trough +``` + +## Use + +```js +var fs = require('fs') +var path = require('path') +var trough = require('trough') + +var pipeline = trough() + .use(function(fileName) { + console.log('Checking… ' + fileName) + }) + .use(function(fileName) { + return path.join(process.cwd(), fileName) + }) + .use(function(filePath, next) { + fs.stat(filePath, function(err, stats) { + next(err, {filePath, stats}) + }) + }) + .use(function(ctx, next) { + if (ctx.stats.isFile()) { + fs.readFile(ctx.filePath, next) + } else { + next(new Error('Expected file')) + } + }) + +pipeline.run('readme.md', console.log) +pipeline.run('node_modules', console.log) +``` + +Yields: + +```txt +Checking… readme.md +Checking… node_modules +Error: Expected file + at ~/example.js:21:12 + at wrapped (~/node_modules/trough/index.js:93:19) + at next (~/node_modules/trough/index.js:56:24) + at done (~/node_modules/trough/index.js:124:12) + at ~/node_modules/example.js:14:7 + at FSReqWrap.oncomplete (fs.js:153:5) +null +``` + +## API + +### `trough()` + +Create a new [`Trough`][trough]. + +#### `trough.wrap(middleware, callback[, …input])` + +Call `middleware` with all input. +If `middleware` accepts more arguments than given in input, and extra `done` +function is passed in after the input when calling it. +It must be called. + +The first value in `input` is called the main input value. +All other input values are called the rest input values. +The values given to `callback` are the input values, merged with every non-nully +output value. + +* If `middleware` throws an error, returns a promise that is rejected, or + calls the given `done` function with an error, `callback` is invoked with + that error +* If `middleware` returns a value or returns a promise that is resolved, that + value is the main output value +* If `middleware` calls `done`, all non-nully values except for the first one + (the error) overwrite the output values + +### `Trough` + +A pipeline. + +#### `Trough#run([input…, ]done)` + +Run the pipeline (all [`use()`][use]d middleware). +Invokes [`done`][done] on completion with either an error or the output of the +last middleware. + +> Note! +> as the length of input defines whether [async][] functions get a `next` +> function, it’s recommended to keep `input` at one value normally. + +##### `function done(err?, [output…])` + +The final handler passed to [`run()`][run], invoked with an error if a +[middleware function][fn] rejected, passed, or threw one, or the output of the +last middleware function. + +#### `Trough#use(fn)` + +Add `fn`, a [middleware function][fn], to the pipeline. + +##### `function fn([input…, ][next])` + +A middleware function invoked with the output of its predecessor. + +###### Synchronous + +If `fn` returns or throws an error, the pipeline fails and `done` is invoked +with that error. + +If `fn` returns a value (neither `null` nor `undefined`), the first `input` of +the next function is set to that value (all other `input` is passed through). + +The following example shows how returning an error stops the pipeline: + +```js +var trough = require('trough') + +trough() + .use(function(val) { + return new Error('Got: ' + val) + }) + .run('some value', console.log) +``` + +Yields: + +```txt +Error: Got: some value + at ~/example.js:5:12 + … +``` + +The following example shows how throwing an error stops the pipeline: + +```js +var trough = require('trough') + +trough() + .use(function(val) { + throw new Error('Got: ' + val) + }) + .run('more value', console.log) +``` + +Yields: + +```txt +Error: Got: more value + at ~/example.js:5:11 + … +``` + +The following example shows how the first output can be modified: + +```js +var trough = require('trough') + +trough() + .use(function(val) { + return 'even ' + val + }) + .run('more value', 'untouched', console.log) +``` + +Yields: + +```txt +null 'even more value' 'untouched' +``` + +###### Promise + +If `fn` returns a promise, and that promise rejects, the pipeline fails and +`done` is invoked with the rejected value. + +If `fn` returns a promise, and that promise resolves with a value (neither +`null` nor `undefined`), the first `input` of the next function is set to that +value (all other `input` is passed through). + +The following example shows how rejecting a promise stops the pipeline: + +```js +var trough = require('trough') + +trough() + .use(function(val) { + return new Promise(function(resolve, reject) { + reject('Got: ' + val) + }) + }) + .run('val', console.log) +``` + +Yields: + +```txt +Got: val +``` + +The following example shows how the input isn’t touched by resolving to `null`. + +```js +var trough = require('trough') + +trough() + .use(function() { + return new Promise(function(resolve) { + setTimeout(function() { + resolve(null) + }, 100) + }) + }) + .run('Input', console.log) +``` + +Yields: + +```txt +null 'Input' +``` + +###### Asynchronous + +If `fn` accepts one more argument than the given `input`, a `next` function is +given (after the input). `next` must be called, but doesn’t have to be called +async. + +If `next` is given a value (neither `null` nor `undefined`) as its first +argument, the pipeline fails and `done` is invoked with that value. + +If `next` is given no value (either `null` or `undefined`) as the first +argument, all following non-nully values change the input of the following +function, and all nully values default to the `input`. + +The following example shows how passing a first argument stops the pipeline: + +```js +var trough = require('trough') + +trough() + .use(function(val, next) { + next(new Error('Got: ' + val)) + }) + .run('val', console.log) +``` + +Yields: + +```txt +Error: Got: val + at ~/example.js:5:10 +``` + +The following example shows how more values than the input are passed. + +```js +var trough = require('trough') + +trough() + .use(function(val, next) { + setTimeout(function() { + next(null, null, 'values') + }, 100) + }) + .run('some', console.log) +``` + +Yields: + +```txt +null 'some' 'values' +``` + +## License + +[MIT][license] © [Titus Wormer][author] + + + +[build-badge]: https://img.shields.io/travis/wooorm/trough.svg + +[build]: https://travis-ci.org/wooorm/trough + +[coverage-badge]: https://img.shields.io/codecov/c/github/wooorm/trough.svg + +[coverage]: https://codecov.io/github/wooorm/trough + +[downloads-badge]: https://img.shields.io/npm/dm/trough.svg + +[downloads]: https://www.npmjs.com/package/trough + +[size-badge]: https://img.shields.io/bundlephobia/minzip/trough.svg + +[size]: https://bundlephobia.com/result?p=trough + +[npm]: https://docs.npmjs.com/cli/install + +[license]: license + +[author]: https://wooorm.com + +[ware]: https://github.com/segmentio/ware + +[trough]: #trough-1 + +[use]: #troughusefn + +[run]: #troughruninput-done + +[fn]: #function-fninput-next + +[done]: #function-doneerr-output + +[async]: #asynchronous diff --git a/node_modules/trough/wrap.js b/node_modules/trough/wrap.js new file mode 100644 index 0000000..cf568c0 --- /dev/null +++ b/node_modules/trough/wrap.js @@ -0,0 +1,64 @@ +'use strict' + +var slice = [].slice + +module.exports = wrap + +// Wrap `fn`. +// Can be sync or async; return a promise, receive a completion handler, return +// new values and errors. +function wrap(fn, callback) { + var invoked + + return wrapped + + function wrapped() { + var params = slice.call(arguments, 0) + var callback = fn.length > params.length + var result + + if (callback) { + params.push(done) + } + + try { + result = fn.apply(null, params) + } catch (error) { + // Well, this is quite the pickle. + // `fn` received a callback and invoked it (thus continuing the pipeline), + // but later also threw an error. + // We’re not about to restart the pipeline again, so the only thing left + // to do is to throw the thing instead. + if (callback && invoked) { + throw error + } + + return done(error) + } + + if (!callback) { + if (result && typeof result.then === 'function') { + result.then(then, done) + } else if (result instanceof Error) { + done(result) + } else { + then(result) + } + } + } + + // Invoke `next`, only once. + function done() { + if (!invoked) { + invoked = true + + callback.apply(null, arguments) + } + } + + // Invoke `done` with one value. + // Tracks if an error is passed, too. + function then(value) { + done(null, value) + } +} diff --git a/node_modules/unherit/index.js b/node_modules/unherit/index.js new file mode 100644 index 0000000..32ead77 --- /dev/null +++ b/node_modules/unherit/index.js @@ -0,0 +1,45 @@ +'use strict' + +var xtend = require('xtend') +var inherits = require('inherits') + +module.exports = unherit + +// Create a custom constructor which can be modified without affecting the +// original class. +function unherit(Super) { + var result + var key + var value + + inherits(Of, Super) + inherits(From, Of) + + // Clone values. + result = Of.prototype + + for (key in result) { + value = result[key] + + if (value && typeof value === 'object') { + result[key] = 'concat' in value ? value.concat() : xtend(value) + } + } + + return Of + + // Constructor accepting a single argument, which itself is an `arguments` + // object. + function From(parameters) { + return Super.apply(this, parameters) + } + + // Constructor accepting variadic arguments. + function Of() { + if (!(this instanceof Of)) { + return new From(arguments) + } + + return Super.apply(this, arguments) + } +} diff --git a/node_modules/unherit/license b/node_modules/unherit/license new file mode 100644 index 0000000..f3722d9 --- /dev/null +++ b/node_modules/unherit/license @@ -0,0 +1,21 @@ +(The MIT License) + +Copyright (c) 2015 Titus Wormer + +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: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +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. diff --git a/node_modules/unherit/package.json b/node_modules/unherit/package.json new file mode 100644 index 0000000..d05ea23 --- /dev/null +++ b/node_modules/unherit/package.json @@ -0,0 +1,112 @@ +{ + "_from": "unherit@^1.0.4", + "_id": "unherit@1.1.3", + "_inBundle": false, + "_integrity": "sha512-Ft16BJcnapDKp0+J/rqFC3Rrk6Y/Ng4nzsC028k2jdDII/rdZ7Wd3pPT/6+vIIxRagwRc9K0IUX0Ra4fKvw+WQ==", + "_location": "/unherit", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "unherit@^1.0.4", + "name": "unherit", + "escapedName": "unherit", + "rawSpec": "^1.0.4", + "saveSpec": null, + "fetchSpec": "^1.0.4" + }, + "_requiredBy": [ + "/remark-parse", + "/remark-stringify" + ], + "_resolved": "https://registry.npmjs.org/unherit/-/unherit-1.1.3.tgz", + "_shasum": "6c9b503f2b41b262330c80e91c8614abdaa69c22", + "_spec": "unherit@^1.0.4", + "_where": "/Users/josh/Projects/slackify-markdown-action/node_modules/remark-parse", + "author": { + "name": "Titus Wormer", + "email": "tituswormer@gmail.com", + "url": "https://wooorm.com" + }, + "bugs": { + "url": "https://github.com/wooorm/unherit/issues" + }, + "bundleDependencies": false, + "contributors": [ + { + "name": "Titus Wormer", + "email": "tituswormer@gmail.com", + "url": "https://wooorm.com" + } + ], + "dependencies": { + "inherits": "^2.0.0", + "xtend": "^4.0.0" + }, + "deprecated": false, + "description": "Clone a constructor without affecting the super-class", + "devDependencies": { + "browserify": "^16.0.0", + "nyc": "^15.0.0", + "prettier": "^1.0.0", + "remark-cli": "^7.0.0", + "remark-preset-wooorm": "^6.0.0", + "tape": "^4.0.0", + "tinyify": "^2.0.0", + "xo": "^0.25.0" + }, + "files": [ + "index.js" + ], + "funding": { + "type": "github", + "url": "https://github.com/sponsors/wooorm" + }, + "homepage": "https://github.com/wooorm/unherit#readme", + "keywords": [ + "clone", + "super", + "class", + "constructor" + ], + "license": "MIT", + "name": "unherit", + "prettier": { + "tabWidth": 2, + "useTabs": false, + "singleQuote": true, + "bracketSpacing": false, + "semi": false, + "trailingComma": "none" + }, + "remarkConfig": { + "plugins": [ + "preset-wooorm" + ] + }, + "repository": { + "type": "git", + "url": "git+https://github.com/wooorm/unherit.git" + }, + "scripts": { + "build": "npm run build-bundle && npm run build-mangle", + "build-bundle": "browserify . -s unherit -o unherit.js", + "build-mangle": "browserify . -s unherit -p tinyify -o unherit.min.js", + "format": "remark . -qfo && prettier --write \"**/*.js\" && xo --fix", + "test": "npm run format && npm run build && npm run test-coverage", + "test-api": "node test", + "test-coverage": "nyc --reporter lcov tape test.js" + }, + "version": "1.1.3", + "xo": { + "prettier": true, + "esnext": false, + "rules": { + "unicorn/prefer-reflect-apply": "off", + "guard-for-in": "off" + }, + "ignores": [ + "unherit.js" + ] + } +} diff --git a/node_modules/unherit/readme.md b/node_modules/unherit/readme.md new file mode 100644 index 0000000..bf67959 --- /dev/null +++ b/node_modules/unherit/readme.md @@ -0,0 +1,79 @@ +# unherit + +[![Build][build-badge]][build] +[![Coverage][coverage-badge]][coverage] +[![Downloads][downloads-badge]][downloads] +[![Size][size-badge]][size] + +Create a custom constructor which can be modified without affecting the original +class. + +## Install + +[npm][]: + +```sh +npm install unherit +``` + +## Use + +```js +var EventEmitter = require('events').EventEmitter +var unherit = require('unherit') + +// Create a private class which acts just like `EventEmitter`. +var Emitter = unherit(EventEmitter) + +Emitter.prototype.defaultMaxListeners = 0 +// Now, all instances of `Emitter` have no maximum listeners, without affecting +// other `EventEmitter`s. + +new Emitter().defaultMaxListeners === 0 // => true +new EventEmitter().defaultMaxListeners === undefined // => true +new Emitter() instanceof EventEmitter // => true +``` + +## API + +### `unherit(Super)` + +Create a custom constructor which can be modified without affecting the original +class. + +###### Parameters + +* `Super` (`Function`) — Super-class + +###### Returns + +`Function` — Constructor acting like `Super`, which can be modified without +affecting the original class. + +## License + +[MIT][license] © [Titus Wormer][author] + + + +[build-badge]: https://img.shields.io/travis/wooorm/unherit.svg + +[build]: https://travis-ci.org/wooorm/unherit + +[coverage-badge]: https://img.shields.io/codecov/c/github/wooorm/unherit.svg + +[coverage]: https://codecov.io/github/wooorm/unherit + +[downloads-badge]: https://img.shields.io/npm/dm/unherit.svg + +[downloads]: https://www.npmjs.com/package/unherit + +[size-badge]: https://img.shields.io/bundlephobia/minzip/unherit.svg + +[size]: https://bundlephobia.com/result?p=unherit + +[npm]: https://docs.npmjs.com/cli/install + +[license]: license + +[author]: https://wooorm.com diff --git a/node_modules/unified/changelog.md b/node_modules/unified/changelog.md new file mode 100644 index 0000000..b50c832 --- /dev/null +++ b/node_modules/unified/changelog.md @@ -0,0 +1,5 @@ +# Changelog + +See [GitHub Releases][releases] for the changelog. + +[releases]: https://github.com/unifiedjs/unified/releases diff --git a/node_modules/unified/index.js b/node_modules/unified/index.js new file mode 100644 index 0000000..7a337fe --- /dev/null +++ b/node_modules/unified/index.js @@ -0,0 +1,473 @@ +'use strict' + +var bail = require('bail') +var buffer = require('is-buffer') +var extend = require('extend') +var plain = require('is-plain-obj') +var trough = require('trough') +var vfile = require('vfile') + +// Expose a frozen processor. +module.exports = unified().freeze() + +var slice = [].slice +var own = {}.hasOwnProperty + +// Process pipeline. +var pipeline = trough() + .use(pipelineParse) + .use(pipelineRun) + .use(pipelineStringify) + +function pipelineParse(p, ctx) { + ctx.tree = p.parse(ctx.file) +} + +function pipelineRun(p, ctx, next) { + p.run(ctx.tree, ctx.file, done) + + function done(err, tree, file) { + if (err) { + next(err) + } else { + ctx.tree = tree + ctx.file = file + next() + } + } +} + +function pipelineStringify(p, ctx) { + var result = p.stringify(ctx.tree, ctx.file) + var file = ctx.file + + if (result === undefined || result === null) { + // Empty. + } else if (typeof result === 'string' || buffer(result)) { + file.contents = result + } else { + file.result = result + } +} + +// Function to create the first processor. +function unified() { + var attachers = [] + var transformers = trough() + var namespace = {} + var frozen = false + var freezeIndex = -1 + + // Data management. + processor.data = data + + // Lock. + processor.freeze = freeze + + // Plugins. + processor.attachers = attachers + processor.use = use + + // API. + processor.parse = parse + processor.stringify = stringify + processor.run = run + processor.runSync = runSync + processor.process = process + processor.processSync = processSync + + // Expose. + return processor + + // Create a new processor based on the processor in the current scope. + function processor() { + var destination = unified() + var length = attachers.length + var index = -1 + + while (++index < length) { + destination.use.apply(null, attachers[index]) + } + + destination.data(extend(true, {}, namespace)) + + return destination + } + + // Freeze: used to signal a processor that has finished configuration. + // + // For example, take unified itself: it’s frozen. + // Plugins should not be added to it. + // Rather, it should be extended, by invoking it, before modifying it. + // + // In essence, always invoke this when exporting a processor. + function freeze() { + var values + var plugin + var options + var transformer + + if (frozen) { + return processor + } + + while (++freezeIndex < attachers.length) { + values = attachers[freezeIndex] + plugin = values[0] + options = values[1] + transformer = null + + if (options === false) { + continue + } + + if (options === true) { + values[1] = undefined + } + + transformer = plugin.apply(processor, values.slice(1)) + + if (typeof transformer === 'function') { + transformers.use(transformer) + } + } + + frozen = true + freezeIndex = Infinity + + return processor + } + + // Data management. + // Getter / setter for processor-specific informtion. + function data(key, value) { + if (typeof key === 'string') { + // Set `key`. + if (arguments.length === 2) { + assertUnfrozen('data', frozen) + + namespace[key] = value + + return processor + } + + // Get `key`. + return (own.call(namespace, key) && namespace[key]) || null + } + + // Set space. + if (key) { + assertUnfrozen('data', frozen) + namespace = key + return processor + } + + // Get space. + return namespace + } + + // Plugin management. + // + // Pass it: + // * an attacher and options, + // * a preset, + // * a list of presets, attachers, and arguments (list of attachers and + // options). + function use(value) { + var settings + + assertUnfrozen('use', frozen) + + if (value === null || value === undefined) { + // Empty. + } else if (typeof value === 'function') { + addPlugin.apply(null, arguments) + } else if (typeof value === 'object') { + if ('length' in value) { + addList(value) + } else { + addPreset(value) + } + } else { + throw new Error('Expected usable value, not `' + value + '`') + } + + if (settings) { + namespace.settings = extend(namespace.settings || {}, settings) + } + + return processor + + function addPreset(result) { + addList(result.plugins) + + if (result.settings) { + settings = extend(settings || {}, result.settings) + } + } + + function add(value) { + if (typeof value === 'function') { + addPlugin(value) + } else if (typeof value === 'object') { + if ('length' in value) { + addPlugin.apply(null, value) + } else { + addPreset(value) + } + } else { + throw new Error('Expected usable value, not `' + value + '`') + } + } + + function addList(plugins) { + var length + var index + + if (plugins === null || plugins === undefined) { + // Empty. + } else if (typeof plugins === 'object' && 'length' in plugins) { + length = plugins.length + index = -1 + + while (++index < length) { + add(plugins[index]) + } + } else { + throw new Error('Expected a list of plugins, not `' + plugins + '`') + } + } + + function addPlugin(plugin, value) { + var entry = find(plugin) + + if (entry) { + if (plain(entry[1]) && plain(value)) { + value = extend(entry[1], value) + } + + entry[1] = value + } else { + attachers.push(slice.call(arguments)) + } + } + } + + function find(plugin) { + var length = attachers.length + var index = -1 + var entry + + while (++index < length) { + entry = attachers[index] + + if (entry[0] === plugin) { + return entry + } + } + } + + // Parse a file (in string or vfile representation) into a unist node using + // the `Parser` on the processor. + function parse(doc) { + var file = vfile(doc) + var Parser + + freeze() + Parser = processor.Parser + assertParser('parse', Parser) + + if (newable(Parser, 'parse')) { + return new Parser(String(file), file).parse() + } + + return Parser(String(file), file) // eslint-disable-line new-cap + } + + // Run transforms on a unist node representation of a file (in string or + // vfile representation), async. + function run(node, file, cb) { + assertNode(node) + freeze() + + if (!cb && typeof file === 'function') { + cb = file + file = null + } + + if (!cb) { + return new Promise(executor) + } + + executor(null, cb) + + function executor(resolve, reject) { + transformers.run(node, vfile(file), done) + + function done(err, tree, file) { + tree = tree || node + if (err) { + reject(err) + } else if (resolve) { + resolve(tree) + } else { + cb(null, tree, file) + } + } + } + } + + // Run transforms on a unist node representation of a file (in string or + // vfile representation), sync. + function runSync(node, file) { + var complete = false + var result + + run(node, file, done) + + assertDone('runSync', 'run', complete) + + return result + + function done(err, tree) { + complete = true + bail(err) + result = tree + } + } + + // Stringify a unist node representation of a file (in string or vfile + // representation) into a string using the `Compiler` on the processor. + function stringify(node, doc) { + var file = vfile(doc) + var Compiler + + freeze() + Compiler = processor.Compiler + assertCompiler('stringify', Compiler) + assertNode(node) + + if (newable(Compiler, 'compile')) { + return new Compiler(node, file).compile() + } + + return Compiler(node, file) // eslint-disable-line new-cap + } + + // Parse a file (in string or vfile representation) into a unist node using + // the `Parser` on the processor, then run transforms on that node, and + // compile the resulting node using the `Compiler` on the processor, and + // store that result on the vfile. + function process(doc, cb) { + freeze() + assertParser('process', processor.Parser) + assertCompiler('process', processor.Compiler) + + if (!cb) { + return new Promise(executor) + } + + executor(null, cb) + + function executor(resolve, reject) { + var file = vfile(doc) + + pipeline.run(processor, {file: file}, done) + + function done(err) { + if (err) { + reject(err) + } else if (resolve) { + resolve(file) + } else { + cb(null, file) + } + } + } + } + + // Process the given document (in string or vfile representation), sync. + function processSync(doc) { + var complete = false + var file + + freeze() + assertParser('processSync', processor.Parser) + assertCompiler('processSync', processor.Compiler) + file = vfile(doc) + + process(file, done) + + assertDone('processSync', 'process', complete) + + return file + + function done(err) { + complete = true + bail(err) + } + } +} + +// Check if `value` is a constructor. +function newable(value, name) { + return ( + typeof value === 'function' && + value.prototype && + // A function with keys in its prototype is probably a constructor. + // Classes’ prototype methods are not enumerable, so we check if some value + // exists in the prototype. + (keys(value.prototype) || name in value.prototype) + ) +} + +// Check if `value` is an object with keys. +function keys(value) { + var key + for (key in value) { + return true + } + + return false +} + +// Assert a parser is available. +function assertParser(name, Parser) { + if (typeof Parser !== 'function') { + throw new Error('Cannot `' + name + '` without `Parser`') + } +} + +// Assert a compiler is available. +function assertCompiler(name, Compiler) { + if (typeof Compiler !== 'function') { + throw new Error('Cannot `' + name + '` without `Compiler`') + } +} + +// Assert the processor is not frozen. +function assertUnfrozen(name, frozen) { + if (frozen) { + throw new Error( + 'Cannot invoke `' + + name + + '` on a frozen processor.\nCreate a new processor first, by invoking it: use `processor()` instead of `processor`.' + ) + } +} + +// Assert `node` is a unist node. +function assertNode(node) { + if (!node || typeof node.type !== 'string') { + throw new Error('Expected node, got `' + node + '`') + } +} + +// Assert that `complete` is `true`. +function assertDone(name, asyncName, complete) { + if (!complete) { + throw new Error( + '`' + name + '` finished async. Use `' + asyncName + '` instead' + ) + } +} diff --git a/node_modules/unified/license b/node_modules/unified/license new file mode 100644 index 0000000..f3722d9 --- /dev/null +++ b/node_modules/unified/license @@ -0,0 +1,21 @@ +(The MIT License) + +Copyright (c) 2015 Titus Wormer + +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: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +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. diff --git a/node_modules/unified/package.json b/node_modules/unified/package.json new file mode 100644 index 0000000..ebed423 --- /dev/null +++ b/node_modules/unified/package.json @@ -0,0 +1,164 @@ +{ + "_from": "unified@^9.0.0", + "_id": "unified@9.0.0", + "_inBundle": false, + "_integrity": "sha512-ssFo33gljU3PdlWLjNp15Inqb77d6JnJSfyplGJPT/a+fNRNyCBeveBAYJdO5khKdF6WVHa/yYCC7Xl6BDwZUQ==", + "_location": "/unified", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "unified@^9.0.0", + "name": "unified", + "escapedName": "unified", + "rawSpec": "^9.0.0", + "saveSpec": null, + "fetchSpec": "^9.0.0" + }, + "_requiredBy": [ + "/slackify-markdown" + ], + "_resolved": "https://registry.npmjs.org/unified/-/unified-9.0.0.tgz", + "_shasum": "12b099f97ee8b36792dbad13d278ee2f696eed1d", + "_spec": "unified@^9.0.0", + "_where": "/Users/josh/Projects/slackify-markdown-action/node_modules/slackify-markdown", + "author": { + "name": "Titus Wormer", + "email": "tituswormer@gmail.com", + "url": "https://wooorm.com" + }, + "bugs": { + "url": "https://github.com/unifiedjs/unified/issues" + }, + "bundleDependencies": false, + "collective": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + }, + "contributors": [ + { + "name": "Titus Wormer", + "email": "tituswormer@gmail.com", + "url": "https://wooorm.com" + }, + { + "name": "Junyoung Choi", + "email": "fluke8259@gmail.com" + }, + { + "name": "Hernan Rajchert", + "email": "hrajchert@gmail.com" + }, + { + "name": "Christian Murphy", + "email": "christian.murphy.42@gmail.com" + }, + { + "name": "Vse Mozhet Byt", + "email": "vsemozhetbyt@gmail.com" + }, + { + "name": "Richard Littauer", + "email": "richard.littauer@gmail.com" + } + ], + "dependencies": { + "bail": "^1.0.0", + "extend": "^3.0.0", + "is-buffer": "^2.0.0", + "is-plain-obj": "^2.0.0", + "trough": "^1.0.0", + "vfile": "^4.0.0" + }, + "deprecated": false, + "description": "Interface for parsing, inspecting, transforming, and serializing content through syntax trees", + "devDependencies": { + "browserify": "^16.0.0", + "c8": "^7.0.0", + "dtslint": "^3.0.0", + "prettier": "^2.0.0", + "remark-cli": "^7.0.0", + "remark-preset-wooorm": "^6.0.0", + "tape": "^4.0.0", + "tinyify": "^2.0.0", + "xo": "^0.28.0" + }, + "files": [ + "types/index.d.ts", + "index.js", + "lib" + ], + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + }, + "homepage": "https://unifiedjs.com", + "keywords": [ + "unified", + "process", + "parse", + "transform", + "compile", + "stringify", + "serialize", + "ast", + "cst", + "syntax", + "tree", + "content", + "rehype", + "retext", + "remark" + ], + "license": "MIT", + "name": "unified", + "prettier": { + "tabWidth": 2, + "useTabs": false, + "singleQuote": true, + "bracketSpacing": false, + "semi": false, + "trailingComma": "none" + }, + "remarkConfig": { + "plugins": [ + "preset-wooorm", + [ + "toc", + { + "heading": "contents" + } + ] + ] + }, + "repository": { + "type": "git", + "url": "git+https://github.com/unifiedjs/unified.git" + }, + "scripts": { + "build": "npm run build-bundle && npm run build-mangle", + "build-bundle": "browserify index.js -s unified -o unified.js", + "build-mangle": "browserify index.js -s unified -p tinyify -o unified.min.js", + "format": "remark . -qfo && prettier --write \"**/{*.js,*.ts}\" && xo --fix", + "test": "npm run format && npm run build && npm run test-coverage && npm run test-types", + "test-api": "node test", + "test-coverage": "c8 --check-coverage --lines 100 --functions 100 --branches 100 --reporter lcov tape test", + "test-types": "dtslint types" + }, + "types": "types/index.d.ts", + "version": "9.0.0", + "xo": { + "prettier": true, + "esnext": false, + "rules": { + "import/no-extraneous-dependencies": "off", + "unicorn/prefer-type-error": "off", + "unicorn/prefer-reflect-apply": "off", + "guard-for-in": "off" + }, + "ignores": [ + "types", + "unified.js" + ] + } +} diff --git a/node_modules/unified/readme.md b/node_modules/unified/readme.md new file mode 100644 index 0000000..042a0eb --- /dev/null +++ b/node_modules/unified/readme.md @@ -0,0 +1,1394 @@ +# [![unified][logo]][site] + +[![GitHub CI][github-ci-badge]][github-ci] +[![Build][build-badge]][build] +[![Coverage][coverage-badge]][coverage] +[![Downloads][downloads-badge]][downloads] +[![Size][size-badge]][size] +[![Sponsors][sponsors-badge]][collective] +[![Backers][backers-badge]][collective] +[![Chat][chat-badge]][chat] + +**unified** is an interface for processing text using syntax trees. +It’s what powers [**remark**][remark] (Markdown), [**retext**][retext] (natural +language), and [**rehype**][rehype] (HTML), and allows for processing between +formats. + +## Intro + +**unified** enables new exciting projects like [Gatsby][] to pull in Markdown, +[MDX][] to embed [JSX][], and [Prettier][] to format it. +It’s used in about 350k projects on GitHub and has about 15m downloads each +month on npm: you’re probably using it. +Some notable users are [Node.js][], [ZEIT][], [Netlify][], [GitHub][], +[Mozilla][], [WordPress][], [Adobe][], [Facebook][], [Google][], and many more. + +* To read about what we are up to, follow us [Twitter][] +* For a less technical and more practical introduction to unified, visit + [`unifiedjs.com`][site] and peruse its [Learn][] section +* Browse [awesome unified][awesome] to find out more about the ecosystem +* Questions? + Get help on [our Spectrum community][spectrum]! +* Check out [Contribute][] below to find out how to help out, or become a + backer or sponsor on [OpenCollective][collective] + +## Sponsors + + + + + + + + + + + + + + + +
+ Gatsby
🥇

+ +
+ ZEIT
🥇

+ + +
+ Netlify
🥇

+ + +
+ Holloway


+ +
+ ThemeIsle
🥉

+ +
+ BoostIO
🥉

+ +
+



+ You? +
+ +## Install + +[npm][]: + +```sh +npm install unified +``` + +This package comes with types. +If you’re using TypeScript, make sure to also install +[`@types/unist`][ts-unist]. + +## Use + +```js +var unified = require('unified') +var markdown = require('remark-parse') +var remark2rehype = require('remark-rehype') +var doc = require('rehype-document') +var format = require('rehype-format') +var html = require('rehype-stringify') +var report = require('vfile-reporter') + +unified() + .use(markdown) + .use(remark2rehype) + .use(doc, {title: '👋🌍'}) + .use(format) + .use(html) + .process('# Hello world!', function (err, file) { + console.error(report(err || file)) + console.log(String(file)) + }) +``` + +Yields: + +```txt +no issues found +``` + +```html + + + + + 👋🌍 + + + +

Hello world!

+ + +``` + +## Contents + +* [Description](#description) +* [API](#api) + * [`processor()`](#processor) + * [`processor.use(plugin[, options])`](#processoruseplugin-options) + * [`processor.parse(file)`](#processorparsefile) + * [`processor.stringify(node[, file])`](#processorstringifynode-file) + * [`processor.run(node[, file][, done])`](#processorrunnode-file-done) + * [`processor.runSync(node[, file])`](#processorrunsyncnode-file) + * [`processor.process(file[, done])`](#processorprocessfile-done) + * [`processor.processSync(file|value)`](#processorprocesssyncfilevalue) + * [`processor.data([key[, value]])`](#processordatakey-value) + * [`processor.freeze()`](#processorfreeze) +* [`Plugin`](#plugin) + * [`function attacher([options])`](#function-attacheroptions) + * [`function transformer(node, file[, next])`](#function-transformernode-file-next) +* [`Preset`](#preset) +* [Contribute](#contribute) +* [Acknowledgments](#acknowledgments) +* [License](#license) + +## Description + +**unified** is an interface for processing text using syntax trees. +Syntax trees are a representation of text understandable to programs. +Those programs, called [*plugin*][plugin]s, take these trees and inspect and +modify them. +To get to the syntax tree from text, there is a [*parser*][parser]. +To get from that back to text, there is a [*compiler*][compiler]. +This is the [*process*][process] of a *processor*. + +```ascii +| ........................ process ........................... | +| .......... parse ... | ... run ... | ... stringify ..........| + + +--------+ +----------+ +Input ->- | Parser | ->- Syntax Tree ->- | Compiler | ->- Output + +--------+ | +----------+ + X + | + +--------------+ + | Transformers | + +--------------+ +``` + +###### Processors + +Every **processor** implements another processor. +To create a processor, call another processor. +The new processor is configured to work the same as its ancestor. +But when the descendant processor is configured in the future it does not affect +the ancestral processor. + +When processors are exposed from a module (for example, `unified` itself) they +should not be configured directly, as that would change their behavior for all +module users. +Those processors are [*frozen*][freeze] and they should be called to create a +new processor before they are used. + +###### Syntax trees + +The **syntax trees** used in **unified** are [**unist**][unist] nodes. +A [**node**][node] is a plain JavaScript objects with a `type` field. +The semantics of nodes and format of syntax trees is defined by other projects. + +There are several [*utilities*][unist-utilities] for working with nodes. + +* [**hast**][hast] — HTML +* [**mdast**][mdast] — Markdown +* [**nlcst**][nlcst] — Natural language +* [**xast**][xast] — XML + +###### List of processors + +The following projects process different [*syntax tree*][syntax-tree] formats. +They parse text to a syntax tree and compile that back to text. +These processors can be used as is, or their parser and compiler can be mixed +and matched with **unified** and plugins to process between different syntaxes. + +* [**rehype**][rehype] ([*hast*][hast]) — HTML +* [**remark**][remark] ([*mdast*][mdast]) — Markdown +* [**retext**][retext] ([*nlcst*][nlcst]) — Natural language + +###### List of plugins + +The below [**plugins**][plugin] work with **unified**, on all [*syntax +tree*][syntax-tree] formats: + +* [`unified-diff`](https://github.com/unifiedjs/unified-diff) + — Ignore messages for unchanged lines in Travis +* [`unified-message-control`](https://github.com/unifiedjs/unified-message-control) + — Enable, disable, and ignore messages + +See [**remark**][remark-plugins], [**rehype**][rehype-plugins], and +[**retext**][retext-plugins] for their lists of plugins. + +###### File + +When processing a document, **metadata** is often gathered about that document. +[**vfile**][vfile] is a virtual file format that stores data, metadata, and +messages about files for **unified** and its plugins. + +There are several [*utilities*][vfile-utilities] for working with these files. + +###### Configuration + +[*Processors*][processors] are configured with [*plugin*][plugin]s or +with the [`data`][data] method. + +###### Integrations + +**unified** can integrate with the file system with [`unified-engine`][engine]. +CLI apps can be created with [`unified-args`][args], Gulp plugins with +[`unified-engine-gulp`][gulp], and Atom Linters with +[`unified-engine-atom`][atom]. + +[`unified-stream`][stream] provides a streaming interface. + +###### Programming interface + +The API provided by **unified** allows multiple files to be processed and gives +access to *metadata* (such as lint messages): + +```js +var unified = require('unified') +var markdown = require('remark-parse') +var styleGuide = require('remark-preset-lint-markdown-style-guide') +var remark2retext = require('remark-retext') +var english = require('retext-english') +var equality = require('retext-equality') +var remark2rehype = require('remark-rehype') +var html = require('rehype-stringify') +var report = require('vfile-reporter') + +unified() + .use(markdown) + .use(styleGuide) + .use(remark2retext, unified().use(english).use(equality)) + .use(remark2rehype) + .use(html) + .process('*Emphasis* and _stress_, you guys!', function (err, file) { + console.error(report(err || file)) + console.log(String(file)) + }) +``` + +Yields: + +```txt + 1:16-1:24 warning Emphasis should use `*` as a marker emphasis-marker remark-lint + 1:30-1:34 warning `guys` may be insensitive, use `people`, `persons`, `folks` instead gals-men retext-equality + +⚠ 2 warnings +``` + +```html +

Emphasis and stress, you guys!

+``` + +###### Processing between syntaxes + +[*Processors*][processors] can be combined in two modes. + +**Bridge** mode transforms the [*syntax tree*][syntax-tree] from one format +(*origin*) to another (*destination*). +Another processor runs on the destination tree. +Finally, the original processor continues transforming the origin tree. + +**Mutate** mode also transforms the syntax tree from one format to another. +But the original processor continues transforming the destination tree. + +In the previous example (“Programming interface”), `remark-retext` is used in +*bridge* mode: the origin syntax tree is kept after [**retext**][retext] is +done; whereas `remark-rehype` is used in *mutate* mode: it sets a new syntax +tree and discards the origin tree. + +* [`remark-retext`][remark-retext] +* [`remark-rehype`][remark-rehype] +* [`rehype-retext`][rehype-retext] +* [`rehype-remark`][rehype-remark] + +## API + +### `processor()` + +[*Processor*][processors] describing how to *process* text. + +###### Returns + +`Function` — New [*unfrozen*][freeze] processor that is configured to work the +same as its ancestor. +When the descendant processor is configured in the future it does not affect the +ancestral processor. + +###### Example + +The following example shows how a new processor can be created (from the remark +processor) and linked to **stdin**(4) and **stdout**(4). + +```js +var remark = require('remark') +var concat = require('concat-stream') + +process.stdin.pipe(concat(onconcat)) + +function onconcat(buf) { + var doc = remark().processSync(buf).toString() + + process.stdout.write(doc) +} +``` + +### `processor.use(plugin[, options])` + +[*Configure*][configuration] the processor to use a [*plugin*][plugin] and +optionally configure that plugin with options. + +If the processor is already using this plugin, the previous plugin configuration +is changed based on the options that are passed in. +The plugin is not added a second time. + +###### Signatures + +* `processor.use(plugin[, options])` +* `processor.use(preset)` +* `processor.use(list)` + +###### Parameters + +* `plugin` ([`Attacher`][plugin]) +* `options` (`*`, optional) — Configuration for `plugin` +* `preset` (`Object`) — Object with an optional `plugins` (set to `list`), + and/or an optional `settings` object +* `list` (`Array`) — List of plugins, presets, and pairs (`plugin` and + `options` in an array) + +###### Returns + +`processor` — The processor that `use` was called on. + +###### Note + +`use` cannot be called on [*frozen*][freeze] processors. +Call the processor first to create a new unfrozen processor. + +###### Example + +There are many ways to pass plugins to `.use()`. +The below example gives an overview. + +```js +var unified = require('unified') + +unified() + // Plugin with options: + .use(pluginA, {x: true, y: true}) + // Passing the same plugin again merges configuration (to `{x: true, y: false, z: true}`): + .use(pluginA, {y: false, z: true}) + // Plugins: + .use([pluginB, pluginC]) + // Two plugins, the second with options: + .use([pluginD, [pluginE, {}]]) + // Preset with plugins and settings: + .use({plugins: [pluginF, [pluginG, {}]], settings: {position: false}}) + // Settings only: + .use({settings: {position: false}}) +``` + +### `processor.parse(file)` + +Parse text to a [*syntax tree*][syntax-tree]. + +###### Parameters + +* `file` ([`VFile`][vfile]) — [*File*][file], any value accepted by `vfile()` + +###### Returns + +[`Node`][node] — Parsed [*syntax tree*][syntax-tree] representing `file`. + +###### Note + +`parse` freezes the processor if not already [*frozen*][freeze]. + +`parse` performs the [*parse phase*][description], not the *run phase* or other +phases. + +###### Example + +The below example shows how `parse` can be used to create a syntax tree from a +file. + +```js +var unified = require('unified') +var markdown = require('remark-parse') + +var tree = unified().use(markdown).parse('# Hello world!') + +console.log(tree) +``` + +Yields: + +```js +{ + type: 'root', + children: [ + {type: 'heading', depth: 1, children: [Array], position: [Position]} + ], + position: { + start: {line: 1, column: 1, offset: 0}, + end: {line: 1, column: 15, offset: 14} + } +} +``` + +#### `processor.Parser` + +A **parser** handles the parsing of text to a [*syntax tree*][syntax-tree]. +Used in the [*parse phase*][description] and called with a `string` and +[`VFile`][vfile] representation of the text to parse. + +`Parser` can be a function, in which case it must return a [`Node`][node]: the +syntax tree representation of the given file. + +`Parser` can also be a constructor function (a function with a `parse` field, or +other fields, in its `prototype`), in which case it’s constructed with `new`. +Instances must have a `parse` method that is called without arguments and must +return a [`Node`][node]. + +### `processor.stringify(node[, file])` + +Compile a [*syntax tree*][syntax-tree]. + +###### Parameters + +* `node` ([`Node`][node]) — [*Syntax tree*][syntax-tree] to compile +* `file` ([`VFile`][vfile], optional) — [*File*][file], any value accepted by + `vfile()` + +###### Returns + +`string` or `Buffer` (see notes) — Textual representation of the [*syntax +tree*][syntax-tree] + +###### Note + +`stringify` freezes the processor if not already [*frozen*][freeze]. + +`stringify` performs the [*stringify phase*][description], not the *run phase* +or other phases. + +unified typically compiles by serializing: most [*compiler*][compiler]s return +`string` (or `Buffer`). +Some compilers, such as the one configured with [`rehype-react`][rehype-react], +return other values (in this case, a React tree). +If you’re using a compiler doesn’t serialize, expect different result values. +When using TypeScript, cast the type on your side. + +###### Example + +The below example shows how `stringify` can be used to serialize a syntax tree. + +```js +var unified = require('unified') +var html = require('rehype-stringify') +var h = require('hastscript') + +var tree = h('h1', 'Hello world!') + +var doc = unified().use(html).stringify(tree) + +console.log(doc) +``` + +Yields: + +```html +

Hello world!

+``` + +#### `processor.Compiler` + +A **compiler** handles the compiling of a [*syntax tree*][syntax-tree] to text. +Used in the [*stringify phase*][description] and called with a [`Node`][node] +and [`VFile`][file] representation of syntax tree to compile. + +`Compiler` can be a function, in which case it should return a `string`: the +textual representation of the syntax tree. + +`Compiler` can also be a constructor function (a function with a `compile` +field, or other fields, in its `prototype`), in which case it’s constructed with +`new`. +Instances must have a `compile` method that is called without arguments and +should return a `string`. + +### `processor.run(node[, file][, done])` + +Run [*transformers*][transformer] on a [*syntax tree*][syntax-tree]. + +###### Parameters + +* `node` ([`Node`][node]) — [*Syntax tree*][syntax-tree] to run on +* `file` ([`VFile`][vfile], optional) — [*File*][file], any value accepted by + `vfile()` +* `done` ([`Function`][run-done], optional) — Callback + +###### Returns + +[`Promise`][promise] if `done` is not given. +The returned promise is rejected with a fatal error, or resolved with the +transformed [*syntax tree*][syntax-tree]. + +###### Note + +`run` freezes the processor if not already [*frozen*][freeze]. + +`run` performs the [*run phase*][description], not other phases. + +#### `function done(err[, node, file])` + +Callback called when [*transformers*][transformer] are done. +Called with either an error or results. + +###### Parameters + +* `err` (`Error`, optional) — Fatal error +* `node` ([`Node`][node], optional) — Transformed [*syntax tree*][syntax-tree] +* `file` ([`VFile`][vfile], optional) — [*File*][file] + +###### Example + +The below example shows how `run` can be used to transform a syntax tree. + +```js +var unified = require('unified') +var references = require('remark-reference-links') +var u = require('unist-builder') + +var tree = u('root', [ + u('paragraph', [ + u('link', {href: 'https://example.com'}, [u('text', 'Example Domain')]) + ]) +]) + +unified() + .use(references) + .run(tree, function (err, tree) { + if (err) throw err + console.log(tree) + }) +``` + +Yields: + +```js +{ + type: 'root', + children: [ + {type: 'paragraph', children: [Array]}, + {type: 'definition', identifier: '1', title: undefined, url: undefined} + ] +} +``` + +### `processor.runSync(node[, file])` + +Run [*transformers*][transformer] on a [*syntax tree*][syntax-tree]. + +An error is thrown if asynchronous [*plugin*][plugin]s are configured. + +###### Parameters + +* `node` ([`Node`][node]) — [*Syntax tree*][syntax-tree] to run on +* `file` ([`VFile`][vfile], optional) — [*File*][file], any value accepted by + `vfile()` + +###### Returns + +[`Node`][node] — Transformed [*syntax tree*][syntax-tree]. + +###### Note + +`runSync` freezes the processor if not already [*frozen*][freeze]. + +`runSync` performs the [*run phase*][description], not other phases. + +### `processor.process(file[, done])` + +[*Process*][description] the given [*file*][file] as configured on the +processor. + +###### Parameters + +* `file` ([`VFile`][vfile]) — [*File*][file], any value accepted by `vfile()` +* `done` ([`Function`][process-done], optional) — Callback + +###### Returns + +[`Promise`][promise] if `done` is not given. +The returned promise is rejected with a fatal error, or resolved with the +processed [*file*][file]. + +The parsed, transformed, and compiled value is exposed on +[`file.contents`][vfile-contents] or `file.result` (see notes). + +###### Note + +`process` freezes the processor if not already [*frozen*][freeze]. + +`process` performs the [*parse*, *run*, and *stringify* phases][description]. + +Be aware that [*compiler*][compiler]s typically, but not always, return +`string`. +Some compilers, such as the one configured with [`rehype-react`][rehype-react], +return other values (in this case, a React tree). +When using TypeScript, cast the type of [`file.contents`][vfile-contents] on +your side. + +unified typically compiles by serializing: most [*compiler*][compiler]s return +`string` (or `Buffer`). +Some compilers, such as the one configured with [`rehype-react`][rehype-react], +return other values (in this case, a React tree). +If you’re using a compiler that serializes, the result is available at +`file.contents`. +Otherwise, the result is available at `file.result`. + +###### Example + +The below example shows how `process` can be used to process a file, whether +transformers are asynchronous or not, with promises. + +```js +var unified = require('unified') +var markdown = require('remark-parse') +var remark2rehype = require('remark-rehype') +var doc = require('rehype-document') +var format = require('rehype-format') +var html = require('rehype-stringify') + +unified() + .use(markdown) + .use(remark2rehype) + .use(doc, {title: '👋🌍'}) + .use(format) + .use(html) + .process('# Hello world!') + .then( + function (file) { + console.log(String(file)) + }, + function (err) { + console.error(String(err)) + } + ) +``` + +Yields: + +```html + + + + + 👋🌍 + + + +

Hello world!

+ + +``` + +#### `function done(err, file)` + +Callback called when the [*process*][description] is done. +Called with a fatal error, if any, and a [*file*][file]. + +###### Parameters + +* `err` (`Error`, optional) — Fatal error +* `file` ([`VFile`][vfile]) — Processed [*file*][file] + +###### Example + +The below example shows how `process` can be used to process a file, whether +transformers are asynchronous or not, with a callback. + +```js +var unified = require('unified') +var parse = require('remark-parse') +var stringify = require('remark-stringify') +var github = require('remark-github') +var report = require('vfile-reporter') + +unified() + .use(parse) + .use(github) + .use(stringify) + .process('@wooorm', function (err, file) { + console.error(report(err || file)) + console.log(String(file)) + }) +``` + +Yields: + +```txt +no issues found +``` + +```markdown +[**@wooorm**](https://github.com/wooorm) +``` + +### `processor.processSync(file|value)` + +[*Process*][description] the given [*file*][file] as configured on the +processor. + +An error is thrown if asynchronous [*plugin*][plugin]s are configured. + +###### Parameters + +* `file` ([`VFile`][vfile]) — [*File*][file], any value accepted by `vfile()` + +###### Returns + +([`VFile`][vfile]) — Processed [*file*][file] + +The parsed, transformed, and compiled value is exposed on +[`file.contents`][vfile-contents] or `file.result` (see notes). + +###### Note + +`processSync` freezes the processor if not already [*frozen*][freeze]. + +`processSync` performs the [*parse*, *run*, and *stringify* +phases][description]. + +unified typically compiles by serializing: most [*compiler*][compiler]s return +`string` (or `Buffer`). +Some compilers, such as the one configured with [`rehype-react`][rehype-react], +return other values (in this case, a React tree). +If you’re using a compiler that serializes, the result is available at +`file.contents`. +Otherwise, the result is available at `file.result`. + +###### Example + +The below example shows how `processSync` can be used to process a file, if all +transformers are synchronous. + +```js +var unified = require('unified') +var markdown = require('remark-parse') +var remark2rehype = require('remark-rehype') +var doc = require('rehype-document') +var format = require('rehype-format') +var html = require('rehype-stringify') + +var processor = unified() + .use(markdown) + .use(remark2rehype) + .use(doc, {title: '👋🌍'}) + .use(format) + .use(html) + +console.log(processor.processSync('# Hello world!').toString()) +``` + +Yields: + +```html + + + + + 👋🌍 + + + +

Hello world!

+ + +``` + +### `processor.data([key[, value]])` + +[*Configure*][configuration] the processor with information available to all +[*plugin*][plugin]s. +Information is stored in an in-memory key-value store. + +Typically, options can be given to a specific plugin, but sometimes it makes +sense to have information shared with several plugins. +For example, a list of HTML elements that are self-closing, which is needed +during all [*phases*][description] of the *process*. + +###### Signatures + +* `processor = processor.data(key, value)` +* `processor = processor.data(values)` +* `value = processor.data(key)` +* `info = processor.data()` + +###### Parameters + +* `key` (`string`, optional) — Identifier +* `value` (`*`, optional) — Value to set +* `values` (`Object`, optional) — Values to set + +###### Returns + +* `processor` — If setting, the processor that `data` is called on +* `value` (`*`) — If getting, the value at `key` +* `info` (`Object`) — Without arguments, the key-value store + +###### Note + +Setting information cannot occur on [*frozen*][freeze] processors. +Call the processor first to create a new unfrozen processor. + +###### Example + +The following example show how to get and set information: + +```js +var unified = require('unified') + +var processor = unified().data('alpha', 'bravo') + +processor.data('alpha') // => 'bravo' + +processor.data() // {alpha: 'bravo'} + +processor.data({charlie: 'delta'}) + +processor.data() // {charlie: 'delta'} +``` + +### `processor.freeze()` + +**Freeze** a processor. +*Frozen* processors are meant to be extended and not to be configured directly. + +Once a processor is frozen it cannot be *unfrozen*. +New processors working the same way can be created by calling the processor. + +It’s possible to freeze processors explicitly by calling `.freeze()`. +Processors freeze implicitly when [`.parse()`][parse], [`.run()`][run], +[`.runSync()`][run-sync], [`.stringify()`][stringify], [`.process()`][process], +or [`.processSync()`][process-sync] are called. + +###### Returns + +`processor` — The processor that `freeze` was called on. + +###### Example + +The following example, `index.js`, shows how rehype prevents extensions to +itself: + +```js +var unified = require('unified') +var parse = require('rehype-parse') +var stringify = require('rehype-stringify') + +module.exports = unified().use(parse).use(stringify).freeze() +``` + +The below example, `a.js`, shows how that processor can be used and configured. + +```js +var rehype = require('rehype') +var format = require('rehype-format') +// … + +rehype() + .use(format) + // … +``` + +The below example, `b.js`, shows a similar looking example that operates on the +frozen rehype interface because it does not call `rehype`. +If this behavior was allowed it would result in unexpected behavior so an +error is thrown. +**This is invalid**: + +```js +var rehype = require('rehype') +var format = require('rehype-format') +// … + +rehype + .use(format) + // … +``` + +Yields: + +```txt +~/node_modules/unified/index.js:440 + throw new Error( + ^ + +Error: Cannot invoke `use` on a frozen processor. +Create a new processor first, by invoking it: use `processor()` instead of `processor`. + at assertUnfrozen (~/node_modules/unified/index.js:440:11) + at Function.use (~/node_modules/unified/index.js:172:5) + at Object. (~/b.js:6:4) +``` + +## `Plugin` + +**Plugins** [*configure*][configuration] the processors they are applied on in +the following ways: + +* They change the processor: such as the [*parser*][parser], the + [*compiler*][compiler], or configuring [*data*][data] +* They specify how to handle [*syntax trees*][syntax-tree] and [*files*][file] + +Plugins are a concept. +They materialize as [`attacher`][attacher]s. + +###### Example + +`move.js`: + +```js +module.exports = move + +function move(options) { + var expected = (options || {}).extname + + if (!expected) { + throw new Error('Missing `extname` in options') + } + + return transformer + + function transformer(tree, file) { + if (file.extname && file.extname !== expected) { + file.extname = expected + } + } +} +``` + +`index.md`: + +```markdown +# Hello, world! +``` + +`index.js`: + +```js +var unified = require('unified') +var parse = require('remark-parse') +var remark2rehype = require('remark-rehype') +var stringify = require('rehype-stringify') +var vfile = require('to-vfile') +var report = require('vfile-reporter') +var move = require('./move') + +unified() + .use(parse) + .use(remark2rehype) + .use(move, {extname: '.html'}) + .use(stringify) + .process(vfile.readSync('index.md'), function (err, file) { + console.error(report(err || file)) + if (file) { + vfile.writeSync(file) // Written to `index.html`. + } + }) +``` + +Yields: + +```txt +index.md: no issues found +``` + +`index.html`: + +```html +

Hello, world!

+``` + +### `function attacher([options])` + +**Attachers** are materialized [*plugin*][plugin]s. +An attacher is a function that can receive options and +[*configures*][configuration] the processor. + +Attachers change the processor, such as the [*parser*][parser], the +[*compiler*][compiler], configuring [*data*][data], or by specifying how the +[*syntax tree*][syntax-tree] or [*file*][file] are handled. + +###### Context + +The context object (`this`) is set to the processor the attacher is applied on. + +###### Parameters + +* `options` (`*`, optional) — Configuration + +###### Returns + +[`transformer`][transformer] — Optional. + +###### Note + +Attachers are called when the processor is [*frozen*][freeze], not when they are +applied. + +### `function transformer(node, file[, next])` + +**Transformers** handle [*syntax tree*][syntax-tree]s and [*file*][file]s. +A transformer is a function that is called each time a syntax tree and file are +passed through the [*run phase*][description]. +If an error occurs (either because it’s thrown, returned, rejected, or passed to +[`next`][next]), the process stops. + +The *run phase* is handled by [`trough`][trough], see its documentation for the +exact semantics of these functions. + +###### Parameters + +* `node` ([`Node`][node]) — [*Syntax tree*][syntax-tree] to handle +* `file` ([`VFile`][vfile]) — [*File*][file] to handle +* `next` ([`Function`][next], optional) + +###### Returns + +* `void` — If nothing is returned, the next transformer keeps using same tree. +* `Error` — Fatal error to stop the process +* `node` ([`Node`][node]) — New [*syntax tree*][syntax-tree]. + If returned, the next transformer is given this new tree +* `Promise` — Returned to perform an asynchronous operation. + The promise **must** be resolved (optionally with a [`Node`][node]) or + rejected (optionally with an `Error`) + +#### `function next(err[, tree[, file]])` + +If the signature of a [*transformer*][transformer] includes `next` (the third +argument), the transformer **may** perform asynchronous operations, and **must** +call `next()`. + +###### Parameters + +* `err` (`Error`, optional) — Fatal error to stop the process +* `node` ([`Node`][node], optional) — New [*syntax tree*][syntax-tree]. + If given, the next transformer is given this new tree +* `file` ([`VFile`][vfile], optional) — New [*file*][file]. + If given, the next transformer is given this new file + +## `Preset` + +**Presets** are sharable [*configuration*][configuration]. +They can contain [*plugins*][plugin] and settings. + +###### Example + +`preset.js`: + +```js +exports.settings = {bullet: '*', emphasis: '*', fences: true} + +exports.plugins = [ + require('remark-preset-lint-recommended'), + require('remark-preset-lint-consistent'), + require('remark-comment-config'), + [require('remark-toc'), {maxDepth: 3, tight: true}], + require('remark-license') +] +``` + +`readme.md`: + +```markdown +# Hello, world! + +_Emphasis_ and **importance**. + +## Table of contents + +## API + +## License +``` + +`index.js`: + +```js +var remark = require('remark') +var vfile = require('to-vfile') +var report = require('vfile-reporter') +var preset = require('./preset') + +remark() + .use(preset) + .process(vfile.readSync('readme.md'), function (err, file) { + console.error(report(err || file)) + + if (file) { + vfile.writeSync(file) + } + }) +``` + +Yields: + +```txt +readme.md: no issues found +``` + +`readme.md` now contains: + +```markdown +# Hello, world! + +*Emphasis* and **importance**. + +## Table of contents + +* [API](#api) +* [License](#license) + +## API + +## License + +[MIT](license) © [Titus Wormer](https://wooorm.com) +``` + +## Contribute + +See [`contributing.md`][contributing] in [`unifiedjs/.github`][health] for ways +to get started. +See [`support.md`][support] for ways to get help. +Ideas for new plugins and tools can be posted in [`unifiedjs/ideas`][ideas]. + +A curated list of awesome unified resources can be found in [**awesome +unified**][awesome]. + +This project has a [code of conduct][coc]. +By interacting with this repository, organization, or community you agree to +abide by its terms. + +## Acknowledgments + +Preliminary work for unified was done [in 2014][preliminary] for +[**retext**][retext] and inspired by [`ware`][ware]. +Further incubation happened in [**remark**][remark]. +The project was finally [externalised][] in 2015 and [published][] as `unified`. +The project was authored by [**@wooorm**](https://github.com/wooorm). + +Although `unified` since moved its plugin architecture to [`trough`][trough], +thanks to [**@calvinfo**](https://github.com/calvinfo), +[**@ianstormtaylor**](https://github.com/ianstormtaylor), and others for their +work on [`ware`][ware], as it was a huge initial inspiration. + +## License + +[MIT][license] © [Titus Wormer][author] + + + +[logo]: https://raw.githubusercontent.com/unifiedjs/unified/39917ea/logo.svg?sanitize=true + +[github-ci-badge]: https://github.com/unifiedjs/unified/workflows/CI/badge.svg + +[github-ci]: https://github.com/unifiedjs/unified/actions + +[build-badge]: https://img.shields.io/travis/unifiedjs/unified.svg + +[build]: https://travis-ci.org/unifiedjs/unified + +[coverage-badge]: https://img.shields.io/codecov/c/github/unifiedjs/unified.svg + +[coverage]: https://codecov.io/github/unifiedjs/unified + +[downloads-badge]: https://img.shields.io/npm/dm/unified.svg + +[downloads]: https://www.npmjs.com/package/unified + +[size-badge]: https://img.shields.io/bundlephobia/minzip/unified.svg + +[size]: https://bundlephobia.com/result?p=unified + +[sponsors-badge]: https://opencollective.com/unified/sponsors/badge.svg + +[backers-badge]: https://opencollective.com/unified/backers/badge.svg + +[collective]: https://opencollective.com/unified + +[chat-badge]: https://img.shields.io/badge/chat-spectrum-7b16ff.svg + +[chat]: https://spectrum.chat/unified + +[health]: https://github.com/unifiedjs/.github + +[contributing]: https://github.com/unifiedjs/.github/blob/master/contributing.md + +[support]: https://github.com/unifiedjs/.github/blob/master/support.md + +[coc]: https://github.com/unifiedjs/.github/blob/master/code-of-conduct.md + +[awesome]: https://github.com/unifiedjs/awesome-unified + +[license]: license + +[author]: https://wooorm.com + +[npm]: https://docs.npmjs.com/cli/install + +[ts-unist]: https://www.npmjs.com/package/@types/unist + +[site]: https://unifiedjs.com + +[twitter]: https://twitter.com/unifiedjs + +[learn]: https://unifiedjs.com/learn/ + +[spectrum]: https://spectrum.chat/unified + +[rehype]: https://github.com/rehypejs/rehype + +[remark]: https://github.com/remarkjs/remark + +[retext]: https://github.com/retextjs/retext + +[hast]: https://github.com/syntax-tree/hast + +[mdast]: https://github.com/syntax-tree/mdast + +[nlcst]: https://github.com/syntax-tree/nlcst + +[xast]: https://github.com/syntax-tree/xast + +[unist]: https://github.com/syntax-tree/unist + +[engine]: https://github.com/unifiedjs/unified-engine + +[args]: https://github.com/unifiedjs/unified-args + +[gulp]: https://github.com/unifiedjs/unified-engine-gulp + +[atom]: https://github.com/unifiedjs/unified-engine-atom + +[remark-rehype]: https://github.com/remarkjs/remark-rehype + +[remark-retext]: https://github.com/remarkjs/remark-retext + +[rehype-retext]: https://github.com/rehypejs/rehype-retext + +[rehype-remark]: https://github.com/rehypejs/rehype-remark + +[unist-utilities]: https://github.com/syntax-tree/unist#list-of-utilities + +[vfile]: https://github.com/vfile/vfile + +[vfile-contents]: https://github.com/vfile/vfile#vfilecontents + +[vfile-utilities]: https://github.com/vfile/vfile#related-tools + +[node]: https://github.com/syntax-tree/unist#node + +[description]: #description + +[syntax-tree]: #syntax-trees + +[configuration]: #configuration + +[file]: #file + +[processors]: #processors + +[process]: #processorprocessfile-done + +[process-sync]: #processorprocesssyncfilevalue + +[parse]: #processorparsefile + +[parser]: #processorparser + +[stringify]: #processorstringifynode-file + +[run]: #processorrunnode-file-done + +[run-sync]: #processorrunsyncnode-file + +[compiler]: #processorcompiler + +[data]: #processordatakey-value + +[attacher]: #function-attacheroptions + +[transformer]: #function-transformernode-file-next + +[next]: #function-nexterr-tree-file + +[freeze]: #processorfreeze + +[plugin]: #plugin + +[run-done]: #function-doneerr-node-file + +[process-done]: #function-doneerr-file + +[contribute]: #contribute + +[rehype-react]: https://github.com/rhysd/rehype-react + +[trough]: https://github.com/wooorm/trough#function-fninput-next + +[promise]: https://developer.mozilla.org/Web/JavaScript/Reference/Global_Objects/Promise + +[remark-plugins]: https://github.com/remarkjs/remark/blob/master/doc/plugins.md#list-of-plugins + +[rehype-plugins]: https://github.com/rehypejs/rehype/blob/master/doc/plugins.md#list-of-plugins + +[retext-plugins]: https://github.com/retextjs/retext/blob/master/doc/plugins.md#list-of-plugins + +[stream]: https://github.com/unifiedjs/unified-stream + +[ideas]: https://github.com/unifiedjs/ideas + +[preliminary]: https://github.com/retextjs/retext/commit/8fcb1f#diff-168726dbe96b3ce427e7fedce31bb0bc + +[externalised]: https://github.com/remarkjs/remark/commit/9892ec#diff-168726dbe96b3ce427e7fedce31bb0bc + +[published]: https://github.com/unifiedjs/unified/commit/2ba1cf + +[ware]: https://github.com/segmentio/ware + +[gatsby]: https://www.gatsbyjs.org + +[mdx]: https://mdxjs.com + +[jsx]: https://reactjs.org/docs/jsx-in-depth.html + +[prettier]: https://prettier.io + +[node.js]: https://nodejs.org + +[zeit]: https://zeit.co + +[netlify]: https://www.netlify.com + +[github]: https://github.com + +[mozilla]: https://www.mozilla.org + +[wordpress]: https://wordpress.com + +[adobe]: https://www.adobe.com + +[facebook]: https://www.facebook.com + +[google]: https://www.google.com diff --git a/node_modules/unified/types/index.d.ts b/node_modules/unified/types/index.d.ts new file mode 100644 index 0000000..1ac2dde --- /dev/null +++ b/node_modules/unified/types/index.d.ts @@ -0,0 +1,400 @@ +// TypeScript Version: 3.4 + +import {Node} from 'unist' +import {VFile, VFileContents, VFileOptions, VFileCompatible} from 'vfile' +import vfile = require('vfile') + +declare namespace unified { + /** + * Processor allows plugins, parsers, and compilers to be chained together to transform content. + * + * @typeParam P Processor settings. Useful when packaging unified with a preset parser and compiler. + */ + interface Processor

{ + /** + * Clone current processor + * + * @returns New unfrozen processor which is configured to function the same as its ancestor. + * But when the descendant processor is configured in the future it does not affect the ancestral processor. + */ + (): Processor

+ + /** + * Configure the processor to use a plugin and optionally configure that plugin with options. + * + * @param plugin unified plugin + * @param settings Configuration for plugin + * @typeParam S Plugin settings + * @returns The processor on which use is invoked + */ + use( + plugin: Plugin, + ...settings: S + ): Processor

+ + /** + * Configure the processor with a preset to use + * + * @param preset `Object` with an plugins (set to list), and/or an optional settings object + */ + use(preset: Preset): Processor

+ + /** + * Configure using a tuple of plugin and setting(s) + * + * @param pluginTuple pairs, plugin and settings in an array + * @typeParam S Plugin settings + */ + use( + pluginTuple: PluginTuple + ): Processor

+ + /** + * A list of plugins and presets to be applied to processor + * + * @param list List of plugins, presets, and pairs + */ + use(list: PluggableList

): Processor

+ + /** + * Configuration passed to a frozen processor + * + * @param processorSettings Settings passed to processor + */ + use(processorSettings: ProcessorSettings

): Processor

+ + /** + * Parse text to a syntax tree. + * + * @param file VFile or anything which can be given to vfile() + * @returns Syntax tree representation of input. + */ + parse(file: VFileCompatible): Node + + /** + * Function handling the parsing of text to a syntax tree. + * Used in the parse phase in the process and invoked with a `string` and `VFile` representation of the document to parse. + * + * `Parser` can be a normal function in which case it must return a `Node`: the syntax tree representation of the given file. + * + * `Parser` can also be a constructor function (a function with keys in its `prototype`) in which case it’s invoked with `new`. + * Instances must have a parse method which is invoked without arguments and must return a `Node`. + */ + Parser: ParserConstructor | ParserFunction + + /** + * Compile a syntax tree to text. + * + * @param node unist node + * @param file `VFile` or anything which can be given to `vfile()` + * @returns String representation of the syntax tree file + */ + stringify(node: Node, file?: VFileCompatible): string + + /** + * Function handling the compilation of syntax tree to a text. + * Used in the stringify phase in the process and invoked with a `Node` and `VFile` representation of the document to stringify. + * + * `Compiler` can be a normal function in which case it must return a `string`: the text representation of the given syntax tree. + * + * `Compiler` can also be a constructor function (a function with keys in its `prototype`) in which case it’s invoked with `new`. + * Instances must have a `compile` method which is invoked without arguments and must return a `string`. + */ + Compiler: CompilerConstructor | CompilerFunction + + /** + * Transform a syntax tree by applying plugins to it. + * + * @param node Node to transform + * @returns `Promise` if `done` is not given. Rejected with an error, or resolved with the resulting syntax tree. + */ + run(node: Node): Promise + + /** + * Transform a syntax tree by applying plugins to it. + * + * @param node Node to transform + * @param file `VFile` or anything which can be given to `vfile()` + * @returns `Promise` if `done` is not given. Rejected with an error, or resolved with the resulting syntax tree. + */ + run(node: Node, file: VFileCompatible): Promise + + /** + * Transform a syntax tree by applying plugins to it. + * + * @param node Node to transform + * @param done Invoked when transformation is complete. + */ + run(node: Node, done: RunCallback): void + + /** + * Transform a syntax tree by applying plugins to it. + * + * @param node Node to transform + * @param file `VFile` or anything which can be given to `vfile()` + * @param done Invoked when transformation is complete. + */ + run(node: Node, file: VFileCompatible, done: RunCallback): void + + /** + * Transform a syntax tree by applying plugins to it. + * + * If asynchronous plugins are configured an error is thrown. + * + * @param node Node to transform + * @param file `VFile` or anything which can be given to `vfile()` + * @returns The given syntax tree. + */ + runSync(node: Node, file?: VFileCompatible): Node + + /** + * Process the given representation of a file as configured on the processor. The process invokes `parse`, `run`, and `stringify` internally. + * @param file `VFile` or anything which can be given to `vfile()` + * @returns `Promise` if `done` is not given. + * Rejected with an error or resolved with the resulting file. + */ + process(file: VFileCompatible): Promise + + /** + * Process the given representation of a file as configured on the processor. The process invokes `parse`, `run`, and `stringify` internally. + * @param file `VFile` or anything which can be given to `vfile()` + * @param done Invoked when the process is complete. Invoked with a fatal error, if any, and the VFile. + */ + process(file: VFileCompatible, done: ProcessCallback): void + + /** + * Process the given representation of a file as configured on the processor. The process invokes `parse`, `run`, and `stringify` internally. + * + * If asynchronous plugins are configured an error is thrown. + * + * @param file `VFile` or anything which can be given to `vfile()` + * @returns Virtual file with modified contents. + */ + processSync(file: VFileCompatible): VFile + + /** + * Get or set information in an in-memory key-value store accessible to all phases of the process. + * An example is a list of HTML elements which are self-closing, which is needed when parsing, transforming, and compiling HTML. + * + * @returns key-value store object + */ + data(): {[key: string]: unknown} + + /** + * @param key Identifier + * @returns If getting, the value at key + */ + data(key: string): unknown + + /** + * @param value Value to set. Omit if getting key + * @returns If setting, the processor on which data is invoked + */ + data(key: string, value: any): Processor

+ + /** + * Freeze a processor. Frozen processors are meant to be extended and not to be configured or processed directly. + * + * Once a processor is frozen it cannot be unfrozen. New processors functioning just like it can be created by invoking the processor. + * + * It’s possible to freeze processors explicitly, by calling `.freeze()`, but `.parse()`, `.run()`, `.stringify()`, and `.process()` call `.freeze()` to freeze a processor too. + * + * @returns The processor on which freeze is invoked. + */ + freeze(): Processor

+ } + + /** + * A Plugin (Attacher) is the thing passed to `use`. + * It configures the processor and in turn can receive options. + * + * Attachers can configure processors, such as by interacting with parsers and compilers, linking them to other processors, or by specifying how the syntax tree is handled. + * + * @param settings Configuration + * @typeParam S Plugin settings + * @typeParam P Processor settings + * @returns Optional Transformer. + */ + type Plugin = Attacher + + /** + * Configuration passed to a Plugin or Processor + */ + interface Settings { + [key: string]: unknown + } + + /** + * Presets provide a potentially sharable way to configure processors. + * They can contain multiple plugins and optionally settings as well. + * + * @typeParam P Processor settings + */ + interface Preset { + plugins: PluggableList

+ settings?: Settings + } + + /** + * Settings can be passed directly to the processor + * + * @typeParam P Settings applied to a processor. Useful when packaging unified with a preset parser and compiler. + */ + interface ProcessorSettings

{ + settings: P + } + + /** + * A pairing of a plugin with its settings + * + * @typeParam S Plugin settings + * @typeParam P Processor settings + */ + type PluginTuple = [ + Plugin, + /** + * NOTE: ideally this would be S instead of any[] + * As of TypeScript 3.5.2 generic tuples cannot be spread + * See: https://github.com/microsoft/TypeScript/issues/26113 + */ + ...any[] + ] + + /** + * A union of the different ways to add plugins to unified + * + * @typeParam S Plugin settings + * @typeParam P Processor settings + */ + type Pluggable = + | Plugin + | Preset + | PluginTuple + + /** + * A list of plugins and presets + * + * @typeParam P Processor settings + */ + type PluggableList

= Array> + + /** + * An attacher is the thing passed to `use`. + * It configures the processor and in turn can receive options. + * + * Attachers can configure processors, such as by interacting with parsers and compilers, linking them to other processors, or by specifying how the syntax tree is handled. + * + * @param settings Configuration + * @typeParam S Plugin settings + * @typeParam P Processor settings + * @returns Optional Transformer. + */ + type Attacher = ( + this: Processor

, + ...settings: S + ) => Transformer | void + + /** + * Transformers modify the syntax tree or metadata of a file. A transformer is a function which is invoked each time a file is passed through the transform phase. + * If an error occurs (either because it’s thrown, returned, rejected, or passed to `next`), the process stops. + * + * The transformation process in unified is handled by `trough`, see it’s documentation for the exact semantics of transformers. + * + * @param node Node or tree to be transformed + * @param file File associated with node or tree + * @param next If the signature of a transformer includes `next` (third argument), the function may finish asynchronous, and must invoke `next()`. + * @returns + * - `void` — If nothing is returned, the next transformer keeps using same tree. + * - `Error` — Can be returned to stop the process + * - `Node` — Can be returned and results in further transformations and `stringify`s to be performed on the new tree + * - `Promise` — If a promise is returned, the function is asynchronous, and must be resolved (optionally with a `Node`) or rejected (optionally with an `Error`) + */ + type Transformer = ( + node: Node, + file: VFile, + next?: ( + error: Error | null, + tree: Node, + file: VFile + ) => Record + ) => Error | Node | Promise | void | Promise + + /** + * Transform file contents into an AST + */ + interface Parser { + /** + * Transform file contents into an AST + * + * @returns Parsed AST node/tree + */ + parse(): Node + } + + /** + * A constructor function (a function with keys in its `prototype`) or class that implements a + * `parse` method. + */ + type ParserConstructor = new (text: string, file: VFile) => Parser + + /** + * Transform file contents into an AST + * + * @param text Text to transform into AST node(s) + * @param file File associated with text + * @returns Parsed AST node/tree + */ + type ParserFunction = (text: string, file: VFile) => Node + + /** + * Transform an AST node/tree into text + */ + interface Compiler { + /** + * Transform an AST node/tree into text + * + * @returns Compiled text + */ + compile(): string + } + + /** + * A constructor function (a function with keys in its `prototype`) or class that implements a + * `compile` method. + */ + type CompilerConstructor = new (node: Node, file: VFile) => Compiler + + /** + * Transform an AST node/tree into text + * + * @param node Node/tree to be stringified + * @param file File associated with node + * @returns Compiled text + */ + type CompilerFunction = (node: Node, file: VFile) => string + + /** + * Access results from transforms + * + * @param error Error if any occurred + * @param node Transformed AST tree/node + * @param vfile File associated with node + */ + type RunCallback = (error: Error | null, node: Node, file: VFile) => void + + /** + * Access results from transforms + * + * @param error Error if any occurred + * @param vfile File with updated content + */ + type ProcessCallback = (error: Error | null, file: VFile) => void +} + +/** + * Unified processor allows plugins, parsers, and compilers to be chained together to transform content. + * + * @typeParam P Processor settings. Useful when packaging unified with a preset parser and compiler. + */ +declare function unified

(): unified.Processor

+export = unified diff --git a/node_modules/unist-util-is/convert.d.ts b/node_modules/unist-util-is/convert.d.ts new file mode 100644 index 0000000..ce80aea --- /dev/null +++ b/node_modules/unist-util-is/convert.d.ts @@ -0,0 +1,6 @@ +import {Test, TestFunction} from './' +import {Node} from 'unist' + +declare function convert(test: Test): TestFunction + +export = convert diff --git a/node_modules/unist-util-is/convert.js b/node_modules/unist-util-is/convert.js new file mode 100644 index 0000000..f92f34f --- /dev/null +++ b/node_modules/unist-util-is/convert.js @@ -0,0 +1,87 @@ +'use strict' + +module.exports = convert + +function convert(test) { + if (typeof test === 'string') { + return typeFactory(test) + } + + if (test === null || test === undefined) { + return ok + } + + if (typeof test === 'object') { + return ('length' in test ? anyFactory : matchesFactory)(test) + } + + if (typeof test === 'function') { + return test + } + + throw new Error('Expected function, string, or object as test') +} + +function convertAll(tests) { + var results = [] + var length = tests.length + var index = -1 + + while (++index < length) { + results[index] = convert(tests[index]) + } + + return results +} + +// Utility assert each property in `test` is represented in `node`, and each +// values are strictly equal. +function matchesFactory(test) { + return matches + + function matches(node) { + var key + + for (key in test) { + if (node[key] !== test[key]) { + return false + } + } + + return true + } +} + +function anyFactory(tests) { + var checks = convertAll(tests) + var length = checks.length + + return matches + + function matches() { + var index = -1 + + while (++index < length) { + if (checks[index].apply(this, arguments)) { + return true + } + } + + return false + } +} + +// Utility to convert a string into a function which checks a given node’s type +// for said string. +function typeFactory(test) { + return type + + function type(node) { + return Boolean(node && node.type === test) + } +} + +// Utility to return true. +function ok() { + return true +} diff --git a/node_modules/unist-util-is/index.d.ts b/node_modules/unist-util-is/index.d.ts new file mode 100644 index 0000000..f05d502 --- /dev/null +++ b/node_modules/unist-util-is/index.d.ts @@ -0,0 +1,66 @@ +// TypeScript Version: 3.5 + +import {Node, Parent} from 'unist' + +declare namespace unistUtilIs { + /** + * Check that type property matches expectation for a node + * + * @typeParam T type of node that passes test + */ + type TestType = T['type'] + + /** + * Check that some attributes on a node are matched + * + * @typeParam T type of node that passes test + */ + type TestObject = Partial + + /** + * Check if a node passes a test + * + * @param node node to check + * @param index index of node in parent + * @param parent parent of node + * @typeParam T type of node that passes test + * @returns true if type T is found, false otherwise + */ + type TestFunction = ( + node: unknown, + index?: number, + parent?: Parent + ) => node is T + + /** + * Union of all the types of tests + * + * @typeParam T type of node that passes test + */ + type Test = TestType | TestObject | TestFunction +} + +/** + * Unist utility to check if a node passes a test. + * + * @param node Node to check. + * @param test When not given, checks if `node` is a `Node`. + * When `string`, works like passing `function (node) {return node.type === test}`. + * When `function` checks if function passed the node is true. + * When `object`, checks that all keys in test are in node, and that they have (strictly) equal values. + * When `array`, checks any one of the subtests pass. + * @param index Position of `node` in `parent` + * @param parent Parent of `node` + * @param context Context object to invoke `test` with + * @typeParam T type that node is compared with + * @returns Whether test passed and `node` is a `Node` (object with `type` set to non-empty `string`). + */ +declare function unistUtilIs( + node: unknown, + test: unistUtilIs.Test | Array>, + index?: number, + parent?: Parent, + context?: any +): node is T + +export = unistUtilIs diff --git a/node_modules/unist-util-is/index.js b/node_modules/unist-util-is/index.js new file mode 100644 index 0000000..f18d416 --- /dev/null +++ b/node_modules/unist-util-is/index.js @@ -0,0 +1,37 @@ +'use strict' + +var convert = require('./convert') + +module.exports = is + +is.convert = convert + +// Assert if `test` passes for `node`. +// When a `parent` node is known the `index` of node should also be given. +// eslint-disable-next-line max-params +function is(node, test, index, parent, context) { + var hasParent = parent !== null && parent !== undefined + var hasIndex = index !== null && index !== undefined + var check = convert(test) + + if ( + hasIndex && + (typeof index !== 'number' || index < 0 || index === Infinity) + ) { + throw new Error('Expected positive finite index or child node') + } + + if (hasParent && (!is(parent) || !parent.children)) { + throw new Error('Expected parent node') + } + + if (!node || !node.type || typeof node.type !== 'string') { + return false + } + + if (hasParent !== hasIndex) { + throw new Error('Expected both parent and index') + } + + return Boolean(check.call(context, node, index, parent)) +} diff --git a/node_modules/unist-util-is/license b/node_modules/unist-util-is/license new file mode 100644 index 0000000..cfa79e6 --- /dev/null +++ b/node_modules/unist-util-is/license @@ -0,0 +1,22 @@ +(The MIT license) + +Copyright (c) 2015 Titus Wormer + +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: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +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. diff --git a/node_modules/unist-util-is/package.json b/node_modules/unist-util-is/package.json new file mode 100644 index 0000000..64a0fa1 --- /dev/null +++ b/node_modules/unist-util-is/package.json @@ -0,0 +1,134 @@ +{ + "_from": "unist-util-is@^4.0.0", + "_id": "unist-util-is@4.0.2", + "_inBundle": false, + "_integrity": "sha512-Ofx8uf6haexJwI1gxWMGg6I/dLnF2yE+KibhD3/diOqY2TinLcqHXCV6OI5gFVn3xQqDH+u0M625pfKwIwgBKQ==", + "_location": "/unist-util-is", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "unist-util-is@^4.0.0", + "name": "unist-util-is", + "escapedName": "unist-util-is", + "rawSpec": "^4.0.0", + "saveSpec": null, + "fetchSpec": "^4.0.0" + }, + "_requiredBy": [ + "/unist-util-visit", + "/unist-util-visit-parents" + ], + "_resolved": "https://registry.npmjs.org/unist-util-is/-/unist-util-is-4.0.2.tgz", + "_shasum": "c7d1341188aa9ce5b3cff538958de9895f14a5de", + "_spec": "unist-util-is@^4.0.0", + "_where": "/Users/josh/Projects/slackify-markdown-action/node_modules/unist-util-visit", + "author": { + "name": "Titus Wormer", + "email": "tituswormer@gmail.com", + "url": "https://wooorm.com" + }, + "bugs": { + "url": "https://github.com/syntax-tree/unist-util-is/issues" + }, + "bundleDependencies": false, + "contributors": [ + { + "name": "Titus Wormer", + "email": "tituswormer@gmail.com", + "url": "https://wooorm.com" + }, + { + "name": "Christian Murphy", + "email": "christian.murphy.42@gmail.com" + } + ], + "dependencies": {}, + "deprecated": false, + "description": "unist utility to check if a node passes a test", + "devDependencies": { + "@types/mdast": "^3.0.0", + "browserify": "^16.0.0", + "dtslint": "^3.0.0", + "nyc": "^15.0.0", + "prettier": "^1.0.0", + "remark-cli": "^7.0.0", + "remark-preset-wooorm": "^6.0.0", + "tape": "^4.0.0", + "tinyify": "^2.0.0", + "unified": "^8.0.0", + "xo": "^0.26.0" + }, + "files": [ + "index.js", + "convert.js", + "index.d.ts", + "convert.d.ts" + ], + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + }, + "homepage": "https://github.com/syntax-tree/unist-util-is#readme", + "keywords": [ + "unist", + "unist-util", + "util", + "utility", + "tree", + "node", + "is", + "equal", + "check", + "test", + "type" + ], + "license": "MIT", + "name": "unist-util-is", + "nyc": { + "check-coverage": true, + "lines": 100, + "functions": 100, + "branches": 100 + }, + "prettier": { + "tabWidth": 2, + "useTabs": false, + "singleQuote": true, + "bracketSpacing": false, + "semi": false, + "trailingComma": "none" + }, + "remarkConfig": { + "plugins": [ + "preset-wooorm" + ] + }, + "repository": { + "type": "git", + "url": "git+https://github.com/syntax-tree/unist-util-is.git" + }, + "scripts": { + "build": "npm run build-bundle && npm run build-mangle", + "build-bundle": "browserify . -s unistUtilIs > unist-util-is.js", + "build-mangle": "browserify . -s unistUtilIs -p tinyify > unist-util-is.min.js", + "format": "remark . -qfo && prettier --write \"**/*.{js,ts}\" && xo --fix", + "test": "npm run format && npm run build && npm run test-coverage && npm run test-types", + "test-api": "node test", + "test-coverage": "nyc --reporter lcov tape test.js", + "test-types": "dtslint ." + }, + "types": "index.d.ts", + "version": "4.0.2", + "xo": { + "prettier": true, + "esnext": false, + "rules": { + "unicorn/prefer-type-error": "off", + "unicorn/prefer-reflect-apply": "off" + }, + "ignore": [ + "unist-util-is.js" + ] + } +} diff --git a/node_modules/unist-util-is/readme.md b/node_modules/unist-util-is/readme.md new file mode 100644 index 0000000..9e67054 --- /dev/null +++ b/node_modules/unist-util-is/readme.md @@ -0,0 +1,205 @@ +# unist-util-is + +[![Build][build-badge]][build] +[![Coverage][coverage-badge]][coverage] +[![Downloads][downloads-badge]][downloads] +[![Size][size-badge]][size] +[![Sponsors][sponsors-badge]][collective] +[![Backers][backers-badge]][collective] +[![Chat][chat-badge]][chat] + +[**unist**][unist] utility to check if a node passes a test. + +## Install + +[npm][]: + +```sh +npm install unist-util-is +``` + +## Use + +```js +var is = require('unist-util-is') + +var node = {type: 'strong'} +var parent = {type: 'paragraph', children: [node]} + +function test(node, n) { + return n === 5 +} + +is() // => false +is({children: []}) // => false +is(node) // => true +is(node, 'strong') // => true +is(node, 'emphasis') // => false + +is(node, node) // => true +is(parent, {type: 'paragraph'}) // => true +is(parent, {type: 'strong'}) // => false + +is(node, test) // => false +is(node, test, 4, parent) // => false +is(node, test, 5, parent) // => true +``` + +## API + +### `is(node[, test[, index, parent[, context]]])` + +###### Parameters + +* `node` ([`Node`][node]) — Node to check. +* `test` ([`Function`][test], `string`, `Object`, or `Array.`, optional) + — When not given, checks if `node` is a [`Node`][node]. + When `string`, works like passing `node => node.type === test`. + When `array`, checks if any one of the subtests pass. + When `object`, checks that all keys in `test` are in `node`, + and that they have strictly equal values +* `index` (`number`, optional) — [Index][] of `node` in `parent` +* `parent` ([`Node`][node], optional) — [Parent][] of `node` +* `context` (`*`, optional) — Context object to invoke `test` with + +###### Returns + +`boolean` — Whether `test` passed *and* `node` is a [`Node`][node] (object with +`type` set to a non-empty `string`). + +#### `function test(node[, index, parent])` + +###### Parameters + +* `node` ([`Node`][node]) — Node to check +* `index` (`number?`) — [Index][] of `node` in `parent` +* `parent` ([`Node?`][node]) — [Parent][] of `node` + +###### Context + +`*` — The to `is` given `context`. + +###### Returns + +`boolean?` — Whether `node` matches. + +### `is.convert(test)` + +Create a test function from `test`, that can later be called with a `node`, +`index`, and `parent`. +Useful if you’re going to test many nodes, for example when creating a utility +where something else passes an is-compatible test. + +The created function is slightly faster because it expects valid input only. +Therefore, passing invalid input, yields unexpected results. + +Can also be accessed with `require('unist-util-is/convert')`. + +For example: + +```js +var u = require('unist-builder') +var convert = require('unist-util-is/convert') + +var test = convert('leaf') + +var tree = u('tree', [ + u('node', [u('leaf', '1')]), + u('leaf', '2'), + u('node', [u('leaf', '3'), u('leaf', '4')]), + u('leaf', '5') +]) + +var leafs = tree.children.filter((child, index) => test(child, index, tree)) + +console.log(leafs) +``` + +Yields: + +```js +[{type: 'leaf', value: '2'}, {type: 'leaf', value: '5'}] +``` + +## Related + +* [`unist-util-find-after`](https://github.com/syntax-tree/unist-util-find-after) + — Find a node after another node +* [`unist-util-find-before`](https://github.com/syntax-tree/unist-util-find-before) + — Find a node before another node +* [`unist-util-find-all-after`](https://github.com/syntax-tree/unist-util-find-all-after) + — Find all nodes after another node +* [`unist-util-find-all-before`](https://github.com/syntax-tree/unist-util-find-all-before) + — Find all nodes before another node +* [`unist-util-find-all-between`](https://github.com/mrzmmr/unist-util-find-all-between) + — Find all nodes between two nodes +* [`unist-util-find`](https://github.com/blahah/unist-util-find) + — Find nodes matching a predicate +* [`unist-util-filter`](https://github.com/eush77/unist-util-filter) + — Create a new tree with nodes that pass a check +* [`unist-util-remove`](https://github.com/eush77/unist-util-remove) + — Remove nodes from tree + +## Contribute + +See [`contributing.md` in `syntax-tree/.github`][contributing] for ways to get +started. +See [`support.md`][support] for ways to get help. + +This project has a [code of conduct][coc]. +By interacting with this repository, organization, or community you agree to +abide by its terms. + +## License + +[MIT][license] © [Titus Wormer][author] + + + +[build-badge]: https://img.shields.io/travis/syntax-tree/unist-util-is.svg + +[build]: https://travis-ci.org/syntax-tree/unist-util-is + +[coverage-badge]: https://img.shields.io/codecov/c/github/syntax-tree/unist-util-is.svg + +[coverage]: https://codecov.io/github/syntax-tree/unist-util-is + +[downloads-badge]: https://img.shields.io/npm/dm/unist-util-is.svg + +[downloads]: https://www.npmjs.com/package/unist-util-is + +[size-badge]: https://img.shields.io/bundlephobia/minzip/unist-util-is.svg + +[size]: https://bundlephobia.com/result?p=unist-util-is + +[sponsors-badge]: https://opencollective.com/unified/sponsors/badge.svg + +[backers-badge]: https://opencollective.com/unified/backers/badge.svg + +[collective]: https://opencollective.com/unified + +[chat-badge]: https://img.shields.io/badge/chat-spectrum-7b16ff.svg + +[chat]: https://spectrum.chat/unified/syntax-tree + +[npm]: https://docs.npmjs.com/cli/install + +[license]: license + +[author]: https://wooorm.com + +[contributing]: https://github.com/syntax-tree/.github/blob/master/contributing.md + +[support]: https://github.com/syntax-tree/.github/blob/master/support.md + +[coc]: https://github.com/syntax-tree/.github/blob/master/code-of-conduct.md + +[unist]: https://github.com/syntax-tree/unist + +[node]: https://github.com/syntax-tree/unist#node + +[parent]: https://github.com/syntax-tree/unist#parent-1 + +[index]: https://github.com/syntax-tree/unist#index + +[test]: #function-testnode-index-parent diff --git a/node_modules/unist-util-remove-position/index.js b/node_modules/unist-util-remove-position/index.js new file mode 100644 index 0000000..0963959 --- /dev/null +++ b/node_modules/unist-util-remove-position/index.js @@ -0,0 +1,18 @@ +'use strict' + +var visit = require('unist-util-visit') + +module.exports = removePosition + +function removePosition(node, force) { + visit(node, force ? hard : soft) + return node +} + +function hard(node) { + delete node.position +} + +function soft(node) { + node.position = undefined +} diff --git a/node_modules/unist-util-remove-position/license b/node_modules/unist-util-remove-position/license new file mode 100644 index 0000000..8d8660d --- /dev/null +++ b/node_modules/unist-util-remove-position/license @@ -0,0 +1,22 @@ +(The MIT License) + +Copyright (c) 2016 Titus Wormer + +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: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +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. diff --git a/node_modules/unist-util-remove-position/package.json b/node_modules/unist-util-remove-position/package.json new file mode 100644 index 0000000..f1bfcbd --- /dev/null +++ b/node_modules/unist-util-remove-position/package.json @@ -0,0 +1,119 @@ +{ + "_from": "unist-util-remove-position@^2.0.0", + "_id": "unist-util-remove-position@2.0.1", + "_inBundle": false, + "_integrity": "sha512-fDZsLYIe2uT+oGFnuZmy73K6ZxOPG/Qcm+w7jbEjaFcJgbQ6cqjs/eSPzXhsmGpAsWPkqZM9pYjww5QTn3LHMA==", + "_location": "/unist-util-remove-position", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "unist-util-remove-position@^2.0.0", + "name": "unist-util-remove-position", + "escapedName": "unist-util-remove-position", + "rawSpec": "^2.0.0", + "saveSpec": null, + "fetchSpec": "^2.0.0" + }, + "_requiredBy": [ + "/remark-parse" + ], + "_resolved": "https://registry.npmjs.org/unist-util-remove-position/-/unist-util-remove-position-2.0.1.tgz", + "_shasum": "5d19ca79fdba712301999b2b73553ca8f3b352cc", + "_spec": "unist-util-remove-position@^2.0.0", + "_where": "/Users/josh/Projects/slackify-markdown-action/node_modules/remark-parse", + "author": { + "name": "Titus Wormer", + "email": "tituswormer@gmail.com", + "url": "https://wooorm.com" + }, + "bugs": { + "url": "https://github.com/syntax-tree/unist-util-remove-position/issues" + }, + "bundleDependencies": false, + "contributors": [ + { + "name": "Titus Wormer", + "email": "tituswormer@gmail.com", + "url": "https://wooorm.com" + } + ], + "dependencies": { + "unist-util-visit": "^2.0.0" + }, + "deprecated": false, + "description": "unist utility to remove positions from a tree", + "devDependencies": { + "browserify": "^16.0.0", + "nyc": "^15.0.0", + "prettier": "^1.0.0", + "remark": "^11.0.0", + "remark-cli": "^7.0.0", + "remark-preset-wooorm": "^6.0.0", + "tape": "^4.0.0", + "tinyify": "^2.0.0", + "unist-builder": "^2.0.0", + "xo": "^0.26.0" + }, + "files": [ + "index.js" + ], + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + }, + "homepage": "https://github.com/syntax-tree/unist-util-remove-position#readme", + "keywords": [ + "unist", + "unist-util", + "util", + "utility", + "remove", + "position", + "location", + "clean", + "force" + ], + "license": "MIT", + "name": "unist-util-remove-position", + "nyc": { + "check-coverage": true, + "lines": 100, + "functions": 100, + "branches": 100 + }, + "prettier": { + "tabWidth": 2, + "useTabs": false, + "singleQuote": true, + "bracketSpacing": false, + "semi": false, + "trailingComma": "none" + }, + "remarkConfig": { + "plugins": [ + "preset-wooorm" + ] + }, + "repository": { + "type": "git", + "url": "git+https://github.com/syntax-tree/unist-util-remove-position.git" + }, + "scripts": { + "build": "npm run build-bundle && npm run build-mangle", + "build-bundle": "browserify . -s unistUtilRemovePosition > unist-util-remove-position.js", + "build-mangle": "browserify . -s unistUtilRemovePosition -p tinyify > unist-util-remove-position.min.js", + "format": "remark . -qfo && prettier --write \"**/*.js\" && xo --fix", + "test": "npm run format && npm run build && npm run test-coverage", + "test-api": "node test", + "test-coverage": "nyc --reporter lcov tape test.js" + }, + "version": "2.0.1", + "xo": { + "prettier": true, + "esnext": false, + "ignores": [ + "unist-util-remove-position.js" + ] + } +} diff --git a/node_modules/unist-util-remove-position/readme.md b/node_modules/unist-util-remove-position/readme.md new file mode 100644 index 0000000..cfa35ed --- /dev/null +++ b/node_modules/unist-util-remove-position/readme.md @@ -0,0 +1,125 @@ +# unist-util-remove-position + +[![Build][build-badge]][build] +[![Coverage][coverage-badge]][coverage] +[![Downloads][downloads-badge]][downloads] +[![Size][size-badge]][size] +[![Sponsors][sponsors-badge]][collective] +[![Backers][backers-badge]][collective] +[![Chat][chat-badge]][chat] + +[**unist**][unist] utility to remove [`position`][position]s from tree. + +## Install + +[npm][]: + +```sh +npm install unist-util-remove-position +``` + +## Use + +```js +var remark = require('remark') +var removePosition = require('unist-util-remove-position') + +var tree = remark().parse('Some _emphasis_, **importance**, and `code`.') + +removePosition(tree, true) + +console.dir(tree, {depth: null}) +``` + +Yields: + +```js +{ + type: 'root', + children: [ + { + type: 'paragraph', + children: [ + {type: 'text', value: 'Some '}, + {type: 'emphasis', children: [{type: 'text', value: 'emphasis'}]}, + {type: 'text', value: ', '}, + {type: 'strong', children: [{type: 'text', value: 'importance'}]}, + {type: 'text', value: ', and '}, + {type: 'inlineCode', value: 'code'}, + {type: 'text', value: '.'} + ] + } + ] +} +``` + +## API + +### `removePosition(node[, force])` + +Remove [`position`][position] fields from [`node`][node]. +If `force` is given, uses `delete`, otherwise, sets `position`s to `undefined`. + +###### Returns + +The given `node`. + +## Contribute + +See [`contributing.md` in `syntax-tree/.github`][contributing] for ways to get +started. +See [`support.md`][support] for ways to get help. + +This project has a [code of conduct][coc]. +By interacting with this repository, organization, or community you agree to +abide by its terms. + +## License + +[MIT][license] © [Titus Wormer][author] + + + +[build-badge]: https://img.shields.io/travis/syntax-tree/unist-util-remove-position.svg + +[build]: https://travis-ci.org/syntax-tree/unist-util-remove-position + +[coverage-badge]: https://img.shields.io/codecov/c/github/syntax-tree/unist-util-remove-position.svg + +[coverage]: https://codecov.io/github/syntax-tree/unist-util-remove-position + +[downloads-badge]: https://img.shields.io/npm/dm/unist-util-remove-position.svg + +[downloads]: https://www.npmjs.com/package/unist-util-remove-position + +[size-badge]: https://img.shields.io/bundlephobia/minzip/unist-util-remove-position.svg + +[size]: https://bundlephobia.com/result?p=unist-util-remove-position + +[sponsors-badge]: https://opencollective.com/unified/sponsors/badge.svg + +[backers-badge]: https://opencollective.com/unified/backers/badge.svg + +[collective]: https://opencollective.com/unified + +[chat-badge]: https://img.shields.io/badge/chat-spectrum-7b16ff.svg + +[chat]: https://spectrum.chat/unified/syntax-tree + +[npm]: https://docs.npmjs.com/cli/install + +[license]: license + +[author]: https://wooorm.com + +[contributing]: https://github.com/syntax-tree/.github/blob/master/contributing.md + +[support]: https://github.com/syntax-tree/.github/blob/master/support.md + +[coc]: https://github.com/syntax-tree/.github/blob/master/code-of-conduct.md + +[unist]: https://github.com/syntax-tree/unist + +[position]: https://github.com/syntax-tree/unist#position + +[node]: https://github.com/syntax-tree/unist#node diff --git a/node_modules/unist-util-stringify-position/index.js b/node_modules/unist-util-stringify-position/index.js new file mode 100644 index 0000000..3d78a44 --- /dev/null +++ b/node_modules/unist-util-stringify-position/index.js @@ -0,0 +1,50 @@ +'use strict' + +var own = {}.hasOwnProperty + +module.exports = stringify + +function stringify(value) { + // Nothing. + if (!value || typeof value !== 'object') { + return '' + } + + // Node. + if (own.call(value, 'position') || own.call(value, 'type')) { + return position(value.position) + } + + // Position. + if (own.call(value, 'start') || own.call(value, 'end')) { + return position(value) + } + + // Point. + if (own.call(value, 'line') || own.call(value, 'column')) { + return point(value) + } + + // ? + return '' +} + +function point(point) { + if (!point || typeof point !== 'object') { + point = {} + } + + return index(point.line) + ':' + index(point.column) +} + +function position(pos) { + if (!pos || typeof pos !== 'object') { + pos = {} + } + + return point(pos.start) + '-' + point(pos.end) +} + +function index(value) { + return value && typeof value === 'number' ? value : 1 +} diff --git a/node_modules/unist-util-stringify-position/license b/node_modules/unist-util-stringify-position/license new file mode 100644 index 0000000..8d8660d --- /dev/null +++ b/node_modules/unist-util-stringify-position/license @@ -0,0 +1,22 @@ +(The MIT License) + +Copyright (c) 2016 Titus Wormer + +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: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +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. diff --git a/node_modules/unist-util-stringify-position/package.json b/node_modules/unist-util-stringify-position/package.json new file mode 100644 index 0000000..4094e82 --- /dev/null +++ b/node_modules/unist-util-stringify-position/package.json @@ -0,0 +1,124 @@ +{ + "_from": "unist-util-stringify-position@^2.0.0", + "_id": "unist-util-stringify-position@2.0.3", + "_inBundle": false, + "_integrity": "sha512-3faScn5I+hy9VleOq/qNbAd6pAx7iH5jYBMS9I1HgQVijz/4mv5Bvw5iw1sC/90CODiKo81G/ps8AJrISn687g==", + "_location": "/unist-util-stringify-position", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "unist-util-stringify-position@^2.0.0", + "name": "unist-util-stringify-position", + "escapedName": "unist-util-stringify-position", + "rawSpec": "^2.0.0", + "saveSpec": null, + "fetchSpec": "^2.0.0" + }, + "_requiredBy": [ + "/vfile", + "/vfile-message" + ], + "_resolved": "https://registry.npmjs.org/unist-util-stringify-position/-/unist-util-stringify-position-2.0.3.tgz", + "_shasum": "cce3bfa1cdf85ba7375d1d5b17bdc4cada9bd9da", + "_spec": "unist-util-stringify-position@^2.0.0", + "_where": "/Users/josh/Projects/slackify-markdown-action/node_modules/vfile", + "author": { + "name": "Titus Wormer", + "email": "tituswormer@gmail.com", + "url": "https://wooorm.com" + }, + "bugs": { + "url": "https://github.com/syntax-tree/unist-util-stringify-position/issues" + }, + "bundleDependencies": false, + "contributors": [ + { + "name": "Titus Wormer", + "email": "tituswormer@gmail.com", + "url": "https://wooorm.com" + } + ], + "dependencies": { + "@types/unist": "^2.0.2" + }, + "deprecated": false, + "description": "unist utility to serialize a node, position, or point as a human readable location", + "devDependencies": { + "browserify": "^16.0.0", + "dtslint": "^3.0.0", + "nyc": "^15.0.0", + "prettier": "^1.0.0", + "remark-cli": "^7.0.0", + "remark-preset-wooorm": "^6.0.0", + "tape": "^4.0.0", + "tinyify": "^2.0.0", + "typescript": "^3.0.0", + "xo": "^0.27.0" + }, + "files": [ + "types/index.d.ts", + "index.js" + ], + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + }, + "homepage": "https://github.com/syntax-tree/unist-util-stringify-position#readme", + "keywords": [ + "unist", + "unist-util", + "util", + "utility", + "position", + "location", + "point", + "node", + "stringify", + "tostring" + ], + "license": "MIT", + "name": "unist-util-stringify-position", + "nyc": { + "check-coverage": true, + "lines": 100, + "functions": 100, + "branches": 100 + }, + "prettier": { + "tabWidth": 2, + "useTabs": false, + "singleQuote": true, + "bracketSpacing": false, + "semi": false, + "trailingComma": "none" + }, + "remarkConfig": { + "plugins": [ + "preset-wooorm" + ] + }, + "repository": { + "type": "git", + "url": "git+https://github.com/syntax-tree/unist-util-stringify-position.git" + }, + "scripts": { + "build": "npm run build-bundle && npm run build-mangle", + "build-bundle": "browserify . -s unistUtilStringifyPosition > unist-util-stringify-position.js", + "build-mangle": "browserify . -s unistUtilStringifyPosition -p tinyify > unist-util-stringify-position.min.js", + "format": "remark . -qfo && prettier --write \"**/*.{js,ts}\" && xo --fix", + "test": "npm run format && npm run build && npm run test-coverage && npm run test-types", + "test-api": "node test", + "test-coverage": "nyc --reporter lcov tape test.js", + "test-types": "dtslint types" + }, + "types": "types/index.d.ts", + "version": "2.0.3", + "xo": { + "prettier": true, + "esnext": false, + "ignores": [ + "unist-util-stringify-position.js" + ] + } +} diff --git a/node_modules/unist-util-stringify-position/readme.md b/node_modules/unist-util-stringify-position/readme.md new file mode 100644 index 0000000..bb56514 --- /dev/null +++ b/node_modules/unist-util-stringify-position/readme.md @@ -0,0 +1,140 @@ +# unist-util-stringify-position + +[![Build][build-badge]][build] +[![Coverage][coverage-badge]][coverage] +[![Downloads][downloads-badge]][downloads] +[![Size][size-badge]][size] +[![Sponsors][sponsors-badge]][collective] +[![Backers][backers-badge]][collective] +[![Chat][chat-badge]][chat] + +[**unist**][unist] utility to pretty print the positional information of a node. + +## Install + +[npm][]: + +```sh +npm install unist-util-stringify-position +``` + +## Use + +```js +var stringify = require('unist-util-stringify-position') + +// Point +stringify({line: 2, column: 3}) // => '2:3' + +// Position +stringify({start: {line: 2}, end: {line: 3}}) // => '2:1-3:1' + +// Node +stringify({ + type: 'text', + value: '!', + position: { + start: {line: 5, column: 11}, + end: {line: 5, column: 12} + } +}) // => '5:11-5:12' +``` + +## API + +### `stringifyPosition(node|position|point)` + +Stringify one [point][], a [position][] (start and end [point][]s), or a node’s +[positional information][positional-information]. + +###### Parameters + +* `node` ([`Node`][node]) + — Node whose `'position'` property to stringify +* `position` ([`Position`][position]) + — Position whose `'start'` and `'end'` points to stringify +* `point` ([`Point`][point]) + — Point whose `'line'` and `'column'` to stringify + +###### Returns + +`string?` — A range `ls:cs-le:ce` (when given `node` or `position`) or a point +`l:c` (when given `point`), where `l` stands for line, `c` for column, `s` for +`start`, and `e` for end. +An empty string (`''`) is returned if the given value is neither `node`, +`position`, nor `point`. + +## Related + +* [`unist-util-generated`](https://github.com/syntax-tree/unist-util-generated) + — Check if a node is generated +* [`unist-util-position`](https://github.com/syntax-tree/unist-util-position) + — Get positional info of nodes +* [`unist-util-remove-position`](https://github.com/syntax-tree/unist-util-remove-position) + — Remove positional info from trees +* [`unist-util-source`](https://github.com/syntax-tree/unist-util-source) + — Get the source of a value (node or position) in a file + +## Contribute + +See [`contributing.md` in `syntax-tree/.github`][contributing] for ways to get +started. +See [`support.md`][support] for ways to get help. + +This project has a [code of conduct][coc]. +By interacting with this repository, organization, or community you agree to +abide by its terms. + +## License + +[MIT][license] © [Titus Wormer][author] + + + +[build-badge]: https://img.shields.io/travis/syntax-tree/unist-util-stringify-position.svg + +[build]: https://travis-ci.org/syntax-tree/unist-util-stringify-position + +[coverage-badge]: https://img.shields.io/codecov/c/github/syntax-tree/unist-util-stringify-position.svg + +[coverage]: https://codecov.io/github/syntax-tree/unist-util-stringify-position + +[downloads-badge]: https://img.shields.io/npm/dm/unist-util-stringify-position.svg + +[downloads]: https://www.npmjs.com/package/unist-util-stringify-position + +[size-badge]: https://img.shields.io/bundlephobia/minzip/unist-util-stringify-position.svg + +[size]: https://bundlephobia.com/result?p=unist-util-stringify-position + +[sponsors-badge]: https://opencollective.com/unified/sponsors/badge.svg + +[backers-badge]: https://opencollective.com/unified/backers/badge.svg + +[collective]: https://opencollective.com/unified + +[chat-badge]: https://img.shields.io/badge/chat-spectrum-7b16ff.svg + +[chat]: https://spectrum.chat/unified/syntax-tree + +[npm]: https://docs.npmjs.com/cli/install + +[license]: license + +[author]: https://wooorm.com + +[contributing]: https://github.com/syntax-tree/.github/blob/master/contributing.md + +[support]: https://github.com/syntax-tree/.github/blob/master/support.md + +[coc]: https://github.com/syntax-tree/.github/blob/master/code-of-conduct.md + +[unist]: https://github.com/syntax-tree/unist + +[node]: https://github.com/syntax-tree/unist#node + +[position]: https://github.com/syntax-tree/unist#position + +[point]: https://github.com/syntax-tree/unist#point + +[positional-information]: https://github.com/syntax-tree/unist#positional-information diff --git a/node_modules/unist-util-stringify-position/types/index.d.ts b/node_modules/unist-util-stringify-position/types/index.d.ts new file mode 100644 index 0000000..8f31bc0 --- /dev/null +++ b/node_modules/unist-util-stringify-position/types/index.d.ts @@ -0,0 +1,9 @@ +// TypeScript Version: 3.0 + +import * as Unist from 'unist' + +declare function unistUtilStringifyPosition( + value: Unist.Node | Unist.Position | Unist.Point +): string + +export = unistUtilStringifyPosition diff --git a/node_modules/unist-util-visit-parents/index.js b/node_modules/unist-util-visit-parents/index.js new file mode 100644 index 0000000..c726359 --- /dev/null +++ b/node_modules/unist-util-visit-parents/index.js @@ -0,0 +1,78 @@ +'use strict' + +module.exports = visitParents + +var convert = require('unist-util-is/convert') + +var CONTINUE = true +var SKIP = 'skip' +var EXIT = false + +visitParents.CONTINUE = CONTINUE +visitParents.SKIP = SKIP +visitParents.EXIT = EXIT + +function visitParents(tree, test, visitor, reverse) { + var is + + if (typeof test === 'function' && typeof visitor !== 'function') { + reverse = visitor + visitor = test + test = null + } + + is = convert(test) + + one(tree, null, []) + + // Visit a single node. + function one(node, index, parents) { + var result = [] + var subresult + + if (!test || is(node, index, parents[parents.length - 1] || null)) { + result = toResult(visitor(node, parents)) + + if (result[0] === EXIT) { + return result + } + } + + if (node.children && result[0] !== SKIP) { + subresult = toResult(all(node.children, parents.concat(node))) + return subresult[0] === EXIT ? subresult : result + } + + return result + } + + // Visit children in `parent`. + function all(children, parents) { + var min = -1 + var step = reverse ? -1 : 1 + var index = (reverse ? children.length : min) + step + var result + + while (index > min && index < children.length) { + result = one(children[index], index, parents) + + if (result[0] === EXIT) { + return result + } + + index = typeof result[1] === 'number' ? result[1] : index + step + } + } +} + +function toResult(value) { + if (value !== null && typeof value === 'object' && 'length' in value) { + return value + } + + if (typeof value === 'number') { + return [CONTINUE, value] + } + + return [value] +} diff --git a/node_modules/unist-util-visit-parents/license b/node_modules/unist-util-visit-parents/license new file mode 100644 index 0000000..8d8660d --- /dev/null +++ b/node_modules/unist-util-visit-parents/license @@ -0,0 +1,22 @@ +(The MIT License) + +Copyright (c) 2016 Titus Wormer + +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: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +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. diff --git a/node_modules/unist-util-visit-parents/package.json b/node_modules/unist-util-visit-parents/package.json new file mode 100644 index 0000000..7a9eab6 --- /dev/null +++ b/node_modules/unist-util-visit-parents/package.json @@ -0,0 +1,128 @@ +{ + "_from": "unist-util-visit-parents@^3.0.0", + "_id": "unist-util-visit-parents@3.0.2", + "_inBundle": false, + "_integrity": "sha512-yJEfuZtzFpQmg1OSCyS9M5NJRrln/9FbYosH3iW0MG402QbdbaB8ZESwUv9RO6nRfLAKvWcMxCwdLWOov36x/g==", + "_location": "/unist-util-visit-parents", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "unist-util-visit-parents@^3.0.0", + "name": "unist-util-visit-parents", + "escapedName": "unist-util-visit-parents", + "rawSpec": "^3.0.0", + "saveSpec": null, + "fetchSpec": "^3.0.0" + }, + "_requiredBy": [ + "/unist-util-visit" + ], + "_resolved": "https://registry.npmjs.org/unist-util-visit-parents/-/unist-util-visit-parents-3.0.2.tgz", + "_shasum": "d4076af3011739c71d2ce99d05de37d545f4351d", + "_spec": "unist-util-visit-parents@^3.0.0", + "_where": "/Users/josh/Projects/slackify-markdown-action/node_modules/unist-util-visit", + "author": { + "name": "Titus Wormer", + "email": "tituswormer@gmail.com", + "url": "https://wooorm.com" + }, + "bugs": { + "url": "https://github.com/syntax-tree/unist-util-visit-parents/issues" + }, + "bundleDependencies": false, + "contributors": [ + { + "name": "Titus Wormer", + "email": "tituswormer@gmail.com", + "url": "https://wooorm.com" + } + ], + "dependencies": { + "@types/unist": "^2.0.0", + "unist-util-is": "^4.0.0" + }, + "deprecated": false, + "description": "unist utility to recursively walk over nodes, with ancestral information", + "devDependencies": { + "browserify": "^16.0.0", + "dtslint": "^3.0.0", + "nyc": "^15.0.0", + "prettier": "^1.0.0", + "remark": "^11.0.0", + "remark-cli": "^7.0.0", + "remark-preset-wooorm": "^6.0.0", + "tape": "^4.0.0", + "tinyify": "^2.0.0", + "typescript": "^3.0.0", + "unified": "^8.0.0", + "xo": "^0.26.0" + }, + "files": [ + "index.js", + "types/index.d.ts" + ], + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + }, + "homepage": "https://github.com/syntax-tree/unist-util-visit-parents#readme", + "keywords": [ + "unist", + "unist-util", + "util", + "utility", + "tree", + "ast", + "visit", + "traverse", + "walk", + "check", + "parent", + "parents" + ], + "license": "MIT", + "name": "unist-util-visit-parents", + "nyc": { + "check-coverage": true, + "lines": 100, + "functions": 100, + "branches": 100 + }, + "prettier": { + "tabWidth": 2, + "useTabs": false, + "singleQuote": true, + "bracketSpacing": false, + "semi": false, + "trailingComma": "none" + }, + "remarkConfig": { + "plugins": [ + "preset-wooorm" + ] + }, + "repository": { + "type": "git", + "url": "git+https://github.com/syntax-tree/unist-util-visit-parents.git" + }, + "scripts": { + "build": "npm run build-bundle && npm run build-mangle", + "build-bundle": "browserify index.js -s unistUtilVisitParents > unist-util-visit-parents.js", + "build-mangle": "browserify index.js -s unistUtilVisitParents -p tinyify > unist-util-visit-parents.min.js", + "format": "remark . -qfo && prettier --write \"**/*.{js,ts}\" && xo --fix", + "test": "npm run format && npm run build && npm run test-coverage && npm run test-types", + "test-api": "node test", + "test-coverage": "nyc --reporter lcov tape test.js", + "test-types": "dtslint types" + }, + "types": "types/index.d.ts", + "version": "3.0.2", + "xo": { + "prettier": true, + "esnext": false, + "ignores": [ + "unist-util-visit-parents.js" + ] + } +} diff --git a/node_modules/unist-util-visit-parents/readme.md b/node_modules/unist-util-visit-parents/readme.md new file mode 100644 index 0000000..ff0fbd8 --- /dev/null +++ b/node_modules/unist-util-visit-parents/readme.md @@ -0,0 +1,234 @@ +# unist-util-visit-parents + +[![Build][build-badge]][build] +[![Coverage][coverage-badge]][coverage] +[![Downloads][downloads-badge]][downloads] +[![Size][size-badge]][size] +[![Sponsors][sponsors-badge]][collective] +[![Backers][backers-badge]][collective] +[![Chat][chat-badge]][chat] + +[**unist**][unist] utility to visit nodes, with ancestral information. + +## Install + +[npm][]: + +```sh +npm install unist-util-visit-parents +``` + +## Use + +```js +var remark = require('remark') +var visit = require('unist-util-visit-parents') + +var tree = remark.parse('Some _emphasis_, **importance**, and `code`.') + +visit(tree, 'strong', visitor) + +function visitor(node, ancestors) { + console.log(ancestors) +} +``` + +Yields: + +```js +[ { type: 'root', children: [ [Object] ] }, + { type: 'paragraph', + children: + [ [Object], + [Object], + [Object], + [Object], + [Object], + [Object], + [Object] ] } ] +``` + +## API + +### `visit(tree[, test], visitor[, reverse])` + +Visit nodes ([*inclusive descendants*][descendant] of [`tree`][tree]), with +ancestral information. +Optionally filtering nodes. +Optionally in reverse. + +This algorithm performs [*depth-first*][depth-first] +[*tree traversal*][tree-traversal] in [*preorder*][preorder] (**NLR**), or +if `reverse` is given, in *reverse preorder* (**NRL**). + +Walking the tree is an intensive task. +Make use of the return values of the visitor when possible. +Instead of walking a tree multiple times with different `test`s, walk it once +without a test, and use [`unist-util-is`][is] to check if a node matches a test, +and then perform different operations. + +###### Parameters + +* `tree` ([`Node`][node]) — [Tree][] to traverse +* `test` ([`Test`][is], optional) — [`is`][is]-compatible test (such as a + [type][]) +* `visitor` ([Function][visitor]) — Function invoked when a node is found + that passes `test` +* `reverse` (`boolean`, default: `false`) — The tree is traversed in + [preorder][] (NLR), visiting the node itself, then its [head][], etc. + When `reverse` is passed, the tree is traversed in reverse preorder (NRL): + the node itself is visited, then its [tail][], etc. + +#### `next? = visitor(node, ancestors)` + +Invoked when a node (matching `test`, if given) is found. + +Visitors are free to transform `node`. +They can also transform the [parent][] of node (the last of `ancestors`). +Replacing `node` itself, if `visit.SKIP` is not returned, still causes its +[descendant][]s to be visited. +If adding or removing previous [sibling][]s (or next siblings, in case of +`reverse`) of `node`, `visitor` should return a new [`index`][index] (`number`) +to specify the sibling to traverse after `node` is traversed. +Adding or removing next siblings of `node` (or previous siblings, in case of +reverse) is handled as expected without needing to return a new `index`. +Removing the `children` property of an ancestor still results in them being +traversed. + +###### Parameters + +* `node` ([`Node`][node]) — Found node +* `ancestors` (`Array.`) — [Ancestor][]s of `node` + +##### Returns + +The return value can have the following forms: + +* [`index`][index] (`number`) — Treated as a tuple of `[CONTINUE, index]` +* `action` (`*`) — Treated as a tuple of `[action]` +* `tuple` (`Array.<*>`) — List with one or two values, the first an `action`, + the second and `index`. + Note that passing a tuple only makes sense if the `action` is `SKIP`. + If the `action` is `EXIT`, that action can be returned. + If the `action` is `CONTINUE`, `index` can be returned. + +###### `action` + +An action can have the following values: + +* `visit.EXIT` (`false`) — Stop traversing immediately +* `visit.CONTINUE` (`true`) — Continue traversing as normal (same behaviour + as not returning anything) +* `visit.SKIP` (`'skip'`) — Do not traverse this node’s children; continue + with the specified index + +###### `index` + +[`index`][index] (`number`) — Move to the sibling at `index` next (after `node` +itself is completely traversed). +Useful if mutating the tree, such as removing the node the visitor is currently +on, or any of its previous siblings (or next siblings, in case of `reverse`) +Results less than `0` or greater than or equal to `children.length` stop +traversing the parent + +## Related + +* [`unist-util-visit`](https://github.com/syntax-tree/unist-util-visit) + — Like `visit-parents`, but with one parent +* [`unist-util-filter`](https://github.com/eush77/unist-util-filter) + — Create a new tree with all nodes that pass a test +* [`unist-util-map`](https://github.com/syntax-tree/unist-util-map) + — Create a new tree with all nodes mapped by a given function +* [`unist-util-flatmap`](https://gitlab.com/staltz/unist-util-flatmap) + — Create a new tree by mapping (to an array) with the provided function and + then flattening +* [`unist-util-remove`](https://github.com/eush77/unist-util-remove) + — Remove nodes from a tree that pass a test +* [`unist-util-select`](https://github.com/eush77/unist-util-select) + — Select nodes with CSS-like selectors + +## Contribute + +See [`contributing.md` in `syntax-tree/.github`][contributing] for ways to get +started. +See [`support.md`][support] for ways to get help. + +This project has a [code of conduct][coc]. +By interacting with this repository, organization, or community you agree to +abide by its terms. + +## License + +[MIT][license] © [Titus Wormer][author] + + + +[build-badge]: https://img.shields.io/travis/syntax-tree/unist-util-visit-parents.svg + +[build]: https://travis-ci.org/syntax-tree/unist-util-visit-parents + +[coverage-badge]: https://img.shields.io/codecov/c/github/syntax-tree/unist-util-visit-parents.svg + +[coverage]: https://codecov.io/github/syntax-tree/unist-util-visit-parents + +[downloads-badge]: https://img.shields.io/npm/dm/unist-util-visit-parents.svg + +[downloads]: https://www.npmjs.com/package/unist-util-visit-parents + +[size-badge]: https://img.shields.io/bundlephobia/minzip/unist-util-visit-parents.svg + +[size]: https://bundlephobia.com/result?p=unist-util-visit-parents + +[sponsors-badge]: https://opencollective.com/unified/sponsors/badge.svg + +[backers-badge]: https://opencollective.com/unified/backers/badge.svg + +[collective]: https://opencollective.com/unified + +[chat-badge]: https://img.shields.io/badge/chat-spectrum-7b16ff.svg + +[chat]: https://spectrum.chat/unified/syntax-tree + +[npm]: https://docs.npmjs.com/cli/install + +[license]: license + +[author]: https://wooorm.com + +[unist]: https://github.com/syntax-tree/unist + +[node]: https://github.com/syntax-tree/unist#node + +[visitor]: #next--visitornode-ancestors + +[contributing]: https://github.com/syntax-tree/.github/blob/master/contributing.md + +[support]: https://github.com/syntax-tree/.github/blob/master/support.md + +[coc]: https://github.com/syntax-tree/.github/blob/master/code-of-conduct.md + +[is]: https://github.com/syntax-tree/unist-util-is + +[depth-first]: https://github.com/syntax-tree/unist#depth-first-traversal + +[tree-traversal]: https://github.com/syntax-tree/unist#tree-traversal + +[preorder]: https://github.com/syntax-tree/unist#preorder + +[descendant]: https://github.com/syntax-tree/unist#descendant + +[head]: https://github.com/syntax-tree/unist#head + +[tail]: https://github.com/syntax-tree/unist#tail + +[parent]: https://github.com/syntax-tree/unist#parent-1 + +[sibling]: https://github.com/syntax-tree/unist#sibling + +[index]: https://github.com/syntax-tree/unist#index + +[ancestor]: https://github.com/syntax-tree/unist#ancestor + +[tree]: https://github.com/syntax-tree/unist#tree + +[type]: https://github.com/syntax-tree/unist#type diff --git a/node_modules/unist-util-visit-parents/types/index.d.ts b/node_modules/unist-util-visit-parents/types/index.d.ts new file mode 100644 index 0000000..53a37c4 --- /dev/null +++ b/node_modules/unist-util-visit-parents/types/index.d.ts @@ -0,0 +1,111 @@ +// TypeScript Version: 3.5 + +import {Node, Parent} from 'unist' +import {Test} from 'unist-util-is' + +declare namespace visitParents { + /** + * Continue traversing as normal + */ + type Continue = true + + /** + * Do not traverse this node’s children + */ + type Skip = 'skip' + + /** + * Stop traversing immediately + */ + type Exit = false + + /** + * Union of the action types + */ + type Action = Continue | Skip | Exit + + /** + * List with one or two values, the first an action, the second an index. + */ + type ActionTuple = [Action, Index] + + /** + * Move to the sibling at index next (after node itself is completely traversed). + * Useful if mutating the tree, such as removing the node the visitor is currently on, + * or any of its previous siblings (or next siblings, in case of reverse) + * Results less than 0 or greater than or equal to children.length stop traversing the parent + */ + type Index = number + + /** + * Invoked when a node (matching test, if given) is found. + * Visitors are free to transform node. + * They can also transform the parent of node (the last of ancestors). + * Replacing node itself, if visit.SKIP is not returned, still causes its descendants to be visited. + * If adding or removing previous siblings (or next siblings, in case of reverse) of node, + * visitor should return a new index (number) to specify the sibling to traverse after node is traversed. + * Adding or removing next siblings of node (or previous siblings, in case of reverse) + * is handled as expected without needing to return a new index. + * Removing the children property of an ancestor still results in them being traversed. + * + * @param node Found node + * @param ancestors Ancestors of node + * @paramType V node type found + * @returns + * When Action is passed, treated as a tuple of [Action] + * When Index is passed, treated as a tuple of [CONTINUE, Index] + * When ActionTuple is passed, + * Note that passing a tuple only makes sense if the action is SKIP. + * If the action is EXIT, that action can be returned. + * If the action is CONTINUE, index can be returned. + */ + type Visitor = ( + node: V, + ancestors: Node[] + ) => void | Action | Index | ActionTuple +} + +declare const visitParents: { + /** + * Visit children of tree which pass a test + * + * @param tree abstract syntax tree to visit + * @param test test node + * @param visitor function to run for each node + * @param reverse visit the tree in reverse, defaults to false + * @typeParam T tree node + * @typeParam V node type found + */ + ( + tree: Node, + test: Test | Array>, + visitor: visitParents.Visitor, + reverse?: boolean + ): void + + /** + * Visit children of a tree + * + * @param tree abstract syntax tree to visit + * @param visitor function to run for each node + * @param reverse visit the tree in reverse, defaults to false + */ + (tree: Node, visitor: visitParents.Visitor, reverse?: boolean): void + + /** + * Continue traversing as normal + */ + CONTINUE: visitParents.Continue + + /** + * Do not traverse this node’s children + */ + SKIP: visitParents.Skip + + /** + * Stop traversing immediately + */ + EXIT: visitParents.Exit +} + +export = visitParents diff --git a/node_modules/unist-util-visit/index.js b/node_modules/unist-util-visit/index.js new file mode 100644 index 0000000..39970e7 --- /dev/null +++ b/node_modules/unist-util-visit/index.js @@ -0,0 +1,29 @@ +'use strict' + +module.exports = visit + +var visitParents = require('unist-util-visit-parents') + +var CONTINUE = visitParents.CONTINUE +var SKIP = visitParents.SKIP +var EXIT = visitParents.EXIT + +visit.CONTINUE = CONTINUE +visit.SKIP = SKIP +visit.EXIT = EXIT + +function visit(tree, test, visitor, reverse) { + if (typeof test === 'function' && typeof visitor !== 'function') { + reverse = visitor + visitor = test + test = null + } + + visitParents(tree, test, overload, reverse) + + function overload(node, parents) { + var parent = parents[parents.length - 1] + var index = parent ? parent.children.indexOf(node) : null + return visitor(node, index, parent) + } +} diff --git a/node_modules/unist-util-visit/license b/node_modules/unist-util-visit/license new file mode 100644 index 0000000..32e7a3d --- /dev/null +++ b/node_modules/unist-util-visit/license @@ -0,0 +1,22 @@ +(The MIT License) + +Copyright (c) 2015 Titus Wormer + +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: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +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. diff --git a/node_modules/unist-util-visit/package.json b/node_modules/unist-util-visit/package.json new file mode 100644 index 0000000..7792878 --- /dev/null +++ b/node_modules/unist-util-visit/package.json @@ -0,0 +1,147 @@ +{ + "_from": "unist-util-visit@^2.0.0", + "_id": "unist-util-visit@2.0.2", + "_inBundle": false, + "_integrity": "sha512-HoHNhGnKj6y+Sq+7ASo2zpVdfdRifhTgX2KTU3B/sO/TTlZchp7E3S4vjRzDJ7L60KmrCPsQkVK3lEF3cz36XQ==", + "_location": "/unist-util-visit", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "unist-util-visit@^2.0.0", + "name": "unist-util-visit", + "escapedName": "unist-util-visit", + "rawSpec": "^2.0.0", + "saveSpec": null, + "fetchSpec": "^2.0.0" + }, + "_requiredBy": [ + "/mdast-util-compact", + "/unist-util-remove-position" + ], + "_resolved": "https://registry.npmjs.org/unist-util-visit/-/unist-util-visit-2.0.2.tgz", + "_shasum": "3843782a517de3d2357b4c193b24af2d9366afb7", + "_spec": "unist-util-visit@^2.0.0", + "_where": "/Users/josh/Projects/slackify-markdown-action/node_modules/unist-util-remove-position", + "author": { + "name": "Titus Wormer", + "email": "tituswormer@gmail.com", + "url": "https://wooorm.com" + }, + "bugs": { + "url": "https://github.com/syntax-tree/unist-util-visit/issues" + }, + "bundleDependencies": false, + "contributors": [ + { + "name": "Titus Wormer", + "email": "tituswormer@gmail.com", + "url": "https://wooorm.com" + }, + { + "name": "Eugene Sharygin", + "email": "eush77@gmail.com" + }, + { + "name": "Richard Gibson", + "email": "richard.gibson@gmail.com" + } + ], + "dependencies": { + "@types/unist": "^2.0.0", + "unist-util-is": "^4.0.0", + "unist-util-visit-parents": "^3.0.0" + }, + "deprecated": false, + "description": "unist utility to visit nodes", + "devDependencies": { + "browserify": "^16.0.0", + "dtslint": "^3.0.0", + "nyc": "^15.0.0", + "prettier": "^1.0.0", + "remark": "^11.0.0", + "remark-cli": "^7.0.0", + "remark-preset-wooorm": "^6.0.0", + "tape": "^4.0.0", + "tinyify": "^2.0.0", + "typescript": "^3.0.0", + "unified": "^8.0.0", + "xo": "^0.26.0" + }, + "files": [ + "index.js", + "types/index.d.ts" + ], + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + }, + "homepage": "https://github.com/syntax-tree/unist-util-visit#readme", + "keywords": [ + "unist", + "unist-util", + "util", + "utility", + "remark", + "retext", + "rehype", + "mdast", + "hast", + "xast", + "nlcst", + "natural", + "language", + "markdown", + "html", + "xml", + "tree", + "ast", + "node", + "visit", + "walk" + ], + "license": "MIT", + "name": "unist-util-visit", + "nyc": { + "check-coverage": true, + "lines": 100, + "functions": 100, + "branches": 100 + }, + "prettier": { + "tabWidth": 2, + "useTabs": false, + "singleQuote": true, + "bracketSpacing": false, + "semi": false, + "trailingComma": "none" + }, + "remarkConfig": { + "plugins": [ + "preset-wooorm" + ] + }, + "repository": { + "type": "git", + "url": "git+https://github.com/syntax-tree/unist-util-visit.git" + }, + "scripts": { + "build": "npm run build-bundle && npm run build-mangle", + "build-bundle": "browserify . -s unistUtilVisit > unist-util-visit.js", + "build-mangle": "browserify . -s unistUtilVisit -p tinyify > unist-util-visit.min.js", + "format": "remark . -qfo && prettier --write \"**/*.{js,ts}\" && xo --fix", + "test": "npm run format && npm run build && npm run test-coverage && npm run test-types", + "test-api": "node test", + "test-coverage": "nyc --reporter lcov tape test.js", + "test-types": "dtslint types" + }, + "types": "types/index.d.ts", + "version": "2.0.2", + "xo": { + "prettier": true, + "esnext": false, + "ignores": [ + "unist-util-visit.js" + ] + } +} diff --git a/node_modules/unist-util-visit/readme.md b/node_modules/unist-util-visit/readme.md new file mode 100644 index 0000000..4b3322a --- /dev/null +++ b/node_modules/unist-util-visit/readme.md @@ -0,0 +1,137 @@ +# unist-util-visit + +[![Build][build-badge]][build] +[![Coverage][coverage-badge]][coverage] +[![Downloads][downloads-badge]][downloads] +[![Size][size-badge]][size] +[![Sponsors][sponsors-badge]][collective] +[![Backers][backers-badge]][collective] +[![Chat][chat-badge]][chat] + +[**unist**][unist] utility to visit nodes. + +## Install + +[npm][]: + +```sh +npm install unist-util-visit +``` + +## Use + +```js +var u = require('unist-builder') +var visit = require('unist-util-visit') + +var tree = u('tree', [ + u('leaf', '1'), + u('node', [u('leaf', '2')]), + u('void'), + u('leaf', '3') +]) + +visit(tree, 'leaf', function(node) { + console.log(node) +}) +``` + +Yields: + +```js +{ type: 'leaf', value: '1' } +{ type: 'leaf', value: '2' } +{ type: 'leaf', value: '3' } +``` + +## API + +### `visit(tree[, test], visitor[, reverse])` + +This function works exactly the same as [`unist-util-visit-parents`][vp], +but `visitor` has a different signature. + +#### `next? = visitor(node, index, parent)` + +Instead of being passed an array of ancestors, `visitor` is invoked with the +node’s [`index`][index] and its [`parent`][parent]. + +Otherwise the same as [`unist-util-visit-parents`][vp]. + +## Related + +* [`unist-util-visit-parents`][vp] + — Like `visit`, but with a stack of parents +* [`unist-util-filter`](https://github.com/syntax-tree/unist-util-filter) + — Create a new tree with all nodes that pass a test +* [`unist-util-map`](https://github.com/syntax-tree/unist-util-map) + — Create a new tree with all nodes mapped by a given function +* [`unist-util-flatmap`](https://gitlab.com/staltz/unist-util-flatmap) + — Create a new tree by mapping (to an array) with the provided function and + then flattening +* [`unist-util-remove`](https://github.com/syntax-tree/unist-util-remove) + — Remove nodes from a tree that pass a test +* [`unist-util-select`](https://github.com/syntax-tree/unist-util-select) + — Select nodes with CSS-like selectors + +## Contribute + +See [`contributing.md` in `syntax-tree/.github`][contributing] for ways to get +started. +See [`support.md`][support] for ways to get help. + +This project has a [code of conduct][coc]. +By interacting with this repository, organization, or community you agree to +abide by its terms. + +## License + +[MIT][license] © [Titus Wormer][author] + + + +[build-badge]: https://img.shields.io/travis/syntax-tree/unist-util-visit.svg + +[build]: https://travis-ci.org/syntax-tree/unist-util-visit + +[coverage-badge]: https://img.shields.io/codecov/c/github/syntax-tree/unist-util-visit.svg + +[coverage]: https://codecov.io/github/syntax-tree/unist-util-visit + +[downloads-badge]: https://img.shields.io/npm/dm/unist-util-visit.svg + +[downloads]: https://www.npmjs.com/package/unist-util-visit + +[size-badge]: https://img.shields.io/bundlephobia/minzip/unist-util-visit.svg + +[size]: https://bundlephobia.com/result?p=unist-util-visit + +[sponsors-badge]: https://opencollective.com/unified/sponsors/badge.svg + +[backers-badge]: https://opencollective.com/unified/backers/badge.svg + +[collective]: https://opencollective.com/unified + +[chat-badge]: https://img.shields.io/badge/chat-spectrum-7b16ff.svg + +[chat]: https://spectrum.chat/unified/syntax-tree + +[npm]: https://docs.npmjs.com/cli/install + +[license]: license + +[author]: https://wooorm.com + +[contributing]: https://github.com/syntax-tree/.github/blob/master/contributing.md + +[support]: https://github.com/syntax-tree/.github/blob/master/support.md + +[coc]: https://github.com/syntax-tree/.github/blob/master/code-of-conduct.md + +[unist]: https://github.com/syntax-tree/unist + +[vp]: https://github.com/syntax-tree/unist-util-visit-parents + +[index]: https://github.com/syntax-tree/unist#index + +[parent]: https://github.com/syntax-tree/unist#parent-1 diff --git a/node_modules/unist-util-visit/types/index.d.ts b/node_modules/unist-util-visit/types/index.d.ts new file mode 100644 index 0000000..09a9c37 --- /dev/null +++ b/node_modules/unist-util-visit/types/index.d.ts @@ -0,0 +1,88 @@ +// TypeScript Version: 3.5 + +import {Node, Parent} from 'unist' +import {Test} from 'unist-util-is' +import { + Action, + ActionTuple, + Continue, + Exit, + Index, + Skip +} from 'unist-util-visit-parents' + +declare namespace visit { + /** + * Invoked when a node (matching test, if given) is found. + * Visitors are free to transform node. + * They can also transform the parent of node. + * Replacing node itself, if visit.SKIP is not returned, still causes its descendants to be visited. + * If adding or removing previous siblings (or next siblings, in case of reverse) of node, + * visitor should return a new index (number) to specify the sibling to traverse after node is traversed. + * Adding or removing next siblings of node (or previous siblings, in case of reverse) + * is handled as expected without needing to return a new index. + * Removing the children property of the parent still result in them being traversed. + * + * @param node Found node + * @param index Position of found node within Parent + * @param parent Parent of found node + * @paramType V node type found + * @returns + * When Action is passed, treated as a tuple of [Action] + * When Index is passed, treated as a tuple of [CONTINUE, Index] + * When ActionTuple is passed, + * Note that passing a tuple only makes sense if the action is SKIP. + * If the action is EXIT, that action can be returned. + * If the action is CONTINUE, index can be returned. + */ + type Visitor = ( + node: V, + index: number, + parent: Node + ) => void | Action | Index | ActionTuple +} + +declare const visit: { + /** + * Visit children of tree which pass a test + * + * @param tree abstract syntax tree to visit + * @param test test node + * @param visitor function to run for each node + * @param reverse visit the tree in reverse, defaults to false + * @typeParam T tree node + * @typeParam V node type found + */ + ( + tree: Node, + test: Test | Array>, + visitor: visit.Visitor, + reverse?: boolean + ): void + + /** + * Visit children of a tree + * + * @param tree abstract syntax tree to visit + * @param visitor function to run for each node + * @param reverse visit the tree in reverse, defaults to false + */ + (tree: Node, visitor: visit.Visitor, reverse?: boolean): void + + /** + * Continue traversing as normal + */ + CONTINUE: Continue + + /** + * Do not traverse this node’s children + */ + SKIP: Skip + + /** + * Stop traversing immediately + */ + EXIT: Exit +} + +export = visit diff --git a/node_modules/vfile-location/index.js b/node_modules/vfile-location/index.js new file mode 100644 index 0000000..2d7c21c --- /dev/null +++ b/node_modules/vfile-location/index.js @@ -0,0 +1,74 @@ +'use strict' + +module.exports = factory + +function factory(file) { + var contents = indices(String(file)) + + return { + toPosition: offsetToPositionFactory(contents), + toOffset: positionToOffsetFactory(contents) + } +} + +// Factory to get the line and column-based `position` for `offset` in the bound +// indices. +function offsetToPositionFactory(indices) { + return offsetToPosition + + // Get the line and column-based `position` for `offset` in the bound indices. + function offsetToPosition(offset) { + var index = -1 + var length = indices.length + + if (offset < 0) { + return {} + } + + while (++index < length) { + if (indices[index] > offset) { + return { + line: index + 1, + column: offset - (indices[index - 1] || 0) + 1, + offset: offset + } + } + } + + return {} + } +} + +// Factory to get the `offset` for a line and column-based `position` in the +// bound indices. +function positionToOffsetFactory(indices) { + return positionToOffset + + // Get the `offset` for a line and column-based `position` in the bound + // indices. + function positionToOffset(position) { + var line = position && position.line + var column = position && position.column + + if (!isNaN(line) && !isNaN(column) && line - 1 in indices) { + return (indices[line - 2] || 0) + column - 1 || 0 + } + + return -1 + } +} + +// Get indices of line-breaks in `value`. +function indices(value) { + var result = [] + var index = value.indexOf('\n') + + while (index !== -1) { + result.push(index + 1) + index = value.indexOf('\n', index + 1) + } + + result.push(value.length + 1) + + return result +} diff --git a/node_modules/vfile-location/license b/node_modules/vfile-location/license new file mode 100644 index 0000000..8d8660d --- /dev/null +++ b/node_modules/vfile-location/license @@ -0,0 +1,22 @@ +(The MIT License) + +Copyright (c) 2016 Titus Wormer + +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: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +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. diff --git a/node_modules/vfile-location/package.json b/node_modules/vfile-location/package.json new file mode 100644 index 0000000..33103bb --- /dev/null +++ b/node_modules/vfile-location/package.json @@ -0,0 +1,125 @@ +{ + "_from": "vfile-location@^3.0.0", + "_id": "vfile-location@3.0.1", + "_inBundle": false, + "_integrity": "sha512-yYBO06eeN/Ki6Kh1QAkgzYpWT1d3Qln+ZCtSbJqFExPl1S3y2qqotJQXoh6qEvl/jDlgpUJolBn3PItVnnZRqQ==", + "_location": "/vfile-location", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "vfile-location@^3.0.0", + "name": "vfile-location", + "escapedName": "vfile-location", + "rawSpec": "^3.0.0", + "saveSpec": null, + "fetchSpec": "^3.0.0" + }, + "_requiredBy": [ + "/remark-parse" + ], + "_resolved": "https://registry.npmjs.org/vfile-location/-/vfile-location-3.0.1.tgz", + "_shasum": "d78677c3546de0f7cd977544c367266764d31bb3", + "_spec": "vfile-location@^3.0.0", + "_where": "/Users/josh/Projects/slackify-markdown-action/node_modules/remark-parse", + "author": { + "name": "Titus Wormer", + "email": "tituswormer@gmail.com", + "url": "https://wooorm.com" + }, + "bugs": { + "url": "https://github.com/vfile/vfile-location/issues" + }, + "bundleDependencies": false, + "contributors": [ + { + "name": "Titus Wormer", + "email": "tituswormer@gmail.com", + "url": "https://wooorm.com" + }, + { + "name": "Christian Murphy", + "email": "christian.murphy.42@gmail.com" + } + ], + "dependencies": {}, + "deprecated": false, + "description": "vfile utility to convert between positional (line and column-based) and offset (range-based) locations", + "devDependencies": { + "@types/unist": "^2.0.0", + "browserify": "^16.0.0", + "dtslint": "^3.0.0", + "nyc": "^15.0.0", + "prettier": "^1.0.0", + "remark-cli": "^7.0.0", + "remark-preset-wooorm": "^6.0.0", + "tape": "^4.0.0", + "tinyify": "^2.0.0", + "vfile": "^4.0.0", + "xo": "^0.27.0" + }, + "files": [ + "index.js", + "types/index.d.ts" + ], + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + }, + "homepage": "https://github.com/vfile/vfile-location#readme", + "keywords": [ + "vfile", + "vfile-util", + "util", + "utility", + "virtual", + "file", + "location", + "position", + "offset" + ], + "license": "MIT", + "name": "vfile-location", + "nyc": { + "check-coverage": true, + "lines": 100, + "functions": 100, + "branches": 100 + }, + "prettier": { + "tabWidth": 2, + "useTabs": false, + "singleQuote": true, + "bracketSpacing": false, + "semi": false, + "trailingComma": "none" + }, + "remarkConfig": { + "plugins": [ + "preset-wooorm" + ] + }, + "repository": { + "type": "git", + "url": "git+https://github.com/vfile/vfile-location.git" + }, + "scripts": { + "build": "npm run build-bundle && npm run build-mangle", + "build-bundle": "browserify . -s vfileLocation > vfile-location.js", + "build-mangle": "browserify . -s vfileLocation -p tinyify > vfile-location.min.js", + "format": "remark . -qfo && prettier --write \"**/*.{js,ts}\" && xo --fix", + "test": "npm run format && npm run build && npm run test-coverage && npm run test-types", + "test-api": "node test", + "test-coverage": "nyc --reporter lcov tape test.js", + "test-types": "dtslint types" + }, + "types": "types/index.d.ts", + "version": "3.0.1", + "xo": { + "prettier": true, + "esnext": false, + "ignores": [ + "vfile-location.js" + ] + } +} diff --git a/node_modules/vfile-location/readme.md b/node_modules/vfile-location/readme.md new file mode 100644 index 0000000..4d52286 --- /dev/null +++ b/node_modules/vfile-location/readme.md @@ -0,0 +1,115 @@ +# vfile-location + +[![Build][build-badge]][build] +[![Coverage][coverage-badge]][coverage] +[![Downloads][downloads-badge]][downloads] +[![Size][size-badge]][size] +[![Sponsors][sponsors-badge]][collective] +[![Backers][backers-badge]][collective] +[![Chat][chat-badge]][chat] + +Convert between positions (line and column-based) and offsets (range-based) +locations in a [virtual file][vfile]. + +## Install + +[npm][]: + +```sh +npm install vfile-location +``` + +## Use + +```js +var vfile = require('vfile') +var vfileLocation = require('vfile-location') + +var location = vfileLocation(vfile('foo\nbar\nbaz')) + +var offset = location.toOffset({line: 3, column: 3}) // => 10 +location.toPosition(offset) // => {line: 3, column: 3, offset: 10} +``` + +## API + +### `location = vfileLocation(doc)` + +Get transform functions for the given `doc` (`string`) or [`file`][vfile]. + +Returns an object with [`toOffset`][to-offset] and [`toPosition`][to-position]. + +### `location.toOffset(position)` + +Get the `offset` (`number`) for a line and column-based [`position`][position] +in the bound file. +Returns `-1` when given invalid or out of bounds input. + +### `location.toPosition(offset)` + +Get the line and column-based [`position`][position] for `offset` in the bound +file. + +## Contribute + +See [`contributing.md`][contributing] in [`vfile/.github`][health] for ways to +get started. +See [`support.md`][support] for ways to get help. + +This project has a [code of conduct][coc]. +By interacting with this repository, organization, or community you agree to +abide by its terms. + +## License + +[MIT][license] © [Titus Wormer][author] + + + +[build-badge]: https://img.shields.io/travis/vfile/vfile-location.svg + +[build]: https://travis-ci.org/vfile/vfile-location + +[coverage-badge]: https://img.shields.io/codecov/c/github/vfile/vfile-location.svg + +[coverage]: https://codecov.io/github/vfile/vfile-location + +[downloads-badge]: https://img.shields.io/npm/dm/vfile-location.svg + +[downloads]: https://www.npmjs.com/package/vfile-location + +[size-badge]: https://img.shields.io/bundlephobia/minzip/vfile-location.svg + +[size]: https://bundlephobia.com/result?p=vfile-location + +[sponsors-badge]: https://opencollective.com/unified/sponsors/badge.svg + +[backers-badge]: https://opencollective.com/unified/backers/badge.svg + +[collective]: https://opencollective.com/unified + +[chat-badge]: https://img.shields.io/badge/chat-spectrum-7b16ff.svg + +[chat]: https://spectrum.chat/unified/vfile + +[npm]: https://docs.npmjs.com/cli/install + +[contributing]: https://github.com/vfile/.github/blob/master/contributing.md + +[support]: https://github.com/vfile/.github/blob/master/support.md + +[health]: https://github.com/vfile/.github + +[coc]: https://github.com/vfile/.github/blob/master/code-of-conduct.md + +[license]: license + +[author]: https://wooorm.com + +[vfile]: https://github.com/vfile/vfile + +[to-offset]: #locationtooffsetposition + +[to-position]: #locationtopositionoffset + +[position]: https://github.com/syntax-tree/unist#position diff --git a/node_modules/vfile-location/types/index.d.ts b/node_modules/vfile-location/types/index.d.ts new file mode 100644 index 0000000..08e423b --- /dev/null +++ b/node_modules/vfile-location/types/index.d.ts @@ -0,0 +1,30 @@ +// TypeScript Version: 3.0 + +import {Point} from 'unist' +import {VFile} from 'vfile' + +declare namespace vfileLocation { + type Position = Pick + type PositionWithOffset = Required + type Offset = NonNullable + + interface Location { + /** + * Get the offset for a line and column based position in the bound file. + * Returns `-1` when given invalid or out of bounds input. + */ + toOffset: (position: Position) => Offset + + /** + * Get the line and column-based position for offset in the bound file. + */ + toPosition: (offset: Offset) => PositionWithOffset + } +} + +/** + * Get transform functions for the given `document`. + */ +declare function vfileLocation(document: string | VFile): vfileLocation.Location + +export = vfileLocation diff --git a/node_modules/vfile-message/index.js b/node_modules/vfile-message/index.js new file mode 100644 index 0000000..c913753 --- /dev/null +++ b/node_modules/vfile-message/index.js @@ -0,0 +1,94 @@ +'use strict' + +var stringify = require('unist-util-stringify-position') + +module.exports = VMessage + +// Inherit from `Error#`. +function VMessagePrototype() {} +VMessagePrototype.prototype = Error.prototype +VMessage.prototype = new VMessagePrototype() + +// Message properties. +var proto = VMessage.prototype + +proto.file = '' +proto.name = '' +proto.reason = '' +proto.message = '' +proto.stack = '' +proto.fatal = null +proto.column = null +proto.line = null + +// Construct a new VMessage. +// +// Note: We cannot invoke `Error` on the created context, as that adds readonly +// `line` and `column` attributes on Safari 9, thus throwing and failing the +// data. +function VMessage(reason, position, origin) { + var parts + var range + var location + + if (typeof position === 'string') { + origin = position + position = null + } + + parts = parseOrigin(origin) + range = stringify(position) || '1:1' + + location = { + start: {line: null, column: null}, + end: {line: null, column: null} + } + + // Node. + if (position && position.position) { + position = position.position + } + + if (position) { + // Position. + if (position.start) { + location = position + position = position.start + } else { + // Point. + location.start = position + } + } + + if (reason.stack) { + this.stack = reason.stack + reason = reason.message + } + + this.message = reason + this.name = range + this.reason = reason + this.line = position ? position.line : null + this.column = position ? position.column : null + this.location = location + this.source = parts[0] + this.ruleId = parts[1] +} + +function parseOrigin(origin) { + var result = [null, null] + var index + + if (typeof origin === 'string') { + index = origin.indexOf(':') + + if (index === -1) { + result[1] = origin + } else { + result[0] = origin.slice(0, index) + result[1] = origin.slice(index + 1) + } + } + + return result +} diff --git a/node_modules/vfile-message/license b/node_modules/vfile-message/license new file mode 100644 index 0000000..045ffe0 --- /dev/null +++ b/node_modules/vfile-message/license @@ -0,0 +1,22 @@ +(The MIT License) + +Copyright (c) 2017 Titus Wormer + +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: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +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. diff --git a/node_modules/vfile-message/package.json b/node_modules/vfile-message/package.json new file mode 100644 index 0000000..b6beef9 --- /dev/null +++ b/node_modules/vfile-message/package.json @@ -0,0 +1,124 @@ +{ + "_from": "vfile-message@^2.0.0", + "_id": "vfile-message@2.0.4", + "_inBundle": false, + "_integrity": "sha512-DjssxRGkMvifUOJre00juHoP9DPWuzjxKuMDrhNbk2TdaYYBNMStsNhEOt3idrtI12VQYM/1+iM0KOzXi4pxwQ==", + "_location": "/vfile-message", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "vfile-message@^2.0.0", + "name": "vfile-message", + "escapedName": "vfile-message", + "rawSpec": "^2.0.0", + "saveSpec": null, + "fetchSpec": "^2.0.0" + }, + "_requiredBy": [ + "/vfile" + ], + "_resolved": "https://registry.npmjs.org/vfile-message/-/vfile-message-2.0.4.tgz", + "_shasum": "5b43b88171d409eae58477d13f23dd41d52c371a", + "_spec": "vfile-message@^2.0.0", + "_where": "/Users/josh/Projects/slackify-markdown-action/node_modules/vfile", + "author": { + "name": "Titus Wormer", + "email": "tituswormer@gmail.com", + "url": "https://wooorm.com" + }, + "bugs": { + "url": "https://github.com/vfile/vfile-message/issues" + }, + "bundleDependencies": false, + "contributors": [ + { + "name": "Titus Wormer", + "email": "tituswormer@gmail.com", + "url": "https://wooorm.com" + } + ], + "dependencies": { + "@types/unist": "^2.0.0", + "unist-util-stringify-position": "^2.0.0" + }, + "deprecated": false, + "description": "vfile utility to create a virtual message", + "devDependencies": { + "browserify": "^16.0.0", + "dtslint": "^3.0.0", + "nyc": "^15.0.0", + "prettier": "^2.0.0", + "remark-cli": "^7.0.0", + "remark-preset-wooorm": "^6.0.0", + "tape": "^4.0.0", + "tinyify": "^2.0.0", + "xo": "^0.28.0" + }, + "files": [ + "types/index.d.ts", + "index.js" + ], + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + }, + "homepage": "https://github.com/vfile/vfile-message#readme", + "keywords": [ + "vfile", + "vfile-util", + "util", + "utility", + "virtual", + "file", + "message" + ], + "license": "MIT", + "name": "vfile-message", + "nyc": { + "check-coverage": true, + "lines": 100, + "functions": 100, + "branches": 100 + }, + "prettier": { + "tabWidth": 2, + "useTabs": false, + "singleQuote": true, + "bracketSpacing": false, + "semi": false, + "trailingComma": "none" + }, + "remarkConfig": { + "plugins": [ + "preset-wooorm" + ] + }, + "repository": { + "type": "git", + "url": "git+https://github.com/vfile/vfile-message.git" + }, + "scripts": { + "build": "npm run build-bundle && npm run build-mangle", + "build-bundle": "browserify . -s vfileMessage > vfile-message.js", + "build-mangle": "browserify . -s vfileMessage -p tinyify > vfile-message.min.js", + "format": "remark . -qfo && prettier --write \"**/*.{js,ts}\" && xo --fix", + "test": "npm run format && npm run build && npm run test-coverage && npm run test-types", + "test-api": "node test", + "test-coverage": "nyc --reporter lcov tape test.js", + "test-types": "dtslint types" + }, + "types": "types/index.d.ts", + "version": "2.0.4", + "xo": { + "prettier": true, + "esnext": false, + "rules": { + "@typescript-eslint/member-ordering": "off" + }, + "ignores": [ + "types", + "vfile-message.js" + ] + } +} diff --git a/node_modules/vfile-message/readme.md b/node_modules/vfile-message/readme.md new file mode 100644 index 0000000..894504a --- /dev/null +++ b/node_modules/vfile-message/readme.md @@ -0,0 +1,214 @@ +# vfile-message + +[![Build][build-badge]][build] +[![Coverage][coverage-badge]][coverage] +[![Downloads][downloads-badge]][downloads] +[![Size][size-badge]][size] +[![Sponsors][sponsors-badge]][collective] +[![Backers][backers-badge]][collective] +[![Chat][chat-badge]][chat] + +Create [vfile][] messages. + +## Install + +[npm][]: + +```bash +npm install vfile-message +``` + +## Use + +```js +var VMessage = require('vfile-message') + +var message = new VMessage( + '`braavo` is misspelt; did you mean `bravo`?', + {line: 1, column: 8}, + 'spell:typo' +) + +console.log(message) +``` + +Yields: + +```js +{ [1:8: `braavo` is misspelt; did you mean `bravo`?] + reason: '`braavo` is misspelt; did you mean `bravo`?', + fatal: null, + line: 1, + column: 8, + location: + { start: { line: 1, column: 8 }, + end: { line: null, column: null } }, + source: 'spell', + ruleId: 'typo' } +``` + +## API + +### `VMessage(reason[, position][, origin])` + +Constructor of a message for `reason` at `position` from `origin`. +When an error is passed in as `reason`, copies the stack. + +##### Parameters + +###### `reason` + +Reason for message (`string` or `Error`). +Uses the stack and message of the error if given. + +###### `position` + +Place at which the message occurred in a file ([`Node`][node], +[`Position`][position], or [`Point`][point], optional). + +###### `origin` + +Place in code the message originates from (`string`, optional). + +Can either be the [`ruleId`][ruleid] (`'rule'`), or a string with both a +[`source`][source] and a [`ruleId`][ruleid] delimited with a colon +(`'source:rule'`). + +##### Extends + +[`Error`][error]. + +##### Returns + +An instance of itself. + +##### Properties + +###### `reason` + +Reason for message (`string`). + +###### `fatal` + +If `true`, marks associated file as no longer processable (`boolean?`). +If `false`, necessitates a (potential) change. +The value can also be `null` or `undefined`. + +###### `line` + +Starting line of error (`number?`). + +###### `column` + +Starting column of error (`number?`). + +###### `location` + +Full range information, when available ([`Position`][position]). +Has `start` and `end` properties, both set to an object with `line` and +`column`, set to `number?`. + +###### `source` + +Namespace of warning (`string?`). + +###### `ruleId` + +Category of message (`string?`). + +###### `stack` + +Stack of message (`string?`). + +##### Custom properties + +It’s OK to store custom data directly on the `VMessage`, some of those are +handled by [utilities][util]. + +###### `file` + +You may add a `file` property with a path of a file (used throughout the +[**VFile**][vfile] ecosystem). + +###### `note` + +You may add a `note` property with a long form description of the message +(supported by [`vfile-reporter`][reporter]). + +###### `url` + +You may add a `url` property with a link to documentation for the message. + +## Contribute + +See [`contributing.md`][contributing] in [`vfile/.github`][health] for ways to +get started. +See [`support.md`][support] for ways to get help. + +This project has a [code of conduct][coc]. +By interacting with this repository, organization, or community you agree to +abide by its terms. + +## License + +[MIT][license] © [Titus Wormer][author] + + + +[build-badge]: https://img.shields.io/travis/vfile/vfile-message.svg + +[build]: https://travis-ci.org/vfile/vfile-message + +[coverage-badge]: https://img.shields.io/codecov/c/github/vfile/vfile-message.svg + +[coverage]: https://codecov.io/github/vfile/vfile-message + +[downloads-badge]: https://img.shields.io/npm/dm/vfile-message.svg + +[downloads]: https://www.npmjs.com/package/vfile-message + +[size-badge]: https://img.shields.io/bundlephobia/minzip/vfile-message.svg + +[size]: https://bundlephobia.com/result?p=vfile-message + +[sponsors-badge]: https://opencollective.com/unified/sponsors/badge.svg + +[backers-badge]: https://opencollective.com/unified/backers/badge.svg + +[collective]: https://opencollective.com/unified + +[chat-badge]: https://img.shields.io/badge/chat-spectrum-7b16ff.svg + +[chat]: https://spectrum.chat/unified/vfile + +[npm]: https://docs.npmjs.com/cli/install + +[contributing]: https://github.com/vfile/.github/blob/master/contributing.md + +[support]: https://github.com/vfile/.github/blob/master/support.md + +[health]: https://github.com/vfile/.github + +[coc]: https://github.com/vfile/.github/blob/master/code-of-conduct.md + +[license]: license + +[author]: https://wooorm.com + +[error]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Error + +[node]: https://github.com/syntax-tree/unist#node + +[position]: https://github.com/syntax-tree/unist#position + +[point]: https://github.com/syntax-tree/unist#point + +[vfile]: https://github.com/vfile/vfile + +[util]: https://github.com/vfile/vfile#utilities + +[reporter]: https://github.com/vfile/vfile-reporter + +[ruleid]: #ruleid + +[source]: #source diff --git a/node_modules/vfile-message/types/index.d.ts b/node_modules/vfile-message/types/index.d.ts new file mode 100644 index 0000000..d217843 --- /dev/null +++ b/node_modules/vfile-message/types/index.d.ts @@ -0,0 +1,98 @@ +// TypeScript Version: 3.0 + +import * as Unist from 'unist' + +declare namespace vfileMessage { + /** + * Create a virtual message. + */ + interface VFileMessage extends Error { + /** + * Constructor of a message for `reason` at `position` from `origin`. + * When an error is passed in as `reason`, copies the `stack`. + * + * @param reason Reason for message (`string` or `Error`). Uses the stack and message of the error if given. + * @param position Place at which the message occurred in a file (`Node`, `Position`, or `Point`, optional). + * @param origin Place in code the message originates from (`string`, optional). + */ + ( + reason: string | Error, + position?: Unist.Node | Unist.Position | Unist.Point, + origin?: string + ): VFileMessage + + /** + * Constructor of a message for `reason` at `position` from `origin`. + * When an error is passed in as `reason`, copies the `stack`. + * + * @param reason Reason for message (`string` or `Error`). Uses the stack and message of the error if given. + * @param position Place at which the message occurred in a file (`Node`, `Position`, or `Point`, optional). + * @param origin Place in code the message originates from (`string`, optional). + */ + new ( + reason: string | Error, + position?: Unist.Node | Unist.Position | Unist.Point, + origin?: string + ): VFileMessage + + /** + * Category of message. + */ + ruleId: string | null + + /** + * Reason for message. + */ + reason: string + + /** + * Starting line of error. + */ + line: number | null + + /** + * Starting column of error. + */ + column: number | null + + /** + * Full range information, when available. + * Has start and end properties, both set to an object with line and column, set to number?. + */ + location: Unist.Position + + /** + * Namespace of warning. + */ + source: string | null + + /** + * If true, marks associated file as no longer processable. + */ + fatal?: boolean | null + + /** + * You may add a file property with a path of a file (used throughout the VFile ecosystem). + */ + file?: string + + /** + * You may add a note property with a long form description of the message (supported by vfile-reporter). + */ + note?: string + + /** + * You may add a url property with a link to documentation for the message. + */ + url?: string + + /** + * It’s OK to store custom data directly on the VMessage, some of those are handled by utilities. + */ + [key: string]: unknown + } +} + +declare const vfileMessage: vfileMessage.VFileMessage + +export = vfileMessage diff --git a/node_modules/vfile/changelog.md b/node_modules/vfile/changelog.md new file mode 100644 index 0000000..66bdd1a --- /dev/null +++ b/node_modules/vfile/changelog.md @@ -0,0 +1,5 @@ +# Changelog + +See [GitHub Releases][releases] for the changelog. + +[releases]: https://github.com/vfile/vfile/releases diff --git a/node_modules/vfile/core.js b/node_modules/vfile/core.js new file mode 100644 index 0000000..e192a49 --- /dev/null +++ b/node_modules/vfile/core.js @@ -0,0 +1,170 @@ +'use strict' + +var path = require('path') +var replace = require('replace-ext') +var buffer = require('is-buffer') + +module.exports = VFile + +var own = {}.hasOwnProperty +var proto = VFile.prototype + +// Order of setting (least specific to most), we need this because otherwise +// `{stem: 'a', path: '~/b.js'}` would throw, as a path is needed before a +// stem can be set. +var order = ['history', 'path', 'basename', 'stem', 'extname', 'dirname'] + +proto.toString = toString + +// Access full path (`~/index.min.js`). +Object.defineProperty(proto, 'path', {get: getPath, set: setPath}) + +// Access parent path (`~`). +Object.defineProperty(proto, 'dirname', {get: getDirname, set: setDirname}) + +// Access basename (`index.min.js`). +Object.defineProperty(proto, 'basename', {get: getBasename, set: setBasename}) + +// Access extname (`.js`). +Object.defineProperty(proto, 'extname', {get: getExtname, set: setExtname}) + +// Access stem (`index.min`). +Object.defineProperty(proto, 'stem', {get: getStem, set: setStem}) + +// Construct a new file. +function VFile(options) { + var prop + var index + var length + + if (!options) { + options = {} + } else if (typeof options === 'string' || buffer(options)) { + options = {contents: options} + } else if ('message' in options && 'messages' in options) { + return options + } + + if (!(this instanceof VFile)) { + return new VFile(options) + } + + this.data = {} + this.messages = [] + this.history = [] + this.cwd = process.cwd() + + // Set path related properties in the correct order. + index = -1 + length = order.length + + while (++index < length) { + prop = order[index] + + if (own.call(options, prop)) { + this[prop] = options[prop] + } + } + + // Set non-path related properties. + for (prop in options) { + if (order.indexOf(prop) === -1) { + this[prop] = options[prop] + } + } +} + +function getPath() { + return this.history[this.history.length - 1] +} + +function setPath(path) { + assertNonEmpty(path, 'path') + + if (path !== this.path) { + this.history.push(path) + } +} + +function getDirname() { + return typeof this.path === 'string' ? path.dirname(this.path) : undefined +} + +function setDirname(dirname) { + assertPath(this.path, 'dirname') + this.path = path.join(dirname || '', this.basename) +} + +function getBasename() { + return typeof this.path === 'string' ? path.basename(this.path) : undefined +} + +function setBasename(basename) { + assertNonEmpty(basename, 'basename') + assertPart(basename, 'basename') + this.path = path.join(this.dirname || '', basename) +} + +function getExtname() { + return typeof this.path === 'string' ? path.extname(this.path) : undefined +} + +function setExtname(extname) { + var ext = extname || '' + + assertPart(ext, 'extname') + assertPath(this.path, 'extname') + + if (ext) { + if (ext.charAt(0) !== '.') { + throw new Error('`extname` must start with `.`') + } + + if (ext.indexOf('.', 1) !== -1) { + throw new Error('`extname` cannot contain multiple dots') + } + } + + this.path = replace(this.path, ext) +} + +function getStem() { + return typeof this.path === 'string' + ? path.basename(this.path, this.extname) + : undefined +} + +function setStem(stem) { + assertNonEmpty(stem, 'stem') + assertPart(stem, 'stem') + this.path = path.join(this.dirname || '', stem + (this.extname || '')) +} + +// Get the value of the file. +function toString(encoding) { + var value = this.contents || '' + return buffer(value) ? value.toString(encoding) : String(value) +} + +// Assert that `part` is not a path (i.e., does not contain `path.sep`). +function assertPart(part, name) { + if (part.indexOf(path.sep) !== -1) { + throw new Error( + '`' + name + '` cannot be a path: did not expect `' + path.sep + '`' + ) + } +} + +// Assert that `part` is not empty. +function assertNonEmpty(part, name) { + if (!part) { + throw new Error('`' + name + '` cannot be empty') + } +} + +// Assert `path` exists. +function assertPath(path, name) { + if (!path) { + throw new Error('Setting `' + name + '` requires `path` to be set too') + } +} diff --git a/node_modules/vfile/index.js b/node_modules/vfile/index.js new file mode 100644 index 0000000..01307eb --- /dev/null +++ b/node_modules/vfile/index.js @@ -0,0 +1,49 @@ +'use strict' + +var VMessage = require('vfile-message') +var VFile = require('./core.js') + +module.exports = VFile + +var proto = VFile.prototype + +proto.message = message +proto.info = info +proto.fail = fail + +// Create a message with `reason` at `position`. +// When an error is passed in as `reason`, copies the stack. +function message(reason, position, origin) { + var filePath = this.path + var message = new VMessage(reason, position, origin) + + if (filePath) { + message.name = filePath + ':' + message.name + message.file = filePath + } + + message.fatal = false + + this.messages.push(message) + + return message +} + +// Fail: creates a vmessage, associates it with the file, and throws it. +function fail() { + var message = this.message.apply(this, arguments) + + message.fatal = true + + throw message +} + +// Info: creates a vmessage, associates it with the file, and marks the fatality +// as null. +function info() { + var message = this.message.apply(this, arguments) + + message.fatal = null + + return message +} diff --git a/node_modules/vfile/license b/node_modules/vfile/license new file mode 100644 index 0000000..f3722d9 --- /dev/null +++ b/node_modules/vfile/license @@ -0,0 +1,21 @@ +(The MIT License) + +Copyright (c) 2015 Titus Wormer + +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: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +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. diff --git a/node_modules/vfile/package.json b/node_modules/vfile/package.json new file mode 100644 index 0000000..660e7ce --- /dev/null +++ b/node_modules/vfile/package.json @@ -0,0 +1,159 @@ +{ + "_from": "vfile@^4.0.0", + "_id": "vfile@4.1.1", + "_inBundle": false, + "_integrity": "sha512-lRjkpyDGjVlBA7cDQhQ+gNcvB1BGaTHYuSOcY3S7OhDmBtnzX95FhtZZDecSTDm6aajFymyve6S5DN4ZHGezdQ==", + "_location": "/vfile", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "vfile@^4.0.0", + "name": "vfile", + "escapedName": "vfile", + "rawSpec": "^4.0.0", + "saveSpec": null, + "fetchSpec": "^4.0.0" + }, + "_requiredBy": [ + "/unified" + ], + "_resolved": "https://registry.npmjs.org/vfile/-/vfile-4.1.1.tgz", + "_shasum": "282d28cebb609183ac51703001bc18b3e3f17de9", + "_spec": "vfile@^4.0.0", + "_where": "/Users/josh/Projects/slackify-markdown-action/node_modules/unified", + "author": { + "name": "Titus Wormer", + "email": "tituswormer@gmail.com", + "url": "https://wooorm.com" + }, + "bugs": { + "url": "https://github.com/vfile/vfile/issues" + }, + "bundleDependencies": false, + "contributors": [ + { + "name": "Titus Wormer", + "email": "tituswormer@gmail.com", + "url": "https://wooorm.com" + }, + { + "name": "Brendan Abbott", + "email": "brendan.abbott@temando.com" + }, + { + "name": "Denys Dovhan", + "email": "email@denysdovhan.com" + }, + { + "name": "Kyle Mathews", + "email": "mathews.kyle@gmail.com" + }, + { + "name": "Shinnosuke Watanabe", + "email": "snnskwtnb@gmail.com" + }, + { + "name": "Sindre Sorhus", + "email": "sindresorhus@gmail.com" + } + ], + "dependencies": { + "@types/unist": "^2.0.0", + "is-buffer": "^2.0.0", + "replace-ext": "1.0.0", + "unist-util-stringify-position": "^2.0.0", + "vfile-message": "^2.0.0" + }, + "deprecated": false, + "description": "Virtual file format for text processing", + "devDependencies": { + "browserify": "^16.0.0", + "dtslint": "^3.0.0", + "nyc": "^15.0.0", + "prettier": "^2.0.0", + "remark-cli": "^8.0.0", + "remark-preset-wooorm": "^7.0.0", + "tape": "^5.0.0", + "tinyify": "^2.0.0", + "xo": "^0.30.0" + }, + "files": [ + "types/index.d.ts", + "core.js", + "index.js" + ], + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + }, + "homepage": "https://github.com/vfile/vfile#readme", + "keywords": [ + "vfile", + "virtual", + "file", + "text", + "processing", + "message", + "warning", + "error", + "remark", + "retext", + "rehype" + ], + "license": "MIT", + "name": "vfile", + "nyc": { + "check-coverage": true, + "lines": 100, + "functions": 100, + "branches": 100 + }, + "prettier": { + "tabWidth": 2, + "useTabs": false, + "singleQuote": true, + "bracketSpacing": false, + "semi": false, + "trailingComma": "none" + }, + "remarkConfig": { + "plugins": [ + "preset-wooorm", + [ + "toc", + { + "heading": "contents" + } + ] + ] + }, + "repository": { + "type": "git", + "url": "git+https://github.com/vfile/vfile.git" + }, + "scripts": { + "build": "npm run build-bundle && npm run build-mangle", + "build-bundle": "browserify . -s VFile > vfile.js", + "build-mangle": "browserify . -s VFile -p tinyify > vfile.min.js", + "format": "remark . -qfo && prettier --write \"**/*.{js,ts}\" && xo --fix", + "test": "npm run format && npm run build && npm run test-coverage && npm run test-types", + "test-api": "node test", + "test-coverage": "nyc --reporter lcov tape test.js", + "test-types": "dtslint types" + }, + "types": "types/index.d.ts", + "version": "4.1.1", + "xo": { + "prettier": true, + "esnext": false, + "ignores": [ + "types", + "vfile.js" + ], + "rules": { + "unicorn/prefer-includes": "off", + "unicorn/prefer-reflect-apply": "off" + } + } +} diff --git a/node_modules/vfile/readme.md b/node_modules/vfile/readme.md new file mode 100644 index 0000000..74a157d --- /dev/null +++ b/node_modules/vfile/readme.md @@ -0,0 +1,432 @@ +# [![vfile][]][unified] + +[![GitHub CI][github-ci-badge]][github-ci] +[![Build][build-badge]][build] +[![Coverage][coverage-badge]][coverage] +[![Downloads][downloads-badge]][downloads] +[![Size][size-badge]][size] +[![Sponsors][sponsors-badge]][collective] +[![Backers][backers-badge]][collective] +[![Chat][chat-badge]][chat] + +**vfile** is a virtual file format part of the [unified][] [collective][]. + +## Intro + +**vfile** is a virtual file format used by [**unified**][unified], a text +processing umbrella (it powers [**retext**][retext] for natural language, +[**remark**][remark] for markdown, and [**rehype**][rehype] for HTML). +Each processors that parse, transform, and compile text, and need a virtual +representation of files and a place to store [messages][] about them. +Plus, they work in the browser. +**vfile** provides these requirements at a small size. + +* Visit [`unifiedjs.com`][website] and see its [learn][] section for an + overview +* Read [unified][]’s readme for a technical intro +* Follow us on [Medium][] and [Twitter][] to see what we’re up to +* Check out [Contribute][] below to find out how to help out + +> **vfile** is different from the excellent [`vinyl`][vinyl] in that it has +> a smaller API, a smaller size, and focuses on [messages][]. + +vfile can be used anywhere where files need a lightweight representation. +For example, it’s used in: + +* [`documentation`](https://github.com/documentationjs/documentation) + — The documentation system for modern JavaScript +* [`awoo`](https://github.com/awoojs/awoo) + — Declarative small site generator +* [`geojsonhint`](https://github.com/mapbox/geojsonhint) + — Complete, fast, standards-based validation for geojson + +## Sponsors + + + + + + + + + + + +
+ +

🥇 + Vercel +
+ +

🥇 + Gatsby
+ +

🥇 + Netlify +
+ +

+ Holloway +
+



+ You? +
+ +[**Read more about the unified collective on Medium »**][announcement] + +## Install + +[npm][]: + +```sh +npm install vfile +``` + +## Contents + +* [Use](#use) +* [API](#api) + * [`VFile([options])`](#vfileoptions) + * [`vfile.contents`](#vfilecontents) + * [`vfile.cwd`](#vfilecwd) + * [`vfile.path`](#vfilepath) + * [`vfile.basename`](#vfilebasename) + * [`vfile.stem`](#vfilestem) + * [`vfile.extname`](#vfileextname) + * [`vfile.dirname`](#vfiledirname) + * [`vfile.history`](#vfilehistory) + * [`vfile.messages`](#vfilemessages) + * [`vfile.data`](#vfiledata) + * [`VFile#toString([encoding])`](#vfiletostringencoding) + * [`VFile#message(reason[, position][, origin])`](#vfilemessagereason-position-origin) + * [`VFile#info(reason[, position][, origin])`](#vfileinforeason-position-origin) + * [`VFile#fail(reason[, position][, origin])`](#vfilefailreason-position-origin) +* [Utilities](#utilities) +* [Reporters](#reporters) +* [Contribute](#contribute) +* [Acknowledgments](#acknowledgments) +* [License](#license) + +## Use + +```js +var vfile = require('vfile') + +var file = vfile({path: '~/example.txt', contents: 'Alpha *braavo* charlie.'}) + +file.path // => '~/example.txt' +file.dirname // => '~' + +file.extname = '.md' + +file.basename // => 'example.md' + +file.basename = 'index.text' + +file.history // => ['~/example.txt', '~/example.md', '~/index.text'] + +file.message('`braavo` is misspelt; did you mean `bravo`?', { + line: 1, + column: 8 +}) + +console.log(file.messages) +``` + +Yields: + +```js +[ { [~/index.text:1:8: `braavo` is misspelt; did you mean `bravo`?] + message: '`braavo` is misspelt; did you mean `bravo`?', + name: '~/index.text:1:8', + file: '~/index.text', + reason: '`braavo` is misspelt; did you mean `bravo`?', + line: 1, + column: 8, + location: { start: [Object], end: [Object] }, + ruleId: null, + source: null, + fatal: false } ] +``` + +## API + +### `VFile([options])` + +Create a new virtual file. +If `options` is `string` or `Buffer`, treats it as `{contents: options}`. +If `options` is a `VFile`, returns it. +All other options are set on the newly created `vfile`. + +Path related properties are set in the following order (least specific to most +specific): `history`, `path`, `basename`, `stem`, `extname`, `dirname`. + +It’s not possible to set either `dirname` or `extname` without setting either +`history`, `path`, `basename`, or `stem` as well. + +###### Example + +```js +vfile() +vfile('console.log("alpha");') +vfile(Buffer.from('exit 1')) +vfile({path: path.join(__dirname, 'readme.md')}) +vfile({stem: 'readme', extname: '.md', dirname: __dirname}) +vfile({other: 'properties', are: 'copied', ov: {e: 'r'}}) +``` + +### `vfile.contents` + +`Buffer`, `string`, `null` — Raw value. + +### `vfile.cwd` + +`string` — Base of `path`. +Defaults to `process.cwd()`. + +### `vfile.path` + +`string?` — Path of `vfile`. +Cannot be nullified. + +### `vfile.basename` + +`string?` — Current name (including extension) of `vfile`. +Cannot contain path separators. +Cannot be nullified either (use `file.path = file.dirname` instead). + +### `vfile.stem` + +`string?` — Name (without extension) of `vfile`. +Cannot be nullified, and cannot contain path separators. + +### `vfile.extname` + +`string?` — Extension (with dot) of `vfile`. +Cannot be set if there’s no `path` yet and cannot contain path separators. + +### `vfile.dirname` + +`string?` — Path to parent directory of `vfile`. +Cannot be set if there’s no `path` yet. + +### `vfile.history` + +`Array.` — List of file-paths the file moved between. + +### `vfile.messages` + +[`Array.`][message] — List of messages associated with the file. + +### `vfile.data` + +`Object` — Place to store custom information. +It’s OK to store custom data directly on the `vfile`, moving it to `data` gives +a *little* more privacy. + +### `VFile#toString([encoding])` + +Convert contents of `vfile` to string. +If `contents` is a buffer, `encoding` is used to stringify buffers (default: +`'utf8'`). + +### `VFile#message(reason[, position][, origin])` + +Associates a message with the file, where `fatal` is set to `false`. +Constructs a new [`VMessage`][vmessage] and adds it to +[`vfile.messages`][messages]. + +##### Returns + +[`VMessage`][vmessage]. + +### `VFile#info(reason[, position][, origin])` + +Associates an informational message with the file, where `fatal` is set to +`null`. +Calls [`#message()`][message] internally. + +##### Returns + +[`VMessage`][vmessage]. + +### `VFile#fail(reason[, position][, origin])` + +Associates a fatal message with the file, then immediately throws it. +Note: fatal errors mean a file is no longer processable. +Calls [`#message()`][message] internally. + +##### Throws + +[`VMessage`][vmessage]. + +## Utilities + +The following list of projects includes tools for working with virtual files. +See **[unist][]** for projects working with nodes. + +* [`convert-vinyl-to-vfile`](https://github.com/dustinspecker/convert-vinyl-to-vfile) + — transform from [Vinyl][] to vfile +* [`to-vfile`](https://github.com/vfile/to-vfile) + — create a vfile from a filepath +* [`vfile-find-down`](https://github.com/vfile/vfile-find-down) + — find files by searching the file system downwards +* [`vfile-find-up`](https://github.com/vfile/vfile-find-up) + — find files by searching the file system upwards +* [`vfile-glob`](https://github.com/shinnn/vfile-glob) + — find files by glob patterns +* [`vfile-is`](https://github.com/vfile/vfile-is) + — check if a vfile passes a test +* [`vfile-location`](https://github.com/vfile/vfile-location) + — convert between positional and offset locations +* [`vfile-matter`](https://github.com/vfile/vfile-matter) + — parse the YAML front matter +* [`vfile-message`](https://github.com/vfile/vfile-message) + — create a vfile message +* [`vfile-messages-to-vscode-diagnostics`](https://github.com/shinnn/vfile-messages-to-vscode-diagnostics) + — transform vfile messages to VS Code diagnostics +* [`vfile-mkdirp`](https://github.com/vfile/vfile-mkdirp) + — make sure the directory of a vfile exists on the file system +* [`vfile-rename`](https://github.com/vfile/vfile-rename) + — rename the path parts of a vfile +* [`vfile-sort`](https://github.com/vfile/vfile-sort) + — sort messages by line/column +* [`vfile-statistics`](https://github.com/vfile/vfile-statistics) + — count messages per category: failures, warnings, etc +* [`vfile-to-eslint`](https://github.com/vfile/vfile-to-eslint) + — convert to ESLint formatter compatible output + +## Reporters + +The following list of projects show linting results for given virtual files. +Reporters *must* accept `Array.` as their first argument, and return +`string`. +Reporters *may* accept other values too, in which case it’s suggested to stick +to `vfile-reporter`s interface. + +* [`vfile-reporter`][reporter] + — create a report +* [`vfile-reporter-json`](https://github.com/vfile/vfile-reporter-json) + — create a JSON report +* [`vfile-reporter-folder-json`](https://github.com/vfile/vfile-reporter-folder-json) + — create a JSON representation of vfiles +* [`vfile-reporter-pretty`](https://github.com/vfile/vfile-reporter-pretty) + — create a pretty report +* [`vfile-reporter-junit`](https://github.com/kellyselden/vfile-reporter-junit) + — create a jUnit report +* [`vfile-reporter-position`](https://github.com/Hocdoc/vfile-reporter-position) + — create a report with content excerpts + +## Contribute + +See [`contributing.md`][contributing] in [`vfile/.github`][health] for ways to +get started. +See [`support.md`][support] for ways to get help. +Ideas for new utilities and tools can be posted in [`vfile/ideas`][ideas]. + +This project has a [code of conduct][coc]. +By interacting with this repository, organization, or community you agree to +abide by its terms. + +## Acknowledgments + +The initial release of this project was authored by +[**@wooorm**](https://github.com/wooorm). + +Thanks to [**@contra**](https://github.com/contra), +[**@phated**](https://github.com/phated), and others for their work on +[Vinyl][], which was a huge inspiration. + +Thanks to +[**@brendo**](https://github.com/brendo), +[**@shinnn**](https://github.com/shinnn), +[**@KyleAMathews**](https://github.com/KyleAMathews), +[**@sindresorhus**](https://github.com/sindresorhus), and +[**@denysdovhan**](https://github.com/denysdovhan) +for contributing commits since! + +## License + +[MIT][license] © [Titus Wormer][author] + + + +[github-ci-badge]: https://github.com/vfile/vfile/workflows/CI/badge.svg + +[github-ci]: https://github.com/vfile/vfile/actions + +[build-badge]: https://img.shields.io/travis/vfile/vfile.svg + +[build]: https://travis-ci.org/vfile/vfile + +[coverage-badge]: https://img.shields.io/codecov/c/github/vfile/vfile.svg + +[coverage]: https://codecov.io/github/vfile/vfile + +[downloads-badge]: https://img.shields.io/npm/dm/vfile.svg + +[downloads]: https://www.npmjs.com/package/vfile + +[size-badge]: https://img.shields.io/bundlephobia/minzip/vfile.svg + +[size]: https://bundlephobia.com/result?p=vfile + +[sponsors-badge]: https://opencollective.com/unified/sponsors/badge.svg + +[backers-badge]: https://opencollective.com/unified/backers/badge.svg + +[collective]: https://opencollective.com/unified + +[chat-badge]: https://img.shields.io/badge/chat-spectrum-7b16ff.svg + +[chat]: https://spectrum.chat/unified/vfile + +[npm]: https://docs.npmjs.com/cli/install + +[contributing]: https://github.com/vfile/.github/blob/master/contributing.md + +[support]: https://github.com/vfile/.github/blob/master/support.md + +[health]: https://github.com/vfile/.github + +[coc]: https://github.com/vfile/.github/blob/master/code-of-conduct.md + +[license]: license + +[author]: https://wooorm.com + +[vfile]: https://raw.githubusercontent.com/vfile/vfile/7e1e6a6/logo.svg?sanitize=true + +[unified]: https://github.com/unifiedjs/unified + +[retext]: https://github.com/retextjs/retext + +[remark]: https://github.com/remarkjs/remark + +[rehype]: https://github.com/rehypejs/rehype + +[vinyl]: https://github.com/gulpjs/vinyl + +[unist]: https://github.com/syntax-tree/unist#list-of-utilities + +[reporter]: https://github.com/vfile/vfile-reporter + +[vmessage]: https://github.com/vfile/vfile-message + +[messages]: #vfilemessages + +[message]: #vfilemessagereason-position-origin + +[website]: https://unifiedjs.com + +[learn]: https://unifiedjs.com/learn/ + +[contribute]: #contribute + +[ideas]: https://github.com/vfile/ideas + +[medium]: https://medium.com/unifiedjs + +[announcement]: https://medium.com/unifiedjs/collectively-evolving-through-crowdsourcing-22c359ea95cc + +[twitter]: https://twitter.com/unifiedjs diff --git a/node_modules/vfile/types/index.d.ts b/node_modules/vfile/types/index.d.ts new file mode 100644 index 0000000..b1a33ca --- /dev/null +++ b/node_modules/vfile/types/index.d.ts @@ -0,0 +1,159 @@ +// TypeScript Version: 3.0 + +import * as Unist from 'unist' +import * as vfileMessage from 'vfile-message' + +declare namespace vfile { + /** + * Encodings supported by the buffer class + * + * @remarks + * This is a copy of the typing from Node, copied to prevent Node globals from being needed. + * Copied from https://github.com/DefinitelyTyped/DefinitelyTyped/blob/a2bc1d868d81733a8969236655fa600bd3651a7b/types/node/globals.d.ts#L174 + */ + type BufferEncoding = + | 'ascii' + | 'utf8' + | 'utf-8' + | 'utf16le' + | 'ucs2' + | 'ucs-2' + | 'base64' + | 'latin1' + | 'binary' + | 'hex' + + /** + * VFileContents can either be text, or a Buffer like structure + * @remarks + * This does not directly use type `Buffer, because it can also be used in a browser context. + * Instead this leverages `Uint8Array` which is the base type for `Buffer`, and a native JavaScript construct. + */ + type VFileContents = string | Uint8Array + type VFileCompatible = VFile | VFileOptions | VFileContents + interface Settings { + [key: string]: unknown + } + type VFileReporter = (files: VFile[], options: T) => string + + interface VFileOptions { + contents?: VFileContents + path?: string + basename?: string + stem?: string + extname?: string + dirname?: string + cwd?: string + data?: any + [key: string]: any + } + + interface VFile { + /** + * Create a new virtual file. If `options` is `string` or `Buffer`, treats it as `{contents: options}`. + * If `options` is a `VFile`, returns it. All other options are set on the newly created `vfile`. + * + * Path related properties are set in the following order (least specific to most specific): `history`, `path`, `basename`, `stem`, `extname`, `dirname`. + * + * It’s not possible to set either `dirname` or `extname` without setting either `history`, `path`, `basename`, or `stem` as well. + * + * @param options If `options` is `string` or `Buffer`, treats it as `{contents: options}`. If `options` is a `VFile`, returns it. All other options are set on the newly created `vfile`. + */ + (input?: VFileContents | F | VFileOptions): F + /** + * List of file-paths the file moved between. + */ + history: string[] + /** + * Place to store custom information. + * It's OK to store custom data directly on the `vfile`, moving it to `data` gives a little more privacy. + */ + data: unknown + /** + * List of messages associated with the file. + */ + messages: vfileMessage.VFileMessage[] + /** + * Raw value. + */ + contents: VFileContents + /** + * Path of `vfile`. + * Cannot be nullified. + */ + path?: string + /** + * Path to parent directory of `vfile`. + * Cannot be set if there's no `path` yet. + */ + dirname?: string + /** + * Current name (including extension) of `vfile`. + * Cannot contain path separators. + * Cannot be nullified either (use `file.path = file.dirname` instead). + */ + basename?: string + /** + * Name (without extension) of `vfile`. + * Cannot be nullified, and cannot contain path separators. + */ + stem?: string + /** + * Extension (with dot) of `vfile`. + * Cannot be set if there's no `path` yet and cannot contain path separators. + */ + extname?: string + /** + * Base of `path`. + * Defaults to `process.cwd()`. + */ + cwd: string + /** + * Convert contents of `vfile` to string. + * @param encoding If `contents` is a buffer, `encoding` is used to stringify buffers (default: `'utf8'`). + */ + toString: (encoding?: BufferEncoding) => string + /** + * Associates a message with the file for `reason` at `position`. + * When an error is passed in as `reason`, copies the stack. + * Each message has a `fatal` property which by default is set to `false` (ie. `warning`). + * @param reason Reason for message. Uses the stack and message of the error if given. + * @param position Place at which the message occurred in `vfile`. + * @param ruleId Category of message. + */ + message: ( + reason: string, + position?: Unist.Point | Unist.Position | Unist.Node, + ruleId?: string + ) => vfileMessage.VFileMessage + /** + * Associates a fatal message with the file, then immediately throws it. + * Note: fatal errors mean a file is no longer processable. + * Calls `message()` internally. + * @param reason Reason for message. Uses the stack and message of the error if given. + * @param position Place at which the message occurred in `vfile`. + * @param ruleId Category of message. + */ + fail: ( + reason: string, + position?: Unist.Point | Unist.Position | Unist.Node, + ruleId?: string + ) => never + /** + * Associates an informational message with the file, where `fatal` is set to `null`. + * Calls `message()` internally. + * @param reason Reason for message. Uses the stack and message of the error if given. + * @param position Place at which the message occurred in `vfile`. + * @param ruleId Category of message. + */ + info: ( + reason: string, + position?: Unist.Point | Unist.Position | Unist.Node, + ruleId?: string + ) => vfileMessage.VFileMessage + } +} + +declare const vfile: vfile.VFile + +export = vfile diff --git a/node_modules/xtend/.jshintrc b/node_modules/xtend/.jshintrc new file mode 100644 index 0000000..77887b5 --- /dev/null +++ b/node_modules/xtend/.jshintrc @@ -0,0 +1,30 @@ +{ + "maxdepth": 4, + "maxstatements": 200, + "maxcomplexity": 12, + "maxlen": 80, + "maxparams": 5, + + "curly": true, + "eqeqeq": true, + "immed": true, + "latedef": false, + "noarg": true, + "noempty": true, + "nonew": true, + "undef": true, + "unused": "vars", + "trailing": true, + + "quotmark": true, + "expr": true, + "asi": true, + + "browser": false, + "esnext": true, + "devel": false, + "node": false, + "nonstandard": false, + + "predef": ["require", "module", "__dirname", "__filename"] +} diff --git a/node_modules/xtend/LICENSE b/node_modules/xtend/LICENSE new file mode 100644 index 0000000..0099f4f --- /dev/null +++ b/node_modules/xtend/LICENSE @@ -0,0 +1,20 @@ +The MIT License (MIT) +Copyright (c) 2012-2014 Raynos. + +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: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +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. diff --git a/node_modules/xtend/README.md b/node_modules/xtend/README.md new file mode 100644 index 0000000..4a2703c --- /dev/null +++ b/node_modules/xtend/README.md @@ -0,0 +1,32 @@ +# xtend + +[![browser support][3]][4] + +[![locked](http://badges.github.io/stability-badges/dist/locked.svg)](http://github.com/badges/stability-badges) + +Extend like a boss + +xtend is a basic utility library which allows you to extend an object by appending all of the properties from each object in a list. When there are identical properties, the right-most property takes precedence. + +## Examples + +```js +var extend = require("xtend") + +// extend returns a new object. Does not mutate arguments +var combination = extend({ + a: "a", + b: "c" +}, { + b: "b" +}) +// { a: "a", b: "b" } +``` + +## Stability status: Locked + +## MIT Licensed + + + [3]: http://ci.testling.com/Raynos/xtend.png + [4]: http://ci.testling.com/Raynos/xtend diff --git a/node_modules/xtend/immutable.js b/node_modules/xtend/immutable.js new file mode 100644 index 0000000..94889c9 --- /dev/null +++ b/node_modules/xtend/immutable.js @@ -0,0 +1,19 @@ +module.exports = extend + +var hasOwnProperty = Object.prototype.hasOwnProperty; + +function extend() { + var target = {} + + for (var i = 0; i < arguments.length; i++) { + var source = arguments[i] + + for (var key in source) { + if (hasOwnProperty.call(source, key)) { + target[key] = source[key] + } + } + } + + return target +} diff --git a/node_modules/xtend/mutable.js b/node_modules/xtend/mutable.js new file mode 100644 index 0000000..72debed --- /dev/null +++ b/node_modules/xtend/mutable.js @@ -0,0 +1,17 @@ +module.exports = extend + +var hasOwnProperty = Object.prototype.hasOwnProperty; + +function extend(target) { + for (var i = 1; i < arguments.length; i++) { + var source = arguments[i] + + for (var key in source) { + if (hasOwnProperty.call(source, key)) { + target[key] = source[key] + } + } + } + + return target +} diff --git a/node_modules/xtend/package.json b/node_modules/xtend/package.json new file mode 100644 index 0000000..bc39307 --- /dev/null +++ b/node_modules/xtend/package.json @@ -0,0 +1,88 @@ +{ + "_from": "xtend@^4.0.1", + "_id": "xtend@4.0.2", + "_inBundle": false, + "_integrity": "sha512-LKYU1iAXJXUgAXn9URjiu+MWhyUXHsvfp7mcuYm9dSUKK0/CjtrUwFAxD82/mCWbtLsGjFIad0wIsod4zrTAEQ==", + "_location": "/xtend", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "xtend@^4.0.1", + "name": "xtend", + "escapedName": "xtend", + "rawSpec": "^4.0.1", + "saveSpec": null, + "fetchSpec": "^4.0.1" + }, + "_requiredBy": [ + "/remark-parse", + "/remark-stringify", + "/unherit" + ], + "_resolved": "https://registry.npmjs.org/xtend/-/xtend-4.0.2.tgz", + "_shasum": "bb72779f5fa465186b1f438f674fa347fdb5db54", + "_spec": "xtend@^4.0.1", + "_where": "/Users/josh/Projects/slackify-markdown-action/node_modules/remark-parse", + "author": { + "name": "Raynos", + "email": "raynos2@gmail.com" + }, + "bugs": { + "url": "https://github.com/Raynos/xtend/issues", + "email": "raynos2@gmail.com" + }, + "bundleDependencies": false, + "contributors": [ + { + "name": "Jake Verbaten" + }, + { + "name": "Matt Esch" + } + ], + "dependencies": {}, + "deprecated": false, + "description": "extend like a boss", + "devDependencies": { + "tape": "~1.1.0" + }, + "engines": { + "node": ">=0.4" + }, + "homepage": "https://github.com/Raynos/xtend", + "keywords": [ + "extend", + "merge", + "options", + "opts", + "object", + "array" + ], + "license": "MIT", + "main": "immutable", + "name": "xtend", + "repository": { + "type": "git", + "url": "git://github.com/Raynos/xtend.git" + }, + "scripts": { + "test": "node test" + }, + "testling": { + "files": "test.js", + "browsers": [ + "ie/7..latest", + "firefox/16..latest", + "firefox/nightly", + "chrome/22..latest", + "chrome/canary", + "opera/12..latest", + "opera/next", + "safari/5.1..latest", + "ipad/6.0..latest", + "iphone/6.0..latest" + ] + }, + "version": "4.0.2" +} diff --git a/node_modules/xtend/test.js b/node_modules/xtend/test.js new file mode 100644 index 0000000..b895b42 --- /dev/null +++ b/node_modules/xtend/test.js @@ -0,0 +1,103 @@ +var test = require("tape") +var extend = require("./") +var mutableExtend = require("./mutable") + +test("merge", function(assert) { + var a = { a: "foo" } + var b = { b: "bar" } + + assert.deepEqual(extend(a, b), { a: "foo", b: "bar" }) + assert.end() +}) + +test("replace", function(assert) { + var a = { a: "foo" } + var b = { a: "bar" } + + assert.deepEqual(extend(a, b), { a: "bar" }) + assert.end() +}) + +test("undefined", function(assert) { + var a = { a: undefined } + var b = { b: "foo" } + + assert.deepEqual(extend(a, b), { a: undefined, b: "foo" }) + assert.deepEqual(extend(b, a), { a: undefined, b: "foo" }) + assert.end() +}) + +test("handle 0", function(assert) { + var a = { a: "default" } + var b = { a: 0 } + + assert.deepEqual(extend(a, b), { a: 0 }) + assert.deepEqual(extend(b, a), { a: "default" }) + assert.end() +}) + +test("is immutable", function (assert) { + var record = {} + + extend(record, { foo: "bar" }) + assert.equal(record.foo, undefined) + assert.end() +}) + +test("null as argument", function (assert) { + var a = { foo: "bar" } + var b = null + var c = void 0 + + assert.deepEqual(extend(b, a, c), { foo: "bar" }) + assert.end() +}) + +test("mutable", function (assert) { + var a = { foo: "bar" } + + mutableExtend(a, { bar: "baz" }) + + assert.equal(a.bar, "baz") + assert.end() +}) + +test("null prototype", function(assert) { + var a = { a: "foo" } + var b = Object.create(null) + b.b = "bar"; + + assert.deepEqual(extend(a, b), { a: "foo", b: "bar" }) + assert.end() +}) + +test("null prototype mutable", function (assert) { + var a = { foo: "bar" } + var b = Object.create(null) + b.bar = "baz"; + + mutableExtend(a, b) + + assert.equal(a.bar, "baz") + assert.end() +}) + +test("prototype pollution", function (assert) { + var a = {} + var maliciousPayload = '{"__proto__":{"oops":"It works!"}}' + + assert.strictEqual(a.oops, undefined) + extend({}, maliciousPayload) + assert.strictEqual(a.oops, undefined) + assert.end() +}) + +test("prototype pollution mutable", function (assert) { + var a = {} + var maliciousPayload = '{"__proto__":{"oops":"It works!"}}' + + assert.strictEqual(a.oops, undefined) + mutableExtend({}, maliciousPayload) + assert.strictEqual(a.oops, undefined) + assert.end() +}) diff --git a/package-lock.json b/package-lock.json new file mode 100644 index 0000000..fb140a8 --- /dev/null +++ b/package-lock.json @@ -0,0 +1,340 @@ +{ + "name": "slackify-markdown-action", + "version": "1.0.0", + "lockfileVersion": 1, + "requires": true, + "dependencies": { + "@actions/core": { + "version": "1.2.4", + "resolved": "https://registry.npmjs.org/@actions/core/-/core-1.2.4.tgz", + "integrity": "sha512-YJCEq8BE3CdN8+7HPZ/4DxJjk/OkZV2FFIf+DlZTC/4iBlzYCD5yjRR6eiOS5llO11zbRltIRuKAjMKaWTE6cg==" + }, + "@types/unist": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/@types/unist/-/unist-2.0.3.tgz", + "integrity": "sha512-FvUupuM3rlRsRtCN+fDudtmytGO6iHJuuRKS1Ss0pG5z8oX0diNEw94UEL7hgDbpN94rgaK5R7sWm6RrSkZuAQ==" + }, + "bail": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/bail/-/bail-1.0.5.tgz", + "integrity": "sha512-xFbRxM1tahm08yHBP16MMjVUAvDaBMD38zsM9EMAUN61omwLmKlOpB/Zku5QkjZ8TZ4vn53pj+t518cH0S03RQ==" + }, + "ccount": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/ccount/-/ccount-1.0.5.tgz", + "integrity": "sha512-MOli1W+nfbPLlKEhInaxhRdp7KVLFxLN5ykwzHgLsLI3H3gs5jjFAK4Eoj3OzzcxCtumDaI8onoVDeQyWaNTkw==" + }, + "character-entities": { + "version": "1.2.4", + "resolved": "https://registry.npmjs.org/character-entities/-/character-entities-1.2.4.tgz", + "integrity": "sha512-iBMyeEHxfVnIakwOuDXpVkc54HijNgCyQB2w0VfGQThle6NXn50zU6V/u+LDhxHcDUPojn6Kpga3PTAD8W1bQw==" + }, + "character-entities-html4": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/character-entities-html4/-/character-entities-html4-1.1.4.tgz", + "integrity": "sha512-HRcDxZuZqMx3/a+qrzxdBKBPUpxWEq9xw2OPZ3a/174ihfrQKVsFhqtthBInFy1zZ9GgZyFXOatNujm8M+El3g==" + }, + "character-entities-legacy": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/character-entities-legacy/-/character-entities-legacy-1.1.4.tgz", + "integrity": "sha512-3Xnr+7ZFS1uxeiUDvV02wQ+QDbc55o97tIV5zHScSPJpcLm/r0DFPcoY3tYRp+VZukxuMeKgXYmsXQHO05zQeA==" + }, + "character-reference-invalid": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/character-reference-invalid/-/character-reference-invalid-1.1.4.tgz", + "integrity": "sha512-mKKUkUbhPpQlCOfIuZkvSEgktjPFIsZKRRbC6KWVEMvlzblj3i3asQv5ODsrwt0N3pHAEvjP8KTQPHkp0+6jOg==" + }, + "collapse-white-space": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/collapse-white-space/-/collapse-white-space-1.0.6.tgz", + "integrity": "sha512-jEovNnrhMuqyCcjfEJA56v0Xq8SkIoPKDyaHahwo3POf4qcSXqMYuwNcOTzp74vTsR9Tn08z4MxWqAhcekogkQ==" + }, + "extend": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/extend/-/extend-3.0.2.tgz", + "integrity": "sha512-fjquC59cD7CyW6urNXK0FBufkZcoiGG80wTuPujX590cB5Ttln20E2UB4S/WARVqhXffZl2LNgS+gQdPIIim/g==" + }, + "inherits": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", + "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==" + }, + "is-alphabetical": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/is-alphabetical/-/is-alphabetical-1.0.4.tgz", + "integrity": "sha512-DwzsA04LQ10FHTZuL0/grVDk4rFoVH1pjAToYwBrHSxcrBIGQuXrQMtD5U1b0U2XVgKZCTLLP8u2Qxqhy3l2Vg==" + }, + "is-alphanumeric": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-alphanumeric/-/is-alphanumeric-1.0.0.tgz", + "integrity": "sha1-Spzvcdr0wAHB2B1j0UDPU/1oifQ=" + }, + "is-alphanumerical": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/is-alphanumerical/-/is-alphanumerical-1.0.4.tgz", + "integrity": "sha512-UzoZUr+XfVz3t3v4KyGEniVL9BDRoQtY7tOyrRybkVNjDFWyo1yhXNGrrBTQxp3ib9BLAWs7k2YKBQsFRkZG9A==", + "requires": { + "is-alphabetical": "^1.0.0", + "is-decimal": "^1.0.0" + } + }, + "is-buffer": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/is-buffer/-/is-buffer-2.0.4.tgz", + "integrity": "sha512-Kq1rokWXOPXWuaMAqZiJW4XxsmD9zGx9q4aePabbn3qCRGedtH7Cm+zV8WETitMfu1wdh+Rvd6w5egwSngUX2A==" + }, + "is-decimal": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/is-decimal/-/is-decimal-1.0.4.tgz", + "integrity": "sha512-RGdriMmQQvZ2aqaQq3awNA6dCGtKpiDFcOzrTWrDAT2MiWrKQVPmxLGHl7Y2nNu6led0kEyoX0enY0qXYsv9zw==" + }, + "is-hexadecimal": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/is-hexadecimal/-/is-hexadecimal-1.0.4.tgz", + "integrity": "sha512-gyPJuv83bHMpocVYoqof5VDiZveEoGoFL8m3BXNb2VW8Xs+rz9kqO8LOQ5DH6EsuvilT1ApazU0pyl+ytbPtlw==" + }, + "is-plain-obj": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/is-plain-obj/-/is-plain-obj-2.1.0.tgz", + "integrity": "sha512-YWnfyRwxL/+SsrWYfOpUtz5b3YD+nyfkHvjbcanzk8zgyO4ASD67uVMRt8k5bM4lLMDnXfriRhOpemw+NfT1eA==" + }, + "is-whitespace-character": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/is-whitespace-character/-/is-whitespace-character-1.0.4.tgz", + "integrity": "sha512-SDweEzfIZM0SJV0EUga669UTKlmL0Pq8Lno0QDQsPnvECB3IM2aP0gdx5TrU0A01MAPfViaZiI2V1QMZLaKK5w==" + }, + "is-word-character": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/is-word-character/-/is-word-character-1.0.4.tgz", + "integrity": "sha512-5SMO8RVennx3nZrqtKwCGyyetPE9VDba5ugvKLaD4KopPG5kR4mQ7tNt/r7feL5yt5h3lpuBbIUmCOG2eSzXHA==" + }, + "longest-streak": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/longest-streak/-/longest-streak-2.0.4.tgz", + "integrity": "sha512-vM6rUVCVUJJt33bnmHiZEvr7wPT78ztX7rojL+LW51bHtLh6HTjx84LA5W4+oa6aKEJA7jJu5LR6vQRBpA5DVg==" + }, + "markdown-escapes": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/markdown-escapes/-/markdown-escapes-1.0.4.tgz", + "integrity": "sha512-8z4efJYk43E0upd0NbVXwgSTQs6cT3T06etieCMEg7dRbzCbxUCK/GHlX8mhHRDcp+OLlHkPKsvqQTCvsRl2cg==" + }, + "markdown-table": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/markdown-table/-/markdown-table-2.0.0.tgz", + "integrity": "sha512-Ezda85ToJUBhM6WGaG6veasyym+Tbs3cMAw/ZhOPqXiYsr0jgocBV3j3nx+4lk47plLlIqjwuTm/ywVI+zjJ/A==", + "requires": { + "repeat-string": "^1.0.0" + } + }, + "mdast-util-compact": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/mdast-util-compact/-/mdast-util-compact-2.0.1.tgz", + "integrity": "sha512-7GlnT24gEwDrdAwEHrU4Vv5lLWrEer4KOkAiKT9nYstsTad7Oc1TwqT2zIMKRdZF7cTuaf+GA1E4Kv7jJh8mPA==", + "requires": { + "unist-util-visit": "^2.0.0" + } + }, + "parse-entities": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/parse-entities/-/parse-entities-2.0.0.tgz", + "integrity": "sha512-kkywGpCcRYhqQIchaWqZ875wzpS/bMKhz5HnN3p7wveJTkTtyAB/AlnS0f8DFSqYW1T82t6yEAkEcB+A1I3MbQ==", + "requires": { + "character-entities": "^1.0.0", + "character-entities-legacy": "^1.0.0", + "character-reference-invalid": "^1.0.0", + "is-alphanumerical": "^1.0.0", + "is-decimal": "^1.0.0", + "is-hexadecimal": "^1.0.0" + } + }, + "remark-parse": { + "version": "8.0.2", + "resolved": "https://registry.npmjs.org/remark-parse/-/remark-parse-8.0.2.tgz", + "integrity": "sha512-eMI6kMRjsAGpMXXBAywJwiwAse+KNpmt+BK55Oofy4KvBZEqUDj6mWbGLJZrujoPIPPxDXzn3T9baRlpsm2jnQ==", + "requires": { + "ccount": "^1.0.0", + "collapse-white-space": "^1.0.2", + "is-alphabetical": "^1.0.0", + "is-decimal": "^1.0.0", + "is-whitespace-character": "^1.0.0", + "is-word-character": "^1.0.0", + "markdown-escapes": "^1.0.0", + "parse-entities": "^2.0.0", + "repeat-string": "^1.5.4", + "state-toggle": "^1.0.0", + "trim": "0.0.1", + "trim-trailing-lines": "^1.0.0", + "unherit": "^1.0.4", + "unist-util-remove-position": "^2.0.0", + "vfile-location": "^3.0.0", + "xtend": "^4.0.1" + } + }, + "remark-stringify": { + "version": "8.1.0", + "resolved": "https://registry.npmjs.org/remark-stringify/-/remark-stringify-8.1.0.tgz", + "integrity": "sha512-FSPZv1ds76oAZjurhhuV5qXSUSoz6QRPuwYK38S41sLHwg4oB7ejnmZshj7qwjgYLf93kdz6BOX9j5aidNE7rA==", + "requires": { + "ccount": "^1.0.0", + "is-alphanumeric": "^1.0.0", + "is-decimal": "^1.0.0", + "is-whitespace-character": "^1.0.0", + "longest-streak": "^2.0.1", + "markdown-escapes": "^1.0.0", + "markdown-table": "^2.0.0", + "mdast-util-compact": "^2.0.0", + "parse-entities": "^2.0.0", + "repeat-string": "^1.5.4", + "state-toggle": "^1.0.0", + "stringify-entities": "^3.0.0", + "unherit": "^1.0.4", + "xtend": "^4.0.1" + } + }, + "repeat-string": { + "version": "1.6.1", + "resolved": "https://registry.npmjs.org/repeat-string/-/repeat-string-1.6.1.tgz", + "integrity": "sha1-jcrkcOHIirwtYA//Sndihtp15jc=" + }, + "replace-ext": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/replace-ext/-/replace-ext-1.0.0.tgz", + "integrity": "sha1-3mMSg3P8v3w8z6TeWkgMRaZ5WOs=" + }, + "slackify-markdown": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/slackify-markdown/-/slackify-markdown-3.0.3.tgz", + "integrity": "sha512-XRXmbeOizWBpECWXy0gOBdc3+9GdSw0JImW1p1QXNwAnkcuNGMwt3os4fOxq/OVGevIK0phMthSai39bKcV+HQ==", + "requires": { + "remark-parse": "^8.0.2", + "remark-stringify": "^8.0.0", + "unified": "^9.0.0" + } + }, + "state-toggle": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/state-toggle/-/state-toggle-1.0.3.tgz", + "integrity": "sha512-d/5Z4/2iiCnHw6Xzghyhb+GcmF89bxwgXG60wjIiZaxnymbyOmI8Hk4VqHXiVVp6u2ysaskFfXg3ekCj4WNftQ==" + }, + "stringify-entities": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/stringify-entities/-/stringify-entities-3.0.1.tgz", + "integrity": "sha512-Lsk3ISA2++eJYqBMPKcr/8eby1I6L0gP0NlxF8Zja6c05yr/yCYyb2c9PwXjd08Ib3If1vn1rbs1H5ZtVuOfvQ==", + "requires": { + "character-entities-html4": "^1.0.0", + "character-entities-legacy": "^1.0.0", + "is-alphanumerical": "^1.0.0", + "is-decimal": "^1.0.2", + "is-hexadecimal": "^1.0.0" + } + }, + "trim": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/trim/-/trim-0.0.1.tgz", + "integrity": "sha1-WFhUf2spB1fulczMZm+1AITEYN0=" + }, + "trim-trailing-lines": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/trim-trailing-lines/-/trim-trailing-lines-1.1.3.tgz", + "integrity": "sha512-4ku0mmjXifQcTVfYDfR5lpgV7zVqPg6zV9rdZmwOPqq0+Zq19xDqEgagqVbc4pOOShbncuAOIs59R3+3gcF3ZA==" + }, + "trough": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/trough/-/trough-1.0.5.tgz", + "integrity": "sha512-rvuRbTarPXmMb79SmzEp8aqXNKcK+y0XaB298IXueQ8I2PsrATcPBCSPyK/dDNa2iWOhKlfNnOjdAOTBU/nkFA==" + }, + "unherit": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/unherit/-/unherit-1.1.3.tgz", + "integrity": "sha512-Ft16BJcnapDKp0+J/rqFC3Rrk6Y/Ng4nzsC028k2jdDII/rdZ7Wd3pPT/6+vIIxRagwRc9K0IUX0Ra4fKvw+WQ==", + "requires": { + "inherits": "^2.0.0", + "xtend": "^4.0.0" + } + }, + "unified": { + "version": "9.0.0", + "resolved": "https://registry.npmjs.org/unified/-/unified-9.0.0.tgz", + "integrity": "sha512-ssFo33gljU3PdlWLjNp15Inqb77d6JnJSfyplGJPT/a+fNRNyCBeveBAYJdO5khKdF6WVHa/yYCC7Xl6BDwZUQ==", + "requires": { + "bail": "^1.0.0", + "extend": "^3.0.0", + "is-buffer": "^2.0.0", + "is-plain-obj": "^2.0.0", + "trough": "^1.0.0", + "vfile": "^4.0.0" + } + }, + "unist-util-is": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/unist-util-is/-/unist-util-is-4.0.2.tgz", + "integrity": "sha512-Ofx8uf6haexJwI1gxWMGg6I/dLnF2yE+KibhD3/diOqY2TinLcqHXCV6OI5gFVn3xQqDH+u0M625pfKwIwgBKQ==" + }, + "unist-util-remove-position": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/unist-util-remove-position/-/unist-util-remove-position-2.0.1.tgz", + "integrity": "sha512-fDZsLYIe2uT+oGFnuZmy73K6ZxOPG/Qcm+w7jbEjaFcJgbQ6cqjs/eSPzXhsmGpAsWPkqZM9pYjww5QTn3LHMA==", + "requires": { + "unist-util-visit": "^2.0.0" + } + }, + "unist-util-stringify-position": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/unist-util-stringify-position/-/unist-util-stringify-position-2.0.3.tgz", + "integrity": "sha512-3faScn5I+hy9VleOq/qNbAd6pAx7iH5jYBMS9I1HgQVijz/4mv5Bvw5iw1sC/90CODiKo81G/ps8AJrISn687g==", + "requires": { + "@types/unist": "^2.0.2" + } + }, + "unist-util-visit": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/unist-util-visit/-/unist-util-visit-2.0.2.tgz", + "integrity": "sha512-HoHNhGnKj6y+Sq+7ASo2zpVdfdRifhTgX2KTU3B/sO/TTlZchp7E3S4vjRzDJ7L60KmrCPsQkVK3lEF3cz36XQ==", + "requires": { + "@types/unist": "^2.0.0", + "unist-util-is": "^4.0.0", + "unist-util-visit-parents": "^3.0.0" + } + }, + "unist-util-visit-parents": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/unist-util-visit-parents/-/unist-util-visit-parents-3.0.2.tgz", + "integrity": "sha512-yJEfuZtzFpQmg1OSCyS9M5NJRrln/9FbYosH3iW0MG402QbdbaB8ZESwUv9RO6nRfLAKvWcMxCwdLWOov36x/g==", + "requires": { + "@types/unist": "^2.0.0", + "unist-util-is": "^4.0.0" + } + }, + "vfile": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/vfile/-/vfile-4.1.1.tgz", + "integrity": "sha512-lRjkpyDGjVlBA7cDQhQ+gNcvB1BGaTHYuSOcY3S7OhDmBtnzX95FhtZZDecSTDm6aajFymyve6S5DN4ZHGezdQ==", + "requires": { + "@types/unist": "^2.0.0", + "is-buffer": "^2.0.0", + "replace-ext": "1.0.0", + "unist-util-stringify-position": "^2.0.0", + "vfile-message": "^2.0.0" + } + }, + "vfile-location": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/vfile-location/-/vfile-location-3.0.1.tgz", + "integrity": "sha512-yYBO06eeN/Ki6Kh1QAkgzYpWT1d3Qln+ZCtSbJqFExPl1S3y2qqotJQXoh6qEvl/jDlgpUJolBn3PItVnnZRqQ==" + }, + "vfile-message": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/vfile-message/-/vfile-message-2.0.4.tgz", + "integrity": "sha512-DjssxRGkMvifUOJre00juHoP9DPWuzjxKuMDrhNbk2TdaYYBNMStsNhEOt3idrtI12VQYM/1+iM0KOzXi4pxwQ==", + "requires": { + "@types/unist": "^2.0.0", + "unist-util-stringify-position": "^2.0.0" + } + }, + "xtend": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/xtend/-/xtend-4.0.2.tgz", + "integrity": "sha512-LKYU1iAXJXUgAXn9URjiu+MWhyUXHsvfp7mcuYm9dSUKK0/CjtrUwFAxD82/mCWbtLsGjFIad0wIsod4zrTAEQ==" + } + } +} diff --git a/package.json b/package.json new file mode 100644 index 0000000..b53ffe2 --- /dev/null +++ b/package.json @@ -0,0 +1,28 @@ +{ + "name": "slackify-markdown-action", + "version": "1.0.0", + "description": "GitHub Action to convert markdown into Slack's mrkdwn.", + "main": "index.js", + "scripts": { + "test": "echo \"Error: no test specified\" && exit 1" + }, + "repository": { + "type": "git", + "url": "git+https://github.com/LoveToKnow/slackify-markdown-action.git" + }, + "keywords": [ + "Slack", + "markdown", + "mrkdwn" + ], + "author": "Joshua Coady", + "license": "MIT", + "bugs": { + "url": "https://github.com/LoveToKnow/slackify-markdown-action/issues" + }, + "homepage": "https://github.com/LoveToKnow/slackify-markdown-action#readme", + "dependencies": { + "@actions/core": "^1.2.4", + "slackify-markdown": "^3.0.3" + } +}