diff --git a/LICENSE b/LICENSE index d2a8f38..1abe689 100644 --- a/LICENSE +++ b/LICENSE @@ -1,6 +1,6 @@ The MIT License (MIT) -Copyright (c) 2018 Khan Academy, Aria Buckles +Copyright (c) 2018 Khan Academy, Aria Buckles, Christopher Jeffrey Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/Makefile b/Makefile index df9b926..4ded453 100644 --- a/Makefile +++ b/Makefile @@ -1,5 +1,5 @@ .PHONY: all -all: install test size +all: install test build .PHONY: install install: @@ -11,16 +11,29 @@ minify: simple-markdown.min.js .PHONY: test test: check runtests size +.PHONY: build +build: simple-markdown.js minify + +.PHONY: simple-markdown.js +simple-markdown.js: src/* + ./node_modules/.bin/rollup -c + .PHONY: check check: + @echo "Checking flow types..." ./node_modules/.bin/flow + @echo "Flow types complete." + @echo "Checking typescript types..." + ./node_modules/.bin/tsc + @echo "Typescript types complete." .PHONY: runtests runtests: ./node_modules/.bin/mocha __tests__ .PHONY: coverage - ./node_modules/.bin/nyc --reporter=html --reporter=text ./node_modules/.bin/mocha __tests__ +coverage: + ./node_modules/.bin/nyc --cache=false --reporter=html --reporter=text ./node_modules/.bin/mocha __tests__ # Start a chrome debugger for test case(s). Usage: # `make debug` or `make debug TEST="part of a test name"` diff --git a/README.md b/README.md index 8710413..8672536 100644 --- a/README.md +++ b/README.md @@ -298,7 +298,7 @@ and parsing. The most common field on `state` is `inline`, which all of the default rules set to true when we are in an inline scope, and false or undefined when we are in a block scope. -`lookbehind` is the string previously captured at this parsing level, to +**DEPRECATED - use `state.prevCapture` instead.** `lookbehind` is the string previously captured at this parsing level, to allow for lookbehind. For example, lists check that lookbehind ends with `/^$|\n *$/` to ensure that lists only match at the beginning of a new line. diff --git a/__tests__/simple-markdown-test.js b/__tests__/simple-markdown-test.js index b1ee1bf..b637f83 100644 --- a/__tests__/simple-markdown-test.js +++ b/__tests__/simple-markdown-test.js @@ -1,7 +1,10 @@ -// @flow +/* @flow */ +/* @ts-check */ -var assert = require("assert"); -var _ = require("underscore"); +// As of 2019-11-03, flow doesn't have definitions for assert.strict: +// https://github.com/facebook/flow/pull/7660 +// So we use a /*::*/ hack to satisfy flow: +var assert = require("assert") /*:: || {} */ .strict; var React = require("react"); var ReactDOMServer = require("react-dom/server"); @@ -21,36 +24,39 @@ var FLOW_IGNORE_COVARIANCE = { }; */ -// A pretty-printer that handles `undefined` and functions better -// than JSON.stringify -// Important because some AST node fields can be undefined, and -// if those don't show up in the assert output, it can be -// very confusing to figure out how the actual and expected differ -// Whether node's util.inspect or JSON.stringify is better seems -// context dependent. +/** + * A pretty-printer that handles `undefined` and functions better + * than JSON.stringify + * Important because some AST node fields can be undefined, and + * if those don't show up in the assert output, it can be + * very confusing to figure out how the actual and expected differ + * Whether node's util.inspect or JSON.stringify is better seems + * context dependent. + * + * @param {SimpleMarkdown.ASTNode | Array} ast + */ var prettyPrintAST = function(ast) { return JSON.stringify(ast, null, 4); +// // FIXME(aria): For debugging in more depth? This used to work? // return nodeUtil.inspect(ast, { // depth: null, // colors: false // }); }; +/** + * Asset that two ast parse trees are equal + * @param {SimpleMarkdown.ASTNode | Array} parsed + * @param {SimpleMarkdown.ASTNode | Array} expected + */ var validateParse = function(parsed, expected) { - if (!_.isEqual(parsed, expected)) { - var parsedStr = prettyPrintAST(parsed); - var expectedStr = prettyPrintAST(expected); - // assert.fail doesn't seem to print the - // expected and actual anymore, so we just - // throw our own exception. - throw new Error("Expected:\n" + - expectedStr + - "\n\nActual:\n" + - parsedStr - ); - } + assert.deepEqual(parsed, expected); }; +/** + * @param {SimpleMarkdown.ReactElements} reactElements + * @returns {string} + */ var reactToHtml = function(reactElements) { var rawHtml = ReactDOMServer.renderToStaticMarkup( React.createElement('div', {}, reactElements) @@ -65,26 +71,46 @@ var reactToHtml = function(reactElements) { return simplifiedHtml; }; +/** + * @param {SimpleMarkdown.ASTNode} parsed + * @returns {string} + */ var htmlThroughReact = function(parsed) { var output = defaultReactOutput(parsed); return reactToHtml(output); }; +/** + * @param {string} source + * @returns {string} + */ var htmlFromReactMarkdown = function(source) { return htmlThroughReact(implicitParse(source)); }; +/** + * @param {string} source + * @returns {string} + */ var htmlFromMarkdown = function(source) { var html = defaultHtmlOutput(implicitParse(source)); var simplifiedHtml = html.replace(/\s+/g, ' '); return simplifiedHtml; }; +/** + * @param {string} source + * @param {string} html + */ var assertParsesToReact = function(source, html) { var actualHtml = htmlFromReactMarkdown(source); assert.strictEqual(actualHtml, html); }; +/** + * @param {string} source + * @param {string} html + */ var assertParsesToHtml = function(source, html) { var actualHtml = htmlFromMarkdown(source); assert.strictEqual(actualHtml, html); @@ -550,6 +576,26 @@ describe("simple markdown", function() { }]); }); + it("should ignore a single space at the start and end of an inline code block separating a '`'", function() { + var parsed1 = inlineParse( + "test `` ` `` escaping a code block" + ); + validateParse(parsed1, [ + {type: "text", content: "test "}, + {type: "inlineCode", content: "`"}, + {type: "text", content: " escaping a code block"}, + ]); + + var parsed1 = inlineParse( + "test `` ` `` escaping a code block" + ); + validateParse(parsed1, [ + {type: "text", content: "test "}, + {type: "inlineCode", content: " ` "}, + {type: "text", content: " escaping a code block"}, + ]); + }); + it("should allow you to escape special characters with \\", function() { var parsed = inlineParse( "\\`hi\\` \\*bye\\* \\~\\|\\<\\[\\{" @@ -686,6 +732,19 @@ describe("simple markdown", function() { ]); }); + it("should allow one level of balanced parens in link urls", function() { + var parsed = inlineParse("[link]((foo)and(bar))"); + validateParse(parsed, [{ + type: "link", + content: [{ + "content": "link", + "type": "text" + }], + target: "(foo)and(bar)", + title: undefined + }]); + }) + it("should parse basic ", function() { var parsed = inlineParse(""); validateParse(parsed, [{ @@ -2472,7 +2531,9 @@ describe("simple markdown", function() { [{type: "text", content: "h2"}], [{type: "text", content: "h3"}] ], - align: [null, null, null], + align: /** @type {Array} */ ( + [null, null, null] + ), cells: [ [ [{type: "text", content: "d1"}], @@ -2514,7 +2575,9 @@ describe("simple markdown", function() { [{type: "em", content: [{type: "text", content: "h2"}]}], [{type: "em", content: [{type: "text", content: "h3"}]}], ], - align: [null, null, null], + align: /** @type {Array} */ ( + [null, null, null] + ), cells: [[ [{type: "em", content: [{type: "text", content: "d1"}]}], [{type: "em", content: [{type: "text", content: "d2"}]}], @@ -2540,6 +2603,10 @@ describe("simple markdown", function() { }); it("should parse table alignments", function() { + /** + * @param {string} tableSrc + * @param {Array} expectedAligns + */ var validateAligns = function(tableSrc, expectedAligns) { var parsed = blockParse(tableSrc + "\n"); assert.strictEqual(parsed[0].type, "table"); @@ -2551,7 +2618,9 @@ describe("simple markdown", function() { "| h1 | h2 | h3 |\n" + "| -- | -- | -- |\n" + "| d1 | d2 | d3 |\n", - [null, null, null] + /** @type {Array} */ ( + [null, null, null] + ) ); validateAligns( @@ -2593,13 +2662,15 @@ describe("simple markdown", function() { it("should parse empty table cells", function() { var expected = [{ type: "table", - header: [ + header: /** @type {any[][]} */ ([ [], [], [] - ], - align: [null, null, null], - cells: [ + ]), + align: /** @type {Array} */ ( + [null, null, null] + ), + cells: /** @type {any[][]} */ ([ [ [], [], @@ -2610,7 +2681,7 @@ describe("simple markdown", function() { [], [] ] - ] + ]), }]; var parsedPiped = blockParse( @@ -2632,6 +2703,90 @@ describe("simple markdown", function() { validateParse(parsedNp, expected); }); + it("should allow escaping pipes inside tables", function() { + var expected = [{ + type: "table", + header: [ + [ + {type: "text", content: '|'}, + {type: "text", content: 'Attribute'}, + {type: "text", content: '|'}, + ], + [ + {type: "text", content: '|'}, + {type: "text", content: 'Type'}, + {type: "text", content: '|'}, + ], + ], + align: /** @type {Array} */ ( + [null, null] + ), + cells: [[ + [ + {type: "text", content: "pos"}, + {type: "text", content: "|"}, + {type: "text", content: "position"} + ], + [ + {type: "text", content: '"left'}, + {type: "text", content: '" '}, + {type: "text", content: '|'}, + {type: "text", content: ' '}, + {type: "text", content: '"right'}, + {type: "text", content: '"'} + ], + ]] + }]; + + var parsedPiped = blockParse( + '| \\|Attribute\\| | \\|Type\\| |\n' + + '| --------------- | ------------------ |\n' + + '| pos\\|position | "left" \\| "right" |\n' + + '\n' + ); + validateParse(parsedPiped, expected); + + var parsedNp = blockParse( + '\\|Attribute\\| | \\|Type\\| \n' + + '--------------- | ------------------\n' + + 'pos\\|position | "left" \\| "right"\n' + + '\n' + ); + validateParse(parsedNp, expected); + }); + + it("should allow pipes in code inside tables", function() { + var expected = [{ + type: "table", + header: [ + [{type: "text", content: 'Attribute'}], + [{type: "text", content: 'Type'}], + ], + align: /** @type {Array} */ ( + [null, null] + ), + cells: [[ + [{type: "inlineCode", content: "position"}], + [{type: "inlineCode", content: '"left" | "right"'}], + ]] + }]; + + var parsedPiped = blockParse( + '| Attribute | Type |\n' + + '| ------------ | --------------------- |\n' + + '| `position` | `"left" | "right"` |\n' + + '\n' + ); + validateParse(parsedPiped, expected); + + var parsedNp = blockParse( + 'Attribute | Type \n' + + '------------ | ---------------------\n' + + '`position` | `"left" | "right"`\n' + + '\n' + ); + validateParse(parsedNp, expected); + }); it("should be able to parse
s", function() { // Inside a paragraph: @@ -2743,25 +2898,30 @@ describe("simple markdown", function() { describe("parser extension api", function() { it("should parse a simple %variable% extension", function() { var percentVarRule = { - match: function(source) { + match: function(/** @type {string} */ source) { return /^%([\s\S]+?)%/.exec(source); }, order: SimpleMarkdown.defaultRules.em.order + 0.5, - parse: function(capture, parse, state) { + parse: function( + /** @type {SimpleMarkdown.Capture} */ capture, + /** @type {SimpleMarkdown.Parser} */ parse, + /** @type {SimpleMarkdown.State} */ state + ) { return { content: capture[1] }; } }; - var rules = _.extend({}, SimpleMarkdown.defaultRules, { + var rules = Object.assign({}, SimpleMarkdown.defaultRules, { percentVar: percentVarRule }); var rawBuiltParser = SimpleMarkdown.parserFor(rules); + /** @type {SimpleMarkdown.Parser} */ var inlineParse = function(source) { return rawBuiltParser(source, {inline: true}); }; @@ -2778,7 +2938,11 @@ describe("simple markdown", function() { describe("should sort rules by order and name", function() { var emRule = { match: SimpleMarkdown.inlineRegex(/^_([\s\S]+?)_/), - parse: function(capture, parse, state) { + parse: function( + /** @type {SimpleMarkdown.Capture} */ capture, + /** @type {SimpleMarkdown.Parser} */ parse, + /** @type {SimpleMarkdown.State} */ state + ) { return { content: capture[1] }; @@ -2786,22 +2950,26 @@ describe("simple markdown", function() { }; var strongRule = { match: SimpleMarkdown.defaultRules.strong.match, - parse: function(capture, parse, state) { + parse: function( + /** @type {SimpleMarkdown.Capture} */ capture, + /** @type {SimpleMarkdown.Parser} */ parse, + /** @type {SimpleMarkdown.State} */ state + ) { return { content: capture[1] }; } }; - var textRule = _.extend({}, SimpleMarkdown.defaultRules.text, { + var textRule = Object.assign({}, SimpleMarkdown.defaultRules.text, { order: 10 }); it("should sort rules by order", function() { var parser1 = SimpleMarkdown.parserFor({ - em1: _.extend({}, emRule, { + em1: Object.assign({}, emRule, { order: 0 }), - em2: _.extend({}, emRule, { + em2: Object.assign({}, emRule, { order: 1 }), text: textRule @@ -2813,10 +2981,10 @@ describe("simple markdown", function() { ]); var parser2 = SimpleMarkdown.parserFor({ - em1: _.extend({}, emRule, { + em1: Object.assign({}, emRule, { order: 1 }), - em2: _.extend({}, emRule, { + em2: Object.assign({}, emRule, { order: 0 }), text: textRule @@ -2830,10 +2998,10 @@ describe("simple markdown", function() { it("should allow fractional orders", function() { var parser1 = SimpleMarkdown.parserFor({ - em1: _.extend({}, emRule, { + em1: Object.assign({}, emRule, { order: 1.4 }), - em2: _.extend({}, emRule, { + em2: Object.assign({}, emRule, { order: 0.9 }), text: textRule @@ -2845,10 +3013,10 @@ describe("simple markdown", function() { ]); var parser2 = SimpleMarkdown.parserFor({ - em1: _.extend({}, emRule, { + em1: Object.assign({}, emRule, { order: 0.5 }), - em2: _.extend({}, emRule, { + em2: Object.assign({}, emRule, { order: 0 }), text: textRule @@ -2862,10 +3030,10 @@ describe("simple markdown", function() { it("should allow negative orders", function() { var parser1 = SimpleMarkdown.parserFor({ - em1: _.extend({}, emRule, { + em1: Object.assign({}, emRule, { order: 0 }), - em2: _.extend({}, emRule, { + em2: Object.assign({}, emRule, { order: -1 }), text: textRule @@ -2877,10 +3045,10 @@ describe("simple markdown", function() { ]); var parser2 = SimpleMarkdown.parserFor({ - em1: _.extend({}, emRule, { + em1: Object.assign({}, emRule, { order: -2 }), - em2: _.extend({}, emRule, { + em2: Object.assign({}, emRule, { order: 1 }), text: textRule @@ -2894,10 +3062,10 @@ describe("simple markdown", function() { it("should break ties by rule name", function() { var parser1 = SimpleMarkdown.parserFor({ - em1: _.extend({}, emRule, { + em1: Object.assign({}, emRule, { order: 0 }), - em2: _.extend({}, emRule, { + em2: Object.assign({}, emRule, { order: 0 }), text: textRule @@ -2911,10 +3079,10 @@ describe("simple markdown", function() { // ...regardless of their order in the // original rule definition var parser2 = SimpleMarkdown.parserFor({ - em2: _.extend({}, emRule, { + em2: Object.assign({}, emRule, { order: 0 }), - em1: _.extend({}, emRule, { + em1: Object.assign({}, emRule, { order: 0 }), text: textRule @@ -2928,12 +3096,13 @@ describe("simple markdown", function() { it("should output a warning for non-numeric orders", function() { var oldconsolewarn = console.warn; + /** @type {any[]} */ var warnings = []; - /*::FLOW_IGNORE_COVARIANCE.*/ console.warn = function(warning) { + /*::FLOW_IGNORE_COVARIANCE.*/ console.warn = function(/** @type {any} */ warning) { warnings.push(warning); }; var parser1 = SimpleMarkdown.parserFor({ - em1: _.extend({}, emRule, { + em1: Object.assign({}, emRule, { order: 1/0 - 1/0 }), text: textRule @@ -2950,11 +3119,11 @@ describe("simple markdown", function() { it("should break ties with quality", function() { var parser1 = SimpleMarkdown.parserFor({ - em1: _.extend({}, emRule, { + em1: Object.assign({}, emRule, { order: 0, quality: function() { return 1; }, }), - em2: _.extend({}, emRule, { + em2: Object.assign({}, emRule, { order: 0, quality: function() { return 2; }, }), @@ -2969,11 +3138,11 @@ describe("simple markdown", function() { // ...regardless of their order in the // original rule definition var parser2 = SimpleMarkdown.parserFor({ - em2: _.extend({}, emRule, { + em2: Object.assign({}, emRule, { order: 0, quality: function() { return 2; }, }), - em1: _.extend({}, emRule, { + em1: Object.assign({}, emRule, { order: 0, quality: function() { return 1; }, }), @@ -2988,10 +3157,10 @@ describe("simple markdown", function() { it("rules with quality should always win the tie", function() { var parser1 = SimpleMarkdown.parserFor({ - em1: _.extend({}, emRule, { + em1: Object.assign({}, emRule, { order: 0, }), - em2: _.extend({}, emRule, { + em2: Object.assign({}, emRule, { order: 0, quality: function() { return 2; }, }), @@ -3005,10 +3174,10 @@ describe("simple markdown", function() { // except if they don't match var parser2 = SimpleMarkdown.parserFor({ - em: _.extend({}, emRule, { + em: Object.assign({}, emRule, { order: 0, }), - strong: _.extend({}, strongRule, { + strong: Object.assign({}, strongRule, { order: 0, quality: function() { return 2; }, }), @@ -3030,11 +3199,15 @@ describe("simple markdown", function() { var parser1 = SimpleMarkdown.parserFor({ fancy: { order: SimpleMarkdown.defaultRules.text.order - 1, - match: function(source) { + match: function(/** @type {string} */ source) { return /^.*/.exec(source); }, - parse: function(capture, parse, state) { - return capture[0].split(' ').map(function(word) { + parse: function( + /** @type {SimpleMarkdown.Capture} */ capture, + /** @type {SimpleMarkdown.Parser} */ parse, + /** @type {SimpleMarkdown.State} */ state + ) { + return capture[0].split(' ').map(function(/** @type {string} */ word) { return { type: "text", content: word }; }); }, @@ -3058,7 +3231,11 @@ describe("simple markdown", function() { // gives a flattened array result of the words. var rules = { Array: { - result: function(arr, output, state) { + result: function( + /** @type {Array} */ arr, + /** @type {SimpleMarkdown.Output} */ output, + /** @type {SimpleMarkdown.State} */ state + ) { return arr.map(function(node) { return output(node, state); }).filter(function(word) { @@ -3068,23 +3245,35 @@ describe("simple markdown", function() { }, word: { order: SimpleMarkdown.defaultRules.text.order - 1, - match: function(source) { + match: function(/** @type {string} */ source) { return /^\w+/.exec(source); }, - parse: function(capture, parse, state) { + parse: function( + /** @type {SimpleMarkdown.Capture} */ capture, + /** @type {SimpleMarkdown.Parser} */ parse, + /** @type {SimpleMarkdown.State} */ state + ) { state.wordCount++; return {content: capture[0]}; }, - result: function(node, output, state) { + result: function( + /** @type {SimpleMarkdown.SingleASTNode} */ node, + /** @type {SimpleMarkdown.NodeOutput} */ output, + /** @type {SimpleMarkdown.State} */ state + ) { state.wordCount++; return node.content; }, }, delimiter: Object.assign({}, SimpleMarkdown.defaultRules.text, { - match: function(source) { + match: function(/** @type {string} */ source) { return /^\W+/.exec(source); }, - result: function(node, output, state) { + result: function( + /** @type {SimpleMarkdown.SingleASTNode} */ node, + /** @type {SimpleMarkdown.NodeOutput} */ output, + /** @type {SimpleMarkdown.State} */ state + ) { return null; }, }), @@ -3094,6 +3283,7 @@ describe("simple markdown", function() { var output = SimpleMarkdown.outputFor(rules, 'result', {wordCount: 0}); // test parsing + /** @type {{ wordCount?: number }} */ var parseState = {}; var ast1 = parse('hi here are some words', parseState); assert.strictEqual(parseState.wordCount, 5); @@ -3103,6 +3293,7 @@ describe("simple markdown", function() { assert.deepEqual(ast1, ast2); // test output + /** @type {{ wordCount?: number }} */ var outputState = {}; var result1 = output(ast1, outputState); assert.deepEqual(result1, ['hi', 'here', 'are', 'some', 'words']); @@ -3118,10 +3309,14 @@ describe("simple markdown", function() { { fancy: { order: SimpleMarkdown.defaultRules.text.order - 1, - match: function(source) { + match: function(/** @type {string} */ source) { return /^\w+/.exec(source); }, - parse: function(capture, parse, state) { + parse: function( + /** @type {SimpleMarkdown.Capture} */ capture, + /** @type {SimpleMarkdown.Parser} */ parse, + /** @type {SimpleMarkdown.State} */ state + ) { var word = capture[0]; var translated = state.lookup[word]; if (translated) { @@ -3132,7 +3327,7 @@ describe("simple markdown", function() { }, }, text: Object.assign({}, SimpleMarkdown.defaultRules.text, { - match: function(source) { + match: function(/** @type {string} */ source) { return /^\W+/.exec(source); }, }), @@ -3163,7 +3358,11 @@ describe("simple markdown", function() { { Array: SimpleMarkdown.defaultRules.Array, text: Object.assign({}, SimpleMarkdown.defaultRules.text, { - react: function(node, output, state) { + react: function( + /** @type {SimpleMarkdown.SingleASTNode} */ node, + /** @type {SimpleMarkdown.ReactNodeOutput} */ output, + /** @type {SimpleMarkdown.State} */ state + ) { return React.createElement( state.TextComponent, {key: state.key}, @@ -3192,10 +3391,14 @@ describe("simple markdown", function() { var parse = SimpleMarkdown.parserFor({ bracketed: { order: SimpleMarkdown.defaultRules.text.order - 1, - match: function(source) { + match: function(/** @type {string} */ source) { return /^\{((?:\\[\S\s]|[^\\\*])+)\}/.exec(source); }, - parse: function(capture, parse, state) { + parse: function( + /** @type {SimpleMarkdown.Capture} */ capture, + /** @type {SimpleMarkdown.Parser} */ parse, + /** @type {SimpleMarkdown.State} */ state + ) { var result = { // note no passing state here: content: parse(capture[1]), @@ -3256,12 +3459,19 @@ describe("simple markdown", function() { var output = SimpleMarkdown.outputFor({ Array: SimpleMarkdown.defaultRules.Array, paragraph: Object.assign({}, SimpleMarkdown.defaultRules.paragraph, { - html: function(node, output) { + html: function( + /** @type {SimpleMarkdown.SingleASTNode} */ node, + /** @type {SimpleMarkdown.HtmlOutput} */ output + ) { return '

' + output(node.content) + '

'; }, }), text: Object.assign({}, SimpleMarkdown.defaultRules.text, { - html: function(node, output, state) { + html: function( + /** @type {SimpleMarkdown.SingleASTNode} */ node, + /** @type {SimpleMarkdown.HtmlOutput} */ output, + /** @type {SimpleMarkdown.State} */ state + ) { return '' + @@ -3292,13 +3502,19 @@ describe("simple markdown", function() { Array: SimpleMarkdown.defaultRules.Array, spoiler: { order: SimpleMarkdown.defaultRules.text.order - 1, - match: function(source) { + match: function(/** @type {string} */ source) { return /^\[\[((?:[^\]]|\][^\]])+)\]\]/.exec(source); }, - parse: function(capture, parse) { + parse: function( + /** @type {SimpleMarkdown.Capture} */ capture, + /** @type {SimpleMarkdown.Parser} */ parse + ) { return {content: parse(capture[1])}; }, - html: function(node, output) { + html: function( + /** @type {SimpleMarkdown.SingleASTNode} */ node, + /** @type {SimpleMarkdown.HtmlOutput} */ output + ) { return '' + output(node.content) + ''; @@ -3700,7 +3916,11 @@ describe("simple markdown", function() { it("should join text nodes before outputting them", function() { var rules = Object.assign({}, SimpleMarkdown.defaultRules, { text: Object.assign({}, SimpleMarkdown.defaultRules.text, { - react: function(node, output, state) { + react: function( + /** @type {SimpleMarkdown.SingleASTNode} */ node, + /** @type {SimpleMarkdown.ReactOutput} */ output, + /** @type {SimpleMarkdown.State} */ state + ) { return React.createElement( 'span', {key: state.key, className: 'text'}, @@ -4149,4 +4369,50 @@ describe("simple markdown", function() { }); }); }); + + describe("Exponential backtracking avoidance", function() { + it("should parse long inlineCode quickly", function() { + var source = '`' + Array(2000).join(' '); + var startTime = Date.now(); + var parsed = inlineParse(source); + var duration = Date.now() - startTime; + assert.ok(duration < 10, "Expected parsing to finish in <10ms, but was " + duration + "ms."); + }); + + it("should parse long headings quickly", function() { + var source = '### Hi ' + Array(1200).join(' ') + 'there ### \n\n'; + var startTime = Date.now(); + var parsed = blockParse(source); + var duration = Date.now() - startTime; + assert.ok(duration < 10, "Expected parsing to finish in <10ms, but was " + duration + "ms."); + }); + + it("should parse long del strikethroughs quickly", function() { + var source = '~~~h' + Array(30).join(' ') + 'i'; + var startTime = Date.now(); + var parsed = inlineParse(source); + var duration = Date.now() - startTime; + assert.ok(duration < 10, "Expected parsing to finish in <10ms, but was " + duration + "ms."); + + source = '~~~h' + Array(1000).join(' ') + 'i'; + startTime = Date.now(); + parsed = inlineParse(source); + duration = Date.now() - startTime; + assert.ok(duration < 10, "Expected parsing to finish in <10ms, but was " + duration + "ms."); + }); + + it("should parse long code fences quickly", function() { + var source = '~~~' + Array(1000).join(' ') + '\n' + Array(1000).join(' ') + '\n'; + var startTime = Date.now(); + var parsed = blockParse(source); + var duration = Date.now() - startTime; + assert.ok(duration < 10, "Expected parsing to finish in <10ms, but was " + duration + "ms."); + + var source = '~~~' + Array(2000).join(' ') + '\n' + Array(10000).join(' ') + '\n'; + var startTime = Date.now(); + var parsed = blockParse(source); + var duration = Date.now() - startTime; + assert.ok(duration < 10, "Expected parsing to finish in <10ms, but was " + duration + "ms."); + }); + }); }); diff --git a/flow-typed/npm/express_v4.17.x.js b/flow-typed/npm/express_v4.17.x.js new file mode 100644 index 0000000..ed5c6d4 --- /dev/null +++ b/flow-typed/npm/express_v4.17.x.js @@ -0,0 +1,353 @@ +// flow-typed signature: 53fbc99af5ac2f0732fc7c8641f3e128 +// flow-typed version: 2f514ea8dd/express_v4.17.x/flow_>=v0.104.x + +declare type express$RouterOptions = { + caseSensitive?: boolean, + mergeParams?: boolean, + strict?: boolean, + ... +}; + +declare class express$RequestResponseBase { + app: express$Application; + get(field: string): string | void; +} + +declare type express$RequestParams = { [param: string]: string, ... }; + +/* + NOTE: Use caution when extending `express$Request` or `express$Response`. When + a request first hits the server, its `req` and `res` will not have any + additional properties, even if you explicitly type them with your custom + subclass. Subsequent middleware may assign these properties, but you must be + cognizant of this ordering. One way to handle this is marking all properties + as optional to force refinement every time a property is accessed. Therefore, + we advise that you always mark properties as _optional_ in `express$Request` + and `express$Response` subclasses. + + You may decide not to do this, in which case the typings will be unsound and + the behavior will be similar to how arrays work in Flow. See here for more + information: https://flow.org/en/docs/types/arrays/#toc-array-access-is-unsafe + + See #3578 and #3337 for additional discussion. If you have ideas on how to + improve these typings, please share them in #3578 or open a new issue. + + **BAD** + declare class test_express$CustomRequest extends express$Request { + foo: string; + } + + **GOOD** + declare class test_express$CustomRequest extends express$Request { + foo: string | void; + } +*/ +declare class express$Request extends http$IncomingMessage mixins express$RequestResponseBase { + baseUrl: string; + body: mixed; + cookies: { [cookie: string]: string, ... }; + connection: net$Socket; + fresh: boolean; + hostname: string; + ip: string; + ips: Array; + method: string; + originalUrl: string; + params: express$RequestParams; + path: string; + protocol: "https" | "http"; + query: { [name: string]: string | Array, ... }; + route: string; + secure: boolean; + signedCookies: { [signedCookie: string]: string, ... }; + stale: boolean; + subdomains: Array; + xhr: boolean; + accepts(types: string): string | false; + accepts(types: Array): string | false; + acceptsCharsets(...charsets: Array): string | false; + acceptsEncodings(...encoding: Array): string | false; + acceptsLanguages(...lang: Array): string | false; + header(field: string): string | void; + is(type: string): string | false; + param(name: string, defaultValue?: string): string | void; +} + +declare type express$CookieOptions = { + domain?: string, + encode?: (value: string) => string, + expires?: Date, + httpOnly?: boolean, + maxAge?: number, + path?: string, + secure?: boolean, + signed?: boolean, + ... +}; + +declare type express$Path = string | RegExp; + +declare type express$RenderCallback = ( + err: Error | null, + html?: string +) => mixed; + +declare type express$SendFileOptions = { + maxAge?: number, + root?: string, + lastModified?: boolean, + headers?: { [name: string]: string, ... }, + dotfiles?: "allow" | "deny" | "ignore", + ... +}; + +declare class express$Response extends http$ServerResponse mixins express$RequestResponseBase { + headersSent: boolean; + locals: { [name: string]: mixed, ... }; + append(field: string, value?: string): this; + attachment(filename?: string): this; + cookie(name: string, value: string, options?: express$CookieOptions): this; + clearCookie(name: string, options?: express$CookieOptions): this; + download( + path: string, + filename?: string, + callback?: (err?: ?Error) => void + ): this; + format(typesObject: { [type: string]: Function, ... }): this; + json(body?: mixed): this; + jsonp(body?: mixed): this; + links(links: { [name: string]: string, ... }): this; + location(path: string): this; + redirect(url: string, ...args: Array): this; + redirect(status: number, url: string, ...args: Array): this; + render( + view: string, + locals?: { [name: string]: mixed, ... }, + callback?: express$RenderCallback + ): this; + send(body?: mixed): this; + sendFile( + path: string, + options?: express$SendFileOptions, + callback?: (err?: ?Error) => mixed + ): this; + sendStatus(statusCode: number): this; + header(field: string, value?: string): this; + header(headers: { [name: string]: string, ... }): this; + set(field: string, value?: string | string[]): this; + set(headers: { [name: string]: string, ... }): this; + status(statusCode: number): this; + type(type: string): this; + vary(field: string): this; + req: express$Request; +} + +declare type express$NextFunction = (err?: ?Error | "route") => mixed; +declare type express$Middleware< + Req: express$Request = express$Request, + Res: express$Response = express$Response, +> = + ((req: Req, res: Res, next: express$NextFunction) => mixed) | + ((error: Error, req: Req, res: Res, next: express$NextFunction) => mixed); + +declare interface express$RouteMethodType< + T, + Req: express$Request = express$Request, + Res: express$Response = express$Response, +> { + (middleware: express$Middleware): T; + (...middleware: Array>): T; + ( + path: express$Path | $ReadOnlyArray, + ...middleware: Array> + ): T; +} + +declare class express$Route< + Req: express$Request = express$Request, + Res: express$Response = express$Response, +> { + all: express$RouteMethodType; + get: express$RouteMethodType; + post: express$RouteMethodType; + put: express$RouteMethodType; + head: express$RouteMethodType; + delete: express$RouteMethodType; + options: express$RouteMethodType; + trace: express$RouteMethodType; + copy: express$RouteMethodType; + lock: express$RouteMethodType; + mkcol: express$RouteMethodType; + move: express$RouteMethodType; + purge: express$RouteMethodType; + propfind: express$RouteMethodType; + proppatch: express$RouteMethodType; + unlock: express$RouteMethodType; + report: express$RouteMethodType; + mkactivity: express$RouteMethodType; + checkout: express$RouteMethodType; + merge: express$RouteMethodType; + + // @TODO Missing 'm-search' but get flow illegal name error. + + notify: express$RouteMethodType; + subscribe: express$RouteMethodType; + unsubscribe: express$RouteMethodType; + patch: express$RouteMethodType; + search: express$RouteMethodType; + connect: express$RouteMethodType; +} + +declare class express$Router< + Req: express$Request = express$Request, + Res: express$Response = express$Response, +> extends express$Route { + constructor(options?: express$RouterOptions): void; + route(path: string): express$Route; + static ( + options?: express$RouterOptions, + ): express$Router; + use(middleware: express$Middleware): this; + use(...middleware: Array>): this; + use( + path: express$Path | $ReadOnlyArray, + ...middleware: Array> + ): this; + use(path: string, router: express$Router): this; + handle( + req: http$IncomingMessage<>, + res: http$ServerResponse, + next: express$NextFunction + ): void; + param( + param: string, + callback: ( + req: Req, + res: Res, + next: express$NextFunction, + value: string, + paramName: string, + ) => mixed + ): void; + ( + req: http$IncomingMessage<>, + res: http$ServerResponse, + next?: ?express$NextFunction + ): void; +} + +/* +With flow-bin ^0.59, express app.listen() is deemed to return any and fails flow type coverage. +Which is ironic because https://github.com/facebook/flow/blob/master/Changelog.md#misc-2 (release notes for 0.59) +says "Improves typings for Node.js HTTP server listen() function." See that? IMPROVES! +To work around this issue, we changed Server to ?Server here, so that our invocations of express.listen() will +not be deemed to lack type coverage. +*/ + +declare class express$Application< + Req: express$Request = express$Request, + Res: express$Response = express$Response, +> extends express$Router mixins events$EventEmitter { + constructor(): void; + locals: { [name: string]: mixed, ... }; + mountpath: string; + listen( + port: number, + hostname?: string, + backlog?: number, + callback?: (err?: ?Error) => mixed + ): ?http$Server; + listen( + port: number, + hostname?: string, + callback?: (err?: ?Error) => mixed + ): ?http$Server; + listen(port: number, callback?: (err?: ?Error) => mixed): ?http$Server; + listen(path: string, callback?: (err?: ?Error) => mixed): ?http$Server; + listen(handle: Object, callback?: (err?: ?Error) => mixed): ?http$Server; + disable(name: string): void; + disabled(name: string): boolean; + enable(name: string): this; + enabled(name: string): boolean; + engine(name: string, callback: Function): void; + /** + * Mixed will not be taken as a value option. Issue around using the GET http method name and the get for settings. + */ + // get(name: string): mixed; + set(name: string, value: mixed): mixed; + render( + name: string, + optionsOrFunction: { [name: string]: mixed, ... }, + callback: express$RenderCallback + ): void; + handle( + req: http$IncomingMessage<>, + res: http$ServerResponse, + next?: ?express$NextFunction + ): void; + // callable signature is not inherited + ( + req: http$IncomingMessage<>, + res: http$ServerResponse, + next?: ?express$NextFunction + ): void; +} + +declare type JsonOptions = { + inflate?: boolean, + limit?: string | number, + reviver?: (key: string, value: mixed) => mixed, + strict?: boolean, + type?: string | Array | ((req: express$Request) => boolean), + verify?: ( + req: express$Request, + res: express$Response, + buf: Buffer, + encoding: string + ) => mixed, + ... +}; + +declare type express$UrlEncodedOptions = { + extended?: boolean, + inflate?: boolean, + limit?: string | number, + parameterLimit?: number, + type?: string | Array | ((req: express$Request) => boolean), + verify?: ( + req: express$Request, + res: express$Response, + buf: Buffer, + encoding: string + ) => mixed, + ... +} + +declare module "express" { + declare export type RouterOptions = express$RouterOptions; + declare export type CookieOptions = express$CookieOptions; + declare export type Middleware< + Req: express$Request = express$Request, + Res: express$Response = express$Response, + > = express$Middleware; + declare export type NextFunction = express$NextFunction; + declare export type RequestParams = express$RequestParams; + declare export type $Response = express$Response; + declare export type $Request = express$Request; + declare export type $Application< + Req: express$Request = express$Request, + Res: express$Response = express$Response, + > = express$Application; + + declare module.exports: { + // If you try to call like a function, it will use this signature + (): express$Application, + json: (opts: ?JsonOptions) => express$Middleware<>, + // `static` property on the function + static: (root: string, options?: Object) => express$Middleware, + // `Router` property on the function + Router: typeof express$Router, + urlencoded: (opts: ?express$UrlEncodedOptions) => express$Middleware<>, + ... + }; +} diff --git a/flow-typed/npm/flow-bin_v0.x.x.js b/flow-typed/npm/flow-bin_v0.x.x.js new file mode 100644 index 0000000..fda1f29 --- /dev/null +++ b/flow-typed/npm/flow-bin_v0.x.x.js @@ -0,0 +1,6 @@ +// flow-typed signature: 28fdff7f110e1c75efab63ff205dda30 +// flow-typed version: c6154227d1/flow-bin_v0.x.x/flow_>=v0.104.x + +declare module "flow-bin" { + declare module.exports: string; +} diff --git a/flow-typed/npm/mocha_v3.1.x.js b/flow-typed/npm/mocha_v6.x.x.js similarity index 94% rename from flow-typed/npm/mocha_v3.1.x.js rename to flow-typed/npm/mocha_v6.x.x.js index 1a35f6e..0165a28 100644 --- a/flow-typed/npm/mocha_v3.1.x.js +++ b/flow-typed/npm/mocha_v6.x.x.js @@ -1,5 +1,5 @@ -// flow-typed signature: 58fb316c623a4f7918b0e2529256be8c -// flow-typed version: 0ef6a9a08b/mocha_v3.1.x/flow_>=v0.28.x +// flow-typed signature: 03fc62001bb373473e2e4208d31a9f73 +// flow-typed version: c6154227d1/mocha_v6.x.x/flow_>=v0.104.x declare interface $npm$mocha$SetupOptions { slow?: number; @@ -53,11 +53,12 @@ declare interface $npm$mocha$Runner {} declare class $npm$mocha$BaseReporter { stats: { - suites: number; - tests: number; - passes: number; - pending: number; - failures: number; + suites: number, + tests: number, + passes: number, + pending: number, + failures: number, + ... }; constructor(runner: $npm$mocha$Runner): $npm$mocha$BaseReporter; @@ -77,10 +78,11 @@ declare class $npm$mocha$MinReporter extends $npm$mocha$BaseReporter {} declare class $npm$mocha$NyanReporter extends $npm$mocha$BaseReporter {} declare class $npm$mocha$ProgressReporter extends $npm$mocha$BaseReporter { constructor(runner: $npm$mocha$Runner, options?: { - open?: string; - complete?: string; - incomplete?: string; - close?: string; + open?: string, + complete?: string, + incomplete?: string, + close?: string, + ... }): $npm$mocha$ProgressReporter; } declare class $npm$mocha$SpecReporter extends $npm$mocha$BaseReporter {} @@ -92,13 +94,14 @@ declare class $npm$mocha$XUnitReporter extends $npm$mocha$BaseReporter { declare class $npm$mocha$Mocha { currentTest: $npm$mocha$TestDefinition; constructor(options?: { - grep?: RegExp; - ui?: string; - reporter?: string; - timeout?: number; - reporterOptions?: any; - slow?: number; - bail?: boolean; + grep?: RegExp, + ui?: string, + reporter?: string, + timeout?: number, + reporterOptions?: any, + slow?: number, + bail?: boolean, + ... }): $npm$mocha$Mocha; setup(options: $npm$mocha$SetupOptions): this; bail(value?: boolean): this; @@ -138,6 +141,7 @@ declare class $npm$mocha$Mocha { Min: $npm$mocha$MinReporter, Nyan: $npm$mocha$NyanReporter, Progress: $npm$mocha$ProgressReporter, + ... }; } @@ -160,6 +164,7 @@ declare interface $npm$mocha$Test extends $npm$mocha$Runnable { pending: boolean; state: 'failed' | 'passed' | void; fullTitle(): string; + timeout(ms: number): void; } // declare interface $npm$mocha$BeforeAndAfterContext extends $npm$mocha$HookCallbackContext { diff --git a/flow-typed/npm/typescript_v3.3.x.js b/flow-typed/npm/typescript_v3.3.x.js new file mode 100644 index 0000000..678ca00 --- /dev/null +++ b/flow-typed/npm/typescript_v3.3.x.js @@ -0,0 +1,9785 @@ +// flow-typed signature: a73d5be820ce9376397c9110a4a02d9e +// flow-typed version: c6154227d1/typescript_v3.3.x/flow_>=v0.104.x + +declare module "typescript" { + declare var versionMajorMinor: "3.3"; // "3.3"; + declare var version: string; + declare type MapLike = { [index: string]: T, ... }; + + declare class SortedReadonlyArray extends $ReadOnlyArray { + __sortedArrayBrand: any + } + + declare class SortedArray extends Array { + __sortedArrayBrand: any + } + + declare class ReadonlyMap { + get(key: string): T | void, + has(key: string): boolean, + forEach(action: (value: T, key: string) => void): void, + +size: number, + keys(): Iterator, + values(): Iterator, + entries(): Iterator<[string, T]> + } + + declare class Map extends ReadonlyMap { + set(key: string, value: T): this, + delete(key: string): boolean, + clear(): void + } + + declare type Iterator = { next(): + | { + value: T, + done: false, + ... + } + | { + value: empty, + done: true, + ... + }, ... }; + + declare type Push = { push(...values: T[]): void, ... }; + + declare type Path = string & { __pathBrand: any, ... }; + declare type TextRange = { + pos: number, + end: number, + ... + }; + + declare type JsDocSyntaxKind = + | typeof SyntaxKind.EndOfFileToken + | typeof SyntaxKind.WhitespaceTrivia + | typeof SyntaxKind.AtToken + | typeof SyntaxKind.NewLineTrivia + | typeof SyntaxKind.AsteriskToken + | typeof SyntaxKind.OpenBraceToken + | typeof SyntaxKind.CloseBraceToken + | typeof SyntaxKind.LessThanToken + | typeof SyntaxKind.OpenBracketToken + | typeof SyntaxKind.CloseBracketToken + | typeof SyntaxKind.EqualsToken + | typeof SyntaxKind.CommaToken + | typeof SyntaxKind.DotToken + | typeof SyntaxKind.Identifier + | typeof SyntaxKind.NoSubstitutionTemplateLiteral + | typeof SyntaxKind.Unknown + | KeywordSyntaxKind; + declare type KeywordSyntaxKind = + | typeof SyntaxKind.AbstractKeyword + | typeof SyntaxKind.AnyKeyword + | typeof SyntaxKind.AsKeyword + | typeof SyntaxKind.BigIntKeyword + | typeof SyntaxKind.BooleanKeyword + | typeof SyntaxKind.BreakKeyword + | typeof SyntaxKind.CaseKeyword + | typeof SyntaxKind.CatchKeyword + | typeof SyntaxKind.ClassKeyword + | typeof SyntaxKind.ContinueKeyword + | typeof SyntaxKind.ConstKeyword + | typeof SyntaxKind.ConstructorKeyword + | typeof SyntaxKind.DebuggerKeyword + | typeof SyntaxKind.DeclareKeyword + | typeof SyntaxKind.DefaultKeyword + | typeof SyntaxKind.DeleteKeyword + | typeof SyntaxKind.DoKeyword + | typeof SyntaxKind.ElseKeyword + | typeof SyntaxKind.EnumKeyword + | typeof SyntaxKind.ExportKeyword + | typeof SyntaxKind.ExtendsKeyword + | typeof SyntaxKind.FalseKeyword + | typeof SyntaxKind.FinallyKeyword + | typeof SyntaxKind.ForKeyword + | typeof SyntaxKind.FromKeyword + | typeof SyntaxKind.FunctionKeyword + | typeof SyntaxKind.GetKeyword + | typeof SyntaxKind.IfKeyword + | typeof SyntaxKind.ImplementsKeyword + | typeof SyntaxKind.ImportKeyword + | typeof SyntaxKind.InKeyword + | typeof SyntaxKind.InferKeyword + | typeof SyntaxKind.InstanceOfKeyword + | typeof SyntaxKind.InterfaceKeyword + | typeof SyntaxKind.IsKeyword + | typeof SyntaxKind.KeyOfKeyword + | typeof SyntaxKind.LetKeyword + | typeof SyntaxKind.ModuleKeyword + | typeof SyntaxKind.NamespaceKeyword + | typeof SyntaxKind.NeverKeyword + | typeof SyntaxKind.NewKeyword + | typeof SyntaxKind.NullKeyword + | typeof SyntaxKind.NumberKeyword + | typeof SyntaxKind.ObjectKeyword + | typeof SyntaxKind.PackageKeyword + | typeof SyntaxKind.PrivateKeyword + | typeof SyntaxKind.ProtectedKeyword + | typeof SyntaxKind.PublicKeyword + | typeof SyntaxKind.ReadonlyKeyword + | typeof SyntaxKind.RequireKeyword + | typeof SyntaxKind.GlobalKeyword + | typeof SyntaxKind.ReturnKeyword + | typeof SyntaxKind.SetKeyword + | typeof SyntaxKind.StaticKeyword + | typeof SyntaxKind.StringKeyword + | typeof SyntaxKind.SuperKeyword + | typeof SyntaxKind.SwitchKeyword + | typeof SyntaxKind.SymbolKeyword + | typeof SyntaxKind.ThisKeyword + | typeof SyntaxKind.ThrowKeyword + | typeof SyntaxKind.TrueKeyword + | typeof SyntaxKind.TryKeyword + | typeof SyntaxKind.TypeKeyword + | typeof SyntaxKind.TypeOfKeyword + | typeof SyntaxKind.UndefinedKeyword + | typeof SyntaxKind.UniqueKeyword + | typeof SyntaxKind.UnknownKeyword + | typeof SyntaxKind.VarKeyword + | typeof SyntaxKind.VoidKeyword + | typeof SyntaxKind.WhileKeyword + | typeof SyntaxKind.WithKeyword + | typeof SyntaxKind.YieldKeyword + | typeof SyntaxKind.AsyncKeyword + | typeof SyntaxKind.AwaitKeyword + | typeof SyntaxKind.OfKeyword; + declare type JsxTokenSyntaxKind = + | typeof SyntaxKind.LessThanSlashToken + | typeof SyntaxKind.EndOfFileToken + | typeof SyntaxKind.ConflictMarkerTrivia + | typeof SyntaxKind.JsxText + | typeof SyntaxKind.JsxTextAllWhiteSpaces + | typeof SyntaxKind.OpenBraceToken + | typeof SyntaxKind.LessThanToken; + + declare var SyntaxKind: { + // 0 + +Unknown: 0, + // 1 + +EndOfFileToken: 1, + // 2 + +SingleLineCommentTrivia: 2, + // 3 + +MultiLineCommentTrivia: 3, + // 4 + +NewLineTrivia: 4, + // 5 + +WhitespaceTrivia: 5, + // 6 + +ShebangTrivia: 6, + // 7 + +ConflictMarkerTrivia: 7, + // 8 + +NumericLiteral: 8, + // 9 + +BigIntLiteral: 9, + // 10 + +StringLiteral: 10, + // 11 + +JsxText: 11, + // 12 + +JsxTextAllWhiteSpaces: 12, + // 13 + +RegularExpressionLiteral: 13, + // 14 + +NoSubstitutionTemplateLiteral: 14, + // 15 + +TemplateHead: 15, + // 16 + +TemplateMiddle: 16, + // 17 + +TemplateTail: 17, + // 18 + +OpenBraceToken: 18, + // 19 + +CloseBraceToken: 19, + // 20 + +OpenParenToken: 20, + // 21 + +CloseParenToken: 21, + // 22 + +OpenBracketToken: 22, + // 23 + +CloseBracketToken: 23, + // 24 + +DotToken: 24, + // 25 + +DotDotDotToken: 25, + // 26 + +SemicolonToken: 26, + // 27 + +CommaToken: 27, + // 28 + +LessThanToken: 28, + // 29 + +LessThanSlashToken: 29, + // 30 + +GreaterThanToken: 30, + // 31 + +LessThanEqualsToken: 31, + // 32 + +GreaterThanEqualsToken: 32, + // 33 + +EqualsEqualsToken: 33, + // 34 + +ExclamationEqualsToken: 34, + // 35 + +EqualsEqualsEqualsToken: 35, + // 36 + +ExclamationEqualsEqualsToken: 36, + // 37 + +EqualsGreaterThanToken: 37, + // 38 + +PlusToken: 38, + // 39 + +MinusToken: 39, + // 40 + +AsteriskToken: 40, + // 41 + +AsteriskAsteriskToken: 41, + // 42 + +SlashToken: 42, + // 43 + +PercentToken: 43, + // 44 + +PlusPlusToken: 44, + // 45 + +MinusMinusToken: 45, + // 46 + +LessThanLessThanToken: 46, + // 47 + +GreaterThanGreaterThanToken: 47, + // 48 + +GreaterThanGreaterThanGreaterThanToken: 48, + // 49 + +AmpersandToken: 49, + // 50 + +BarToken: 50, + // 51 + +CaretToken: 51, + // 52 + +ExclamationToken: 52, + // 53 + +TildeToken: 53, + // 54 + +AmpersandAmpersandToken: 54, + // 55 + +BarBarToken: 55, + // 56 + +QuestionToken: 56, + // 57 + +ColonToken: 57, + // 58 + +AtToken: 58, + // 59 + +EqualsToken: 59, + // 60 + +PlusEqualsToken: 60, + // 61 + +MinusEqualsToken: 61, + // 62 + +AsteriskEqualsToken: 62, + // 63 + +AsteriskAsteriskEqualsToken: 63, + // 64 + +SlashEqualsToken: 64, + // 65 + +PercentEqualsToken: 65, + // 66 + +LessThanLessThanEqualsToken: 66, + // 67 + +GreaterThanGreaterThanEqualsToken: 67, + // 68 + +GreaterThanGreaterThanGreaterThanEqualsToken: 68, + // 69 + +AmpersandEqualsToken: 69, + // 70 + +BarEqualsToken: 70, + // 71 + +CaretEqualsToken: 71, + // 72 + +Identifier: 72, + // 73 + +BreakKeyword: 73, + // 74 + +CaseKeyword: 74, + // 75 + +CatchKeyword: 75, + // 76 + +ClassKeyword: 76, + // 77 + +ConstKeyword: 77, + // 78 + +ContinueKeyword: 78, + // 79 + +DebuggerKeyword: 79, + // 80 + +DefaultKeyword: 80, + // 81 + +DeleteKeyword: 81, + // 82 + +DoKeyword: 82, + // 83 + +ElseKeyword: 83, + // 84 + +EnumKeyword: 84, + // 85 + +ExportKeyword: 85, + // 86 + +ExtendsKeyword: 86, + // 87 + +FalseKeyword: 87, + // 88 + +FinallyKeyword: 88, + // 89 + +ForKeyword: 89, + // 90 + +FunctionKeyword: 90, + // 91 + +IfKeyword: 91, + // 92 + +ImportKeyword: 92, + // 93 + +InKeyword: 93, + // 94 + +InstanceOfKeyword: 94, + // 95 + +NewKeyword: 95, + // 96 + +NullKeyword: 96, + // 97 + +ReturnKeyword: 97, + // 98 + +SuperKeyword: 98, + // 99 + +SwitchKeyword: 99, + // 100 + +ThisKeyword: 100, + // 101 + +ThrowKeyword: 101, + // 102 + +TrueKeyword: 102, + // 103 + +TryKeyword: 103, + // 104 + +TypeOfKeyword: 104, + // 105 + +VarKeyword: 105, + // 106 + +VoidKeyword: 106, + // 107 + +WhileKeyword: 107, + // 108 + +WithKeyword: 108, + // 109 + +ImplementsKeyword: 109, + // 110 + +InterfaceKeyword: 110, + // 111 + +LetKeyword: 111, + // 112 + +PackageKeyword: 112, + // 113 + +PrivateKeyword: 113, + // 114 + +ProtectedKeyword: 114, + // 115 + +PublicKeyword: 115, + // 116 + +StaticKeyword: 116, + // 117 + +YieldKeyword: 117, + // 118 + +AbstractKeyword: 118, + // 119 + +AsKeyword: 119, + // 120 + +AnyKeyword: 120, + // 121 + +AsyncKeyword: 121, + // 122 + +AwaitKeyword: 122, + // 123 + +BooleanKeyword: 123, + // 124 + +ConstructorKeyword: 124, + // 125 + +DeclareKeyword: 125, + // 126 + +GetKeyword: 126, + // 127 + +InferKeyword: 127, + // 128 + +IsKeyword: 128, + // 129 + +KeyOfKeyword: 129, + // 130 + +ModuleKeyword: 130, + // 131 + +NamespaceKeyword: 131, + // 132 + +NeverKeyword: 132, + // 133 + +ReadonlyKeyword: 133, + // 134 + +RequireKeyword: 134, + // 135 + +NumberKeyword: 135, + // 136 + +ObjectKeyword: 136, + // 137 + +SetKeyword: 137, + // 138 + +StringKeyword: 138, + // 139 + +SymbolKeyword: 139, + // 140 + +TypeKeyword: 140, + // 141 + +UndefinedKeyword: 141, + // 142 + +UniqueKeyword: 142, + // 143 + +UnknownKeyword: 143, + // 144 + +FromKeyword: 144, + // 145 + +GlobalKeyword: 145, + // 146 + +BigIntKeyword: 146, + // 147 + +OfKeyword: 147, + // 148 + +QualifiedName: 148, + // 149 + +ComputedPropertyName: 149, + // 150 + +TypeParameter: 150, + // 151 + +Parameter: 151, + // 152 + +Decorator: 152, + // 153 + +PropertySignature: 153, + // 154 + +PropertyDeclaration: 154, + // 155 + +MethodSignature: 155, + // 156 + +MethodDeclaration: 156, + // 157 + +Constructor: 157, + // 158 + +GetAccessor: 158, + // 159 + +SetAccessor: 159, + // 160 + +CallSignature: 160, + // 161 + +ConstructSignature: 161, + // 162 + +IndexSignature: 162, + // 163 + +TypePredicate: 163, + // 164 + +TypeReference: 164, + // 165 + +FunctionType: 165, + // 166 + +ConstructorType: 166, + // 167 + +TypeQuery: 167, + // 168 + +TypeLiteral: 168, + // 169 + +ArrayType: 169, + // 170 + +TupleType: 170, + // 171 + +OptionalType: 171, + // 172 + +RestType: 172, + // 173 + +UnionType: 173, + // 174 + +IntersectionType: 174, + // 175 + +ConditionalType: 175, + // 176 + +InferType: 176, + // 177 + +ParenthesizedType: 177, + // 178 + +ThisType: 178, + // 179 + +TypeOperator: 179, + // 180 + +IndexedAccessType: 180, + // 181 + +MappedType: 181, + // 182 + +LiteralType: 182, + // 183 + +ImportType: 183, + // 184 + +ObjectBindingPattern: 184, + // 185 + +ArrayBindingPattern: 185, + // 186 + +BindingElement: 186, + // 187 + +ArrayLiteralExpression: 187, + // 188 + +ObjectLiteralExpression: 188, + // 189 + +PropertyAccessExpression: 189, + // 190 + +ElementAccessExpression: 190, + // 191 + +CallExpression: 191, + // 192 + +NewExpression: 192, + // 193 + +TaggedTemplateExpression: 193, + // 194 + +TypeAssertionExpression: 194, + // 195 + +ParenthesizedExpression: 195, + // 196 + +FunctionExpression: 196, + // 197 + +ArrowFunction: 197, + // 198 + +DeleteExpression: 198, + // 199 + +TypeOfExpression: 199, + // 200 + +VoidExpression: 200, + // 201 + +AwaitExpression: 201, + // 202 + +PrefixUnaryExpression: 202, + // 203 + +PostfixUnaryExpression: 203, + // 204 + +BinaryExpression: 204, + // 205 + +ConditionalExpression: 205, + // 206 + +TemplateExpression: 206, + // 207 + +YieldExpression: 207, + // 208 + +SpreadElement: 208, + // 209 + +ClassExpression: 209, + // 210 + +OmittedExpression: 210, + // 211 + +ExpressionWithTypeArguments: 211, + // 212 + +AsExpression: 212, + // 213 + +NonNullExpression: 213, + // 214 + +MetaProperty: 214, + // 215 + +SyntheticExpression: 215, + // 216 + +TemplateSpan: 216, + // 217 + +SemicolonClassElement: 217, + // 218 + +Block: 218, + // 219 + +VariableStatement: 219, + // 220 + +EmptyStatement: 220, + // 221 + +ExpressionStatement: 221, + // 222 + +IfStatement: 222, + // 223 + +DoStatement: 223, + // 224 + +WhileStatement: 224, + // 225 + +ForStatement: 225, + // 226 + +ForInStatement: 226, + // 227 + +ForOfStatement: 227, + // 228 + +ContinueStatement: 228, + // 229 + +BreakStatement: 229, + // 230 + +ReturnStatement: 230, + // 231 + +WithStatement: 231, + // 232 + +SwitchStatement: 232, + // 233 + +LabeledStatement: 233, + // 234 + +ThrowStatement: 234, + // 235 + +TryStatement: 235, + // 236 + +DebuggerStatement: 236, + // 237 + +VariableDeclaration: 237, + // 238 + +VariableDeclarationList: 238, + // 239 + +FunctionDeclaration: 239, + // 240 + +ClassDeclaration: 240, + // 241 + +InterfaceDeclaration: 241, + // 242 + +TypeAliasDeclaration: 242, + // 243 + +EnumDeclaration: 243, + // 244 + +ModuleDeclaration: 244, + // 245 + +ModuleBlock: 245, + // 246 + +CaseBlock: 246, + // 247 + +NamespaceExportDeclaration: 247, + // 248 + +ImportEqualsDeclaration: 248, + // 249 + +ImportDeclaration: 249, + // 250 + +ImportClause: 250, + // 251 + +NamespaceImport: 251, + // 252 + +NamedImports: 252, + // 253 + +ImportSpecifier: 253, + // 254 + +ExportAssignment: 254, + // 255 + +ExportDeclaration: 255, + // 256 + +NamedExports: 256, + // 257 + +ExportSpecifier: 257, + // 258 + +MissingDeclaration: 258, + // 259 + +ExternalModuleReference: 259, + // 260 + +JsxElement: 260, + // 261 + +JsxSelfClosingElement: 261, + // 262 + +JsxOpeningElement: 262, + // 263 + +JsxClosingElement: 263, + // 264 + +JsxFragment: 264, + // 265 + +JsxOpeningFragment: 265, + // 266 + +JsxClosingFragment: 266, + // 267 + +JsxAttribute: 267, + // 268 + +JsxAttributes: 268, + // 269 + +JsxSpreadAttribute: 269, + // 270 + +JsxExpression: 270, + // 271 + +CaseClause: 271, + // 272 + +DefaultClause: 272, + // 273 + +HeritageClause: 273, + // 274 + +CatchClause: 274, + // 275 + +PropertyAssignment: 275, + // 276 + +ShorthandPropertyAssignment: 276, + // 277 + +SpreadAssignment: 277, + // 278 + +EnumMember: 278, + // 279 + +SourceFile: 279, + // 280 + +Bundle: 280, + // 281 + +UnparsedSource: 281, + // 282 + +InputFiles: 282, + // 283 + +JSDocTypeExpression: 283, + // 284 + +JSDocAllType: 284, + // 285 + +JSDocUnknownType: 285, + // 286 + +JSDocNullableType: 286, + // 287 + +JSDocNonNullableType: 287, + // 288 + +JSDocOptionalType: 288, + // 289 + +JSDocFunctionType: 289, + // 290 + +JSDocVariadicType: 290, + // 291 + +JSDocComment: 291, + // 292 + +JSDocTypeLiteral: 292, + // 293 + +JSDocSignature: 293, + // 294 + +JSDocTag: 294, + // 295 + +JSDocAugmentsTag: 295, + // 296 + +JSDocClassTag: 296, + // 297 + +JSDocCallbackTag: 297, + // 298 + +JSDocEnumTag: 298, + // 299 + +JSDocParameterTag: 299, + // 300 + +JSDocReturnTag: 300, + // 301 + +JSDocThisTag: 301, + // 302 + +JSDocTypeTag: 302, + // 303 + +JSDocTemplateTag: 303, + // 304 + +JSDocTypedefTag: 304, + // 305 + +JSDocPropertyTag: 305, + // 306 + +SyntaxList: 306, + // 307 + +NotEmittedStatement: 307, + // 308 + +PartiallyEmittedExpression: 308, + // 309 + +CommaListExpression: 309, + // 310 + +MergeDeclarationMarker: 310, + // 311 + +EndOfDeclarationMarker: 311, + // 312 + +Count: 312, + // 59 + +FirstAssignment: 59, + // 71 + +LastAssignment: 71, + // 60 + +FirstCompoundAssignment: 60, + // 71 + +LastCompoundAssignment: 71, + // 73 + +FirstReservedWord: 73, + // 108 + +LastReservedWord: 108, + // 73 + +FirstKeyword: 73, + // 147 + +LastKeyword: 147, + // 109 + +FirstFutureReservedWord: 109, + // 117 + +LastFutureReservedWord: 117, + // 163 + +FirstTypeNode: 163, + // 183 + +LastTypeNode: 183, + // 18 + +FirstPunctuation: 18, + // 71 + +LastPunctuation: 71, + // 0 + +FirstToken: 0, + // 147 + +LastToken: 147, + // 2 + +FirstTriviaToken: 2, + // 7 + +LastTriviaToken: 7, + // 8 + +FirstLiteralToken: 8, + // 14 + +LastLiteralToken: 14, + // 14 + +FirstTemplateToken: 14, + // 17 + +LastTemplateToken: 17, + // 28 + +FirstBinaryOperator: 28, + // 71 + +LastBinaryOperator: 71, + // 148 + +FirstNode: 148, + // 283 + +FirstJSDocNode: 283, + // 305 + +LastJSDocNode: 305, + // 294 + +FirstJSDocTagNode: 294, + // 305 + +LastJSDocTagNode: 305, + ... + }; + + declare var NodeFlags: { + // 0 + +None: 0, + // 1 + +Let: 1, + // 2 + +Const: 2, + // 4 + +NestedNamespace: 4, + // 8 + +Synthesized: 8, + // 16 + +Namespace: 16, + // 32 + +ExportContext: 32, + // 64 + +ContainsThis: 64, + // 128 + +HasImplicitReturn: 128, + // 256 + +HasExplicitReturn: 256, + // 512 + +GlobalAugmentation: 512, + // 1024 + +HasAsyncFunctions: 1024, + // 2048 + +DisallowInContext: 2048, + // 4096 + +YieldContext: 4096, + // 8192 + +DecoratorContext: 8192, + // 16384 + +AwaitContext: 16384, + // 32768 + +ThisNodeHasError: 32768, + // 65536 + +JavaScriptFile: 65536, + // 131072 + +ThisNodeOrAnySubNodesHasError: 131072, + // 262144 + +HasAggregatedChildData: 262144, + // 2097152 + +JSDoc: 2097152, + // 16777216 + +JsonFile: 16777216, + // 3 + +BlockScoped: 3, + // 384 + +ReachabilityCheckFlags: 384, + // 1408 + +ReachabilityAndEmitFlags: 1408, + // 12679168 + +ContextFlags: 12679168, + // 20480 + +TypeExcludesFlags: 20480, + ... + }; + + declare var ModifierFlags: { + // 0 + +None: 0, + // 1 + +Export: 1, + // 2 + +Ambient: 2, + // 4 + +Public: 4, + // 8 + +Private: 8, + // 16 + +Protected: 16, + // 32 + +Static: 32, + // 64 + +Readonly: 64, + // 128 + +Abstract: 128, + // 256 + +Async: 256, + // 512 + +Default: 512, + // 2048 + +Const: 2048, + // 536870912 + +HasComputedFlags: 536870912, + // 28 + +AccessibilityModifier: 28, + // 92 + +ParameterPropertyModifier: 92, + // 24 + +NonPublicAccessibilityModifier: 24, + // 2270 + +TypeScriptModifier: 2270, + // 513 + +ExportDefault: 513, + // 3071 + +All: 3071, + ... + }; + + declare var JsxFlags: { + // 0 + +None: 0, + // 1 + +IntrinsicNamedElement: 1, + // 2 + +IntrinsicIndexedElement: 2, + // 3 + +IntrinsicElement: 3, + ... + }; + + declare type Node = { + ...$Exact, + kind: $Values, + flags: $Values, + decorators?: NodeArray, + modifiers?: ModifiersArray, + parent: any, + getSourceFile(): SourceFile, + getChildCount(sourceFile?: SourceFile): number, + getChildAt(index: number, sourceFile?: SourceFile): Node, + getChildren(sourceFile?: SourceFile): Node[], + getStart(sourceFile?: SourceFile, includeJsDocComment?: boolean): number, + getFullStart(): number, + getEnd(): number, + getWidth(sourceFile?: SourceFileLike): number, + getFullWidth(): number, + getLeadingTriviaWidth(sourceFile?: SourceFile): number, + getFullText(sourceFile?: SourceFile): string, + getText(sourceFile?: SourceFile): string, + getFirstToken(sourceFile?: SourceFile): Node | void, + getLastToken(sourceFile?: SourceFile): Node | void, + forEachChild( + cbNode: (node: Node) => T | void, + cbNodeArray?: (nodes: NodeArray) => T | void + ): T | void, + ... + }; + + declare type JSDocContainer = {...}; + + declare type HasJSDoc = + | ParameterDeclaration + | CallSignatureDeclaration + | ConstructSignatureDeclaration + | MethodSignature + | PropertySignature + | ArrowFunction + | ParenthesizedExpression + | SpreadAssignment + | ShorthandPropertyAssignment + | PropertyAssignment + | FunctionExpression + | LabeledStatement + | ExpressionStatement + | VariableStatement + | FunctionDeclaration + | ConstructorDeclaration + | MethodDeclaration + | PropertyDeclaration + | AccessorDeclaration + | ClassLikeDeclaration + | InterfaceDeclaration + | TypeAliasDeclaration + | EnumMember + | EnumDeclaration + | ModuleDeclaration + | ImportEqualsDeclaration + | IndexSignatureDeclaration + | FunctionTypeNode + | ConstructorTypeNode + | JSDocFunctionType + | ExportDeclaration + | EndOfFileToken; + declare type HasType = + | SignatureDeclaration + | VariableDeclaration + | ParameterDeclaration + | PropertySignature + | PropertyDeclaration + | TypePredicateNode + | ParenthesizedTypeNode + | TypeOperatorNode + | MappedTypeNode + | AssertionExpression + | TypeAliasDeclaration + | JSDocTypeExpression + | JSDocNonNullableType + | JSDocNullableType + | JSDocOptionalType + | JSDocVariadicType; + declare type HasInitializer = + | HasExpressionInitializer + | ForStatement + | ForInStatement + | ForOfStatement + | JsxAttribute; + declare type HasExpressionInitializer = + | VariableDeclaration + | ParameterDeclaration + | BindingElement + | PropertySignature + | PropertyDeclaration + | PropertyAssignment + | EnumMember; + declare type NodeArray> = { + ...$Exact, + hasTrailingComma?: boolean, + ... + } & $ReadOnlyArray; + + declare type Token> = { + ...$Exact, + kind: TKind, + ... + }; + + declare type DotDotDotToken = Token; + declare type QuestionToken = Token; + declare type ExclamationToken = Token; + declare type ColonToken = Token; + declare type EqualsToken = Token; + declare type AsteriskToken = Token; + declare type EqualsGreaterThanToken = Token< + typeof SyntaxKind.EqualsGreaterThanToken + >; + declare type EndOfFileToken = Token & + JSDocContainer; + declare type ReadonlyToken = Token; + declare type AwaitKeywordToken = Token; + declare type PlusToken = Token; + declare type MinusToken = Token; + declare type Modifier = + | Token + | Token + | Token + | Token + | Token + | Token + | Token + | Token + | Token + | Token + | Token; + declare type ModifiersArray = NodeArray; + declare type Identifier = { + ...$Exact, + ...$Exact, + kind: typeof SyntaxKind.Identifier, + escapedText: __String, + originalKeywordKind?: $Values, + isInJSDocNamespace?: boolean, + +text: string, + ... + }; + + declare type TransientIdentifier = { + ...$Exact, + resolvedSymbol: Symbol, + ... + }; + + declare type QualifiedName = { + ...$Exact, + kind: typeof SyntaxKind.QualifiedName, + left: EntityName, + right: Identifier, + ... + }; + + declare type EntityName = Identifier | QualifiedName; + declare type PropertyName = + | Identifier + | StringLiteral + | NumericLiteral + | ComputedPropertyName; + declare type DeclarationName = + | Identifier + | StringLiteralLike + | NumericLiteral + | ComputedPropertyName + | BindingPattern; + declare type Declaration = { + ...$Exact, + _declarationBrand: any, + ... + }; + + declare type NamedDeclaration = { + ...$Exact, + name?: DeclarationName, + ... + }; + + declare type DeclarationStatement = { + ...$Exact, + ...$Exact, + name?: Identifier | StringLiteral | NumericLiteral, + ... + }; + + declare type ComputedPropertyName = { + ...$Exact, + parent: Declaration, + kind: typeof SyntaxKind.ComputedPropertyName, + expression: Expression, + ... + }; + + declare type Decorator = { + ...$Exact, + kind: typeof SyntaxKind.Decorator, + parent: NamedDeclaration, + expression: LeftHandSideExpression, + ... + }; + + declare type TypeParameterDeclaration = { + ...$Exact, + kind: typeof SyntaxKind.TypeParameter, + parent: DeclarationWithTypeParameterChildren | InferTypeNode, + name: Identifier, + constraint?: TypeNode, + default?: TypeNode, + expression?: Expression, + ... + }; + + declare type SignatureDeclarationBase = { + ...$Exact, + ...$Exact, + kind: $ElementType, + name?: PropertyName, + typeParameters?: NodeArray, + parameters: NodeArray, + type?: TypeNode, + ... + }; + + declare type SignatureDeclaration = + | CallSignatureDeclaration + | ConstructSignatureDeclaration + | MethodSignature + | IndexSignatureDeclaration + | FunctionTypeNode + | ConstructorTypeNode + | JSDocFunctionType + | FunctionDeclaration + | MethodDeclaration + | ConstructorDeclaration + | AccessorDeclaration + | FunctionExpression + | ArrowFunction; + declare type CallSignatureDeclaration = { + ...$Exact, + ...$Exact, + kind: typeof SyntaxKind.CallSignature, + ... + }; + + declare type ConstructSignatureDeclaration = { + ...$Exact, + ...$Exact, + kind: typeof SyntaxKind.ConstructSignature, + ... + }; + + declare type BindingName = Identifier | BindingPattern; + declare type VariableDeclaration = { + ...$Exact, + kind: typeof SyntaxKind.VariableDeclaration, + parent: VariableDeclarationList | CatchClause, + name: BindingName, + exclamationToken?: ExclamationToken, + type?: TypeNode, + initializer?: Expression, + ... + }; + + declare type VariableDeclarationList = { + ...$Exact, + kind: typeof SyntaxKind.VariableDeclarationList, + parent: VariableStatement | ForStatement | ForOfStatement | ForInStatement, + declarations: NodeArray, + ... + }; + + declare type ParameterDeclaration = { + ...$Exact, + ...$Exact, + kind: typeof SyntaxKind.Parameter, + parent: SignatureDeclaration, + dotDotDotToken?: DotDotDotToken, + name: BindingName, + questionToken?: QuestionToken, + type?: TypeNode, + initializer?: Expression, + ... + }; + + declare type BindingElement = { + ...$Exact, + kind: typeof SyntaxKind.BindingElement, + parent: BindingPattern, + propertyName?: PropertyName, + dotDotDotToken?: DotDotDotToken, + name: BindingName, + initializer?: Expression, + ... + }; + + declare type PropertySignature = { + ...$Exact, + ...$Exact, + kind: typeof SyntaxKind.PropertySignature, + name: PropertyName, + questionToken?: QuestionToken, + type?: TypeNode, + initializer?: Expression, + ... + }; + + declare type PropertyDeclaration = { + ...$Exact, + ...$Exact, + kind: typeof SyntaxKind.PropertyDeclaration, + parent: ClassLikeDeclaration, + name: PropertyName, + questionToken?: QuestionToken, + exclamationToken?: ExclamationToken, + type?: TypeNode, + initializer?: Expression, + ... + }; + + declare type ObjectLiteralElement = { + ...$Exact, + _objectLiteralBrandBrand: any, + name?: PropertyName, + ... + }; + + declare type ObjectLiteralElementLike = + | PropertyAssignment + | ShorthandPropertyAssignment + | SpreadAssignment + | MethodDeclaration + | AccessorDeclaration; + declare type PropertyAssignment = { + ...$Exact, + ...$Exact, + parent: ObjectLiteralExpression, + kind: typeof SyntaxKind.PropertyAssignment, + name: PropertyName, + questionToken?: QuestionToken, + initializer: Expression, + ... + }; + + declare type ShorthandPropertyAssignment = { + ...$Exact, + ...$Exact, + parent: ObjectLiteralExpression, + kind: typeof SyntaxKind.ShorthandPropertyAssignment, + name: Identifier, + questionToken?: QuestionToken, + exclamationToken?: ExclamationToken, + equalsToken?: Token, + objectAssignmentInitializer?: Expression, + ... + }; + + declare type SpreadAssignment = { + ...$Exact, + ...$Exact, + parent: ObjectLiteralExpression, + kind: typeof SyntaxKind.SpreadAssignment, + expression: Expression, + ... + }; + + declare type VariableLikeDeclaration = + | VariableDeclaration + | ParameterDeclaration + | BindingElement + | PropertyDeclaration + | PropertyAssignment + | PropertySignature + | JsxAttribute + | ShorthandPropertyAssignment + | EnumMember + | JSDocPropertyTag + | JSDocParameterTag; + declare type PropertyLikeDeclaration = { + ...$Exact, + name: PropertyName, + ... + }; + + declare type ObjectBindingPattern = { + ...$Exact, + kind: typeof SyntaxKind.ObjectBindingPattern, + parent: VariableDeclaration | ParameterDeclaration | BindingElement, + elements: NodeArray, + ... + }; + + declare type ArrayBindingPattern = { + ...$Exact, + kind: typeof SyntaxKind.ArrayBindingPattern, + parent: VariableDeclaration | ParameterDeclaration | BindingElement, + elements: NodeArray, + ... + }; + + declare type BindingPattern = ObjectBindingPattern | ArrayBindingPattern; + declare type ArrayBindingElement = BindingElement | OmittedExpression; + declare type FunctionLikeDeclarationBase = { + ...$Exact, + _functionLikeDeclarationBrand: any, + asteriskToken?: AsteriskToken, + questionToken?: QuestionToken, + exclamationToken?: ExclamationToken, + body?: Block | Expression, + ... + }; + + declare type FunctionLikeDeclaration = + | FunctionDeclaration + | MethodDeclaration + | GetAccessorDeclaration + | SetAccessorDeclaration + | ConstructorDeclaration + | FunctionExpression + | ArrowFunction; + declare type FunctionLike = SignatureDeclaration; + declare type FunctionDeclaration = { + ...$Exact, + ...$Exact, + kind: typeof SyntaxKind.FunctionDeclaration, + name?: Identifier, + body?: FunctionBody, + ... + }; + + declare type MethodSignature = { + ...$Exact, + ...$Exact, + kind: typeof SyntaxKind.MethodSignature, + parent: ObjectTypeDeclaration, + name: PropertyName, + ... + }; + + declare type MethodDeclaration = { + ...$Exact, + ...$Exact, + ...$Exact, + ...$Exact, + kind: typeof SyntaxKind.MethodDeclaration, + parent: ClassLikeDeclaration | ObjectLiteralExpression, + name: PropertyName, + body?: FunctionBody, + ... + }; + + declare type ConstructorDeclaration = { + ...$Exact, + ...$Exact, + ...$Exact, + kind: typeof SyntaxKind.Constructor, + parent: ClassLikeDeclaration, + body?: FunctionBody, + ... + }; + + declare type SemicolonClassElement = { + ...$Exact, + kind: typeof SyntaxKind.SemicolonClassElement, + parent: ClassLikeDeclaration, + ... + }; + + declare type GetAccessorDeclaration = { + ...$Exact, + ...$Exact, + ...$Exact, + ...$Exact, + kind: typeof SyntaxKind.GetAccessor, + parent: ClassLikeDeclaration | ObjectLiteralExpression, + name: PropertyName, + body?: FunctionBody, + ... + }; + + declare type SetAccessorDeclaration = { + ...$Exact, + ...$Exact, + ...$Exact, + ...$Exact, + kind: typeof SyntaxKind.SetAccessor, + parent: ClassLikeDeclaration | ObjectLiteralExpression, + name: PropertyName, + body?: FunctionBody, + ... + }; + + declare type AccessorDeclaration = + | GetAccessorDeclaration + | SetAccessorDeclaration; + declare type IndexSignatureDeclaration = { + ...$Exact, + ...$Exact, + ...$Exact, + kind: typeof SyntaxKind.IndexSignature, + parent: ObjectTypeDeclaration, + ... + }; + + declare type TypeNode = { + ...$Exact, + _typeNodeBrand: any, + ... + }; + + declare type KeywordTypeNode = { + ...$Exact, + kind: + | typeof SyntaxKind.AnyKeyword + | typeof SyntaxKind.UnknownKeyword + | typeof SyntaxKind.NumberKeyword + | typeof SyntaxKind.BigIntKeyword + | typeof SyntaxKind.ObjectKeyword + | typeof SyntaxKind.BooleanKeyword + | typeof SyntaxKind.StringKeyword + | typeof SyntaxKind.SymbolKeyword + | typeof SyntaxKind.ThisKeyword + | typeof SyntaxKind.VoidKeyword + | typeof SyntaxKind.UndefinedKeyword + | typeof SyntaxKind.NullKeyword + | typeof SyntaxKind.NeverKeyword, + ... + }; + + declare type ImportTypeNode = { + ...$Exact, + kind: typeof SyntaxKind.ImportType, + isTypeOf?: boolean, + argument: TypeNode, + qualifier?: EntityName, + ... + }; + + declare type ThisTypeNode = { + ...$Exact, + kind: typeof SyntaxKind.ThisType, + ... + }; + + declare type FunctionOrConstructorTypeNode = + | FunctionTypeNode + | ConstructorTypeNode; + declare type FunctionOrConstructorTypeNodeBase = { + ...$Exact, + ...$Exact, + kind: typeof SyntaxKind.FunctionType | typeof SyntaxKind.ConstructorType, + type: TypeNode, + ... + }; + + declare type FunctionTypeNode = { + ...$Exact, + kind: typeof SyntaxKind.FunctionType, + ... + }; + + declare type ConstructorTypeNode = { + ...$Exact, + kind: typeof SyntaxKind.ConstructorType, + ... + }; + + declare type NodeWithTypeArguments = { + ...$Exact, + typeArguments?: NodeArray, + ... + }; + + declare type TypeReferenceType = + | TypeReferenceNode + | ExpressionWithTypeArguments; + declare type TypeReferenceNode = { + ...$Exact, + kind: typeof SyntaxKind.TypeReference, + typeName: EntityName, + ... + }; + + declare type TypePredicateNode = { + ...$Exact, + kind: typeof SyntaxKind.TypePredicate, + parent: SignatureDeclaration | JSDocTypeExpression, + parameterName: Identifier | ThisTypeNode, + type: TypeNode, + ... + }; + + declare type TypeQueryNode = { + ...$Exact, + kind: typeof SyntaxKind.TypeQuery, + exprName: EntityName, + ... + }; + + declare type TypeLiteralNode = { + ...$Exact, + ...$Exact, + kind: typeof SyntaxKind.TypeLiteral, + members: NodeArray, + ... + }; + + declare type ArrayTypeNode = { + ...$Exact, + kind: typeof SyntaxKind.ArrayType, + elementType: TypeNode, + ... + }; + + declare type TupleTypeNode = { + ...$Exact, + kind: typeof SyntaxKind.TupleType, + elementTypes: NodeArray, + ... + }; + + declare type OptionalTypeNode = { + ...$Exact, + kind: typeof SyntaxKind.OptionalType, + type: TypeNode, + ... + }; + + declare type RestTypeNode = { + ...$Exact, + kind: typeof SyntaxKind.RestType, + type: TypeNode, + ... + }; + + declare type UnionOrIntersectionTypeNode = + | UnionTypeNode + | IntersectionTypeNode; + declare type UnionTypeNode = { + ...$Exact, + kind: typeof SyntaxKind.UnionType, + types: NodeArray, + ... + }; + + declare type IntersectionTypeNode = { + ...$Exact, + kind: typeof SyntaxKind.IntersectionType, + types: NodeArray, + ... + }; + + declare type ConditionalTypeNode = { + ...$Exact, + kind: typeof SyntaxKind.ConditionalType, + checkType: TypeNode, + extendsType: TypeNode, + trueType: TypeNode, + falseType: TypeNode, + ... + }; + + declare type InferTypeNode = { + ...$Exact, + kind: typeof SyntaxKind.InferType, + typeParameter: TypeParameterDeclaration, + ... + }; + + declare type ParenthesizedTypeNode = { + ...$Exact, + kind: typeof SyntaxKind.ParenthesizedType, + type: TypeNode, + ... + }; + + declare type TypeOperatorNode = { + ...$Exact, + kind: typeof SyntaxKind.TypeOperator, + operator: typeof SyntaxKind.KeyOfKeyword | typeof SyntaxKind.UniqueKeyword, + type: TypeNode, + ... + }; + + declare type IndexedAccessTypeNode = { + ...$Exact, + kind: typeof SyntaxKind.IndexedAccessType, + objectType: TypeNode, + indexType: TypeNode, + ... + }; + + declare type MappedTypeNode = { + ...$Exact, + ...$Exact, + kind: typeof SyntaxKind.MappedType, + readonlyToken?: ReadonlyToken | PlusToken | MinusToken, + typeParameter: TypeParameterDeclaration, + questionToken?: QuestionToken | PlusToken | MinusToken, + type?: TypeNode, + ... + }; + + declare type LiteralTypeNode = { + ...$Exact, + kind: typeof SyntaxKind.LiteralType, + literal: BooleanLiteral | LiteralExpression | PrefixUnaryExpression, + ... + }; + + declare type StringLiteral = { + ...$Exact, + kind: typeof SyntaxKind.StringLiteral, + ... + }; + + declare type StringLiteralLike = + | StringLiteral + | NoSubstitutionTemplateLiteral; + declare type Expression = { + ...$Exact, + _expressionBrand: any, + ... + }; + + declare type OmittedExpression = { + ...$Exact, + kind: typeof SyntaxKind.OmittedExpression, + ... + }; + + declare type PartiallyEmittedExpression = { + ...$Exact, + kind: typeof SyntaxKind.PartiallyEmittedExpression, + expression: Expression, + ... + }; + + declare type UnaryExpression = { + ...$Exact, + _unaryExpressionBrand: any, + ... + }; + + declare type IncrementExpression = UpdateExpression; + declare type UpdateExpression = { + ...$Exact, + _updateExpressionBrand: any, + ... + }; + + declare type PrefixUnaryOperator = + | typeof SyntaxKind.PlusPlusToken + | typeof SyntaxKind.MinusMinusToken + | typeof SyntaxKind.PlusToken + | typeof SyntaxKind.MinusToken + | typeof SyntaxKind.TildeToken + | typeof SyntaxKind.ExclamationToken; + declare type PrefixUnaryExpression = { + ...$Exact, + kind: typeof SyntaxKind.PrefixUnaryExpression, + operator: PrefixUnaryOperator, + operand: UnaryExpression, + ... + }; + + declare type PostfixUnaryOperator = + | typeof SyntaxKind.PlusPlusToken + | typeof SyntaxKind.MinusMinusToken; + declare type PostfixUnaryExpression = { + ...$Exact, + kind: typeof SyntaxKind.PostfixUnaryExpression, + operand: LeftHandSideExpression, + operator: PostfixUnaryOperator, + ... + }; + + declare type LeftHandSideExpression = { + ...$Exact, + _leftHandSideExpressionBrand: any, + ... + }; + + declare type MemberExpression = { + ...$Exact, + _memberExpressionBrand: any, + ... + }; + + declare type PrimaryExpression = { + ...$Exact, + _primaryExpressionBrand: any, + ... + }; + + declare type NullLiteral = { + ...$Exact, + ...$Exact, + kind: typeof SyntaxKind.NullKeyword, + ... + }; + + declare type BooleanLiteral = { + ...$Exact, + ...$Exact, + kind: typeof SyntaxKind.TrueKeyword | typeof SyntaxKind.FalseKeyword, + ... + }; + + declare type ThisExpression = { + ...$Exact, + ...$Exact, + kind: typeof SyntaxKind.ThisKeyword, + ... + }; + + declare type SuperExpression = { + ...$Exact, + kind: typeof SyntaxKind.SuperKeyword, + ... + }; + + declare type ImportExpression = { + ...$Exact, + kind: typeof SyntaxKind.ImportKeyword, + ... + }; + + declare type DeleteExpression = { + ...$Exact, + kind: typeof SyntaxKind.DeleteExpression, + expression: UnaryExpression, + ... + }; + + declare type TypeOfExpression = { + ...$Exact, + kind: typeof SyntaxKind.TypeOfExpression, + expression: UnaryExpression, + ... + }; + + declare type VoidExpression = { + ...$Exact, + kind: typeof SyntaxKind.VoidExpression, + expression: UnaryExpression, + ... + }; + + declare type AwaitExpression = { + ...$Exact, + kind: typeof SyntaxKind.AwaitExpression, + expression: UnaryExpression, + ... + }; + + declare type YieldExpression = { + ...$Exact, + kind: typeof SyntaxKind.YieldExpression, + asteriskToken?: AsteriskToken, + expression?: Expression, + ... + }; + + declare type SyntheticExpression = { + ...$Exact, + kind: typeof SyntaxKind.SyntheticExpression, + isSpread: boolean, + type: Type, + ... + }; + + declare type ExponentiationOperator = typeof SyntaxKind.AsteriskAsteriskToken; + declare type MultiplicativeOperator = + | typeof SyntaxKind.AsteriskToken + | typeof SyntaxKind.SlashToken + | typeof SyntaxKind.PercentToken; + declare type MultiplicativeOperatorOrHigher = + | ExponentiationOperator + | MultiplicativeOperator; + declare type AdditiveOperator = + | typeof SyntaxKind.PlusToken + | typeof SyntaxKind.MinusToken; + declare type AdditiveOperatorOrHigher = + | MultiplicativeOperatorOrHigher + | AdditiveOperator; + declare type ShiftOperator = + | typeof SyntaxKind.LessThanLessThanToken + | typeof SyntaxKind.GreaterThanGreaterThanToken + | typeof SyntaxKind.GreaterThanGreaterThanGreaterThanToken; + declare type ShiftOperatorOrHigher = AdditiveOperatorOrHigher | ShiftOperator; + declare type RelationalOperator = + | typeof SyntaxKind.LessThanToken + | typeof SyntaxKind.LessThanEqualsToken + | typeof SyntaxKind.GreaterThanToken + | typeof SyntaxKind.GreaterThanEqualsToken + | typeof SyntaxKind.InstanceOfKeyword + | typeof SyntaxKind.InKeyword; + declare type RelationalOperatorOrHigher = + | ShiftOperatorOrHigher + | RelationalOperator; + declare type EqualityOperator = + | typeof SyntaxKind.EqualsEqualsToken + | typeof SyntaxKind.EqualsEqualsEqualsToken + | typeof SyntaxKind.ExclamationEqualsEqualsToken + | typeof SyntaxKind.ExclamationEqualsToken; + declare type EqualityOperatorOrHigher = + | RelationalOperatorOrHigher + | EqualityOperator; + declare type BitwiseOperator = + | typeof SyntaxKind.AmpersandToken + | typeof SyntaxKind.BarToken + | typeof SyntaxKind.CaretToken; + declare type BitwiseOperatorOrHigher = + | EqualityOperatorOrHigher + | BitwiseOperator; + declare type LogicalOperator = + | typeof SyntaxKind.AmpersandAmpersandToken + | typeof SyntaxKind.BarBarToken; + declare type LogicalOperatorOrHigher = + | BitwiseOperatorOrHigher + | LogicalOperator; + declare type CompoundAssignmentOperator = + | typeof SyntaxKind.PlusEqualsToken + | typeof SyntaxKind.MinusEqualsToken + | typeof SyntaxKind.AsteriskAsteriskEqualsToken + | typeof SyntaxKind.AsteriskEqualsToken + | typeof SyntaxKind.SlashEqualsToken + | typeof SyntaxKind.PercentEqualsToken + | typeof SyntaxKind.AmpersandEqualsToken + | typeof SyntaxKind.BarEqualsToken + | typeof SyntaxKind.CaretEqualsToken + | typeof SyntaxKind.LessThanLessThanEqualsToken + | typeof SyntaxKind.GreaterThanGreaterThanGreaterThanEqualsToken + | typeof SyntaxKind.GreaterThanGreaterThanEqualsToken; + declare type AssignmentOperator = + | typeof SyntaxKind.EqualsToken + | CompoundAssignmentOperator; + declare type AssignmentOperatorOrHigher = + | LogicalOperatorOrHigher + | AssignmentOperator; + declare type BinaryOperator = + | AssignmentOperatorOrHigher + | typeof SyntaxKind.CommaToken; + declare type BinaryOperatorToken = Token; + declare type BinaryExpression = { + ...$Exact, + ...$Exact, + kind: typeof SyntaxKind.BinaryExpression, + left: Expression, + operatorToken: BinaryOperatorToken, + right: Expression, + ... + }; + + declare type AssignmentOperatorToken = Token; + declare type AssignmentExpression = { + ...$Exact, + left: LeftHandSideExpression, + operatorToken: TOperator, + ... + }; + + declare type ObjectDestructuringAssignment = { + ...$Exact>, + left: ObjectLiteralExpression, + ... + }; + + declare type ArrayDestructuringAssignment = { + ...$Exact>, + left: ArrayLiteralExpression, + ... + }; + + declare type DestructuringAssignment = + | ObjectDestructuringAssignment + | ArrayDestructuringAssignment; + declare type BindingOrAssignmentElement = + | VariableDeclaration + | ParameterDeclaration + | BindingElement + | PropertyAssignment + | ShorthandPropertyAssignment + | SpreadAssignment + | OmittedExpression + | SpreadElement + | ArrayLiteralExpression + | ObjectLiteralExpression + | AssignmentExpression + | Identifier + | PropertyAccessExpression + | ElementAccessExpression; + declare type BindingOrAssignmentElementRestIndicator = + | DotDotDotToken + | SpreadElement + | SpreadAssignment; + declare type BindingOrAssignmentElementTarget = + | BindingOrAssignmentPattern + | Identifier + | PropertyAccessExpression + | ElementAccessExpression + | OmittedExpression; + declare type ObjectBindingOrAssignmentPattern = + | ObjectBindingPattern + | ObjectLiteralExpression; + declare type ArrayBindingOrAssignmentPattern = + | ArrayBindingPattern + | ArrayLiteralExpression; + declare type AssignmentPattern = + | ObjectLiteralExpression + | ArrayLiteralExpression; + declare type BindingOrAssignmentPattern = + | ObjectBindingOrAssignmentPattern + | ArrayBindingOrAssignmentPattern; + declare type ConditionalExpression = { + ...$Exact, + kind: typeof SyntaxKind.ConditionalExpression, + condition: Expression, + questionToken: QuestionToken, + whenTrue: Expression, + colonToken: ColonToken, + whenFalse: Expression, + ... + }; + + declare type FunctionBody = Block; + declare type ConciseBody = FunctionBody | Expression; + declare type FunctionExpression = { + ...$Exact, + ...$Exact, + ...$Exact, + kind: typeof SyntaxKind.FunctionExpression, + name?: Identifier, + body: FunctionBody, + ... + }; + + declare type ArrowFunction = { + ...$Exact, + ...$Exact, + ...$Exact, + kind: typeof SyntaxKind.ArrowFunction, + equalsGreaterThanToken: EqualsGreaterThanToken, + body: ConciseBody, + name: empty, + ... + }; + + declare type LiteralLikeNode = { + ...$Exact, + text: string, + isUnterminated?: boolean, + hasExtendedUnicodeEscape?: boolean, + ... + }; + + declare type LiteralExpression = { + ...$Exact, + ...$Exact, + _literalExpressionBrand: any, + ... + }; + + declare type RegularExpressionLiteral = { + ...$Exact, + kind: typeof SyntaxKind.RegularExpressionLiteral, + ... + }; + + declare type NoSubstitutionTemplateLiteral = { + ...$Exact, + kind: typeof SyntaxKind.NoSubstitutionTemplateLiteral, + ... + }; + + declare type NumericLiteral = { + ...$Exact, + kind: typeof SyntaxKind.NumericLiteral, + ... + }; + + declare type BigIntLiteral = { + ...$Exact, + kind: typeof SyntaxKind.BigIntLiteral, + ... + }; + + declare type TemplateHead = { + ...$Exact, + kind: typeof SyntaxKind.TemplateHead, + parent: TemplateExpression, + ... + }; + + declare type TemplateMiddle = { + ...$Exact, + kind: typeof SyntaxKind.TemplateMiddle, + parent: TemplateSpan, + ... + }; + + declare type TemplateTail = { + ...$Exact, + kind: typeof SyntaxKind.TemplateTail, + parent: TemplateSpan, + ... + }; + + declare type TemplateLiteral = + | TemplateExpression + | NoSubstitutionTemplateLiteral; + declare type TemplateExpression = { + ...$Exact, + kind: typeof SyntaxKind.TemplateExpression, + head: TemplateHead, + templateSpans: NodeArray, + ... + }; + + declare type TemplateSpan = { + ...$Exact, + kind: typeof SyntaxKind.TemplateSpan, + parent: TemplateExpression, + expression: Expression, + literal: TemplateMiddle | TemplateTail, + ... + }; + + declare type ParenthesizedExpression = { + ...$Exact, + ...$Exact, + kind: typeof SyntaxKind.ParenthesizedExpression, + expression: Expression, + ... + }; + + declare type ArrayLiteralExpression = { + ...$Exact, + kind: typeof SyntaxKind.ArrayLiteralExpression, + elements: NodeArray, + ... + }; + + declare type SpreadElement = { + ...$Exact, + kind: typeof SyntaxKind.SpreadElement, + parent: ArrayLiteralExpression | CallExpression | NewExpression, + expression: Expression, + ... + }; + + declare type ObjectLiteralExpressionBase = { + ...$Exact, + ...$Exact, + properties: NodeArray, + ... + }; + + declare type ObjectLiteralExpression = { + ...$Exact>, + kind: typeof SyntaxKind.ObjectLiteralExpression, + ... + }; + + declare type EntityNameExpression = + | Identifier + | PropertyAccessEntityNameExpression; + declare type EntityNameOrEntityNameExpression = + | EntityName + | EntityNameExpression; + declare type PropertyAccessExpression = { + ...$Exact, + ...$Exact, + kind: typeof SyntaxKind.PropertyAccessExpression, + expression: LeftHandSideExpression, + name: Identifier, + ... + }; + + declare type SuperPropertyAccessExpression = { + ...$Exact, + expression: SuperExpression, + ... + }; + + declare type PropertyAccessEntityNameExpression = { + ...$Exact, + _propertyAccessExpressionLikeQualifiedNameBrand?: any, + expression: EntityNameExpression, + ... + }; + + declare type ElementAccessExpression = { + ...$Exact, + kind: typeof SyntaxKind.ElementAccessExpression, + expression: LeftHandSideExpression, + argumentExpression: Expression, + ... + }; + + declare type SuperElementAccessExpression = { + ...$Exact, + expression: SuperExpression, + ... + }; + + declare type SuperProperty = + | SuperPropertyAccessExpression + | SuperElementAccessExpression; + declare type CallExpression = { + ...$Exact, + ...$Exact, + kind: typeof SyntaxKind.CallExpression, + expression: LeftHandSideExpression, + typeArguments?: NodeArray, + arguments: NodeArray, + ... + }; + + declare type SuperCall = { + ...$Exact, + expression: SuperExpression, + ... + }; + + declare type ImportCall = { + ...$Exact, + expression: ImportExpression, + ... + }; + + declare type ExpressionWithTypeArguments = { + ...$Exact, + kind: typeof SyntaxKind.ExpressionWithTypeArguments, + parent: HeritageClause | JSDocAugmentsTag, + expression: LeftHandSideExpression, + ... + }; + + declare type NewExpression = { + ...$Exact, + ...$Exact, + kind: typeof SyntaxKind.NewExpression, + expression: LeftHandSideExpression, + typeArguments?: NodeArray, + arguments?: NodeArray, + ... + }; + + declare type TaggedTemplateExpression = { + ...$Exact, + kind: typeof SyntaxKind.TaggedTemplateExpression, + tag: LeftHandSideExpression, + typeArguments?: NodeArray, + template: TemplateLiteral, + ... + }; + + declare type CallLikeExpression = + | CallExpression + | NewExpression + | TaggedTemplateExpression + | Decorator + | JsxOpeningLikeElement; + declare type AsExpression = { + ...$Exact, + kind: typeof SyntaxKind.AsExpression, + expression: Expression, + type: TypeNode, + ... + }; + + declare type TypeAssertion = { + ...$Exact, + kind: typeof SyntaxKind.TypeAssertionExpression, + type: TypeNode, + expression: UnaryExpression, + ... + }; + + declare type AssertionExpression = TypeAssertion | AsExpression; + declare type NonNullExpression = { + ...$Exact, + kind: typeof SyntaxKind.NonNullExpression, + expression: Expression, + ... + }; + + declare type MetaProperty = { + ...$Exact, + kind: typeof SyntaxKind.MetaProperty, + keywordToken: + | typeof SyntaxKind.NewKeyword + | typeof SyntaxKind.ImportKeyword, + name: Identifier, + ... + }; + + declare type JsxElement = { + ...$Exact, + kind: typeof SyntaxKind.JsxElement, + openingElement: JsxOpeningElement, + children: NodeArray, + closingElement: JsxClosingElement, + ... + }; + + declare type JsxOpeningLikeElement = + | JsxSelfClosingElement + | JsxOpeningElement; + declare type JsxAttributeLike = JsxAttribute | JsxSpreadAttribute; + declare type JsxTagNameExpression = + | Identifier + | ThisExpression + | JsxTagNamePropertyAccess; + declare type JsxTagNamePropertyAccess = { + ...$Exact, + expression: JsxTagNameExpression, + ... + }; + + declare type JsxAttributes = { + ...$Exact>, + parent: JsxOpeningLikeElement, + ... + }; + + declare type JsxOpeningElement = { + ...$Exact, + kind: typeof SyntaxKind.JsxOpeningElement, + parent: JsxElement, + tagName: JsxTagNameExpression, + typeArguments?: NodeArray, + attributes: JsxAttributes, + ... + }; + + declare type JsxSelfClosingElement = { + ...$Exact, + kind: typeof SyntaxKind.JsxSelfClosingElement, + tagName: JsxTagNameExpression, + typeArguments?: NodeArray, + attributes: JsxAttributes, + ... + }; + + declare type JsxFragment = { + ...$Exact, + kind: typeof SyntaxKind.JsxFragment, + openingFragment: JsxOpeningFragment, + children: NodeArray, + closingFragment: JsxClosingFragment, + ... + }; + + declare type JsxOpeningFragment = { + ...$Exact, + kind: typeof SyntaxKind.JsxOpeningFragment, + parent: JsxFragment, + ... + }; + + declare type JsxClosingFragment = { + ...$Exact, + kind: typeof SyntaxKind.JsxClosingFragment, + parent: JsxFragment, + ... + }; + + declare type JsxAttribute = { + ...$Exact, + kind: typeof SyntaxKind.JsxAttribute, + parent: JsxAttributes, + name: Identifier, + initializer?: StringLiteral | JsxExpression, + ... + }; + + declare type JsxSpreadAttribute = { + ...$Exact, + kind: typeof SyntaxKind.JsxSpreadAttribute, + parent: JsxAttributes, + expression: Expression, + ... + }; + + declare type JsxClosingElement = { + ...$Exact, + kind: typeof SyntaxKind.JsxClosingElement, + parent: JsxElement, + tagName: JsxTagNameExpression, + ... + }; + + declare type JsxExpression = { + ...$Exact, + kind: typeof SyntaxKind.JsxExpression, + parent: JsxElement | JsxAttributeLike, + dotDotDotToken?: Token, + expression?: Expression, + ... + }; + + declare type JsxText = { + ...$Exact, + kind: typeof SyntaxKind.JsxText, + containsOnlyWhiteSpaces: boolean, + parent: JsxElement, + ... + }; + + declare type JsxChild = + | JsxText + | JsxExpression + | JsxElement + | JsxSelfClosingElement + | JsxFragment; + declare type Statement = { + ...$Exact, + _statementBrand: any, + ... + }; + + declare type NotEmittedStatement = { + ...$Exact, + kind: typeof SyntaxKind.NotEmittedStatement, + ... + }; + + declare type CommaListExpression = { + ...$Exact, + kind: typeof SyntaxKind.CommaListExpression, + elements: NodeArray, + ... + }; + + declare type EmptyStatement = { + ...$Exact, + kind: typeof SyntaxKind.EmptyStatement, + ... + }; + + declare type DebuggerStatement = { + ...$Exact, + kind: typeof SyntaxKind.DebuggerStatement, + ... + }; + + declare type MissingDeclaration = { + ...$Exact, + kind: typeof SyntaxKind.MissingDeclaration, + name?: Identifier, + ... + }; + + declare type BlockLike = + | SourceFile + | Block + | ModuleBlock + | CaseOrDefaultClause; + declare type Block = { + ...$Exact, + kind: typeof SyntaxKind.Block, + statements: NodeArray, + ... + }; + + declare type VariableStatement = { + ...$Exact, + ...$Exact, + kind: typeof SyntaxKind.VariableStatement, + declarationList: VariableDeclarationList, + ... + }; + + declare type ExpressionStatement = { + ...$Exact, + ...$Exact, + kind: typeof SyntaxKind.ExpressionStatement, + expression: Expression, + ... + }; + + declare type IfStatement = { + ...$Exact, + kind: typeof SyntaxKind.IfStatement, + expression: Expression, + thenStatement: Statement, + elseStatement?: Statement, + ... + }; + + declare type IterationStatement = { + ...$Exact, + statement: Statement, + ... + }; + + declare type DoStatement = { + ...$Exact, + kind: typeof SyntaxKind.DoStatement, + expression: Expression, + ... + }; + + declare type WhileStatement = { + ...$Exact, + kind: typeof SyntaxKind.WhileStatement, + expression: Expression, + ... + }; + + declare type ForInitializer = VariableDeclarationList | Expression; + declare type ForStatement = { + ...$Exact, + kind: typeof SyntaxKind.ForStatement, + initializer?: ForInitializer, + condition?: Expression, + incrementor?: Expression, + ... + }; + + declare type ForInOrOfStatement = ForInStatement | ForOfStatement; + declare type ForInStatement = { + ...$Exact, + kind: typeof SyntaxKind.ForInStatement, + initializer: ForInitializer, + expression: Expression, + ... + }; + + declare type ForOfStatement = { + ...$Exact, + kind: typeof SyntaxKind.ForOfStatement, + awaitModifier?: AwaitKeywordToken, + initializer: ForInitializer, + expression: Expression, + ... + }; + + declare type BreakStatement = { + ...$Exact, + kind: typeof SyntaxKind.BreakStatement, + label?: Identifier, + ... + }; + + declare type ContinueStatement = { + ...$Exact, + kind: typeof SyntaxKind.ContinueStatement, + label?: Identifier, + ... + }; + + declare type BreakOrContinueStatement = BreakStatement | ContinueStatement; + declare type ReturnStatement = { + ...$Exact, + kind: typeof SyntaxKind.ReturnStatement, + expression?: Expression, + ... + }; + + declare type WithStatement = { + ...$Exact, + kind: typeof SyntaxKind.WithStatement, + expression: Expression, + statement: Statement, + ... + }; + + declare type SwitchStatement = { + ...$Exact, + kind: typeof SyntaxKind.SwitchStatement, + expression: Expression, + caseBlock: CaseBlock, + possiblyExhaustive?: boolean, + ... + }; + + declare type CaseBlock = { + ...$Exact, + kind: typeof SyntaxKind.CaseBlock, + parent: SwitchStatement, + clauses: NodeArray, + ... + }; + + declare type CaseClause = { + ...$Exact, + kind: typeof SyntaxKind.CaseClause, + parent: CaseBlock, + expression: Expression, + statements: NodeArray, + ... + }; + + declare type DefaultClause = { + ...$Exact, + kind: typeof SyntaxKind.DefaultClause, + parent: CaseBlock, + statements: NodeArray, + ... + }; + + declare type CaseOrDefaultClause = CaseClause | DefaultClause; + declare type LabeledStatement = { + ...$Exact, + ...$Exact, + kind: typeof SyntaxKind.LabeledStatement, + label: Identifier, + statement: Statement, + ... + }; + + declare type ThrowStatement = { + ...$Exact, + kind: typeof SyntaxKind.ThrowStatement, + expression?: Expression, + ... + }; + + declare type TryStatement = { + ...$Exact, + kind: typeof SyntaxKind.TryStatement, + tryBlock: Block, + catchClause?: CatchClause, + finallyBlock?: Block, + ... + }; + + declare type CatchClause = { + ...$Exact, + kind: typeof SyntaxKind.CatchClause, + parent: TryStatement, + variableDeclaration?: VariableDeclaration, + block: Block, + ... + }; + + declare type ObjectTypeDeclaration = + | ClassLikeDeclaration + | InterfaceDeclaration + | TypeLiteralNode; + declare type DeclarationWithTypeParameters = + | DeclarationWithTypeParameterChildren + | JSDocTypedefTag + | JSDocCallbackTag + | JSDocSignature; + declare type DeclarationWithTypeParameterChildren = + | SignatureDeclaration + | ClassLikeDeclaration + | InterfaceDeclaration + | TypeAliasDeclaration + | JSDocTemplateTag; + declare type ClassLikeDeclarationBase = { + ...$Exact, + ...$Exact, + kind: + | typeof SyntaxKind.ClassDeclaration + | typeof SyntaxKind.ClassExpression, + name?: Identifier, + typeParameters?: NodeArray, + heritageClauses?: NodeArray, + members: NodeArray, + ... + }; + + declare type ClassDeclaration = { + ...$Exact, + ...$Exact, + kind: typeof SyntaxKind.ClassDeclaration, + name?: Identifier, + ... + }; + + declare type ClassExpression = { + ...$Exact, + ...$Exact, + kind: typeof SyntaxKind.ClassExpression, + ... + }; + + declare type ClassLikeDeclaration = ClassDeclaration | ClassExpression; + declare type ClassElement = { + ...$Exact, + _classElementBrand: any, + name?: PropertyName, + ... + }; + + declare type TypeElement = { + ...$Exact, + _typeElementBrand: any, + name?: PropertyName, + questionToken?: QuestionToken, + ... + }; + + declare type InterfaceDeclaration = { + ...$Exact, + ...$Exact, + kind: typeof SyntaxKind.InterfaceDeclaration, + name: Identifier, + typeParameters?: NodeArray, + heritageClauses?: NodeArray, + members: NodeArray, + ... + }; + + declare type HeritageClause = { + ...$Exact, + kind: typeof SyntaxKind.HeritageClause, + parent: InterfaceDeclaration | ClassLikeDeclaration, + token: + | typeof SyntaxKind.ExtendsKeyword + | typeof SyntaxKind.ImplementsKeyword, + types: NodeArray, + ... + }; + + declare type TypeAliasDeclaration = { + ...$Exact, + ...$Exact, + kind: typeof SyntaxKind.TypeAliasDeclaration, + name: Identifier, + typeParameters?: NodeArray, + type: TypeNode, + ... + }; + + declare type EnumMember = { + ...$Exact, + ...$Exact, + kind: typeof SyntaxKind.EnumMember, + parent: EnumDeclaration, + name: PropertyName, + initializer?: Expression, + ... + }; + + declare type EnumDeclaration = { + ...$Exact, + ...$Exact, + kind: typeof SyntaxKind.EnumDeclaration, + name: Identifier, + members: NodeArray, + ... + }; + + declare type ModuleName = Identifier | StringLiteral; + declare type ModuleBody = NamespaceBody | JSDocNamespaceBody; + declare type ModuleDeclaration = { + ...$Exact, + ...$Exact, + kind: typeof SyntaxKind.ModuleDeclaration, + parent: ModuleBody | SourceFile, + name: ModuleName, + body?: ModuleBody | JSDocNamespaceDeclaration, + ... + }; + + declare type NamespaceBody = ModuleBlock | NamespaceDeclaration; + declare type NamespaceDeclaration = { + ...$Exact, + name: Identifier, + body: NamespaceBody, + ... + }; + + declare type JSDocNamespaceBody = Identifier | JSDocNamespaceDeclaration; + declare type JSDocNamespaceDeclaration = { + ...$Exact, + name: Identifier, + body?: JSDocNamespaceBody, + ... + }; + + declare type ModuleBlock = { + ...$Exact, + ...$Exact, + kind: typeof SyntaxKind.ModuleBlock, + parent: ModuleDeclaration, + statements: NodeArray, + ... + }; + + declare type ModuleReference = EntityName | ExternalModuleReference; + declare type ImportEqualsDeclaration = { + ...$Exact, + ...$Exact, + kind: typeof SyntaxKind.ImportEqualsDeclaration, + parent: SourceFile | ModuleBlock, + name: Identifier, + moduleReference: ModuleReference, + ... + }; + + declare type ExternalModuleReference = { + ...$Exact, + kind: typeof SyntaxKind.ExternalModuleReference, + parent: ImportEqualsDeclaration, + expression: Expression, + ... + }; + + declare type ImportDeclaration = { + ...$Exact, + kind: typeof SyntaxKind.ImportDeclaration, + parent: SourceFile | ModuleBlock, + importClause?: ImportClause, + moduleSpecifier: Expression, + ... + }; + + declare type NamedImportBindings = NamespaceImport | NamedImports; + declare type ImportClause = { + ...$Exact, + kind: typeof SyntaxKind.ImportClause, + parent: ImportDeclaration, + name?: Identifier, + namedBindings?: NamedImportBindings, + ... + }; + + declare type NamespaceImport = { + ...$Exact, + kind: typeof SyntaxKind.NamespaceImport, + parent: ImportClause, + name: Identifier, + ... + }; + + declare type NamespaceExportDeclaration = { + ...$Exact, + kind: typeof SyntaxKind.NamespaceExportDeclaration, + name: Identifier, + ... + }; + + declare type ExportDeclaration = { + ...$Exact, + ...$Exact, + kind: typeof SyntaxKind.ExportDeclaration, + parent: SourceFile | ModuleBlock, + exportClause?: NamedExports, + moduleSpecifier?: Expression, + ... + }; + + declare type NamedImports = { + ...$Exact, + kind: typeof SyntaxKind.NamedImports, + parent: ImportClause, + elements: NodeArray, + ... + }; + + declare type NamedExports = { + ...$Exact, + kind: typeof SyntaxKind.NamedExports, + parent: ExportDeclaration, + elements: NodeArray, + ... + }; + + declare type NamedImportsOrExports = NamedImports | NamedExports; + declare type ImportSpecifier = { + ...$Exact, + kind: typeof SyntaxKind.ImportSpecifier, + parent: NamedImports, + propertyName?: Identifier, + name: Identifier, + ... + }; + + declare type ExportSpecifier = { + ...$Exact, + kind: typeof SyntaxKind.ExportSpecifier, + parent: NamedExports, + propertyName?: Identifier, + name: Identifier, + ... + }; + + declare type ImportOrExportSpecifier = ImportSpecifier | ExportSpecifier; + declare type ExportAssignment = { + ...$Exact, + kind: typeof SyntaxKind.ExportAssignment, + parent: SourceFile, + isExportEquals?: boolean, + expression: Expression, + ... + }; + + declare type FileReference = { + ...$Exact, + fileName: string, + ... + }; + + declare type CheckJsDirective = { + ...$Exact, + enabled: boolean, + ... + }; + + declare type CommentKind = + | typeof SyntaxKind.SingleLineCommentTrivia + | typeof SyntaxKind.MultiLineCommentTrivia; + declare type CommentRange = { + ...$Exact, + hasTrailingNewLine?: boolean, + kind: CommentKind, + ... + }; + + declare type SynthesizedComment = { + ...$Exact, + text: string, + pos: -1, + end: -1, + ... + }; + + declare type JSDocTypeExpression = { + ...$Exact, + kind: typeof SyntaxKind.JSDocTypeExpression, + type: TypeNode, + ... + }; + + declare type JSDocType = { + ...$Exact, + _jsDocTypeBrand: any, + ... + }; + + declare type JSDocAllType = { + ...$Exact, + kind: typeof SyntaxKind.JSDocAllType, + ... + }; + + declare type JSDocUnknownType = { + ...$Exact, + kind: typeof SyntaxKind.JSDocUnknownType, + ... + }; + + declare type JSDocNonNullableType = { + ...$Exact, + kind: typeof SyntaxKind.JSDocNonNullableType, + type: TypeNode, + ... + }; + + declare type JSDocNullableType = { + ...$Exact, + kind: typeof SyntaxKind.JSDocNullableType, + type: TypeNode, + ... + }; + + declare type JSDocOptionalType = { + ...$Exact, + kind: typeof SyntaxKind.JSDocOptionalType, + type: TypeNode, + ... + }; + + declare type JSDocFunctionType = { + ...$Exact, + ...$Exact, + kind: typeof SyntaxKind.JSDocFunctionType, + ... + }; + + declare type JSDocVariadicType = { + ...$Exact, + kind: typeof SyntaxKind.JSDocVariadicType, + type: TypeNode, + ... + }; + + declare type JSDocTypeReferencingNode = + | JSDocVariadicType + | JSDocOptionalType + | JSDocNullableType + | JSDocNonNullableType; + declare type JSDoc = { + ...$Exact, + kind: typeof SyntaxKind.JSDocComment, + parent: HasJSDoc, + tags?: NodeArray, + comment?: string, + ... + }; + + declare type JSDocTag = { + ...$Exact, + parent: JSDoc | JSDocTypeLiteral, + tagName: Identifier, + comment?: string, + ... + }; + + declare type JSDocUnknownTag = { + ...$Exact, + kind: typeof SyntaxKind.JSDocTag, + ... + }; + + declare type JSDocAugmentsTag = { + ...$Exact, + kind: typeof SyntaxKind.JSDocAugmentsTag, + class: ExpressionWithTypeArguments & { expression: Identifier | PropertyAccessEntityNameExpression, ... }, + ... + }; + + declare type JSDocClassTag = { + ...$Exact, + kind: typeof SyntaxKind.JSDocClassTag, + ... + }; + + declare type JSDocEnumTag = { + ...$Exact, + kind: typeof SyntaxKind.JSDocEnumTag, + typeExpression?: JSDocTypeExpression, + ... + }; + + declare type JSDocThisTag = { + ...$Exact, + kind: typeof SyntaxKind.JSDocThisTag, + typeExpression?: JSDocTypeExpression, + ... + }; + + declare type JSDocTemplateTag = { + ...$Exact, + kind: typeof SyntaxKind.JSDocTemplateTag, + constraint: JSDocTypeExpression | void, + typeParameters: NodeArray, + ... + }; + + declare type JSDocReturnTag = { + ...$Exact, + kind: typeof SyntaxKind.JSDocReturnTag, + typeExpression?: JSDocTypeExpression, + ... + }; + + declare type JSDocTypeTag = { + ...$Exact, + kind: typeof SyntaxKind.JSDocTypeTag, + typeExpression?: JSDocTypeExpression, + ... + }; + + declare type JSDocTypedefTag = { + ...$Exact, + ...$Exact, + parent: JSDoc, + kind: typeof SyntaxKind.JSDocTypedefTag, + fullName?: JSDocNamespaceDeclaration | Identifier, + name?: Identifier, + typeExpression?: JSDocTypeExpression | JSDocTypeLiteral, + ... + }; + + declare type JSDocCallbackTag = { + ...$Exact, + ...$Exact, + parent: JSDoc, + kind: typeof SyntaxKind.JSDocCallbackTag, + fullName?: JSDocNamespaceDeclaration | Identifier, + name?: Identifier, + typeExpression: JSDocSignature, + ... + }; + + declare type JSDocSignature = { + ...$Exact, + ...$Exact, + kind: typeof SyntaxKind.JSDocSignature, + typeParameters?: $ReadOnlyArray, + parameters: $ReadOnlyArray, + type: JSDocReturnTag | void, + ... + }; + + declare type JSDocPropertyLikeTag = { + ...$Exact, + ...$Exact, + parent: JSDoc, + name: EntityName, + typeExpression?: JSDocTypeExpression, + isNameFirst: boolean, + isBracketed: boolean, + ... + }; + + declare type JSDocPropertyTag = { + ...$Exact, + kind: typeof SyntaxKind.JSDocPropertyTag, + ... + }; + + declare type JSDocParameterTag = { + ...$Exact, + kind: typeof SyntaxKind.JSDocParameterTag, + ... + }; + + declare type JSDocTypeLiteral = { + ...$Exact, + kind: typeof SyntaxKind.JSDocTypeLiteral, + jsDocPropertyTags?: $ReadOnlyArray, + isArrayType?: boolean, + ... + }; + + declare var FlowFlags: { + // 1 + +Unreachable: 1, + // 2 + +Start: 2, + // 4 + +BranchLabel: 4, + // 8 + +LoopLabel: 8, + // 16 + +Assignment: 16, + // 32 + +TrueCondition: 32, + // 64 + +FalseCondition: 64, + // 128 + +SwitchClause: 128, + // 256 + +ArrayMutation: 256, + // 512 + +Referenced: 512, + // 1024 + +Shared: 1024, + // 2048 + +PreFinally: 2048, + // 4096 + +AfterFinally: 4096, + // 12 + +Label: 12, + // 96 + +Condition: 96, + ... + }; + + declare type FlowLock = { locked?: boolean, ... }; + + declare type AfterFinallyFlow = { + ...$Exact, + ...$Exact, + antecedent: FlowNode, + ... + }; + + declare type PreFinallyFlow = { + ...$Exact, + antecedent: FlowNode, + lock: FlowLock, + ... + }; + + declare type FlowNode = + | AfterFinallyFlow + | PreFinallyFlow + | FlowStart + | FlowLabel + | FlowAssignment + | FlowCondition + | FlowSwitchClause + | FlowArrayMutation; + declare type FlowNodeBase = { + flags: $Values, + id?: number, + ... + }; + + declare type FlowStart = { + ...$Exact, + container?: FunctionExpression | ArrowFunction | MethodDeclaration, + ... + }; + + declare type FlowLabel = { + ...$Exact, + antecedents: FlowNode[] | void, + ... + }; + + declare type FlowAssignment = { + ...$Exact, + node: Expression | VariableDeclaration | BindingElement, + antecedent: FlowNode, + ... + }; + + declare type FlowCondition = { + ...$Exact, + expression: Expression, + antecedent: FlowNode, + ... + }; + + declare type FlowSwitchClause = { + ...$Exact, + switchStatement: SwitchStatement, + clauseStart: number, + clauseEnd: number, + antecedent: FlowNode, + ... + }; + + declare type FlowArrayMutation = { + ...$Exact, + node: CallExpression | BinaryExpression, + antecedent: FlowNode, + ... + }; + + declare type FlowType = Type | IncompleteType; + declare type IncompleteType = { + flags: $Values, + type: Type, + ... + }; + + declare type AmdDependency = { + path: string, + name?: string, + ... + }; + + declare type SourceFile = { + ...$Exact, + kind: typeof SyntaxKind.SourceFile, + statements: NodeArray, + endOfFileToken: Token, + fileName: string, + text: string, + amdDependencies: $ReadOnlyArray, + moduleName?: string, + referencedFiles: $ReadOnlyArray, + typeReferenceDirectives: $ReadOnlyArray, + libReferenceDirectives: $ReadOnlyArray, + languageVariant: $Values, + isDeclarationFile: boolean, + hasNoDefaultLib: boolean, + languageVersion: $Values, + getLineAndCharacterOfPosition(pos: number): LineAndCharacter, + getLineEndOfPosition(pos: number): number, + getLineStarts(): $ReadOnlyArray, + getPositionOfLineAndCharacter(line: number, character: number): number, + update(newText: string, textChangeRange: TextChangeRange): SourceFile, + ... + }; + + declare type Bundle = { + ...$Exact, + kind: typeof SyntaxKind.Bundle, + prepends: $ReadOnlyArray, + sourceFiles: $ReadOnlyArray, + ... + }; + + declare type InputFiles = { + ...$Exact, + kind: typeof SyntaxKind.InputFiles, + javascriptPath?: string, + javascriptText: string, + javascriptMapPath?: string, + javascriptMapText?: string, + declarationPath?: string, + declarationText: string, + declarationMapPath?: string, + declarationMapText?: string, + ... + }; + + declare type UnparsedSource = { + ...$Exact, + kind: typeof SyntaxKind.UnparsedSource, + fileName?: string, + text: string, + sourceMapPath?: string, + sourceMapText?: string, + ... + }; + + declare type JsonSourceFile = { + ...$Exact, + statements: NodeArray, + ... + }; + + declare type TsConfigSourceFile = { + ...$Exact, + extendedSourceFiles?: string[], + ... + }; + + declare type JsonMinusNumericLiteral = { + ...$Exact, + kind: typeof SyntaxKind.PrefixUnaryExpression, + operator: typeof SyntaxKind.MinusToken, + operand: NumericLiteral, + ... + }; + + declare type JsonObjectExpressionStatement = { + ...$Exact, + expression: + | ObjectLiteralExpression + | ArrayLiteralExpression + | JsonMinusNumericLiteral + | NumericLiteral + | StringLiteral + | BooleanLiteral + | NullLiteral, + ... + }; + + declare type ScriptReferenceHost = { + getCompilerOptions(): CompilerOptions, + getSourceFile(fileName: string): SourceFile | void, + getSourceFileByPath(path: Path): SourceFile | void, + getCurrentDirectory(): string, + ... + }; + + declare type ParseConfigHost = { + useCaseSensitiveFileNames: boolean, + readDirectory( + rootDir: string, + extensions: $ReadOnlyArray, + excludes: $ReadOnlyArray | void, + includes: $ReadOnlyArray, + depth?: number + ): $ReadOnlyArray, + fileExists(path: string): boolean, + readFile(path: string): string | void, + trace?: (s: string) => void, + ... + }; + + declare type ResolvedConfigFileName = string & { _isResolvedConfigFileName: empty, ... }; + declare type WriteFileCallback = ( + fileName: string, + data: string, + writeByteOrderMark: boolean, + onError?: (message: string) => void, + sourceFiles?: $ReadOnlyArray + ) => void; + declare class OperationCanceledException {} + declare type CancellationToken = { + isCancellationRequested(): boolean, + throwIfCancellationRequested(): void, + ... + }; + + declare type Program = { + ...$Exact, + getRootFileNames(): $ReadOnlyArray, + getSourceFiles(): $ReadOnlyArray, + emit( + targetSourceFile?: SourceFile, + writeFile?: WriteFileCallback, + cancellationToken?: CancellationToken, + emitOnlyDtsFiles?: boolean, + customTransformers?: CustomTransformers + ): EmitResult, + getOptionsDiagnostics( + cancellationToken?: CancellationToken + ): $ReadOnlyArray, + getGlobalDiagnostics( + cancellationToken?: CancellationToken + ): $ReadOnlyArray, + getSyntacticDiagnostics( + sourceFile?: SourceFile, + cancellationToken?: CancellationToken + ): $ReadOnlyArray, + getSemanticDiagnostics( + sourceFile?: SourceFile, + cancellationToken?: CancellationToken + ): $ReadOnlyArray, + getDeclarationDiagnostics( + sourceFile?: SourceFile, + cancellationToken?: CancellationToken + ): $ReadOnlyArray, + getConfigFileParsingDiagnostics(): $ReadOnlyArray, + getTypeChecker(): TypeChecker, + isSourceFileFromExternalLibrary(file: SourceFile): boolean, + isSourceFileDefaultLibrary(file: SourceFile): boolean, + getProjectReferences(): $ReadOnlyArray | void, + getResolvedProjectReferences(): $ReadOnlyArray | void, + ... + }; + + declare type ResolvedProjectReference = { + commandLine: ParsedCommandLine, + sourceFile: SourceFile, + references?: $ReadOnlyArray, + ... + }; + + declare type CustomTransformers = { + before?: TransformerFactory[], + after?: TransformerFactory[], + afterDeclarations?: TransformerFactory[], + ... + }; + + declare type SourceMapSpan = { + emittedLine: number, + emittedColumn: number, + sourceLine: number, + sourceColumn: number, + nameIndex?: number, + sourceIndex: number, + ... + }; + + declare var ExitStatus: { + // 0 + +Success: 0, + // 1 + +DiagnosticsPresent_OutputsSkipped: 1, + // 2 + +DiagnosticsPresent_OutputsGenerated: 2, + ... + }; + + declare type EmitResult = { + emitSkipped: boolean, + diagnostics: $ReadOnlyArray, + emittedFiles?: string[], + ... + }; + + declare type TypeChecker = { + getTypeOfSymbolAtLocation(symbol: Symbol, node: Node): Type, + getDeclaredTypeOfSymbol(symbol: Symbol): Type, + getPropertiesOfType(type: Type): Symbol[], + getPropertyOfType(type: Type, propertyName: string): Symbol | void, + getIndexInfoOfType( + type: Type, + kind: $Values + ): IndexInfo | void, + getSignaturesOfType( + type: Type, + kind: $Values + ): $ReadOnlyArray, + getIndexTypeOfType( + type: Type, + kind: $Values + ): Type | void, + getBaseTypes(type: InterfaceType): BaseType[], + getBaseTypeOfLiteralType(type: Type): Type, + getWidenedType(type: Type): Type, + getReturnTypeOfSignature(signature: Signature): Type, + getNullableType(type: Type, flags: $Values): Type, + getNonNullableType(type: Type): Type, + typeToTypeNode( + type: Type, + enclosingDeclaration?: Node, + flags?: $Values + ): TypeNode | void, + signatureToSignatureDeclaration( + signature: Signature, + kind: $Values, + enclosingDeclaration?: Node, + flags?: $Values + ): + | (SignatureDeclaration & { typeArguments?: NodeArray, ... }) + | void, + indexInfoToIndexSignatureDeclaration( + indexInfo: IndexInfo, + kind: $Values, + enclosingDeclaration?: Node, + flags?: $Values + ): IndexSignatureDeclaration | void, + symbolToEntityName( + symbol: Symbol, + meaning: $Values, + enclosingDeclaration?: Node, + flags?: $Values + ): EntityName | void, + symbolToExpression( + symbol: Symbol, + meaning: $Values, + enclosingDeclaration?: Node, + flags?: $Values + ): Expression | void, + symbolToTypeParameterDeclarations( + symbol: Symbol, + enclosingDeclaration?: Node, + flags?: $Values + ): NodeArray | void, + symbolToParameterDeclaration( + symbol: Symbol, + enclosingDeclaration?: Node, + flags?: $Values + ): ParameterDeclaration | void, + typeParameterToDeclaration( + parameter: TypeParameter, + enclosingDeclaration?: Node, + flags?: $Values + ): TypeParameterDeclaration | void, + getSymbolsInScope( + location: Node, + meaning: $Values + ): Symbol[], + getSymbolAtLocation(node: Node): Symbol | void, + getSymbolsOfParameterPropertyDeclaration( + parameter: ParameterDeclaration, + parameterName: string + ): Symbol[], + getShorthandAssignmentValueSymbol(location: Node): Symbol | void, + getExportSpecifierLocalTargetSymbol( + location: ExportSpecifier + ): Symbol | void, + getExportSymbolOfSymbol(symbol: Symbol): Symbol, + getPropertySymbolOfDestructuringAssignment( + location: Identifier + ): Symbol | void, + getTypeAtLocation(node: Node): Type, + getTypeFromTypeNode(node: TypeNode): Type, + signatureToString( + signature: Signature, + enclosingDeclaration?: Node, + flags?: $Values, + kind?: $Values + ): string, + typeToString( + type: Type, + enclosingDeclaration?: Node, + flags?: $Values + ): string, + symbolToString( + symbol: Symbol, + enclosingDeclaration?: Node, + meaning?: $Values, + flags?: $Values + ): string, + typePredicateToString( + predicate: TypePredicate, + enclosingDeclaration?: Node, + flags?: $Values + ): string, + getFullyQualifiedName(symbol: Symbol): string, + getAugmentedPropertiesOfType(type: Type): Symbol[], + getRootSymbols(symbol: Symbol): $ReadOnlyArray, + getContextualType(node: Expression): Type | void, + getResolvedSignature( + node: CallLikeExpression, + candidatesOutArray?: Signature[], + argumentCount?: number + ): Signature | void, + getSignatureFromDeclaration( + declaration: SignatureDeclaration + ): Signature | void, + isImplementationOfOverload(node: SignatureDeclaration): boolean | void, + isUndefinedSymbol(symbol: Symbol): boolean, + isArgumentsSymbol(symbol: Symbol): boolean, + isUnknownSymbol(symbol: Symbol): boolean, + getConstantValue( + node: EnumMember | PropertyAccessExpression | ElementAccessExpression + ): string | number | void, + isValidPropertyAccess( + node: PropertyAccessExpression | QualifiedName | ImportTypeNode, + propertyName: string + ): boolean, + getAliasedSymbol(symbol: Symbol): Symbol, + getExportsOfModule(moduleSymbol: Symbol): Symbol[], + getJsxIntrinsicTagNamesAt(location: Node): Symbol[], + isOptionalParameter(node: ParameterDeclaration): boolean, + getAmbientModules(): Symbol[], + tryGetMemberInModuleExports( + memberName: string, + moduleSymbol: Symbol + ): Symbol | void, + getApparentType(type: Type): Type, + getBaseConstraintOfType(type: Type): Type | void, + getDefaultFromTypeParameter(type: Type): Type | void, + runWithCancellationToken( + token: CancellationToken, + cb: (checker: TypeChecker) => T + ): T, + ... + }; + + declare var NodeBuilderFlags: { + // 0 + +None: 0, + // 1 + +NoTruncation: 1, + // 2 + +WriteArrayAsGenericType: 2, + // 4 + +GenerateNamesForShadowedTypeParams: 4, + // 8 + +UseStructuralFallback: 8, + // 16 + +ForbidIndexedAccessSymbolReferences: 16, + // 32 + +WriteTypeArgumentsOfSignature: 32, + // 64 + +UseFullyQualifiedType: 64, + // 128 + +UseOnlyExternalAliasing: 128, + // 256 + +SuppressAnyReturnType: 256, + // 512 + +WriteTypeParametersInQualifiedName: 512, + // 1024 + +MultilineObjectLiterals: 1024, + // 2048 + +WriteClassExpressionAsTypeLiteral: 2048, + // 4096 + +UseTypeOfFunction: 4096, + // 8192 + +OmitParameterModifiers: 8192, + // 16384 + +UseAliasDefinedOutsideCurrentScope: 16384, + // 32768 + +AllowThisInObjectLiteral: 32768, + // 65536 + +AllowQualifedNameInPlaceOfIdentifier: 65536, + // 131072 + +AllowAnonymousIdentifier: 131072, + // 262144 + +AllowEmptyUnionOrIntersection: 262144, + // 524288 + +AllowEmptyTuple: 524288, + // 1048576 + +AllowUniqueESSymbolType: 1048576, + // 2097152 + +AllowEmptyIndexInfoType: 2097152, + // 67108864 + +AllowNodeModulesRelativePaths: 67108864, + // 70221824 + +IgnoreErrors: 70221824, + // 4194304 + +InObjectTypeLiteral: 4194304, + // 8388608 + +InTypeAlias: 8388608, + // 16777216 + +InInitialEntityName: 16777216, + // 33554432 + +InReverseMappedType: 33554432, + ... + }; + + declare var TypeFormatFlags: { + // 0 + +None: 0, + // 1 + +NoTruncation: 1, + // 2 + +WriteArrayAsGenericType: 2, + // 8 + +UseStructuralFallback: 8, + // 32 + +WriteTypeArgumentsOfSignature: 32, + // 64 + +UseFullyQualifiedType: 64, + // 256 + +SuppressAnyReturnType: 256, + // 1024 + +MultilineObjectLiterals: 1024, + // 2048 + +WriteClassExpressionAsTypeLiteral: 2048, + // 4096 + +UseTypeOfFunction: 4096, + // 8192 + +OmitParameterModifiers: 8192, + // 16384 + +UseAliasDefinedOutsideCurrentScope: 16384, + // 1048576 + +AllowUniqueESSymbolType: 1048576, + // 131072 + +AddUndefined: 131072, + // 262144 + +WriteArrowStyleSignature: 262144, + // 524288 + +InArrayType: 524288, + // 2097152 + +InElementType: 2097152, + // 4194304 + +InFirstTypeArgument: 4194304, + // 8388608 + +InTypeAlias: 8388608, + // 0 + +WriteOwnNameForAnyLike: 0, + // 9469291 + +NodeBuilderFlagsMask: 9469291, + ... + }; + + declare var SymbolFormatFlags: { + // 0 + +None: 0, + // 1 + +WriteTypeParametersOrArguments: 1, + // 2 + +UseOnlyExternalAliasing: 2, + // 4 + +AllowAnyNodeKind: 4, + // 8 + +UseAliasDefinedOutsideCurrentScope: 8, + ... + }; + + declare var TypePredicateKind: { + // 0 + +This: 0, + // 1 + +Identifier: 1, + ... + }; + + declare type TypePredicateBase = { + kind: $Values, + type: Type, + ... + }; + + declare type ThisTypePredicate = { + ...$Exact, + kind: typeof TypePredicateKind.This, + ... + }; + + declare type IdentifierTypePredicate = { + ...$Exact, + kind: typeof TypePredicateKind.Identifier, + parameterName: string, + parameterIndex: number, + ... + }; + + declare type TypePredicate = IdentifierTypePredicate | ThisTypePredicate; + + declare var SymbolFlags: { + // 0 + +None: 0, + // 1 + +FunctionScopedVariable: 1, + // 2 + +BlockScopedVariable: 2, + // 4 + +Property: 4, + // 8 + +EnumMember: 8, + // 16 + +Function: 16, + // 32 + +Class: 32, + // 64 + +Interface: 64, + // 128 + +ConstEnum: 128, + // 256 + +RegularEnum: 256, + // 512 + +ValueModule: 512, + // 1024 + +NamespaceModule: 1024, + // 2048 + +TypeLiteral: 2048, + // 4096 + +ObjectLiteral: 4096, + // 8192 + +Method: 8192, + // 16384 + +Constructor: 16384, + // 32768 + +GetAccessor: 32768, + // 65536 + +SetAccessor: 65536, + // 131072 + +Signature: 131072, + // 262144 + +TypeParameter: 262144, + // 524288 + +TypeAlias: 524288, + // 1048576 + +ExportValue: 1048576, + // 2097152 + +Alias: 2097152, + // 4194304 + +Prototype: 4194304, + // 8388608 + +ExportStar: 8388608, + // 16777216 + +Optional: 16777216, + // 33554432 + +Transient: 33554432, + // 67108864 + +Assignment: 67108864, + // 134217728 + +ModuleExports: 134217728, + // 384 + +Enum: 384, + // 3 + +Variable: 3, + // 67220415 + +Value: 67220415, + // 67897832 + +Type: 67897832, + // 1920 + +Namespace: 1920, + // 1536 + +Module: 1536, + // 98304 + +Accessor: 98304, + // 67220414 + +FunctionScopedVariableExcludes: 67220414, + // 67220415 + +BlockScopedVariableExcludes: 67220415, + // 67220415 + +ParameterExcludes: 67220415, + // 0 + +PropertyExcludes: 0, + // 68008959 + +EnumMemberExcludes: 68008959, + // 67219887 + +FunctionExcludes: 67219887, + // 68008383 + +ClassExcludes: 68008383, + // 67897736 + +InterfaceExcludes: 67897736, + // 68008191 + +RegularEnumExcludes: 68008191, + // 68008831 + +ConstEnumExcludes: 68008831, + // 110735 + +ValueModuleExcludes: 110735, + // 0 + +NamespaceModuleExcludes: 0, + // 67212223 + +MethodExcludes: 67212223, + // 67154879 + +GetAccessorExcludes: 67154879, + // 67187647 + +SetAccessorExcludes: 67187647, + // 67635688 + +TypeParameterExcludes: 67635688, + // 67897832 + +TypeAliasExcludes: 67897832, + // 2097152 + +AliasExcludes: 2097152, + // 2623475 + +ModuleMember: 2623475, + // 944 + +ExportHasLocal: 944, + // 418 + +BlockScoped: 418, + // 98308 + +PropertyOrAccessor: 98308, + // 106500 + +ClassMember: 106500, + ... + }; + + declare type Symbol = { + flags: $Values, + escapedName: __String, + declarations: Declaration[], + valueDeclaration: Declaration, + members?: SymbolTable, + exports?: SymbolTable, + globalExports?: SymbolTable, + +name: string, + getFlags(): $Values, + getEscapedName(): __String, + getName(): string, + getDeclarations(): Declaration[] | void, + getDocumentationComment( + typeChecker: TypeChecker | void + ): SymbolDisplayPart[], + getJsDocTags(): JSDocTagInfo[], + ... + }; + + declare var InternalSymbolName: { + // "__call" + +Call: "__call", + // "__constructor" + +Constructor: "__constructor", + // "__new" + +New: "__new", + // "__index" + +Index: "__index", + // "__export" + +ExportStar: "__export", + // "__global" + +Global: "__global", + // "__missing" + +Missing: "__missing", + // "__type" + +Type: "__type", + // "__object" + +Object: "__object", + // "__jsxAttributes" + +JSXAttributes: "__jsxAttributes", + // "__class" + +Class: "__class", + // "__function" + +Function: "__function", + // "__computed" + +Computed: "__computed", + // "__resolving__" + +Resolving: "__resolving__", + // "export=" + +ExportEquals: "export=", + // "default" + +Default: "default", + // "this" + +This: "this", + ... + }; + + declare type __String = + | (string & { __escapedIdentifier: void, ... }) + | (void & { __escapedIdentifier: void, ... }) + | $Values; + + declare class ReadonlyUnderscoreEscapedMap { + get(key: __String): T | void, + has(key: __String): boolean, + forEach(action: (value: T, key: __String) => void): void, + +size: number, + keys(): Iterator<__String>, + values(): Iterator, + entries(): Iterator<[__String, T]> + } + + declare class UnderscoreEscapedMap extends ReadonlyUnderscoreEscapedMap { + set(key: __String, value: T): this, + delete(key: __String): boolean, + clear(): void + } + + declare type SymbolTable = UnderscoreEscapedMap; + + declare var TypeFlags: { + // 1 + +Any: 1, + // 2 + +Unknown: 2, + // 4 + +String: 4, + // 8 + +Number: 8, + // 16 + +Boolean: 16, + // 32 + +Enum: 32, + // 64 + +BigInt: 64, + // 128 + +StringLiteral: 128, + // 256 + +NumberLiteral: 256, + // 512 + +BooleanLiteral: 512, + // 1024 + +EnumLiteral: 1024, + // 2048 + +BigIntLiteral: 2048, + // 4096 + +ESSymbol: 4096, + // 8192 + +UniqueESSymbol: 8192, + // 16384 + +Void: 16384, + // 32768 + +Undefined: 32768, + // 65536 + +Null: 65536, + // 131072 + +Never: 131072, + // 262144 + +TypeParameter: 262144, + // 524288 + +Object: 524288, + // 1048576 + +Union: 1048576, + // 2097152 + +Intersection: 2097152, + // 4194304 + +Index: 4194304, + // 8388608 + +IndexedAccess: 8388608, + // 16777216 + +Conditional: 16777216, + // 33554432 + +Substitution: 33554432, + // 67108864 + +NonPrimitive: 67108864, + // 2944 + +Literal: 2944, + // 109440 + +Unit: 109440, + // 384 + +StringOrNumberLiteral: 384, + // 117724 + +PossiblyFalsy: 117724, + // 132 + +StringLike: 132, + // 296 + +NumberLike: 296, + // 2112 + +BigIntLike: 2112, + // 528 + +BooleanLike: 528, + // 1056 + +EnumLike: 1056, + // 12288 + +ESSymbolLike: 12288, + // 49152 + +VoidLike: 49152, + // 3145728 + +UnionOrIntersection: 3145728, + // 3670016 + +StructuredType: 3670016, + // 8650752 + +TypeVariable: 8650752, + // 58982400 + +InstantiableNonPrimitive: 58982400, + // 4194304 + +InstantiablePrimitive: 4194304, + // 63176704 + +Instantiable: 63176704, + // 66846720 + +StructuredOrInstantiable: 66846720, + // 133970943 + +Narrowable: 133970943, + // 67637251 + +NotUnionOrUnit: 67637251, + ... + }; + + declare type DestructuringPattern = + | BindingPattern + | ObjectLiteralExpression + | ArrayLiteralExpression; + declare type Type = { + flags: $Values, + symbol: Symbol, + pattern?: DestructuringPattern, + aliasSymbol?: Symbol, + aliasTypeArguments?: $ReadOnlyArray, + getFlags(): $Values, + getSymbol(): Symbol | void, + getProperties(): Symbol[], + getProperty(propertyName: string): Symbol | void, + getApparentProperties(): Symbol[], + getCallSignatures(): $ReadOnlyArray, + getConstructSignatures(): $ReadOnlyArray, + getStringIndexType(): Type | void, + getNumberIndexType(): Type | void, + getBaseTypes(): BaseType[] | void, + getNonNullableType(): Type, + getConstraint(): Type | void, + getDefault(): Type | void, + isUnion(): boolean, + isIntersection(): boolean, + isUnionOrIntersection(): boolean, + isLiteral(): boolean, + isStringLiteral(): boolean, + isNumberLiteral(): boolean, + isTypeParameter(): boolean, + isClassOrInterface(): boolean, + isClass(): boolean, + ... + }; + + declare type LiteralType = { + ...$Exact, + value: string | number | PseudoBigInt, + freshType: LiteralType, + regularType: LiteralType, + ... + }; + + declare type UniqueESSymbolType = { + ...$Exact, + symbol: Symbol, + escapedName: __String, + ... + }; + + declare type StringLiteralType = { + ...$Exact, + value: string, + ... + }; + + declare type NumberLiteralType = { + ...$Exact, + value: number, + ... + }; + + declare type BigIntLiteralType = { + ...$Exact, + value: PseudoBigInt, + ... + }; + + declare type EnumType = { ...$Exact, ... }; + + declare var ObjectFlags: { + // 1 + +Class: 1, + // 2 + +Interface: 2, + // 4 + +Reference: 4, + // 8 + +Tuple: 8, + // 16 + +Anonymous: 16, + // 32 + +Mapped: 32, + // 64 + +Instantiated: 64, + // 128 + +ObjectLiteral: 128, + // 256 + +EvolvingArray: 256, + // 512 + +ObjectLiteralPatternWithComputedProperties: 512, + // 1024 + +ContainsSpread: 1024, + // 2048 + +ReverseMapped: 2048, + // 4096 + +JsxAttributes: 4096, + // 8192 + +MarkerType: 8192, + // 16384 + +JSLiteral: 16384, + // 32768 + +FreshLiteral: 32768, + // 3 + +ClassOrInterface: 3, + ... + }; + + declare type ObjectType = { + ...$Exact, + objectFlags: $Values, + ... + }; + + declare type InterfaceType = { + ...$Exact, + typeParameters: TypeParameter[] | void, + outerTypeParameters: TypeParameter[] | void, + localTypeParameters: TypeParameter[] | void, + thisType: TypeParameter | void, + ... + }; + + declare type BaseType = ObjectType | IntersectionType; + declare type InterfaceTypeWithDeclaredMembers = { + ...$Exact, + declaredProperties: Symbol[], + declaredCallSignatures: Signature[], + declaredConstructSignatures: Signature[], + declaredStringIndexInfo?: IndexInfo, + declaredNumberIndexInfo?: IndexInfo, + ... + }; + + declare type TypeReference = { + ...$Exact, + target: GenericType, + typeArguments?: $ReadOnlyArray, + ... + }; + + declare type GenericType = { + ...$Exact, + ...$Exact, + ... + }; + + declare type TupleType = { + ...$Exact, + minLength: number, + hasRestElement: boolean, + associatedNames?: __String[], + ... + }; + + declare type TupleTypeReference = { + ...$Exact, + target: TupleType, + ... + }; + + declare type UnionOrIntersectionType = { + ...$Exact, + types: Type[], + ... + }; + + declare type UnionType = { ...$Exact, ... }; + + declare type IntersectionType = { ...$Exact, ... }; + + declare type StructuredType = ObjectType | UnionType | IntersectionType; + declare type EvolvingArrayType = { + ...$Exact, + elementType: Type, + finalArrayType?: Type, + ... + }; + + declare type InstantiableType = { ...$Exact, ... }; + + declare type TypeParameter = { ...$Exact, ... }; + + declare type IndexedAccessType = { + ...$Exact, + objectType: Type, + indexType: Type, + constraint?: Type, + simplified?: Type, + ... + }; + + declare type TypeVariable = TypeParameter | IndexedAccessType; + declare type IndexType = { + ...$Exact, + type: InstantiableType | UnionOrIntersectionType, + ... + }; + + declare type ConditionalRoot = { + node: ConditionalTypeNode, + checkType: Type, + extendsType: Type, + trueType: Type, + falseType: Type, + isDistributive: boolean, + inferTypeParameters?: TypeParameter[], + outerTypeParameters?: TypeParameter[], + instantiations?: Map, + aliasSymbol?: Symbol, + aliasTypeArguments?: Type[], + ... + }; + + declare type ConditionalType = { + ...$Exact, + root: ConditionalRoot, + checkType: Type, + extendsType: Type, + resolvedTrueType?: Type, + resolvedFalseType?: Type, + ... + }; + + declare type SubstitutionType = { + ...$Exact, + typeVariable: TypeVariable, + substitute: Type, + ... + }; + + declare var SignatureKind: { + // 0 + +Call: 0, + // 1 + +Construct: 1, + ... + }; + + declare type Signature = { + declaration?: SignatureDeclaration | JSDocSignature, + typeParameters?: $ReadOnlyArray, + parameters: $ReadOnlyArray, + getDeclaration(): SignatureDeclaration, + getTypeParameters(): TypeParameter[] | void, + getParameters(): Symbol[], + getReturnType(): Type, + getDocumentationComment( + typeChecker: TypeChecker | void + ): SymbolDisplayPart[], + getJsDocTags(): JSDocTagInfo[], + ... + }; + + declare var IndexKind: { + // 0 + +String: 0, + // 1 + +Number: 1, + ... + }; + + declare type IndexInfo = { + type: Type, + isReadonly: boolean, + declaration?: IndexSignatureDeclaration, + ... + }; + + declare var InferencePriority: { + // 1 + +NakedTypeVariable: 1, + // 2 + +HomomorphicMappedType: 2, + // 4 + +MappedTypeConstraint: 4, + // 8 + +ReturnType: 8, + // 16 + +LiteralKeyof: 16, + // 32 + +NoConstraints: 32, + // 64 + +AlwaysStrict: 64, + // 28 + +PriorityImpliesCombination: 28, + ... + }; + + declare type JsFileExtensionInfo = FileExtensionInfo; + declare type FileExtensionInfo = { + extension: string, + isMixedContent: boolean, + scriptKind?: $Values, + ... + }; + + declare type DiagnosticMessage = { + key: string, + category: $Values, + code: number, + message: string, + reportsUnnecessary?: {...}, + ... + }; + + declare type DiagnosticMessageChain = { + messageText: string, + category: $Values, + code: number, + next?: DiagnosticMessageChain, + ... + }; + + declare type Diagnostic = { + ...$Exact, + reportsUnnecessary?: {...}, + source?: string, + relatedInformation?: DiagnosticRelatedInformation[], + ... + }; + + declare type DiagnosticRelatedInformation = { + category: $Values, + code: number, + file: SourceFile | void, + start: number | void, + length: number | void, + messageText: string | DiagnosticMessageChain, + ... + }; + + declare type DiagnosticWithLocation = { + ...$Exact, + file: SourceFile, + start: number, + length: number, + ... + }; + + declare var DiagnosticCategory: { + // 0 + +Warning: 0, + // 1 + +Error: 1, + // 2 + +Suggestion: 2, + // 3 + +Message: 3, + ... + }; + + declare var ModuleResolutionKind: { + // 1 + +Classic: 1, + // 2 + +NodeJs: 2, + ... + }; + + declare type PluginImport = { name: string, ... }; + + declare type ProjectReference = { + path: string, + originalPath?: string, + prepend?: boolean, + circular?: boolean, + ... + }; + + declare type CompilerOptionsValue = + | string + | number + | boolean + | (string | number)[] + | string[] + | MapLike + | PluginImport[] + | ProjectReference[] + | null + | void; + declare type CompilerOptions = { + [option: string]: CompilerOptionsValue | TsConfigSourceFile | void, + allowJs?: boolean, + allowSyntheticDefaultImports?: boolean, + allowUnreachableCode?: boolean, + allowUnusedLabels?: boolean, + alwaysStrict?: boolean, + baseUrl?: string, + charset?: string, + checkJs?: boolean, + declaration?: boolean, + declarationMap?: boolean, + emitDeclarationOnly?: boolean, + declarationDir?: string, + disableSizeLimit?: boolean, + downlevelIteration?: boolean, + emitBOM?: boolean, + emitDecoratorMetadata?: boolean, + experimentalDecorators?: boolean, + forceConsistentCasingInFileNames?: boolean, + importHelpers?: boolean, + inlineSourceMap?: boolean, + inlineSources?: boolean, + isolatedModules?: boolean, + jsx?: $Values, + keyofStringsOnly?: boolean, + lib?: string[], + locale?: string, + mapRoot?: string, + maxNodeModuleJsDepth?: number, + module?: $Values, + moduleResolution?: $Values, + newLine?: $Values, + noEmit?: boolean, + noEmitHelpers?: boolean, + noEmitOnError?: boolean, + noErrorTruncation?: boolean, + noFallthroughCasesInSwitch?: boolean, + noImplicitAny?: boolean, + noImplicitReturns?: boolean, + noImplicitThis?: boolean, + noStrictGenericChecks?: boolean, + noUnusedLocals?: boolean, + noUnusedParameters?: boolean, + noImplicitUseStrict?: boolean, + noLib?: boolean, + noResolve?: boolean, + out?: string, + outDir?: string, + outFile?: string, + paths?: MapLike, + preserveConstEnums?: boolean, + preserveSymlinks?: boolean, + project?: string, + reactNamespace?: string, + jsxFactory?: string, + composite?: boolean, + removeComments?: boolean, + rootDir?: string, + rootDirs?: string[], + skipLibCheck?: boolean, + skipDefaultLibCheck?: boolean, + sourceMap?: boolean, + sourceRoot?: string, + strict?: boolean, + strictFunctionTypes?: boolean, + strictBindCallApply?: boolean, + strictNullChecks?: boolean, + strictPropertyInitialization?: boolean, + stripInternal?: boolean, + suppressExcessPropertyErrors?: boolean, + suppressImplicitAnyIndexErrors?: boolean, + target?: $Values, + traceResolution?: boolean, + resolveJsonModule?: boolean, + types?: string[], + typeRoots?: string[], + esModuleInterop?: boolean, + ... + }; + + declare type TypeAcquisition = { + [option: string]: string[] | boolean | void, + enableAutoDiscovery?: boolean, + enable?: boolean, + include?: string[], + exclude?: string[], + ... + }; + + declare var ModuleKind: { + // 0 + +None: 0, + // 1 + +CommonJS: 1, + // 2 + +AMD: 2, + // 3 + +UMD: 3, + // 4 + +System: 4, + // 5 + +ES2015: 5, + // 6 + +ESNext: 6, + ... + }; + + declare var JsxEmit: { + // 0 + +None: 0, + // 1 + +Preserve: 1, + // 2 + +React: 2, + // 3 + +ReactNative: 3, + ... + }; + + declare var NewLineKind: { + // 0 + +CarriageReturnLineFeed: 0, + // 1 + +LineFeed: 1, + ... + }; + + declare type LineAndCharacter = { + line: number, + character: number, + ... + }; + + declare var ScriptKind: { + // 0 + +Unknown: 0, + // 1 + +JS: 1, + // 2 + +JSX: 2, + // 3 + +TS: 3, + // 4 + +TSX: 4, + // 5 + +External: 5, + // 6 + +JSON: 6, + // 7 + +Deferred: 7, + ... + }; + + declare var ScriptTarget: { + // 0 + +ES3: 0, + // 1 + +ES5: 1, + // 2 + +ES2015: 2, + // 3 + +ES2016: 3, + // 4 + +ES2017: 4, + // 5 + +ES2018: 5, + // 6 + +ESNext: 6, + // 100 + +JSON: 100, + // 6 + +Latest: 6, + ... + }; + + declare var LanguageVariant: { + // 0 + +Standard: 0, + // 1 + +JSX: 1, + ... + }; + + declare type ParsedCommandLine = { + options: CompilerOptions, + typeAcquisition?: TypeAcquisition, + fileNames: string[], + projectReferences?: $ReadOnlyArray, + raw?: any, + errors: Diagnostic[], + wildcardDirectories?: MapLike<$Values>, + compileOnSave?: boolean, + ... + }; + + declare var WatchDirectoryFlags: { + // 0 + +None: 0, + // 1 + +Recursive: 1, + ... + }; + + declare type ExpandResult = { + fileNames: string[], + wildcardDirectories: MapLike<$Values>, + ... + }; + + declare type CreateProgramOptions = { + rootNames: $ReadOnlyArray, + options: CompilerOptions, + projectReferences?: $ReadOnlyArray, + host?: CompilerHost, + oldProgram?: Program, + configFileParsingDiagnostics?: $ReadOnlyArray, + ... + }; + + declare type ModuleResolutionHost = { + fileExists(fileName: string): boolean, + readFile(fileName: string): string | void, + trace?: (s: string) => void, + directoryExists?: (directoryName: string) => boolean, + realpath?: (path: string) => string, + getCurrentDirectory?: () => string, + getDirectories?: (path: string) => string[], + ... + }; + + declare type ResolvedModule = { + resolvedFileName: string, + isExternalLibraryImport?: boolean, + ... + }; + + declare type ResolvedModuleFull = { + ...$Exact, + extension: $Values, + packageId?: PackageId, + ... + }; + + declare type PackageId = { + name: string, + subModuleName: string, + version: string, + ... + }; + + declare var Extension: { + // ".ts" + +Ts: ".ts", + // ".tsx" + +Tsx: ".tsx", + // ".d.ts" + +Dts: ".d.ts", + // ".js" + +Js: ".js", + // ".jsx" + +Jsx: ".jsx", + // ".json" + +Json: ".json", + ... + }; + + declare type ResolvedModuleWithFailedLookupLocations = { +resolvedModule: ResolvedModuleFull | void, ... }; + + declare type ResolvedTypeReferenceDirective = { + primary: boolean, + resolvedFileName: string | void, + packageId?: PackageId, + isExternalLibraryImport?: boolean, + ... + }; + + declare type ResolvedTypeReferenceDirectiveWithFailedLookupLocations = { + +resolvedTypeReferenceDirective: ResolvedTypeReferenceDirective | void, + +failedLookupLocations: $ReadOnlyArray, + ... + }; + + declare type CompilerHost = { + ...$Exact, + getSourceFile( + fileName: string, + languageVersion: $Values, + onError?: (message: string) => void, + shouldCreateNewSourceFile?: boolean + ): SourceFile | void, + getSourceFileByPath?: ( + fileName: string, + path: Path, + languageVersion: $Values, + onError?: (message: string) => void, + shouldCreateNewSourceFile?: boolean + ) => SourceFile | void, + getCancellationToken?: () => CancellationToken, + getDefaultLibFileName(options: CompilerOptions): string, + getDefaultLibLocation?: () => string, + writeFile: WriteFileCallback, + getCurrentDirectory(): string, + getCanonicalFileName(fileName: string): string, + useCaseSensitiveFileNames(): boolean, + getNewLine(): string, + readDirectory?: ( + rootDir: string, + extensions: $ReadOnlyArray, + excludes: $ReadOnlyArray | void, + includes: $ReadOnlyArray, + depth?: number + ) => string[], + resolveModuleNames?: ( + moduleNames: string[], + containingFile: string, + reusedNames?: string[], + redirectedReference?: ResolvedProjectReference + ) => (ResolvedModule | void)[], + resolveTypeReferenceDirectives?: ( + typeReferenceDirectiveNames: string[], + containingFile: string, + redirectedReference?: ResolvedProjectReference + ) => (ResolvedTypeReferenceDirective | void)[], + getEnvironmentVariable?: (name: string) => string | void, + createHash?: (data: string) => string, + ... + }; + + declare type SourceMapRange = { + ...$Exact, + source?: SourceMapSource, + ... + }; + + declare type SourceMapSource = { + fileName: string, + text: string, + skipTrivia?: (pos: number) => number, + getLineAndCharacterOfPosition(pos: number): LineAndCharacter, + ... + }; + + declare var EmitFlags: { + // 0 + +None: 0, + // 1 + +SingleLine: 1, + // 2 + +AdviseOnEmitNode: 2, + // 4 + +NoSubstitution: 4, + // 8 + +CapturesThis: 8, + // 16 + +NoLeadingSourceMap: 16, + // 32 + +NoTrailingSourceMap: 32, + // 48 + +NoSourceMap: 48, + // 64 + +NoNestedSourceMaps: 64, + // 128 + +NoTokenLeadingSourceMaps: 128, + // 256 + +NoTokenTrailingSourceMaps: 256, + // 384 + +NoTokenSourceMaps: 384, + // 512 + +NoLeadingComments: 512, + // 1024 + +NoTrailingComments: 1024, + // 1536 + +NoComments: 1536, + // 2048 + +NoNestedComments: 2048, + // 4096 + +HelperName: 4096, + // 8192 + +ExportName: 8192, + // 16384 + +LocalName: 16384, + // 32768 + +InternalName: 32768, + // 65536 + +Indented: 65536, + // 131072 + +NoIndentation: 131072, + // 262144 + +AsyncFunctionBody: 262144, + // 524288 + +ReuseTempVariableScope: 524288, + // 1048576 + +CustomPrologue: 1048576, + // 2097152 + +NoHoisting: 2097152, + // 4194304 + +HasEndOfDeclarationMarker: 4194304, + // 8388608 + +Iterator: 8388608, + // 16777216 + +NoAsciiEscaping: 16777216, + ... + }; + + declare type EmitHelper = { + +name: string, + +scoped: boolean, + +text: string | ((node: EmitHelperUniqueNameCallback) => string), + +priority?: number, + ... + }; + + declare type EmitHelperUniqueNameCallback = (name: string) => string; + + declare var EmitHint: { + // 0 + +SourceFile: 0, + // 1 + +Expression: 1, + // 2 + +IdentifierName: 2, + // 3 + +MappedTypeParameter: 3, + // 4 + +Unspecified: 4, + // 5 + +EmbeddedStatement: 5, + ... + }; + + declare type TransformationContext = { + getCompilerOptions(): CompilerOptions, + startLexicalEnvironment(): void, + suspendLexicalEnvironment(): void, + resumeLexicalEnvironment(): void, + endLexicalEnvironment(): Statement[] | void, + hoistFunctionDeclaration(node: FunctionDeclaration): void, + hoistVariableDeclaration(node: Identifier): void, + requestEmitHelper(helper: EmitHelper): void, + readEmitHelpers(): EmitHelper[] | void, + enableSubstitution(kind: $Values): void, + isSubstitutionEnabled(node: Node): boolean, + onSubstituteNode: (hint: $Values, node: Node) => Node, + enableEmitNotification(kind: $Values): void, + isEmitNotificationEnabled(node: Node): boolean, + onEmitNode: ( + hint: $Values, + node: Node, + emitCallback: (hint: $Values, node: Node) => void + ) => void, + ... + }; + + declare type TransformationResult = { + transformed: T[], + diagnostics?: DiagnosticWithLocation[], + substituteNode(hint: $Values, node: Node): Node, + emitNodeWithNotification( + hint: $Values, + node: Node, + emitCallback: (hint: $Values, node: Node) => void + ): void, + dispose(): void, + ... + }; + + declare type TransformerFactory = ( + context: TransformationContext + ) => Transformer; + declare type Transformer = (node: T) => T; + declare type Visitor = (node: Node) => VisitResult; + declare type VisitResult = T | T[] | void; + declare type Printer = { + printNode( + hint: $Values, + node: Node, + sourceFile: SourceFile + ): string, + printList( + format: $Values, + list: NodeArray, + sourceFile: SourceFile + ): string, + printFile(sourceFile: SourceFile): string, + printBundle(bundle: Bundle): string, + ... + }; + + declare type PrintHandlers = { + hasGlobalName?: (name: string) => boolean, + onEmitNode?: ( + hint: $Values, + node: Node | void, + emitCallback: (hint: $Values, node: Node | void) => void + ) => void, + substituteNode?: (hint: $Values, node: Node) => Node, + ... + }; + + declare type PrinterOptions = { + removeComments?: boolean, + newLine?: $Values, + omitTrailingSemicolon?: boolean, + noEmitHelpers?: boolean, + ... + }; + + declare type GetEffectiveTypeRootsHost = { + directoryExists?: (directoryName: string) => boolean, + getCurrentDirectory?: () => string, + ... + }; + + declare type TextSpan = { + start: number, + length: number, + ... + }; + + declare type TextChangeRange = { + span: TextSpan, + newLength: number, + ... + }; + + declare type SyntaxList = { + ...$Exact, + _children: Node[], + ... + }; + + declare var ListFormat: { + // 0 + +None: 0, + // 0 + +SingleLine: 0, + // 1 + +MultiLine: 1, + // 2 + +PreserveLines: 2, + // 3 + +LinesMask: 3, + // 0 + +NotDelimited: 0, + // 4 + +BarDelimited: 4, + // 8 + +AmpersandDelimited: 8, + // 16 + +CommaDelimited: 16, + // 32 + +AsteriskDelimited: 32, + // 60 + +DelimitersMask: 60, + // 64 + +AllowTrailingComma: 64, + // 128 + +Indented: 128, + // 256 + +SpaceBetweenBraces: 256, + // 512 + +SpaceBetweenSiblings: 512, + // 1024 + +Braces: 1024, + // 2048 + +Parenthesis: 2048, + // 4096 + +AngleBrackets: 4096, + // 8192 + +SquareBrackets: 8192, + // 15360 + +BracketsMask: 15360, + // 16384 + +OptionalIfUndefined: 16384, + // 32768 + +OptionalIfEmpty: 32768, + // 49152 + +Optional: 49152, + // 65536 + +PreferNewLine: 65536, + // 131072 + +NoTrailingNewLine: 131072, + // 262144 + +NoInterveningComments: 262144, + // 524288 + +NoSpaceIfEmpty: 524288, + // 1048576 + +SingleElement: 1048576, + // 262656 + +Modifiers: 262656, + // 512 + +HeritageClauses: 512, + // 768 + +SingleLineTypeLiteralMembers: 768, + // 32897 + +MultiLineTypeLiteralMembers: 32897, + // 528 + +TupleTypeElements: 528, + // 516 + +UnionTypeConstituents: 516, + // 520 + +IntersectionTypeConstituents: 520, + // 525136 + +ObjectBindingPatternElements: 525136, + // 524880 + +ArrayBindingPatternElements: 524880, + // 526226 + +ObjectLiteralExpressionProperties: 526226, + // 8914 + +ArrayLiteralExpressionElements: 8914, + // 528 + +CommaListElements: 528, + // 2576 + +CallExpressionArguments: 2576, + // 18960 + +NewExpressionArguments: 18960, + // 262144 + +TemplateExpressionSpans: 262144, + // 768 + +SingleLineBlockStatements: 768, + // 129 + +MultiLineBlockStatements: 129, + // 528 + +VariableDeclarationList: 528, + // 768 + +SingleLineFunctionBodyStatements: 768, + // 1 + +MultiLineFunctionBodyStatements: 1, + // 0 + +ClassHeritageClauses: 0, + // 129 + +ClassMembers: 129, + // 129 + +InterfaceMembers: 129, + // 145 + +EnumMembers: 145, + // 129 + +CaseBlockClauses: 129, + // 525136 + +NamedImportsOrExportsElements: 525136, + // 262144 + +JsxElementOrFragmentChildren: 262144, + // 262656 + +JsxElementAttributes: 262656, + // 163969 + +CaseOrDefaultClauseStatements: 163969, + // 528 + +HeritageClauseTypes: 528, + // 131073 + +SourceFileStatements: 131073, + // 49153 + +Decorators: 49153, + // 53776 + +TypeArguments: 53776, + // 53776 + +TypeParameters: 53776, + // 2576 + +Parameters: 2576, + // 8848 + +IndexSignatureParameters: 8848, + // 33 + +JSDocComment: 33, + ... + }; + + declare type UserPreferences = { + +disableSuggestions?: boolean, + +quotePreference?: "auto" | "double" | "single", + +includeCompletionsForModuleExports?: boolean, + +includeCompletionsWithInsertText?: boolean, + +importModuleSpecifierPreference?: "relative" | "non-relative", + +importModuleSpecifierEnding?: "minimal" | "index" | "js", + +allowTextChangesInNewFiles?: boolean, + +providePrefixAndSuffixTextForRename?: boolean, + ... + }; + + declare type PseudoBigInt = { + negative: boolean, + base10Value: string, + ... + }; + + declare var FileWatcherEventKind: { + // 0 + +Created: 0, + // 1 + +Changed: 1, + // 2 + +Deleted: 2, + ... + }; + + declare type FileWatcherCallback = ( + fileName: string, + eventKind: $Values + ) => void; + declare type DirectoryWatcherCallback = (fileName: string) => void; + declare type System = { + args: string[], + newLine: string, + useCaseSensitiveFileNames: boolean, + write(s: string): void, + writeOutputIsTTY?: () => boolean, + readFile(path: string, encoding?: string): string | void, + getFileSize?: (path: string) => number, + writeFile(path: string, data: string, writeByteOrderMark?: boolean): void, + watchFile?: ( + path: string, + callback: FileWatcherCallback, + pollingInterval?: number + ) => FileWatcher, + watchDirectory?: ( + path: string, + callback: DirectoryWatcherCallback, + recursive?: boolean + ) => FileWatcher, + resolvePath(path: string): string, + fileExists(path: string): boolean, + directoryExists(path: string): boolean, + createDirectory(path: string): void, + getExecutingFilePath(): string, + getCurrentDirectory(): string, + getDirectories(path: string): string[], + readDirectory( + path: string, + extensions?: $ReadOnlyArray, + exclude?: $ReadOnlyArray, + include?: $ReadOnlyArray, + depth?: number + ): string[], + getModifiedTime?: (path: string) => Date | void, + setModifiedTime?: (path: string, time: Date) => void, + deleteFile?: (path: string) => void, + createHash?: (data: string) => string, + createSHA256Hash?: (data: string) => string, + getMemoryUsage?: () => number, + exit(exitCode?: number): void, + realpath?: (path: string) => string, + setTimeout?: ( + callback: (...args: any[]) => void, + ms: number, + ...args: any[] + ) => any, + clearTimeout?: (timeoutId: any) => void, + clearScreen?: () => void, + base64decode?: (input: string) => string, + base64encode?: (input: string) => string, + ... + }; + + declare type FileWatcher = { close(): void, ... }; + + declare function getNodeMajorVersion(): number | void; + + declare var sys: System; + declare type ErrorCallback = ( + message: DiagnosticMessage, + length: number + ) => void; + declare type Scanner = { + getStartPos(): number, + getToken(): $Values, + getTextPos(): number, + getTokenPos(): number, + getTokenText(): string, + getTokenValue(): string, + hasExtendedUnicodeEscape(): boolean, + hasPrecedingLineBreak(): boolean, + isIdentifier(): boolean, + isReservedWord(): boolean, + isUnterminated(): boolean, + reScanGreaterToken(): $Values, + reScanSlashToken(): $Values, + reScanTemplateToken(): $Values, + scanJsxIdentifier(): $Values, + scanJsxAttributeValue(): $Values, + reScanJsxToken(): JsxTokenSyntaxKind, + reScanLessThanToken(): $Values, + scanJsxToken(): JsxTokenSyntaxKind, + scanJSDocToken(): JsDocSyntaxKind, + scan(): $Values, + getText(): string, + setText(text: string | void, start?: number, length?: number): void, + setOnError(onError: ErrorCallback | void): void, + setScriptTarget(scriptTarget: $Values): void, + setLanguageVariant(variant: $Values): void, + setTextPos(textPos: number): void, + lookAhead(callback: () => T): T, + scanRange(start: number, length: number, callback: () => T): T, + tryScan(callback: () => T): T, + ... + }; + + declare function tokenToString(t: $Values): string | void; + + declare function getPositionOfLineAndCharacter( + sourceFile: SourceFileLike, + line: number, + character: number + ): number; + + declare function getLineAndCharacterOfPosition( + sourceFile: SourceFileLike, + position: number + ): LineAndCharacter; + + declare function isWhiteSpaceLike(ch: number): boolean; + + declare function isWhiteSpaceSingleLine(ch: number): boolean; + + declare function isLineBreak(ch: number): boolean; + + declare function couldStartTrivia(text: string, pos: number): boolean; + + declare function forEachLeadingCommentRange( + text: string, + pos: number, + cb: ( + pos: number, + end: number, + kind: CommentKind, + hasTrailingNewLine: boolean + ) => U + ): U | void; + + declare function forEachLeadingCommentRange( + text: string, + pos: number, + cb: ( + pos: number, + end: number, + kind: CommentKind, + hasTrailingNewLine: boolean, + state: T + ) => U, + state: T + ): U | void; + + declare function forEachTrailingCommentRange( + text: string, + pos: number, + cb: ( + pos: number, + end: number, + kind: CommentKind, + hasTrailingNewLine: boolean + ) => U + ): U | void; + + declare function forEachTrailingCommentRange( + text: string, + pos: number, + cb: ( + pos: number, + end: number, + kind: CommentKind, + hasTrailingNewLine: boolean, + state: T + ) => U, + state: T + ): U | void; + + declare function reduceEachLeadingCommentRange( + text: string, + pos: number, + cb: ( + pos: number, + end: number, + kind: CommentKind, + hasTrailingNewLine: boolean, + state: T, + memo: U + ) => U, + state: T, + initial: U + ): U | void; + + declare function reduceEachTrailingCommentRange( + text: string, + pos: number, + cb: ( + pos: number, + end: number, + kind: CommentKind, + hasTrailingNewLine: boolean, + state: T, + memo: U + ) => U, + state: T, + initial: U + ): U | void; + + declare function getLeadingCommentRanges( + text: string, + pos: number + ): CommentRange[] | void; + + declare function getTrailingCommentRanges( + text: string, + pos: number + ): CommentRange[] | void; + + declare function getShebang(text: string): string | void; + + declare function isIdentifierStart( + ch: number, + languageVersion: $Values | void + ): boolean; + + declare function isIdentifierPart( + ch: number, + languageVersion: $Values | void + ): boolean; + + declare function createScanner( + languageVersion: $Values, + skipTrivia: boolean, + languageVariant?: $Values, + textInitial?: string, + onError?: ErrorCallback, + start?: number, + length?: number + ): Scanner; + + declare function isExternalModuleNameRelative(moduleName: string): boolean; + + declare function sortAndDeduplicateDiagnostics( + diagnostics: $ReadOnlyArray + ): SortedReadonlyArray; + + declare function getDefaultLibFileName(options: CompilerOptions): string; + + declare function textSpanEnd(span: TextSpan): number; + + declare function textSpanIsEmpty(span: TextSpan): boolean; + + declare function textSpanContainsPosition( + span: TextSpan, + position: number + ): boolean; + + declare function textSpanContainsTextSpan( + span: TextSpan, + other: TextSpan + ): boolean; + + declare function textSpanOverlapsWith( + span: TextSpan, + other: TextSpan + ): boolean; + + declare function textSpanOverlap( + span1: TextSpan, + span2: TextSpan + ): TextSpan | void; + + declare function textSpanIntersectsWithTextSpan( + span: TextSpan, + other: TextSpan + ): boolean; + + declare function textSpanIntersectsWith( + span: TextSpan, + start: number, + length: number + ): boolean; + + declare function decodedTextSpanIntersectsWith( + start1: number, + length1: number, + start2: number, + length2: number + ): boolean; + + declare function textSpanIntersectsWithPosition( + span: TextSpan, + position: number + ): boolean; + + declare function textSpanIntersection( + span1: TextSpan, + span2: TextSpan + ): TextSpan | void; + + declare function createTextSpan(start: number, length: number): TextSpan; + + declare function createTextSpanFromBounds( + start: number, + end: number + ): TextSpan; + + declare function textChangeRangeNewSpan(range: TextChangeRange): TextSpan; + + declare function textChangeRangeIsUnchanged(range: TextChangeRange): boolean; + + declare function createTextChangeRange( + span: TextSpan, + newLength: number + ): TextChangeRange; + + declare var unchangedTextChangeRange: TextChangeRange; + declare function collapseTextChangeRangesAcrossMultipleVersions( + changes: $ReadOnlyArray + ): TextChangeRange; + + declare function getTypeParameterOwner(d: Declaration): Declaration | void; + + declare type ParameterPropertyDeclaration = ParameterDeclaration & { + parent: ConstructorDeclaration, + name: Identifier, + ... + }; + declare function isParameterPropertyDeclaration(node: Node): boolean; + + declare function isEmptyBindingPattern(node: BindingName): boolean; + + declare function isEmptyBindingElement(node: BindingElement): boolean; + + declare function walkUpBindingElementsAndPatterns( + binding: BindingElement + ): VariableDeclaration | ParameterDeclaration; + + declare function getCombinedModifierFlags( + node: Declaration + ): $Values; + + declare function getCombinedNodeFlags(node: Node): $Values; + + declare function validateLocaleAndSetLanguage( + locale: string, + sys: { + getExecutingFilePath(): string, + resolvePath(path: string): string, + fileExists(fileName: string): boolean, + readFile(fileName: string): string | void, + ... + }, + errors?: Push + ): void; + + declare function getOriginalNode(node: Node): Node; + + declare function getOriginalNode( + node: Node, + nodeTest: (node: Node) => boolean + ): T; + + declare function getOriginalNode(node: Node | void): Node | void; + + declare function getOriginalNode( + node: Node | void, + nodeTest: (node: Node | void) => boolean + ): T | void; + + declare function isParseTreeNode(node: Node): boolean; + + declare function getParseTreeNode(node: Node): Node; + + declare function getParseTreeNode( + node: Node | void, + nodeTest?: (node: Node) => boolean + ): T | void; + + declare function escapeLeadingUnderscores(identifier: string): __String; + + declare function unescapeLeadingUnderscores(identifier: __String): string; + + declare function idText(identifier: Identifier): string; + + declare function symbolName(symbol: Symbol): string; + + declare function getNameOfJSDocTypedef( + declaration: JSDocTypedefTag + ): Identifier | void; + + declare function getNameOfDeclaration( + declaration: Declaration | Expression + ): DeclarationName | void; + + declare function getJSDocParameterTags( + param: ParameterDeclaration + ): $ReadOnlyArray; + + declare function getJSDocTypeParameterTags( + param: TypeParameterDeclaration + ): $ReadOnlyArray; + + declare function hasJSDocParameterTags( + node: FunctionLikeDeclaration | SignatureDeclaration + ): boolean; + + declare function getJSDocAugmentsTag(node: Node): JSDocAugmentsTag | void; + + declare function getJSDocClassTag(node: Node): JSDocClassTag | void; + + declare function getJSDocEnumTag(node: Node): JSDocEnumTag | void; + + declare function getJSDocThisTag(node: Node): JSDocThisTag | void; + + declare function getJSDocReturnTag(node: Node): JSDocReturnTag | void; + + declare function getJSDocTemplateTag(node: Node): JSDocTemplateTag | void; + + declare function getJSDocTypeTag(node: Node): JSDocTypeTag | void; + + declare function getJSDocType(node: Node): TypeNode | void; + + declare function getJSDocReturnType(node: Node): TypeNode | void; + + declare function getJSDocTags(node: Node): $ReadOnlyArray; + + declare function getAllJSDocTagsOfKind( + node: Node, + kind: $Values + ): $ReadOnlyArray; + + declare function getEffectiveTypeParameterDeclarations( + node: DeclarationWithTypeParameters + ): $ReadOnlyArray; + + declare function getEffectiveConstraintOfTypeParameter( + node: TypeParameterDeclaration + ): TypeNode | void; + + declare function isNumericLiteral(node: Node): boolean; + + declare function isBigIntLiteral(node: Node): boolean; + + declare function isStringLiteral(node: Node): boolean; + + declare function isJsxText(node: Node): boolean; + + declare function isRegularExpressionLiteral(node: Node): boolean; + + declare function isNoSubstitutionTemplateLiteral(node: Node): boolean; + + declare function isTemplateHead(node: Node): boolean; + + declare function isTemplateMiddle(node: Node): boolean; + + declare function isTemplateTail(node: Node): boolean; + + declare function isIdentifier(node: Node): boolean; + + declare function isQualifiedName(node: Node): boolean; + + declare function isComputedPropertyName(node: Node): boolean; + + declare function isTypeParameterDeclaration(node: Node): boolean; + + declare function isParameter(node: Node): boolean; + + declare function isDecorator(node: Node): boolean; + + declare function isPropertySignature(node: Node): boolean; + + declare function isPropertyDeclaration(node: Node): boolean; + + declare function isMethodSignature(node: Node): boolean; + + declare function isMethodDeclaration(node: Node): boolean; + + declare function isConstructorDeclaration(node: Node): boolean; + + declare function isGetAccessorDeclaration(node: Node): boolean; + + declare function isSetAccessorDeclaration(node: Node): boolean; + + declare function isCallSignatureDeclaration(node: Node): boolean; + + declare function isConstructSignatureDeclaration(node: Node): boolean; + + declare function isIndexSignatureDeclaration(node: Node): boolean; + + declare function isTypePredicateNode(node: Node): boolean; + + declare function isTypeReferenceNode(node: Node): boolean; + + declare function isFunctionTypeNode(node: Node): boolean; + + declare function isConstructorTypeNode(node: Node): boolean; + + declare function isTypeQueryNode(node: Node): boolean; + + declare function isTypeLiteralNode(node: Node): boolean; + + declare function isArrayTypeNode(node: Node): boolean; + + declare function isTupleTypeNode(node: Node): boolean; + + declare function isUnionTypeNode(node: Node): boolean; + + declare function isIntersectionTypeNode(node: Node): boolean; + + declare function isConditionalTypeNode(node: Node): boolean; + + declare function isInferTypeNode(node: Node): boolean; + + declare function isParenthesizedTypeNode(node: Node): boolean; + + declare function isThisTypeNode(node: Node): boolean; + + declare function isTypeOperatorNode(node: Node): boolean; + + declare function isIndexedAccessTypeNode(node: Node): boolean; + + declare function isMappedTypeNode(node: Node): boolean; + + declare function isLiteralTypeNode(node: Node): boolean; + + declare function isImportTypeNode(node: Node): boolean; + + declare function isObjectBindingPattern(node: Node): boolean; + + declare function isArrayBindingPattern(node: Node): boolean; + + declare function isBindingElement(node: Node): boolean; + + declare function isArrayLiteralExpression(node: Node): boolean; + + declare function isObjectLiteralExpression(node: Node): boolean; + + declare function isPropertyAccessExpression(node: Node): boolean; + + declare function isElementAccessExpression(node: Node): boolean; + + declare function isCallExpression(node: Node): boolean; + + declare function isNewExpression(node: Node): boolean; + + declare function isTaggedTemplateExpression(node: Node): boolean; + + declare function isTypeAssertion(node: Node): boolean; + + declare function isParenthesizedExpression(node: Node): boolean; + + declare function skipPartiallyEmittedExpressions( + node: Expression + ): Expression; + + declare function skipPartiallyEmittedExpressions(node: Node): Node; + + declare function isFunctionExpression(node: Node): boolean; + + declare function isArrowFunction(node: Node): boolean; + + declare function isDeleteExpression(node: Node): boolean; + + declare function isTypeOfExpression(node: Node): boolean; + + declare function isVoidExpression(node: Node): boolean; + + declare function isAwaitExpression(node: Node): boolean; + + declare function isPrefixUnaryExpression(node: Node): boolean; + + declare function isPostfixUnaryExpression(node: Node): boolean; + + declare function isBinaryExpression(node: Node): boolean; + + declare function isConditionalExpression(node: Node): boolean; + + declare function isTemplateExpression(node: Node): boolean; + + declare function isYieldExpression(node: Node): boolean; + + declare function isSpreadElement(node: Node): boolean; + + declare function isClassExpression(node: Node): boolean; + + declare function isOmittedExpression(node: Node): boolean; + + declare function isExpressionWithTypeArguments(node: Node): boolean; + + declare function isAsExpression(node: Node): boolean; + + declare function isNonNullExpression(node: Node): boolean; + + declare function isMetaProperty(node: Node): boolean; + + declare function isTemplateSpan(node: Node): boolean; + + declare function isSemicolonClassElement(node: Node): boolean; + + declare function isBlock(node: Node): boolean; + + declare function isVariableStatement(node: Node): boolean; + + declare function isEmptyStatement(node: Node): boolean; + + declare function isExpressionStatement(node: Node): boolean; + + declare function isIfStatement(node: Node): boolean; + + declare function isDoStatement(node: Node): boolean; + + declare function isWhileStatement(node: Node): boolean; + + declare function isForStatement(node: Node): boolean; + + declare function isForInStatement(node: Node): boolean; + + declare function isForOfStatement(node: Node): boolean; + + declare function isContinueStatement(node: Node): boolean; + + declare function isBreakStatement(node: Node): boolean; + + declare function isBreakOrContinueStatement(node: Node): boolean; + + declare function isReturnStatement(node: Node): boolean; + + declare function isWithStatement(node: Node): boolean; + + declare function isSwitchStatement(node: Node): boolean; + + declare function isLabeledStatement(node: Node): boolean; + + declare function isThrowStatement(node: Node): boolean; + + declare function isTryStatement(node: Node): boolean; + + declare function isDebuggerStatement(node: Node): boolean; + + declare function isVariableDeclaration(node: Node): boolean; + + declare function isVariableDeclarationList(node: Node): boolean; + + declare function isFunctionDeclaration(node: Node): boolean; + + declare function isClassDeclaration(node: Node): boolean; + + declare function isInterfaceDeclaration(node: Node): boolean; + + declare function isTypeAliasDeclaration(node: Node): boolean; + + declare function isEnumDeclaration(node: Node): boolean; + + declare function isModuleDeclaration(node: Node): boolean; + + declare function isModuleBlock(node: Node): boolean; + + declare function isCaseBlock(node: Node): boolean; + + declare function isNamespaceExportDeclaration(node: Node): boolean; + + declare function isImportEqualsDeclaration(node: Node): boolean; + + declare function isImportDeclaration(node: Node): boolean; + + declare function isImportClause(node: Node): boolean; + + declare function isNamespaceImport(node: Node): boolean; + + declare function isNamedImports(node: Node): boolean; + + declare function isImportSpecifier(node: Node): boolean; + + declare function isExportAssignment(node: Node): boolean; + + declare function isExportDeclaration(node: Node): boolean; + + declare function isNamedExports(node: Node): boolean; + + declare function isExportSpecifier(node: Node): boolean; + + declare function isMissingDeclaration(node: Node): boolean; + + declare function isExternalModuleReference(node: Node): boolean; + + declare function isJsxElement(node: Node): boolean; + + declare function isJsxSelfClosingElement(node: Node): boolean; + + declare function isJsxOpeningElement(node: Node): boolean; + + declare function isJsxClosingElement(node: Node): boolean; + + declare function isJsxFragment(node: Node): boolean; + + declare function isJsxOpeningFragment(node: Node): boolean; + + declare function isJsxClosingFragment(node: Node): boolean; + + declare function isJsxAttribute(node: Node): boolean; + + declare function isJsxAttributes(node: Node): boolean; + + declare function isJsxSpreadAttribute(node: Node): boolean; + + declare function isJsxExpression(node: Node): boolean; + + declare function isCaseClause(node: Node): boolean; + + declare function isDefaultClause(node: Node): boolean; + + declare function isHeritageClause(node: Node): boolean; + + declare function isCatchClause(node: Node): boolean; + + declare function isPropertyAssignment(node: Node): boolean; + + declare function isShorthandPropertyAssignment(node: Node): boolean; + + declare function isSpreadAssignment(node: Node): boolean; + + declare function isEnumMember(node: Node): boolean; + + declare function isSourceFile(node: Node): boolean; + + declare function isBundle(node: Node): boolean; + + declare function isUnparsedSource(node: Node): boolean; + + declare function isJSDocTypeExpression(node: Node): boolean; + + declare function isJSDocAllType(node: JSDocAllType): boolean; + + declare function isJSDocUnknownType(node: Node): boolean; + + declare function isJSDocNullableType(node: Node): boolean; + + declare function isJSDocNonNullableType(node: Node): boolean; + + declare function isJSDocOptionalType(node: Node): boolean; + + declare function isJSDocFunctionType(node: Node): boolean; + + declare function isJSDocVariadicType(node: Node): boolean; + + declare function isJSDoc(node: Node): boolean; + + declare function isJSDocAugmentsTag(node: Node): boolean; + + declare function isJSDocClassTag(node: Node): boolean; + + declare function isJSDocEnumTag(node: Node): boolean; + + declare function isJSDocThisTag(node: Node): boolean; + + declare function isJSDocParameterTag(node: Node): boolean; + + declare function isJSDocReturnTag(node: Node): boolean; + + declare function isJSDocTypeTag(node: Node): boolean; + + declare function isJSDocTemplateTag(node: Node): boolean; + + declare function isJSDocTypedefTag(node: Node): boolean; + + declare function isJSDocPropertyTag(node: Node): boolean; + + declare function isJSDocPropertyLikeTag(node: Node): boolean; + + declare function isJSDocTypeLiteral(node: Node): boolean; + + declare function isJSDocCallbackTag(node: Node): boolean; + + declare function isJSDocSignature(node: Node): boolean; + + declare function isToken(n: Node): boolean; + + declare function isLiteralExpression(node: Node): boolean; + + declare type TemplateLiteralToken = + | NoSubstitutionTemplateLiteral + | TemplateHead + | TemplateMiddle + | TemplateTail; + declare function isTemplateLiteralToken(node: Node): boolean; + + declare function isTemplateMiddleOrTemplateTail(node: Node): boolean; + + declare function isImportOrExportSpecifier(node: Node): boolean; + + declare function isStringTextContainingNode(node: Node): boolean; + + declare function isModifier(node: Node): boolean; + + declare function isEntityName(node: Node): boolean; + + declare function isPropertyName(node: Node): boolean; + + declare function isBindingName(node: Node): boolean; + + declare function isFunctionLike(node: Node): boolean; + + declare function isClassElement(node: Node): boolean; + + declare function isClassLike(node: Node): boolean; + + declare function isAccessor(node: Node): boolean; + + declare function isTypeElement(node: Node): boolean; + + declare function isClassOrTypeElement(node: Node): boolean; + + declare function isObjectLiteralElementLike(node: Node): boolean; + + declare function isTypeNode(node: Node): boolean; + + declare function isFunctionOrConstructorTypeNode(node: Node): boolean; + + declare function isPropertyAccessOrQualifiedName(node: Node): boolean; + + declare function isCallLikeExpression(node: Node): boolean; + + declare function isCallOrNewExpression(node: Node): boolean; + + declare function isTemplateLiteral(node: Node): boolean; + + declare function isAssertionExpression(node: Node): boolean; + + declare function isIterationStatement( + node: Node, + lookInLabeledStatements: false + ): boolean; + + declare function isIterationStatement( + node: Node, + lookInLabeledStatements: boolean + ): boolean; + + declare function isJsxOpeningLikeElement(node: Node): boolean; + + declare function isCaseOrDefaultClause(node: Node): boolean; + + declare function isJSDocCommentContainingNode(node: Node): boolean; + + declare function isSetAccessor(node: Node): boolean; + + declare function isGetAccessor(node: Node): boolean; + + declare function isObjectLiteralElement(node: Node): boolean; + + declare function isStringLiteralLike(node: Node): boolean; + + declare function createNode( + kind: $Values, + pos?: number, + end?: number + ): Node; + + declare function forEachChild( + node: Node, + cbNode: (node: Node) => T | void, + cbNodes?: (nodes: NodeArray) => T | void + ): T | void; + + declare function createSourceFile( + fileName: string, + sourceText: string, + languageVersion: $Values, + setParentNodes?: boolean, + scriptKind?: $Values + ): SourceFile; + + declare function parseIsolatedEntityName( + text: string, + languageVersion: $Values + ): EntityName | void; + + declare function parseJsonText( + fileName: string, + sourceText: string + ): JsonSourceFile; + + declare function isExternalModule(file: SourceFile): boolean; + + declare function updateSourceFile( + sourceFile: SourceFile, + newText: string, + textChangeRange: TextChangeRange, + aggressiveChecks?: boolean + ): SourceFile; + + declare function parseCommandLine( + commandLine: $ReadOnlyArray, + readFile?: (path: string) => string | void + ): ParsedCommandLine; + + declare type DiagnosticReporter = (diagnostic: Diagnostic) => void; + declare type ConfigFileDiagnosticsReporter = { onUnRecoverableConfigFileDiagnostic: DiagnosticReporter, ... }; + + declare type ParseConfigFileHost = { + ...$Exact, + ...$Exact, + getCurrentDirectory(): string, + ... + }; + + declare function getParsedCommandLineOfConfigFile( + configFileName: string, + optionsToExtend: CompilerOptions, + host: ParseConfigFileHost + ): ParsedCommandLine | void; + + declare function readConfigFile( + fileName: string, + readFile: (path: string) => string | void + ): { + config?: any, + error?: Diagnostic, + ... + }; + + declare function parseConfigFileTextToJson( + fileName: string, + jsonText: string + ): { + config?: any, + error?: Diagnostic, + ... + }; + + declare function readJsonConfigFile( + fileName: string, + readFile: (path: string) => string | void + ): TsConfigSourceFile; + + declare function convertToObject( + sourceFile: JsonSourceFile, + errors: Push + ): any; + + declare function parseJsonConfigFileContent( + json: any, + host: ParseConfigHost, + basePath: string, + existingOptions?: CompilerOptions, + configFileName?: string, + resolutionStack?: Path[], + extraFileExtensions?: $ReadOnlyArray + ): ParsedCommandLine; + + declare function parseJsonSourceFileConfigFileContent( + sourceFile: TsConfigSourceFile, + host: ParseConfigHost, + basePath: string, + existingOptions?: CompilerOptions, + configFileName?: string, + resolutionStack?: Path[], + extraFileExtensions?: $ReadOnlyArray + ): ParsedCommandLine; + + declare function convertCompilerOptionsFromJson( + jsonOptions: any, + basePath: string, + configFileName?: string + ): { + options: CompilerOptions, + errors: Diagnostic[], + ... + }; + + declare function convertTypeAcquisitionFromJson( + jsonOptions: any, + basePath: string, + configFileName?: string + ): { + options: TypeAcquisition, + errors: Diagnostic[], + ... + }; + + declare function getEffectiveTypeRoots( + options: CompilerOptions, + host: GetEffectiveTypeRootsHost + ): string[] | void; + + declare function resolveTypeReferenceDirective( + typeReferenceDirectiveName: string, + containingFile: string | void, + options: CompilerOptions, + host: ModuleResolutionHost, + redirectedReference?: ResolvedProjectReference + ): ResolvedTypeReferenceDirectiveWithFailedLookupLocations; + + declare function getAutomaticTypeDirectiveNames( + options: CompilerOptions, + host: ModuleResolutionHost + ): string[]; + + declare type ModuleResolutionCache = { + ...$Exact, + getOrCreateCacheForDirectory( + directoryName: string, + redirectedReference?: ResolvedProjectReference + ): Map, + ... + }; + + declare type NonRelativeModuleNameResolutionCache = { getOrCreateCacheForModuleName( + nonRelativeModuleName: string, + redirectedReference?: ResolvedProjectReference + ): PerModuleNameCache, ... }; + + declare type PerModuleNameCache = { + get(directory: string): ResolvedModuleWithFailedLookupLocations | void, + set( + directory: string, + result: ResolvedModuleWithFailedLookupLocations + ): void, + ... + }; + + declare function createModuleResolutionCache( + currentDirectory: string, + getCanonicalFileName: (s: string) => string + ): ModuleResolutionCache; + + declare function resolveModuleNameFromCache( + moduleName: string, + containingFile: string, + cache: ModuleResolutionCache + ): ResolvedModuleWithFailedLookupLocations | void; + + declare function resolveModuleName( + moduleName: string, + containingFile: string, + compilerOptions: CompilerOptions, + host: ModuleResolutionHost, + cache?: ModuleResolutionCache, + redirectedReference?: ResolvedProjectReference + ): ResolvedModuleWithFailedLookupLocations; + + declare function nodeModuleNameResolver( + moduleName: string, + containingFile: string, + compilerOptions: CompilerOptions, + host: ModuleResolutionHost, + cache?: ModuleResolutionCache, + redirectedReference?: ResolvedProjectReference + ): ResolvedModuleWithFailedLookupLocations; + + declare function classicNameResolver( + moduleName: string, + containingFile: string, + compilerOptions: CompilerOptions, + host: ModuleResolutionHost, + cache?: NonRelativeModuleNameResolutionCache, + redirectedReference?: ResolvedProjectReference + ): ResolvedModuleWithFailedLookupLocations; + + declare function createNodeArray( + elements?: $ReadOnlyArray, + hasTrailingComma?: boolean + ): NodeArray; + + declare function createLiteral( + value: + | string + | StringLiteral + | NoSubstitutionTemplateLiteral + | NumericLiteral + | Identifier + ): StringLiteral; + + declare function createLiteral(value: number | PseudoBigInt): NumericLiteral; + + declare function createLiteral(value: boolean): BooleanLiteral; + + declare function createLiteral( + value: string | number | PseudoBigInt | boolean + ): PrimaryExpression; + + declare function createNumericLiteral(value: string): NumericLiteral; + + declare function createBigIntLiteral(value: string): BigIntLiteral; + + declare function createStringLiteral(text: string): StringLiteral; + + declare function createRegularExpressionLiteral( + text: string + ): RegularExpressionLiteral; + + declare function createIdentifier(text: string): Identifier; + + declare function updateIdentifier(node: Identifier): Identifier; + + declare function createTempVariable( + recordTempVariable: ((node: Identifier) => void) | void + ): Identifier; + + declare function createLoopVariable(): Identifier; + + declare function createUniqueName(text: string): Identifier; + + declare function createOptimisticUniqueName(text: string): Identifier; + + declare function createFileLevelUniqueName(text: string): Identifier; + + declare function getGeneratedNameForNode(node: Node | void): Identifier; + + declare function createToken>( + token: TKind + ): Token; + + declare function createSuper(): SuperExpression; + + declare function createThis(): ThisExpression & + Token; + + declare function createNull(): NullLiteral & + Token; + + declare function createTrue(): BooleanLiteral & + Token; + + declare function createFalse(): BooleanLiteral & + Token; + + declare function createModifier>( + kind: T + ): Token; + + declare function createModifiersFromModifierFlags( + flags: $Values + ): Modifier[]; + + declare function createQualifiedName( + left: EntityName, + right: string | Identifier + ): QualifiedName; + + declare function updateQualifiedName( + node: QualifiedName, + left: EntityName, + right: Identifier + ): QualifiedName; + + declare function createComputedPropertyName( + expression: Expression + ): ComputedPropertyName; + + declare function updateComputedPropertyName( + node: ComputedPropertyName, + expression: Expression + ): ComputedPropertyName; + + declare function createTypeParameterDeclaration( + name: string | Identifier, + constraint?: TypeNode, + defaultType?: TypeNode + ): TypeParameterDeclaration; + + declare function updateTypeParameterDeclaration( + node: TypeParameterDeclaration, + name: Identifier, + constraint: TypeNode | void, + defaultType: TypeNode | void + ): TypeParameterDeclaration; + + declare function createParameter( + decorators: $ReadOnlyArray | void, + modifiers: $ReadOnlyArray | void, + dotDotDotToken: DotDotDotToken | void, + name: string | BindingName, + questionToken?: QuestionToken, + type?: TypeNode, + initializer?: Expression + ): ParameterDeclaration; + + declare function updateParameter( + node: ParameterDeclaration, + decorators: $ReadOnlyArray | void, + modifiers: $ReadOnlyArray | void, + dotDotDotToken: DotDotDotToken | void, + name: string | BindingName, + questionToken: QuestionToken | void, + type: TypeNode | void, + initializer: Expression | void + ): ParameterDeclaration; + + declare function createDecorator(expression: Expression): Decorator; + + declare function updateDecorator( + node: Decorator, + expression: Expression + ): Decorator; + + declare function createPropertySignature( + modifiers: $ReadOnlyArray | void, + name: PropertyName | string, + questionToken: QuestionToken | void, + type: TypeNode | void, + initializer: Expression | void + ): PropertySignature; + + declare function updatePropertySignature( + node: PropertySignature, + modifiers: $ReadOnlyArray | void, + name: PropertyName, + questionToken: QuestionToken | void, + type: TypeNode | void, + initializer: Expression | void + ): PropertySignature; + + declare function createProperty( + decorators: $ReadOnlyArray | void, + modifiers: $ReadOnlyArray | void, + name: string | PropertyName, + questionOrExclamationToken: QuestionToken | ExclamationToken | void, + type: TypeNode | void, + initializer: Expression | void + ): PropertyDeclaration; + + declare function updateProperty( + node: PropertyDeclaration, + decorators: $ReadOnlyArray | void, + modifiers: $ReadOnlyArray | void, + name: string | PropertyName, + questionOrExclamationToken: QuestionToken | ExclamationToken | void, + type: TypeNode | void, + initializer: Expression | void + ): PropertyDeclaration; + + declare function createMethodSignature( + typeParameters: $ReadOnlyArray | void, + parameters: $ReadOnlyArray, + type: TypeNode | void, + name: string | PropertyName, + questionToken: QuestionToken | void + ): MethodSignature; + + declare function updateMethodSignature( + node: MethodSignature, + typeParameters: NodeArray | void, + parameters: NodeArray, + type: TypeNode | void, + name: PropertyName, + questionToken: QuestionToken | void + ): MethodSignature; + + declare function createMethod( + decorators: $ReadOnlyArray | void, + modifiers: $ReadOnlyArray | void, + asteriskToken: AsteriskToken | void, + name: string | PropertyName, + questionToken: QuestionToken | void, + typeParameters: $ReadOnlyArray | void, + parameters: $ReadOnlyArray, + type: TypeNode | void, + body: Block | void + ): MethodDeclaration; + + declare function updateMethod( + node: MethodDeclaration, + decorators: $ReadOnlyArray | void, + modifiers: $ReadOnlyArray | void, + asteriskToken: AsteriskToken | void, + name: PropertyName, + questionToken: QuestionToken | void, + typeParameters: $ReadOnlyArray | void, + parameters: $ReadOnlyArray, + type: TypeNode | void, + body: Block | void + ): MethodDeclaration; + + declare function createConstructor( + decorators: $ReadOnlyArray | void, + modifiers: $ReadOnlyArray | void, + parameters: $ReadOnlyArray, + body: Block | void + ): ConstructorDeclaration; + + declare function updateConstructor( + node: ConstructorDeclaration, + decorators: $ReadOnlyArray | void, + modifiers: $ReadOnlyArray | void, + parameters: $ReadOnlyArray, + body: Block | void + ): ConstructorDeclaration; + + declare function createGetAccessor( + decorators: $ReadOnlyArray | void, + modifiers: $ReadOnlyArray | void, + name: string | PropertyName, + parameters: $ReadOnlyArray, + type: TypeNode | void, + body: Block | void + ): GetAccessorDeclaration; + + declare function updateGetAccessor( + node: GetAccessorDeclaration, + decorators: $ReadOnlyArray | void, + modifiers: $ReadOnlyArray | void, + name: PropertyName, + parameters: $ReadOnlyArray, + type: TypeNode | void, + body: Block | void + ): GetAccessorDeclaration; + + declare function createSetAccessor( + decorators: $ReadOnlyArray | void, + modifiers: $ReadOnlyArray | void, + name: string | PropertyName, + parameters: $ReadOnlyArray, + body: Block | void + ): SetAccessorDeclaration; + + declare function updateSetAccessor( + node: SetAccessorDeclaration, + decorators: $ReadOnlyArray | void, + modifiers: $ReadOnlyArray | void, + name: PropertyName, + parameters: $ReadOnlyArray, + body: Block | void + ): SetAccessorDeclaration; + + declare function createCallSignature( + typeParameters: $ReadOnlyArray | void, + parameters: $ReadOnlyArray, + type: TypeNode | void + ): CallSignatureDeclaration; + + declare function updateCallSignature( + node: CallSignatureDeclaration, + typeParameters: NodeArray | void, + parameters: NodeArray, + type: TypeNode | void + ): CallSignatureDeclaration; + + declare function createConstructSignature( + typeParameters: $ReadOnlyArray | void, + parameters: $ReadOnlyArray, + type: TypeNode | void + ): ConstructSignatureDeclaration; + + declare function updateConstructSignature( + node: ConstructSignatureDeclaration, + typeParameters: NodeArray | void, + parameters: NodeArray, + type: TypeNode | void + ): ConstructSignatureDeclaration; + + declare function createIndexSignature( + decorators: $ReadOnlyArray | void, + modifiers: $ReadOnlyArray | void, + parameters: $ReadOnlyArray, + type: TypeNode + ): IndexSignatureDeclaration; + + declare function updateIndexSignature( + node: IndexSignatureDeclaration, + decorators: $ReadOnlyArray | void, + modifiers: $ReadOnlyArray | void, + parameters: $ReadOnlyArray, + type: TypeNode + ): IndexSignatureDeclaration; + + declare function createKeywordTypeNode( + kind: $ElementType + ): KeywordTypeNode; + + declare function createTypePredicateNode( + parameterName: Identifier | ThisTypeNode | string, + type: TypeNode + ): TypePredicateNode; + + declare function updateTypePredicateNode( + node: TypePredicateNode, + parameterName: Identifier | ThisTypeNode, + type: TypeNode + ): TypePredicateNode; + + declare function createTypeReferenceNode( + typeName: string | EntityName, + typeArguments: $ReadOnlyArray | void + ): TypeReferenceNode; + + declare function updateTypeReferenceNode( + node: TypeReferenceNode, + typeName: EntityName, + typeArguments: NodeArray | void + ): TypeReferenceNode; + + declare function createFunctionTypeNode( + typeParameters: $ReadOnlyArray | void, + parameters: $ReadOnlyArray, + type: TypeNode | void + ): FunctionTypeNode; + + declare function updateFunctionTypeNode( + node: FunctionTypeNode, + typeParameters: NodeArray | void, + parameters: NodeArray, + type: TypeNode | void + ): FunctionTypeNode; + + declare function createConstructorTypeNode( + typeParameters: $ReadOnlyArray | void, + parameters: $ReadOnlyArray, + type: TypeNode | void + ): ConstructorTypeNode; + + declare function updateConstructorTypeNode( + node: ConstructorTypeNode, + typeParameters: NodeArray | void, + parameters: NodeArray, + type: TypeNode | void + ): ConstructorTypeNode; + + declare function createTypeQueryNode(exprName: EntityName): TypeQueryNode; + + declare function updateTypeQueryNode( + node: TypeQueryNode, + exprName: EntityName + ): TypeQueryNode; + + declare function createTypeLiteralNode( + members: $ReadOnlyArray | void + ): TypeLiteralNode; + + declare function updateTypeLiteralNode( + node: TypeLiteralNode, + members: NodeArray + ): TypeLiteralNode; + + declare function createArrayTypeNode(elementType: TypeNode): ArrayTypeNode; + + declare function updateArrayTypeNode( + node: ArrayTypeNode, + elementType: TypeNode + ): ArrayTypeNode; + + declare function createTupleTypeNode( + elementTypes: $ReadOnlyArray + ): TupleTypeNode; + + declare function updateTupleTypeNode( + node: TupleTypeNode, + elementTypes: $ReadOnlyArray + ): TupleTypeNode; + + declare function createOptionalTypeNode(type: TypeNode): OptionalTypeNode; + + declare function updateOptionalTypeNode( + node: OptionalTypeNode, + type: TypeNode + ): OptionalTypeNode; + + declare function createRestTypeNode(type: TypeNode): RestTypeNode; + + declare function updateRestTypeNode( + node: RestTypeNode, + type: TypeNode + ): RestTypeNode; + + declare function createUnionTypeNode( + types: $ReadOnlyArray + ): UnionTypeNode; + + declare function updateUnionTypeNode( + node: UnionTypeNode, + types: NodeArray + ): UnionTypeNode; + + declare function createIntersectionTypeNode( + types: $ReadOnlyArray + ): IntersectionTypeNode; + + declare function updateIntersectionTypeNode( + node: IntersectionTypeNode, + types: NodeArray + ): IntersectionTypeNode; + + declare function createUnionOrIntersectionTypeNode( + kind: typeof SyntaxKind.UnionType | typeof SyntaxKind.IntersectionType, + types: $ReadOnlyArray + ): UnionOrIntersectionTypeNode; + + declare function createConditionalTypeNode( + checkType: TypeNode, + extendsType: TypeNode, + trueType: TypeNode, + falseType: TypeNode + ): ConditionalTypeNode; + + declare function updateConditionalTypeNode( + node: ConditionalTypeNode, + checkType: TypeNode, + extendsType: TypeNode, + trueType: TypeNode, + falseType: TypeNode + ): ConditionalTypeNode; + + declare function createInferTypeNode( + typeParameter: TypeParameterDeclaration + ): InferTypeNode; + + declare function updateInferTypeNode( + node: InferTypeNode, + typeParameter: TypeParameterDeclaration + ): InferTypeNode; + + declare function createImportTypeNode( + argument: TypeNode, + qualifier?: EntityName, + typeArguments?: $ReadOnlyArray, + isTypeOf?: boolean + ): ImportTypeNode; + + declare function updateImportTypeNode( + node: ImportTypeNode, + argument: TypeNode, + qualifier?: EntityName, + typeArguments?: $ReadOnlyArray, + isTypeOf?: boolean + ): ImportTypeNode; + + declare function createParenthesizedType( + type: TypeNode + ): ParenthesizedTypeNode; + + declare function updateParenthesizedType( + node: ParenthesizedTypeNode, + type: TypeNode + ): ParenthesizedTypeNode; + + declare function createThisTypeNode(): ThisTypeNode; + + declare function createTypeOperatorNode(type: TypeNode): TypeOperatorNode; + + declare function createTypeOperatorNode( + operator: typeof SyntaxKind.KeyOfKeyword | typeof SyntaxKind.UniqueKeyword, + type: TypeNode + ): TypeOperatorNode; + + declare function updateTypeOperatorNode( + node: TypeOperatorNode, + type: TypeNode + ): TypeOperatorNode; + + declare function createIndexedAccessTypeNode( + objectType: TypeNode, + indexType: TypeNode + ): IndexedAccessTypeNode; + + declare function updateIndexedAccessTypeNode( + node: IndexedAccessTypeNode, + objectType: TypeNode, + indexType: TypeNode + ): IndexedAccessTypeNode; + + declare function createMappedTypeNode( + readonlyToken: ReadonlyToken | PlusToken | MinusToken | void, + typeParameter: TypeParameterDeclaration, + questionToken: QuestionToken | PlusToken | MinusToken | void, + type: TypeNode | void + ): MappedTypeNode; + + declare function updateMappedTypeNode( + node: MappedTypeNode, + readonlyToken: ReadonlyToken | PlusToken | MinusToken | void, + typeParameter: TypeParameterDeclaration, + questionToken: QuestionToken | PlusToken | MinusToken | void, + type: TypeNode | void + ): MappedTypeNode; + + declare function createLiteralTypeNode( + literal: $ElementType + ): LiteralTypeNode; + + declare function updateLiteralTypeNode( + node: LiteralTypeNode, + literal: $ElementType + ): LiteralTypeNode; + + declare function createObjectBindingPattern( + elements: $ReadOnlyArray + ): ObjectBindingPattern; + + declare function updateObjectBindingPattern( + node: ObjectBindingPattern, + elements: $ReadOnlyArray + ): ObjectBindingPattern; + + declare function createArrayBindingPattern( + elements: $ReadOnlyArray + ): ArrayBindingPattern; + + declare function updateArrayBindingPattern( + node: ArrayBindingPattern, + elements: $ReadOnlyArray + ): ArrayBindingPattern; + + declare function createBindingElement( + dotDotDotToken: DotDotDotToken | void, + propertyName: string | PropertyName | void, + name: string | BindingName, + initializer?: Expression + ): BindingElement; + + declare function updateBindingElement( + node: BindingElement, + dotDotDotToken: DotDotDotToken | void, + propertyName: PropertyName | void, + name: BindingName, + initializer: Expression | void + ): BindingElement; + + declare function createArrayLiteral( + elements?: $ReadOnlyArray, + multiLine?: boolean + ): ArrayLiteralExpression; + + declare function updateArrayLiteral( + node: ArrayLiteralExpression, + elements: $ReadOnlyArray + ): ArrayLiteralExpression; + + declare function createObjectLiteral( + properties?: $ReadOnlyArray, + multiLine?: boolean + ): ObjectLiteralExpression; + + declare function updateObjectLiteral( + node: ObjectLiteralExpression, + properties: $ReadOnlyArray + ): ObjectLiteralExpression; + + declare function createPropertyAccess( + expression: Expression, + name: string | Identifier | void + ): PropertyAccessExpression; + + declare function updatePropertyAccess( + node: PropertyAccessExpression, + expression: Expression, + name: Identifier + ): PropertyAccessExpression; + + declare function createElementAccess( + expression: Expression, + index: number | Expression + ): ElementAccessExpression; + + declare function updateElementAccess( + node: ElementAccessExpression, + expression: Expression, + argumentExpression: Expression + ): ElementAccessExpression; + + declare function createCall( + expression: Expression, + typeArguments: $ReadOnlyArray | void, + argumentsArray: $ReadOnlyArray | void + ): CallExpression; + + declare function updateCall( + node: CallExpression, + expression: Expression, + typeArguments: $ReadOnlyArray | void, + argumentsArray: $ReadOnlyArray + ): CallExpression; + + declare function createNew( + expression: Expression, + typeArguments: $ReadOnlyArray | void, + argumentsArray: $ReadOnlyArray | void + ): NewExpression; + + declare function updateNew( + node: NewExpression, + expression: Expression, + typeArguments: $ReadOnlyArray | void, + argumentsArray: $ReadOnlyArray | void + ): NewExpression; + + declare function createTaggedTemplate( + tag: Expression, + template: TemplateLiteral + ): TaggedTemplateExpression; + + declare function createTaggedTemplate( + tag: Expression, + typeArguments: $ReadOnlyArray | void, + template: TemplateLiteral + ): TaggedTemplateExpression; + + declare function updateTaggedTemplate( + node: TaggedTemplateExpression, + tag: Expression, + template: TemplateLiteral + ): TaggedTemplateExpression; + + declare function updateTaggedTemplate( + node: TaggedTemplateExpression, + tag: Expression, + typeArguments: $ReadOnlyArray | void, + template: TemplateLiteral + ): TaggedTemplateExpression; + + declare function createTypeAssertion( + type: TypeNode, + expression: Expression + ): TypeAssertion; + + declare function updateTypeAssertion( + node: TypeAssertion, + type: TypeNode, + expression: Expression + ): TypeAssertion; + + declare function createParen(expression: Expression): ParenthesizedExpression; + + declare function updateParen( + node: ParenthesizedExpression, + expression: Expression + ): ParenthesizedExpression; + + declare function createFunctionExpression( + modifiers: $ReadOnlyArray | void, + asteriskToken: AsteriskToken | void, + name: string | Identifier | void, + typeParameters: $ReadOnlyArray | void, + parameters: $ReadOnlyArray | void, + type: TypeNode | void, + body: Block + ): FunctionExpression; + + declare function updateFunctionExpression( + node: FunctionExpression, + modifiers: $ReadOnlyArray | void, + asteriskToken: AsteriskToken | void, + name: Identifier | void, + typeParameters: $ReadOnlyArray | void, + parameters: $ReadOnlyArray, + type: TypeNode | void, + body: Block + ): FunctionExpression; + + declare function createArrowFunction( + modifiers: $ReadOnlyArray | void, + typeParameters: $ReadOnlyArray | void, + parameters: $ReadOnlyArray, + type: TypeNode | void, + equalsGreaterThanToken: EqualsGreaterThanToken | void, + body: ConciseBody + ): ArrowFunction; + + declare function updateArrowFunction( + node: ArrowFunction, + modifiers: $ReadOnlyArray | void, + typeParameters: $ReadOnlyArray | void, + parameters: $ReadOnlyArray, + type: TypeNode | void, + equalsGreaterThanToken: Token, + body: ConciseBody + ): ArrowFunction; + + declare function createDelete(expression: Expression): DeleteExpression; + + declare function updateDelete( + node: DeleteExpression, + expression: Expression + ): DeleteExpression; + + declare function createTypeOf(expression: Expression): TypeOfExpression; + + declare function updateTypeOf( + node: TypeOfExpression, + expression: Expression + ): TypeOfExpression; + + declare function createVoid(expression: Expression): VoidExpression; + + declare function updateVoid( + node: VoidExpression, + expression: Expression + ): VoidExpression; + + declare function createAwait(expression: Expression): AwaitExpression; + + declare function updateAwait( + node: AwaitExpression, + expression: Expression + ): AwaitExpression; + + declare function createPrefix( + operator: PrefixUnaryOperator, + operand: Expression + ): PrefixUnaryExpression; + + declare function updatePrefix( + node: PrefixUnaryExpression, + operand: Expression + ): PrefixUnaryExpression; + + declare function createPostfix( + operand: Expression, + operator: PostfixUnaryOperator + ): PostfixUnaryExpression; + + declare function updatePostfix( + node: PostfixUnaryExpression, + operand: Expression + ): PostfixUnaryExpression; + + declare function createBinary( + left: Expression, + operator: BinaryOperator | BinaryOperatorToken, + right: Expression + ): BinaryExpression; + + declare function updateBinary( + node: BinaryExpression, + left: Expression, + right: Expression, + operator?: BinaryOperator | BinaryOperatorToken + ): BinaryExpression; + + declare function createConditional( + condition: Expression, + whenTrue: Expression, + whenFalse: Expression + ): ConditionalExpression; + + declare function createConditional( + condition: Expression, + questionToken: QuestionToken, + whenTrue: Expression, + colonToken: ColonToken, + whenFalse: Expression + ): ConditionalExpression; + + declare function updateConditional( + node: ConditionalExpression, + condition: Expression, + questionToken: Token, + whenTrue: Expression, + colonToken: Token, + whenFalse: Expression + ): ConditionalExpression; + + declare function createTemplateExpression( + head: TemplateHead, + templateSpans: $ReadOnlyArray + ): TemplateExpression; + + declare function updateTemplateExpression( + node: TemplateExpression, + head: TemplateHead, + templateSpans: $ReadOnlyArray + ): TemplateExpression; + + declare function createTemplateHead(text: string): TemplateHead; + + declare function createTemplateMiddle(text: string): TemplateMiddle; + + declare function createTemplateTail(text: string): TemplateTail; + + declare function createNoSubstitutionTemplateLiteral( + text: string + ): NoSubstitutionTemplateLiteral; + + declare function createYield(expression?: Expression): YieldExpression; + + declare function createYield( + asteriskToken: AsteriskToken | void, + expression: Expression + ): YieldExpression; + + declare function updateYield( + node: YieldExpression, + asteriskToken: AsteriskToken | void, + expression: Expression + ): YieldExpression; + + declare function createSpread(expression: Expression): SpreadElement; + + declare function updateSpread( + node: SpreadElement, + expression: Expression + ): SpreadElement; + + declare function createClassExpression( + modifiers: $ReadOnlyArray | void, + name: string | Identifier | void, + typeParameters: $ReadOnlyArray | void, + heritageClauses: $ReadOnlyArray | void, + members: $ReadOnlyArray + ): ClassExpression; + + declare function updateClassExpression( + node: ClassExpression, + modifiers: $ReadOnlyArray | void, + name: Identifier | void, + typeParameters: $ReadOnlyArray | void, + heritageClauses: $ReadOnlyArray | void, + members: $ReadOnlyArray + ): ClassExpression; + + declare function createOmittedExpression(): OmittedExpression; + + declare function createExpressionWithTypeArguments( + typeArguments: $ReadOnlyArray | void, + expression: Expression + ): ExpressionWithTypeArguments; + + declare function updateExpressionWithTypeArguments( + node: ExpressionWithTypeArguments, + typeArguments: $ReadOnlyArray | void, + expression: Expression + ): ExpressionWithTypeArguments; + + declare function createAsExpression( + expression: Expression, + type: TypeNode + ): AsExpression; + + declare function updateAsExpression( + node: AsExpression, + expression: Expression, + type: TypeNode + ): AsExpression; + + declare function createNonNullExpression( + expression: Expression + ): NonNullExpression; + + declare function updateNonNullExpression( + node: NonNullExpression, + expression: Expression + ): NonNullExpression; + + declare function createMetaProperty( + keywordToken: $ElementType, + name: Identifier + ): MetaProperty; + + declare function updateMetaProperty( + node: MetaProperty, + name: Identifier + ): MetaProperty; + + declare function createTemplateSpan( + expression: Expression, + literal: TemplateMiddle | TemplateTail + ): TemplateSpan; + + declare function updateTemplateSpan( + node: TemplateSpan, + expression: Expression, + literal: TemplateMiddle | TemplateTail + ): TemplateSpan; + + declare function createSemicolonClassElement(): SemicolonClassElement; + + declare function createBlock( + statements: $ReadOnlyArray, + multiLine?: boolean + ): Block; + + declare function updateBlock( + node: Block, + statements: $ReadOnlyArray + ): Block; + + declare function createVariableStatement( + modifiers: $ReadOnlyArray | void, + declarationList: + | VariableDeclarationList + | $ReadOnlyArray + ): VariableStatement; + + declare function updateVariableStatement( + node: VariableStatement, + modifiers: $ReadOnlyArray | void, + declarationList: VariableDeclarationList + ): VariableStatement; + + declare function createEmptyStatement(): EmptyStatement; + + declare function createExpressionStatement( + expression: Expression + ): ExpressionStatement; + + declare function updateExpressionStatement( + node: ExpressionStatement, + expression: Expression + ): ExpressionStatement; + + declare var createStatement: typeof createExpressionStatement; + declare var updateStatement: typeof updateExpressionStatement; + declare function createIf( + expression: Expression, + thenStatement: Statement, + elseStatement?: Statement + ): IfStatement; + + declare function updateIf( + node: IfStatement, + expression: Expression, + thenStatement: Statement, + elseStatement: Statement | void + ): IfStatement; + + declare function createDo( + statement: Statement, + expression: Expression + ): DoStatement; + + declare function updateDo( + node: DoStatement, + statement: Statement, + expression: Expression + ): DoStatement; + + declare function createWhile( + expression: Expression, + statement: Statement + ): WhileStatement; + + declare function updateWhile( + node: WhileStatement, + expression: Expression, + statement: Statement + ): WhileStatement; + + declare function createFor( + initializer: ForInitializer | void, + condition: Expression | void, + incrementor: Expression | void, + statement: Statement + ): ForStatement; + + declare function updateFor( + node: ForStatement, + initializer: ForInitializer | void, + condition: Expression | void, + incrementor: Expression | void, + statement: Statement + ): ForStatement; + + declare function createForIn( + initializer: ForInitializer, + expression: Expression, + statement: Statement + ): ForInStatement; + + declare function updateForIn( + node: ForInStatement, + initializer: ForInitializer, + expression: Expression, + statement: Statement + ): ForInStatement; + + declare function createForOf( + awaitModifier: AwaitKeywordToken | void, + initializer: ForInitializer, + expression: Expression, + statement: Statement + ): ForOfStatement; + + declare function updateForOf( + node: ForOfStatement, + awaitModifier: AwaitKeywordToken | void, + initializer: ForInitializer, + expression: Expression, + statement: Statement + ): ForOfStatement; + + declare function createContinue( + label?: string | Identifier + ): ContinueStatement; + + declare function updateContinue( + node: ContinueStatement, + label: Identifier | void + ): ContinueStatement; + + declare function createBreak(label?: string | Identifier): BreakStatement; + + declare function updateBreak( + node: BreakStatement, + label: Identifier | void + ): BreakStatement; + + declare function createReturn(expression?: Expression): ReturnStatement; + + declare function updateReturn( + node: ReturnStatement, + expression: Expression | void + ): ReturnStatement; + + declare function createWith( + expression: Expression, + statement: Statement + ): WithStatement; + + declare function updateWith( + node: WithStatement, + expression: Expression, + statement: Statement + ): WithStatement; + + declare function createSwitch( + expression: Expression, + caseBlock: CaseBlock + ): SwitchStatement; + + declare function updateSwitch( + node: SwitchStatement, + expression: Expression, + caseBlock: CaseBlock + ): SwitchStatement; + + declare function createLabel( + label: string | Identifier, + statement: Statement + ): LabeledStatement; + + declare function updateLabel( + node: LabeledStatement, + label: Identifier, + statement: Statement + ): LabeledStatement; + + declare function createThrow(expression: Expression): ThrowStatement; + + declare function updateThrow( + node: ThrowStatement, + expression: Expression + ): ThrowStatement; + + declare function createTry( + tryBlock: Block, + catchClause: CatchClause | void, + finallyBlock: Block | void + ): TryStatement; + + declare function updateTry( + node: TryStatement, + tryBlock: Block, + catchClause: CatchClause | void, + finallyBlock: Block | void + ): TryStatement; + + declare function createDebuggerStatement(): DebuggerStatement; + + declare function createVariableDeclaration( + name: string | BindingName, + type?: TypeNode, + initializer?: Expression + ): VariableDeclaration; + + declare function updateVariableDeclaration( + node: VariableDeclaration, + name: BindingName, + type: TypeNode | void, + initializer: Expression | void + ): VariableDeclaration; + + declare function createVariableDeclarationList( + declarations: $ReadOnlyArray, + flags?: $Values + ): VariableDeclarationList; + + declare function updateVariableDeclarationList( + node: VariableDeclarationList, + declarations: $ReadOnlyArray + ): VariableDeclarationList; + + declare function createFunctionDeclaration( + decorators: $ReadOnlyArray | void, + modifiers: $ReadOnlyArray | void, + asteriskToken: AsteriskToken | void, + name: string | Identifier | void, + typeParameters: $ReadOnlyArray | void, + parameters: $ReadOnlyArray, + type: TypeNode | void, + body: Block | void + ): FunctionDeclaration; + + declare function updateFunctionDeclaration( + node: FunctionDeclaration, + decorators: $ReadOnlyArray | void, + modifiers: $ReadOnlyArray | void, + asteriskToken: AsteriskToken | void, + name: Identifier | void, + typeParameters: $ReadOnlyArray | void, + parameters: $ReadOnlyArray, + type: TypeNode | void, + body: Block | void + ): FunctionDeclaration; + + declare function createClassDeclaration( + decorators: $ReadOnlyArray | void, + modifiers: $ReadOnlyArray | void, + name: string | Identifier | void, + typeParameters: $ReadOnlyArray | void, + heritageClauses: $ReadOnlyArray | void, + members: $ReadOnlyArray + ): ClassDeclaration; + + declare function updateClassDeclaration( + node: ClassDeclaration, + decorators: $ReadOnlyArray | void, + modifiers: $ReadOnlyArray | void, + name: Identifier | void, + typeParameters: $ReadOnlyArray | void, + heritageClauses: $ReadOnlyArray | void, + members: $ReadOnlyArray + ): ClassDeclaration; + + declare function createInterfaceDeclaration( + decorators: $ReadOnlyArray | void, + modifiers: $ReadOnlyArray | void, + name: string | Identifier, + typeParameters: $ReadOnlyArray | void, + heritageClauses: $ReadOnlyArray | void, + members: $ReadOnlyArray + ): InterfaceDeclaration; + + declare function updateInterfaceDeclaration( + node: InterfaceDeclaration, + decorators: $ReadOnlyArray | void, + modifiers: $ReadOnlyArray | void, + name: Identifier, + typeParameters: $ReadOnlyArray | void, + heritageClauses: $ReadOnlyArray | void, + members: $ReadOnlyArray + ): InterfaceDeclaration; + + declare function createTypeAliasDeclaration( + decorators: $ReadOnlyArray | void, + modifiers: $ReadOnlyArray | void, + name: string | Identifier, + typeParameters: $ReadOnlyArray | void, + type: TypeNode + ): TypeAliasDeclaration; + + declare function updateTypeAliasDeclaration( + node: TypeAliasDeclaration, + decorators: $ReadOnlyArray | void, + modifiers: $ReadOnlyArray | void, + name: Identifier, + typeParameters: $ReadOnlyArray | void, + type: TypeNode + ): TypeAliasDeclaration; + + declare function createEnumDeclaration( + decorators: $ReadOnlyArray | void, + modifiers: $ReadOnlyArray | void, + name: string | Identifier, + members: $ReadOnlyArray + ): EnumDeclaration; + + declare function updateEnumDeclaration( + node: EnumDeclaration, + decorators: $ReadOnlyArray | void, + modifiers: $ReadOnlyArray | void, + name: Identifier, + members: $ReadOnlyArray + ): EnumDeclaration; + + declare function createModuleDeclaration( + decorators: $ReadOnlyArray | void, + modifiers: $ReadOnlyArray | void, + name: ModuleName, + body: ModuleBody | void, + flags?: $Values + ): ModuleDeclaration; + + declare function updateModuleDeclaration( + node: ModuleDeclaration, + decorators: $ReadOnlyArray | void, + modifiers: $ReadOnlyArray | void, + name: ModuleName, + body: ModuleBody | void + ): ModuleDeclaration; + + declare function createModuleBlock( + statements: $ReadOnlyArray + ): ModuleBlock; + + declare function updateModuleBlock( + node: ModuleBlock, + statements: $ReadOnlyArray + ): ModuleBlock; + + declare function createCaseBlock( + clauses: $ReadOnlyArray + ): CaseBlock; + + declare function updateCaseBlock( + node: CaseBlock, + clauses: $ReadOnlyArray + ): CaseBlock; + + declare function createNamespaceExportDeclaration( + name: string | Identifier + ): NamespaceExportDeclaration; + + declare function updateNamespaceExportDeclaration( + node: NamespaceExportDeclaration, + name: Identifier + ): NamespaceExportDeclaration; + + declare function createImportEqualsDeclaration( + decorators: $ReadOnlyArray | void, + modifiers: $ReadOnlyArray | void, + name: string | Identifier, + moduleReference: ModuleReference + ): ImportEqualsDeclaration; + + declare function updateImportEqualsDeclaration( + node: ImportEqualsDeclaration, + decorators: $ReadOnlyArray | void, + modifiers: $ReadOnlyArray | void, + name: Identifier, + moduleReference: ModuleReference + ): ImportEqualsDeclaration; + + declare function createImportDeclaration( + decorators: $ReadOnlyArray | void, + modifiers: $ReadOnlyArray | void, + importClause: ImportClause | void, + moduleSpecifier: Expression + ): ImportDeclaration; + + declare function updateImportDeclaration( + node: ImportDeclaration, + decorators: $ReadOnlyArray | void, + modifiers: $ReadOnlyArray | void, + importClause: ImportClause | void, + moduleSpecifier: Expression + ): ImportDeclaration; + + declare function createImportClause( + name: Identifier | void, + namedBindings: NamedImportBindings | void + ): ImportClause; + + declare function updateImportClause( + node: ImportClause, + name: Identifier | void, + namedBindings: NamedImportBindings | void + ): ImportClause; + + declare function createNamespaceImport(name: Identifier): NamespaceImport; + + declare function updateNamespaceImport( + node: NamespaceImport, + name: Identifier + ): NamespaceImport; + + declare function createNamedImports( + elements: $ReadOnlyArray + ): NamedImports; + + declare function updateNamedImports( + node: NamedImports, + elements: $ReadOnlyArray + ): NamedImports; + + declare function createImportSpecifier( + propertyName: Identifier | void, + name: Identifier + ): ImportSpecifier; + + declare function updateImportSpecifier( + node: ImportSpecifier, + propertyName: Identifier | void, + name: Identifier + ): ImportSpecifier; + + declare function createExportAssignment( + decorators: $ReadOnlyArray | void, + modifiers: $ReadOnlyArray | void, + isExportEquals: boolean | void, + expression: Expression + ): ExportAssignment; + + declare function updateExportAssignment( + node: ExportAssignment, + decorators: $ReadOnlyArray | void, + modifiers: $ReadOnlyArray | void, + expression: Expression + ): ExportAssignment; + + declare function createExportDeclaration( + decorators: $ReadOnlyArray | void, + modifiers: $ReadOnlyArray | void, + exportClause: NamedExports | void, + moduleSpecifier?: Expression + ): ExportDeclaration; + + declare function updateExportDeclaration( + node: ExportDeclaration, + decorators: $ReadOnlyArray | void, + modifiers: $ReadOnlyArray | void, + exportClause: NamedExports | void, + moduleSpecifier: Expression | void + ): ExportDeclaration; + + declare function createNamedExports( + elements: $ReadOnlyArray + ): NamedExports; + + declare function updateNamedExports( + node: NamedExports, + elements: $ReadOnlyArray + ): NamedExports; + + declare function createExportSpecifier( + propertyName: string | Identifier | void, + name: string | Identifier + ): ExportSpecifier; + + declare function updateExportSpecifier( + node: ExportSpecifier, + propertyName: Identifier | void, + name: Identifier + ): ExportSpecifier; + + declare function createExternalModuleReference( + expression: Expression + ): ExternalModuleReference; + + declare function updateExternalModuleReference( + node: ExternalModuleReference, + expression: Expression + ): ExternalModuleReference; + + declare function createJsxElement( + openingElement: JsxOpeningElement, + children: $ReadOnlyArray, + closingElement: JsxClosingElement + ): JsxElement; + + declare function updateJsxElement( + node: JsxElement, + openingElement: JsxOpeningElement, + children: $ReadOnlyArray, + closingElement: JsxClosingElement + ): JsxElement; + + declare function createJsxSelfClosingElement( + tagName: JsxTagNameExpression, + typeArguments: $ReadOnlyArray | void, + attributes: JsxAttributes + ): JsxSelfClosingElement; + + declare function updateJsxSelfClosingElement( + node: JsxSelfClosingElement, + tagName: JsxTagNameExpression, + typeArguments: $ReadOnlyArray | void, + attributes: JsxAttributes + ): JsxSelfClosingElement; + + declare function createJsxOpeningElement( + tagName: JsxTagNameExpression, + typeArguments: $ReadOnlyArray | void, + attributes: JsxAttributes + ): JsxOpeningElement; + + declare function updateJsxOpeningElement( + node: JsxOpeningElement, + tagName: JsxTagNameExpression, + typeArguments: $ReadOnlyArray | void, + attributes: JsxAttributes + ): JsxOpeningElement; + + declare function createJsxClosingElement( + tagName: JsxTagNameExpression + ): JsxClosingElement; + + declare function updateJsxClosingElement( + node: JsxClosingElement, + tagName: JsxTagNameExpression + ): JsxClosingElement; + + declare function createJsxFragment( + openingFragment: JsxOpeningFragment, + children: $ReadOnlyArray, + closingFragment: JsxClosingFragment + ): JsxFragment; + + declare function updateJsxFragment( + node: JsxFragment, + openingFragment: JsxOpeningFragment, + children: $ReadOnlyArray, + closingFragment: JsxClosingFragment + ): JsxFragment; + + declare function createJsxAttribute( + name: Identifier, + initializer: StringLiteral | JsxExpression + ): JsxAttribute; + + declare function updateJsxAttribute( + node: JsxAttribute, + name: Identifier, + initializer: StringLiteral | JsxExpression + ): JsxAttribute; + + declare function createJsxAttributes( + properties: $ReadOnlyArray + ): JsxAttributes; + + declare function updateJsxAttributes( + node: JsxAttributes, + properties: $ReadOnlyArray + ): JsxAttributes; + + declare function createJsxSpreadAttribute( + expression: Expression + ): JsxSpreadAttribute; + + declare function updateJsxSpreadAttribute( + node: JsxSpreadAttribute, + expression: Expression + ): JsxSpreadAttribute; + + declare function createJsxExpression( + dotDotDotToken: DotDotDotToken | void, + expression: Expression | void + ): JsxExpression; + + declare function updateJsxExpression( + node: JsxExpression, + expression: Expression | void + ): JsxExpression; + + declare function createCaseClause( + expression: Expression, + statements: $ReadOnlyArray + ): CaseClause; + + declare function updateCaseClause( + node: CaseClause, + expression: Expression, + statements: $ReadOnlyArray + ): CaseClause; + + declare function createDefaultClause( + statements: $ReadOnlyArray + ): DefaultClause; + + declare function updateDefaultClause( + node: DefaultClause, + statements: $ReadOnlyArray + ): DefaultClause; + + declare function createHeritageClause( + token: $ElementType, + types: $ReadOnlyArray + ): HeritageClause; + + declare function updateHeritageClause( + node: HeritageClause, + types: $ReadOnlyArray + ): HeritageClause; + + declare function createCatchClause( + variableDeclaration: string | VariableDeclaration | void, + block: Block + ): CatchClause; + + declare function updateCatchClause( + node: CatchClause, + variableDeclaration: VariableDeclaration | void, + block: Block + ): CatchClause; + + declare function createPropertyAssignment( + name: string | PropertyName, + initializer: Expression + ): PropertyAssignment; + + declare function updatePropertyAssignment( + node: PropertyAssignment, + name: PropertyName, + initializer: Expression + ): PropertyAssignment; + + declare function createShorthandPropertyAssignment( + name: string | Identifier, + objectAssignmentInitializer?: Expression + ): ShorthandPropertyAssignment; + + declare function updateShorthandPropertyAssignment( + node: ShorthandPropertyAssignment, + name: Identifier, + objectAssignmentInitializer: Expression | void + ): ShorthandPropertyAssignment; + + declare function createSpreadAssignment( + expression: Expression + ): SpreadAssignment; + + declare function updateSpreadAssignment( + node: SpreadAssignment, + expression: Expression + ): SpreadAssignment; + + declare function createEnumMember( + name: string | PropertyName, + initializer?: Expression + ): EnumMember; + + declare function updateEnumMember( + node: EnumMember, + name: PropertyName, + initializer: Expression | void + ): EnumMember; + + declare function updateSourceFileNode( + node: SourceFile, + statements: $ReadOnlyArray, + isDeclarationFile?: boolean, + referencedFiles?: $ElementType, + typeReferences?: $ElementType, + hasNoDefaultLib?: boolean, + libReferences?: $ElementType + ): SourceFile; + + declare function getMutableClone(node: T): T; + + declare function createNotEmittedStatement( + original: Node + ): NotEmittedStatement; + + declare function createPartiallyEmittedExpression( + expression: Expression, + original?: Node + ): PartiallyEmittedExpression; + + declare function updatePartiallyEmittedExpression( + node: PartiallyEmittedExpression, + expression: Expression + ): PartiallyEmittedExpression; + + declare function createCommaList( + elements: $ReadOnlyArray + ): CommaListExpression; + + declare function updateCommaList( + node: CommaListExpression, + elements: $ReadOnlyArray + ): CommaListExpression; + + declare function createBundle( + sourceFiles: $ReadOnlyArray, + prepends?: $ReadOnlyArray + ): Bundle; + + declare function createUnparsedSourceFile(text: string): UnparsedSource; + + declare function createUnparsedSourceFile( + inputFile: InputFiles, + type: "js" | "dts" + ): UnparsedSource; + + declare function createUnparsedSourceFile( + text: string, + mapPath: string | void, + map: string | void + ): UnparsedSource; + + declare function createInputFiles( + javascriptText: string, + declarationText: string + ): InputFiles; + + declare function createInputFiles( + readFileText: (path: string) => string | void, + javascriptPath: string, + javascriptMapPath: string | void, + declarationPath: string, + declarationMapPath: string | void + ): InputFiles; + + declare function createInputFiles( + javascriptText: string, + declarationText: string, + javascriptMapPath: string | void, + javascriptMapText: string | void, + declarationMapPath: string | void, + declarationMapText: string | void + ): InputFiles; + + declare function updateBundle( + node: Bundle, + sourceFiles: $ReadOnlyArray, + prepends?: $ReadOnlyArray + ): Bundle; + + declare function createImmediatelyInvokedFunctionExpression( + statements: $ReadOnlyArray + ): CallExpression; + + declare function createImmediatelyInvokedFunctionExpression( + statements: $ReadOnlyArray, + param: ParameterDeclaration, + paramValue: Expression + ): CallExpression; + + declare function createImmediatelyInvokedArrowFunction( + statements: $ReadOnlyArray + ): CallExpression; + + declare function createImmediatelyInvokedArrowFunction( + statements: $ReadOnlyArray, + param: ParameterDeclaration, + paramValue: Expression + ): CallExpression; + + declare function createComma(left: Expression, right: Expression): Expression; + + declare function createLessThan( + left: Expression, + right: Expression + ): Expression; + + declare function createAssignment( + left: ObjectLiteralExpression | ArrayLiteralExpression, + right: Expression + ): DestructuringAssignment; + + declare function createAssignment( + left: Expression, + right: Expression + ): BinaryExpression; + + declare function createStrictEquality( + left: Expression, + right: Expression + ): BinaryExpression; + + declare function createStrictInequality( + left: Expression, + right: Expression + ): BinaryExpression; + + declare function createAdd( + left: Expression, + right: Expression + ): BinaryExpression; + + declare function createSubtract( + left: Expression, + right: Expression + ): BinaryExpression; + + declare function createPostfixIncrement( + operand: Expression + ): PostfixUnaryExpression; + + declare function createLogicalAnd( + left: Expression, + right: Expression + ): BinaryExpression; + + declare function createLogicalOr( + left: Expression, + right: Expression + ): BinaryExpression; + + declare function createLogicalNot(operand: Expression): PrefixUnaryExpression; + + declare function createVoidZero(): VoidExpression; + + declare function createExportDefault( + expression: Expression + ): ExportAssignment; + + declare function createExternalModuleExport( + exportName: Identifier + ): ExportDeclaration; + + declare function disposeEmitNodes(sourceFile: SourceFile): void; + + declare function setTextRange( + range: T, + location: TextRange | void + ): T; + + declare function setEmitFlags( + node: T, + emitFlags: $Values + ): T; + + declare function getSourceMapRange(node: Node): SourceMapRange; + + declare function setSourceMapRange( + node: T, + range: SourceMapRange | void + ): T; + + declare function createSourceMapSource( + fileName: string, + text: string, + skipTrivia?: (pos: number) => number + ): SourceMapSource; + + declare function getTokenSourceMapRange( + node: Node, + token: $Values + ): SourceMapRange | void; + + declare function setTokenSourceMapRange( + node: T, + token: $Values, + range: SourceMapRange | void + ): T; + + declare function getCommentRange(node: Node): TextRange; + + declare function setCommentRange(node: T, range: TextRange): T; + + declare function getSyntheticLeadingComments( + node: Node + ): SynthesizedComment[] | void; + + declare function setSyntheticLeadingComments( + node: T, + comments: SynthesizedComment[] | void + ): T; + + declare function addSyntheticLeadingComment( + node: T, + kind: + | typeof SyntaxKind.SingleLineCommentTrivia + | typeof SyntaxKind.MultiLineCommentTrivia, + text: string, + hasTrailingNewLine?: boolean + ): T; + + declare function getSyntheticTrailingComments( + node: Node + ): SynthesizedComment[] | void; + + declare function setSyntheticTrailingComments( + node: T, + comments: SynthesizedComment[] | void + ): T; + + declare function addSyntheticTrailingComment( + node: T, + kind: + | typeof SyntaxKind.SingleLineCommentTrivia + | typeof SyntaxKind.MultiLineCommentTrivia, + text: string, + hasTrailingNewLine?: boolean + ): T; + + declare function moveSyntheticComments(node: T, original: Node): T; + + declare function getConstantValue( + node: PropertyAccessExpression | ElementAccessExpression + ): string | number | void; + + declare function setConstantValue( + node: PropertyAccessExpression | ElementAccessExpression, + value: string | number + ): PropertyAccessExpression | ElementAccessExpression; + + declare function addEmitHelper(node: T, helper: EmitHelper): T; + + declare function addEmitHelpers( + node: T, + helpers: EmitHelper[] | void + ): T; + + declare function removeEmitHelper(node: Node, helper: EmitHelper): boolean; + + declare function getEmitHelpers(node: Node): EmitHelper[] | void; + + declare function moveEmitHelpers( + source: Node, + target: Node, + predicate: (helper: EmitHelper) => boolean + ): void; + + declare function setOriginalNode(node: T, original: Node | void): T; + + declare function visitNode( + node: T | void, + visitor: Visitor | void, + test?: (node: Node) => boolean, + lift?: (node: NodeArray) => T + ): T; + + declare function visitNode( + node: T | void, + visitor: Visitor | void, + test?: (node: Node) => boolean, + lift?: (node: NodeArray) => T + ): T | void; + + declare function visitNodes( + nodes: NodeArray | void, + visitor: Visitor, + test?: (node: Node) => boolean, + start?: number, + count?: number + ): NodeArray; + + declare function visitNodes( + nodes: NodeArray | void, + visitor: Visitor, + test?: (node: Node) => boolean, + start?: number, + count?: number + ): NodeArray | void; + + declare function visitLexicalEnvironment( + statements: NodeArray, + visitor: Visitor, + context: TransformationContext, + start?: number, + ensureUseStrict?: boolean + ): NodeArray; + + declare function visitParameterList( + nodes: NodeArray | void, + visitor: Visitor, + context: TransformationContext, + nodesVisitor?: typeof visitNodes + ): NodeArray; + + declare function visitFunctionBody( + node: FunctionBody, + visitor: Visitor, + context: TransformationContext + ): FunctionBody; + + declare function visitFunctionBody( + node: FunctionBody | void, + visitor: Visitor, + context: TransformationContext + ): FunctionBody | void; + + declare function visitFunctionBody( + node: ConciseBody, + visitor: Visitor, + context: TransformationContext + ): ConciseBody; + + declare function visitEachChild( + node: T, + visitor: Visitor, + context: TransformationContext + ): T; + + declare function visitEachChild( + node: T | void, + visitor: Visitor, + context: TransformationContext, + nodesVisitor?: typeof visitNodes, + tokenVisitor?: Visitor + ): T | void; + + declare function createPrinter( + printerOptions?: PrinterOptions, + handlers?: PrintHandlers + ): Printer; + + declare function findConfigFile( + searchPath: string, + fileExists: (fileName: string) => boolean, + configName?: string + ): string | void; + + declare function resolveTripleslashReference( + moduleName: string, + containingFile: string + ): string; + + declare function createCompilerHost( + options: CompilerOptions, + setParentNodes?: boolean + ): CompilerHost; + + declare function getPreEmitDiagnostics( + program: Program, + sourceFile?: SourceFile, + cancellationToken?: CancellationToken + ): $ReadOnlyArray; + + declare type FormatDiagnosticsHost = { + getCurrentDirectory(): string, + getCanonicalFileName(fileName: string): string, + getNewLine(): string, + ... + }; + + declare function formatDiagnostics( + diagnostics: $ReadOnlyArray, + host: FormatDiagnosticsHost + ): string; + + declare function formatDiagnostic( + diagnostic: Diagnostic, + host: FormatDiagnosticsHost + ): string; + + declare function formatDiagnosticsWithColorAndContext( + diagnostics: $ReadOnlyArray, + host: FormatDiagnosticsHost + ): string; + + declare function flattenDiagnosticMessageText( + messageText: string | DiagnosticMessageChain | void, + newLine: string + ): string; + + declare function getConfigFileParsingDiagnostics( + configFileParseResult: ParsedCommandLine + ): $ReadOnlyArray; + + declare function createProgram( + createProgramOptions: CreateProgramOptions + ): Program; + + declare function createProgram( + rootNames: $ReadOnlyArray, + options: CompilerOptions, + host?: CompilerHost, + oldProgram?: Program, + configFileParsingDiagnostics?: $ReadOnlyArray + ): Program; + + declare type ResolveProjectReferencePathHost = { fileExists(fileName: string): boolean, ... }; + + declare function resolveProjectReferencePath( + ref: ProjectReference + ): ResolvedConfigFileName; + + declare function resolveProjectReferencePath( + host: ResolveProjectReferencePathHost, + ref: ProjectReference + ): ResolvedConfigFileName; + + declare type EmitOutput = { + outputFiles: OutputFile[], + emitSkipped: boolean, + ... + }; + + declare type OutputFile = { + name: string, + writeByteOrderMark: boolean, + text: string, + ... + }; + + declare type AffectedFileResult = { + result: T, + affected: SourceFile | Program, + ... + } | void; + declare type BuilderProgramHost = { + useCaseSensitiveFileNames(): boolean, + createHash?: (data: string) => string, + writeFile?: WriteFileCallback, + ... + }; + + declare type BuilderProgram = { + getProgram(): Program, + getCompilerOptions(): CompilerOptions, + getSourceFile(fileName: string): SourceFile | void, + getSourceFiles(): $ReadOnlyArray, + getOptionsDiagnostics( + cancellationToken?: CancellationToken + ): $ReadOnlyArray, + getGlobalDiagnostics( + cancellationToken?: CancellationToken + ): $ReadOnlyArray, + getConfigFileParsingDiagnostics(): $ReadOnlyArray, + getSyntacticDiagnostics( + sourceFile?: SourceFile, + cancellationToken?: CancellationToken + ): $ReadOnlyArray, + getDeclarationDiagnostics( + sourceFile?: SourceFile, + cancellationToken?: CancellationToken + ): $ReadOnlyArray, + getAllDependencies(sourceFile: SourceFile): $ReadOnlyArray, + getSemanticDiagnostics( + sourceFile?: SourceFile, + cancellationToken?: CancellationToken + ): $ReadOnlyArray, + emit( + targetSourceFile?: SourceFile, + writeFile?: WriteFileCallback, + cancellationToken?: CancellationToken, + emitOnlyDtsFiles?: boolean, + customTransformers?: CustomTransformers + ): EmitResult, + getCurrentDirectory(): string, + ... + }; + + declare type SemanticDiagnosticsBuilderProgram = { + ...$Exact, + getSemanticDiagnosticsOfNextAffectedFile( + cancellationToken?: CancellationToken, + ignoreSourceFile?: (sourceFile: SourceFile) => boolean + ): AffectedFileResult<$ReadOnlyArray>, + ... + }; + + declare type EmitAndSemanticDiagnosticsBuilderProgram = { + ...$Exact, + emitNextAffectedFile( + writeFile?: WriteFileCallback, + cancellationToken?: CancellationToken, + emitOnlyDtsFiles?: boolean, + customTransformers?: CustomTransformers + ): AffectedFileResult, + ... + }; + + declare function createSemanticDiagnosticsBuilderProgram( + newProgram: Program, + host: BuilderProgramHost, + oldProgram?: SemanticDiagnosticsBuilderProgram, + configFileParsingDiagnostics?: $ReadOnlyArray + ): SemanticDiagnosticsBuilderProgram; + + declare function createSemanticDiagnosticsBuilderProgram( + rootNames: $ReadOnlyArray | void, + options: CompilerOptions | void, + host?: CompilerHost, + oldProgram?: SemanticDiagnosticsBuilderProgram, + configFileParsingDiagnostics?: $ReadOnlyArray, + projectReferences?: $ReadOnlyArray + ): SemanticDiagnosticsBuilderProgram; + + declare function createEmitAndSemanticDiagnosticsBuilderProgram( + newProgram: Program, + host: BuilderProgramHost, + oldProgram?: EmitAndSemanticDiagnosticsBuilderProgram, + configFileParsingDiagnostics?: $ReadOnlyArray + ): EmitAndSemanticDiagnosticsBuilderProgram; + + declare function createEmitAndSemanticDiagnosticsBuilderProgram( + rootNames: $ReadOnlyArray | void, + options: CompilerOptions | void, + host?: CompilerHost, + oldProgram?: EmitAndSemanticDiagnosticsBuilderProgram, + configFileParsingDiagnostics?: $ReadOnlyArray, + projectReferences?: $ReadOnlyArray + ): EmitAndSemanticDiagnosticsBuilderProgram; + + declare function createAbstractBuilder( + newProgram: Program, + host: BuilderProgramHost, + oldProgram?: BuilderProgram, + configFileParsingDiagnostics?: $ReadOnlyArray + ): BuilderProgram; + + declare function createAbstractBuilder( + rootNames: $ReadOnlyArray | void, + options: CompilerOptions | void, + host?: CompilerHost, + oldProgram?: BuilderProgram, + configFileParsingDiagnostics?: $ReadOnlyArray, + projectReferences?: $ReadOnlyArray + ): BuilderProgram; + + declare type WatchStatusReporter = ( + diagnostic: Diagnostic, + newLine: string, + options: CompilerOptions + ) => void; + declare type CreateProgram = ( + rootNames: $ReadOnlyArray | void, + options: CompilerOptions | void, + host?: CompilerHost, + oldProgram?: T, + configFileParsingDiagnostics?: $ReadOnlyArray, + projectReferences?: $ReadOnlyArray | void + ) => T; + declare type WatchHost = { + onWatchStatusChange?: ( + diagnostic: Diagnostic, + newLine: string, + options: CompilerOptions + ) => void, + watchFile( + path: string, + callback: FileWatcherCallback, + pollingInterval?: number + ): FileWatcher, + watchDirectory( + path: string, + callback: DirectoryWatcherCallback, + recursive?: boolean + ): FileWatcher, + setTimeout?: ( + callback: (...args: any[]) => void, + ms: number, + ...args: any[] + ) => any, + clearTimeout?: (timeoutId: any) => void, + ... + }; + + declare type ProgramHost = { + createProgram: CreateProgram, + useCaseSensitiveFileNames(): boolean, + getNewLine(): string, + getCurrentDirectory(): string, + getDefaultLibFileName(options: CompilerOptions): string, + getDefaultLibLocation?: () => string, + createHash?: (data: string) => string, + fileExists(path: string): boolean, + readFile(path: string, encoding?: string): string | void, + directoryExists?: (path: string) => boolean, + getDirectories?: (path: string) => string[], + readDirectory?: ( + path: string, + extensions?: $ReadOnlyArray, + exclude?: $ReadOnlyArray, + include?: $ReadOnlyArray, + depth?: number + ) => string[], + realpath?: (path: string) => string, + trace?: (s: string) => void, + getEnvironmentVariable?: (name: string) => string | void, + resolveModuleNames?: ( + moduleNames: string[], + containingFile: string, + reusedNames?: string[], + redirectedReference?: ResolvedProjectReference + ) => (ResolvedModule | void)[], + resolveTypeReferenceDirectives?: ( + typeReferenceDirectiveNames: string[], + containingFile: string, + redirectedReference?: ResolvedProjectReference + ) => (ResolvedTypeReferenceDirective | void)[], + ... + }; + + declare type WatchCompilerHost = { + ...$Exact>, + ...$Exact, + afterProgramCreate?: (program: T) => void, + ... + }; + + declare type WatchCompilerHostOfFilesAndCompilerOptions = { + ...$Exact>, + rootFiles: string[], + options: CompilerOptions, + projectReferences?: $ReadOnlyArray, + ... + }; + + declare type WatchCompilerHostOfConfigFile = { + ...$Exact>, + ...$Exact, + configFileName: string, + optionsToExtend?: CompilerOptions, + readDirectory( + path: string, + extensions?: $ReadOnlyArray, + exclude?: $ReadOnlyArray, + include?: $ReadOnlyArray, + depth?: number + ): string[], + ... + }; + + declare type Watch = { getProgram(): T, ... }; + + declare type WatchOfConfigFile = { ...$Exact>, ... }; + + declare type WatchOfFilesAndCompilerOptions = { + ...$Exact>, + updateRootFileNames(fileNames: string[]): void, + ... + }; + + declare function createWatchCompilerHost( + configFileName: string, + optionsToExtend: CompilerOptions | void, + system: System, + createProgram?: CreateProgram, + reportDiagnostic?: DiagnosticReporter, + reportWatchStatus?: WatchStatusReporter + ): WatchCompilerHostOfConfigFile; + + declare function createWatchCompilerHost( + rootFiles: string[], + options: CompilerOptions, + system: System, + createProgram?: CreateProgram, + reportDiagnostic?: DiagnosticReporter, + reportWatchStatus?: WatchStatusReporter, + projectReferences?: $ReadOnlyArray + ): WatchCompilerHostOfFilesAndCompilerOptions; + + declare function createWatchProgram( + host: WatchCompilerHostOfFilesAndCompilerOptions + ): WatchOfFilesAndCompilerOptions; + + declare function createWatchProgram( + host: WatchCompilerHostOfConfigFile + ): WatchOfConfigFile; + + declare type SourceFileLike = { getLineAndCharacterOfPosition(pos: number): LineAndCharacter, ... }; + + declare type IScriptSnapshot = { + getText(start: number, end: number): string, + getLength(): number, + getChangeRange(oldSnapshot: IScriptSnapshot): TextChangeRange | void, + dispose?: () => void, + ... + }; + + declare function ScriptSnapshot$fromString(text: string): IScriptSnapshot; + + declare type PreProcessedFileInfo = { + referencedFiles: FileReference[], + typeReferenceDirectives: FileReference[], + libReferenceDirectives: FileReference[], + importedFiles: FileReference[], + ambientExternalModules?: string[], + isLibFile: boolean, + ... + }; + + declare type HostCancellationToken = { isCancellationRequested(): boolean, ... }; + + declare type InstallPackageOptions = { + fileName: Path, + packageName: string, + ... + }; + + declare type LanguageServiceHost = { + ...$Exact, + getCompilationSettings(): CompilerOptions, + getNewLine?: () => string, + getProjectVersion?: () => string, + getScriptFileNames(): string[], + getScriptKind?: (fileName: string) => $Values, + getScriptVersion(fileName: string): string, + getScriptSnapshot(fileName: string): IScriptSnapshot | void, + getProjectReferences?: () => $ReadOnlyArray | void, + getLocalizedDiagnosticMessages?: () => any, + getCancellationToken?: () => HostCancellationToken, + getCurrentDirectory(): string, + getDefaultLibFileName(options: CompilerOptions): string, + log?: (s: string) => void, + trace?: (s: string) => void, + error?: (s: string) => void, + useCaseSensitiveFileNames?: () => boolean, + readDirectory?: ( + path: string, + extensions?: $ReadOnlyArray, + exclude?: $ReadOnlyArray, + include?: $ReadOnlyArray, + depth?: number + ) => string[], + readFile?: (path: string, encoding?: string) => string | void, + realpath?: (path: string) => string, + fileExists?: (path: string) => boolean, + getTypeRootsVersion?: () => number, + resolveModuleNames?: ( + moduleNames: string[], + containingFile: string, + reusedNames?: string[], + redirectedReference?: ResolvedProjectReference + ) => (ResolvedModule | void)[], + getResolvedModuleWithFailedLookupLocationsFromCache?: ( + modulename: string, + containingFile: string + ) => ResolvedModuleWithFailedLookupLocations | void, + resolveTypeReferenceDirectives?: ( + typeDirectiveNames: string[], + containingFile: string, + redirectedReference?: ResolvedProjectReference + ) => (ResolvedTypeReferenceDirective | void)[], + getDirectories?: (directoryName: string) => string[], + getCustomTransformers?: () => CustomTransformers | void, + isKnownTypesPackageName?: (name: string) => boolean, + installPackage?: ( + options: InstallPackageOptions + ) => Promise, + writeFile?: (fileName: string, content: string) => void, + ... + }; + + declare type WithMetadata = T & { metadata?: mixed, ... }; + declare type LanguageService = { + cleanupSemanticCache(): void, + getSyntacticDiagnostics(fileName: string): DiagnosticWithLocation[], + getSemanticDiagnostics(fileName: string): Diagnostic[], + getSuggestionDiagnostics(fileName: string): DiagnosticWithLocation[], + getCompilerOptionsDiagnostics(): Diagnostic[], + getSyntacticClassifications( + fileName: string, + span: TextSpan + ): ClassifiedSpan[], + getSemanticClassifications( + fileName: string, + span: TextSpan + ): ClassifiedSpan[], + getEncodedSyntacticClassifications( + fileName: string, + span: TextSpan + ): Classifications, + getEncodedSemanticClassifications( + fileName: string, + span: TextSpan + ): Classifications, + getCompletionsAtPosition( + fileName: string, + position: number, + options: GetCompletionsAtPositionOptions | void + ): WithMetadata | void, + getCompletionEntryDetails( + fileName: string, + position: number, + name: string, + formatOptions: FormatCodeOptions | FormatCodeSettings | void, + source: string | void, + preferences: UserPreferences | void + ): CompletionEntryDetails | void, + getCompletionEntrySymbol( + fileName: string, + position: number, + name: string, + source: string | void + ): Symbol | void, + getQuickInfoAtPosition( + fileName: string, + position: number + ): QuickInfo | void, + getNameOrDottedNameSpan( + fileName: string, + startPos: number, + endPos: number + ): TextSpan | void, + getBreakpointStatementAtPosition( + fileName: string, + position: number + ): TextSpan | void, + getSignatureHelpItems( + fileName: string, + position: number, + options: SignatureHelpItemsOptions | void + ): SignatureHelpItems | void, + getRenameInfo( + fileName: string, + position: number, + options?: RenameInfoOptions + ): RenameInfo, + findRenameLocations( + fileName: string, + position: number, + findInStrings: boolean, + findInComments: boolean, + providePrefixAndSuffixTextForRename?: boolean + ): $ReadOnlyArray | void, + getDefinitionAtPosition( + fileName: string, + position: number + ): $ReadOnlyArray | void, + getDefinitionAndBoundSpan( + fileName: string, + position: number + ): DefinitionInfoAndBoundSpan | void, + getTypeDefinitionAtPosition( + fileName: string, + position: number + ): $ReadOnlyArray | void, + getImplementationAtPosition( + fileName: string, + position: number + ): $ReadOnlyArray | void, + getReferencesAtPosition( + fileName: string, + position: number + ): ReferenceEntry[] | void, + findReferences( + fileName: string, + position: number + ): ReferencedSymbol[] | void, + getDocumentHighlights( + fileName: string, + position: number, + filesToSearch: string[] + ): DocumentHighlights[] | void, + getOccurrencesAtPosition( + fileName: string, + position: number + ): $ReadOnlyArray | void, + getNavigateToItems( + searchValue: string, + maxResultCount?: number, + fileName?: string, + excludeDtsFiles?: boolean + ): NavigateToItem[], + getNavigationBarItems(fileName: string): NavigationBarItem[], + getNavigationTree(fileName: string): NavigationTree, + getOutliningSpans(fileName: string): OutliningSpan[], + getTodoComments( + fileName: string, + descriptors: TodoCommentDescriptor[] + ): TodoComment[], + getBraceMatchingAtPosition(fileName: string, position: number): TextSpan[], + getIndentationAtPosition( + fileName: string, + position: number, + options: EditorOptions | EditorSettings + ): number, + getFormattingEditsForRange( + fileName: string, + start: number, + end: number, + options: FormatCodeOptions | FormatCodeSettings + ): TextChange[], + getFormattingEditsForDocument( + fileName: string, + options: FormatCodeOptions | FormatCodeSettings + ): TextChange[], + getFormattingEditsAfterKeystroke( + fileName: string, + position: number, + key: string, + options: FormatCodeOptions | FormatCodeSettings + ): TextChange[], + getDocCommentTemplateAtPosition( + fileName: string, + position: number + ): TextInsertion | void, + isValidBraceCompletionAtPosition( + fileName: string, + position: number, + openingBrace: number + ): boolean, + getJsxClosingTagAtPosition( + fileName: string, + position: number + ): JsxClosingTagInfo | void, + getSpanOfEnclosingComment( + fileName: string, + position: number, + onlyMultiLine: boolean + ): TextSpan | void, + toLineColumnOffset?: ( + fileName: string, + position: number + ) => LineAndCharacter, + getCodeFixesAtPosition( + fileName: string, + start: number, + end: number, + errorCodes: $ReadOnlyArray, + formatOptions: FormatCodeSettings, + preferences: UserPreferences + ): $ReadOnlyArray, + getCombinedCodeFix( + scope: CombinedCodeFixScope, + fixId: {...}, + formatOptions: FormatCodeSettings, + preferences: UserPreferences + ): CombinedCodeActions, + applyCodeActionCommand( + action: CodeActionCommand, + formatSettings?: FormatCodeSettings + ): Promise, + applyCodeActionCommand( + action: CodeActionCommand[], + formatSettings?: FormatCodeSettings + ): Promise, + applyCodeActionCommand( + action: CodeActionCommand | CodeActionCommand[], + formatSettings?: FormatCodeSettings + ): Promise, + applyCodeActionCommand( + fileName: string, + action: CodeActionCommand + ): Promise, + applyCodeActionCommand( + fileName: string, + action: CodeActionCommand[] + ): Promise, + applyCodeActionCommand( + fileName: string, + action: CodeActionCommand | CodeActionCommand[] + ): Promise, + getApplicableRefactors( + fileName: string, + positionOrRange: number | TextRange, + preferences: UserPreferences | void + ): ApplicableRefactorInfo[], + getEditsForRefactor( + fileName: string, + formatOptions: FormatCodeSettings, + positionOrRange: number | TextRange, + refactorName: string, + actionName: string, + preferences: UserPreferences | void + ): RefactorEditInfo | void, + organizeImports( + scope: OrganizeImportsScope, + formatOptions: FormatCodeSettings, + preferences: UserPreferences | void + ): $ReadOnlyArray, + getEditsForFileRename( + oldFilePath: string, + newFilePath: string, + formatOptions: FormatCodeSettings, + preferences: UserPreferences | void + ): $ReadOnlyArray, + getEmitOutput(fileName: string, emitOnlyDtsFiles?: boolean): EmitOutput, + getProgram(): Program | void, + dispose(): void, + ... + }; + + declare type JsxClosingTagInfo = { +newText: string, ... }; + + declare type CombinedCodeFixScope = { + type: "file", + fileName: string, + ... + }; + + declare type OrganizeImportsScope = CombinedCodeFixScope; + declare type CompletionsTriggerCharacter = + | "." + | '"' + | "'" + | "`" + | "/" + | "@" + | "<"; + declare type GetCompletionsAtPositionOptions = { + ...$Exact, + triggerCharacter?: CompletionsTriggerCharacter, + includeExternalModuleExports?: boolean, + includeInsertTextCompletions?: boolean, + ... + }; + + declare type SignatureHelpTriggerCharacter = "," | "(" | "<"; + declare type SignatureHelpRetriggerCharacter = + | SignatureHelpTriggerCharacter + | ")"; + declare type SignatureHelpItemsOptions = { triggerReason?: SignatureHelpTriggerReason, ... }; + + declare type SignatureHelpTriggerReason = + | SignatureHelpInvokedReason + | SignatureHelpCharacterTypedReason + | SignatureHelpRetriggeredReason; + declare type SignatureHelpInvokedReason = { + kind: "invoked", + triggerCharacter?: void, + ... + }; + + declare type SignatureHelpCharacterTypedReason = { + kind: "characterTyped", + triggerCharacter: SignatureHelpTriggerCharacter, + ... + }; + + declare type SignatureHelpRetriggeredReason = { + kind: "retrigger", + triggerCharacter?: SignatureHelpRetriggerCharacter, + ... + }; + + declare type ApplyCodeActionCommandResult = { successMessage: string, ... }; + + declare type Classifications = { + spans: number[], + endOfLineState: $Values, + ... + }; + + declare type ClassifiedSpan = { + textSpan: TextSpan, + classificationType: $Values, + ... + }; + + declare type NavigationBarItem = { + text: string, + kind: $Values, + kindModifiers: string, + spans: TextSpan[], + childItems: NavigationBarItem[], + indent: number, + bolded: boolean, + grayed: boolean, + ... + }; + + declare type NavigationTree = { + text: string, + kind: $Values, + kindModifiers: string, + spans: TextSpan[], + nameSpan: TextSpan | void, + childItems?: NavigationTree[], + ... + }; + + declare type TodoCommentDescriptor = { + text: string, + priority: number, + ... + }; + + declare type TodoComment = { + descriptor: TodoCommentDescriptor, + message: string, + position: number, + ... + }; + + declare type TextChange = { + span: TextSpan, + newText: string, + ... + }; + + declare type FileTextChanges = { + fileName: string, + textChanges: TextChange[], + isNewFile?: boolean, + ... + }; + + declare type CodeAction = { + description: string, + changes: FileTextChanges[], + commands?: CodeActionCommand[], + ... + }; + + declare type CodeFixAction = { + ...$Exact, + fixName: string, + fixId?: {...}, + fixAllDescription?: string, + ... + }; + + declare type CombinedCodeActions = { + changes: $ReadOnlyArray, + commands?: $ReadOnlyArray, + ... + }; + + declare type CodeActionCommand = InstallPackageAction | GenerateTypesAction; + declare type InstallPackageAction = {...}; + + declare type GenerateTypesAction = { ...$Exact, ... }; + + declare type GenerateTypesOptions = { + +file: string, + +fileToGenerateTypesFor: string, + +outputFileName: string, + ... + }; + + declare type ApplicableRefactorInfo = { + name: string, + description: string, + inlineable?: boolean, + actions: RefactorActionInfo[], + ... + }; + + declare type RefactorActionInfo = { + name: string, + description: string, + ... + }; + + declare type RefactorEditInfo = { + edits: FileTextChanges[], + renameFilename?: string, + renameLocation?: number, + commands?: CodeActionCommand[], + ... + }; + + declare type TextInsertion = { + newText: string, + caretOffset: number, + ... + }; + + declare type DocumentSpan = { + textSpan: TextSpan, + fileName: string, + originalTextSpan?: TextSpan, + originalFileName?: string, + ... + }; + + declare type RenameLocation = { + ...$Exact, + +prefixText?: string, + +suffixText?: string, + ... + }; + + declare type ReferenceEntry = { + ...$Exact, + isWriteAccess: boolean, + isDefinition: boolean, + isInString?: true, + ... + }; + + declare type ImplementationLocation = { + ...$Exact, + kind: $Values, + displayParts: SymbolDisplayPart[], + ... + }; + + declare type DocumentHighlights = { + fileName: string, + highlightSpans: HighlightSpan[], + ... + }; + + declare var HighlightSpanKind: { + // "none" + +none: "none", + // "definition" + +definition: "definition", + // "reference" + +reference: "reference", + // "writtenReference" + +writtenReference: "writtenReference", + ... + }; + + declare type HighlightSpan = { + fileName?: string, + isInString?: true, + textSpan: TextSpan, + kind: $Values, + ... + }; + + declare type NavigateToItem = { + name: string, + kind: $Values, + kindModifiers: string, + matchKind: "exact" | "prefix" | "substring" | "camelCase", + isCaseSensitive: boolean, + fileName: string, + textSpan: TextSpan, + containerName: string, + containerKind: $Values, + ... + }; + + declare var IndentStyle: { + // 0 + +None: 0, + // 1 + +Block: 1, + // 2 + +Smart: 2, + ... + }; + + declare type EditorOptions = { + BaseIndentSize?: number, + IndentSize: number, + TabSize: number, + NewLineCharacter: string, + ConvertTabsToSpaces: boolean, + IndentStyle: $Values, + ... + }; + + declare type EditorSettings = { + baseIndentSize?: number, + indentSize?: number, + tabSize?: number, + newLineCharacter?: string, + convertTabsToSpaces?: boolean, + indentStyle?: $Values, + ... + }; + + declare type FormatCodeOptions = { + ...$Exact, + InsertSpaceAfterCommaDelimiter: boolean, + InsertSpaceAfterSemicolonInForStatements: boolean, + InsertSpaceBeforeAndAfterBinaryOperators: boolean, + InsertSpaceAfterConstructor?: boolean, + InsertSpaceAfterKeywordsInControlFlowStatements: boolean, + InsertSpaceAfterFunctionKeywordForAnonymousFunctions: boolean, + InsertSpaceAfterOpeningAndBeforeClosingNonemptyParenthesis: boolean, + InsertSpaceAfterOpeningAndBeforeClosingNonemptyBrackets: boolean, + InsertSpaceAfterOpeningAndBeforeClosingNonemptyBraces?: boolean, + InsertSpaceAfterOpeningAndBeforeClosingTemplateStringBraces: boolean, + InsertSpaceAfterOpeningAndBeforeClosingJsxExpressionBraces?: boolean, + InsertSpaceAfterTypeAssertion?: boolean, + InsertSpaceBeforeFunctionParenthesis?: boolean, + PlaceOpenBraceOnNewLineForFunctions: boolean, + PlaceOpenBraceOnNewLineForControlBlocks: boolean, + insertSpaceBeforeTypeAnnotation?: boolean, + ... + }; + + declare type FormatCodeSettings = { + ...$Exact, + +insertSpaceAfterCommaDelimiter?: boolean, + +insertSpaceAfterSemicolonInForStatements?: boolean, + +insertSpaceBeforeAndAfterBinaryOperators?: boolean, + +insertSpaceAfterConstructor?: boolean, + +insertSpaceAfterKeywordsInControlFlowStatements?: boolean, + +insertSpaceAfterFunctionKeywordForAnonymousFunctions?: boolean, + +insertSpaceAfterOpeningAndBeforeClosingNonemptyParenthesis?: boolean, + +insertSpaceAfterOpeningAndBeforeClosingNonemptyBrackets?: boolean, + +insertSpaceAfterOpeningAndBeforeClosingNonemptyBraces?: boolean, + +insertSpaceAfterOpeningAndBeforeClosingTemplateStringBraces?: boolean, + +insertSpaceAfterOpeningAndBeforeClosingJsxExpressionBraces?: boolean, + +insertSpaceAfterTypeAssertion?: boolean, + +insertSpaceBeforeFunctionParenthesis?: boolean, + +placeOpenBraceOnNewLineForFunctions?: boolean, + +placeOpenBraceOnNewLineForControlBlocks?: boolean, + +insertSpaceBeforeTypeAnnotation?: boolean, + +indentMultiLineObjectLiteralBeginningOnBlankLine?: boolean, + ... + }; + + declare function getDefaultFormatCodeSettings( + newLineCharacter?: string + ): FormatCodeSettings; + + declare type DefinitionInfo = { + ...$Exact, + kind: $Values, + name: string, + containerKind: $Values, + containerName: string, + ... + }; + + declare type DefinitionInfoAndBoundSpan = { + definitions?: $ReadOnlyArray, + textSpan: TextSpan, + ... + }; + + declare type ReferencedSymbolDefinitionInfo = { + ...$Exact, + displayParts: SymbolDisplayPart[], + ... + }; + + declare type ReferencedSymbol = { + definition: ReferencedSymbolDefinitionInfo, + references: ReferenceEntry[], + ... + }; + + declare var SymbolDisplayPartKind: { + // 0 + +aliasName: 0, + // 1 + +className: 1, + // 2 + +enumName: 2, + // 3 + +fieldName: 3, + // 4 + +interfaceName: 4, + // 5 + +keyword: 5, + // 6 + +lineBreak: 6, + // 7 + +numericLiteral: 7, + // 8 + +stringLiteral: 8, + // 9 + +localName: 9, + // 10 + +methodName: 10, + // 11 + +moduleName: 11, + // 12 + +operator: 12, + // 13 + +parameterName: 13, + // 14 + +propertyName: 14, + // 15 + +punctuation: 15, + // 16 + +space: 16, + // 17 + +text: 17, + // 18 + +typeParameterName: 18, + // 19 + +enumMemberName: 19, + // 20 + +functionName: 20, + // 21 + +regularExpressionLiteral: 21, + ... + }; + + declare type SymbolDisplayPart = { + text: string, + kind: string, + ... + }; + + declare type JSDocTagInfo = { + name: string, + text?: string, + ... + }; + + declare type QuickInfo = { + kind: $Values, + kindModifiers: string, + textSpan: TextSpan, + displayParts?: SymbolDisplayPart[], + documentation?: SymbolDisplayPart[], + tags?: JSDocTagInfo[], + ... + }; + + declare type RenameInfo = RenameInfoSuccess | RenameInfoFailure; + declare type RenameInfoSuccess = { + canRename: true, + fileToRename?: string, + displayName: string, + fullDisplayName: string, + kind: $Values, + kindModifiers: string, + triggerSpan: TextSpan, + ... + }; + + declare type RenameInfoFailure = { + canRename: false, + localizedErrorMessage: string, + ... + }; + + declare type RenameInfoOptions = { +allowRenameOfImportPath?: boolean, ... }; + + declare type SignatureHelpParameter = { + name: string, + documentation: SymbolDisplayPart[], + displayParts: SymbolDisplayPart[], + isOptional: boolean, + ... + }; + + declare type SignatureHelpItem = { + isVariadic: boolean, + prefixDisplayParts: SymbolDisplayPart[], + suffixDisplayParts: SymbolDisplayPart[], + separatorDisplayParts: SymbolDisplayPart[], + parameters: SignatureHelpParameter[], + documentation: SymbolDisplayPart[], + tags: JSDocTagInfo[], + ... + }; + + declare type SignatureHelpItems = { + items: SignatureHelpItem[], + applicableSpan: TextSpan, + selectedItemIndex: number, + argumentIndex: number, + argumentCount: number, + ... + }; + + declare type CompletionInfo = { + isGlobalCompletion: boolean, + isMemberCompletion: boolean, + isNewIdentifierLocation: boolean, + entries: CompletionEntry[], + ... + }; + + declare type CompletionEntry = { + name: string, + kind: $Values, + kindModifiers?: string, + sortText: string, + insertText?: string, + replacementSpan?: TextSpan, + hasAction?: true, + source?: string, + isRecommended?: true, + ... + }; + + declare type CompletionEntryDetails = { + name: string, + kind: $Values, + kindModifiers: string, + displayParts: SymbolDisplayPart[], + documentation?: SymbolDisplayPart[], + tags?: JSDocTagInfo[], + codeActions?: CodeAction[], + source?: SymbolDisplayPart[], + ... + }; + + declare type OutliningSpan = { + textSpan: TextSpan, + hintSpan: TextSpan, + bannerText: string, + autoCollapse: boolean, + kind: $Values, + ... + }; + + declare var OutliningSpanKind: { + // "comment" + +Comment: "comment", + // "region" + +Region: "region", + // "code" + +Code: "code", + // "imports" + +Imports: "imports", + ... + }; + + declare var OutputFileType: { + // 0 + +JavaScript: 0, + // 1 + +SourceMap: 1, + // 2 + +Declaration: 2, + ... + }; + + declare var EndOfLineState: { + // 0 + +None: 0, + // 1 + +InMultiLineCommentTrivia: 1, + // 2 + +InSingleQuoteStringLiteral: 2, + // 3 + +InDoubleQuoteStringLiteral: 3, + // 4 + +InTemplateHeadOrNoSubstitutionTemplate: 4, + // 5 + +InTemplateMiddleOrTail: 5, + // 6 + +InTemplateSubstitutionPosition: 6, + ... + }; + + declare var TokenClass: { + // 0 + +Punctuation: 0, + // 1 + +Keyword: 1, + // 2 + +Operator: 2, + // 3 + +Comment: 3, + // 4 + +Whitespace: 4, + // 5 + +Identifier: 5, + // 6 + +NumberLiteral: 6, + // 7 + +BigIntLiteral: 7, + // 8 + +StringLiteral: 8, + // 9 + +RegExpLiteral: 9, + ... + }; + + declare type ClassificationResult = { + finalLexState: $Values, + entries: ClassificationInfo[], + ... + }; + + declare type ClassificationInfo = { + length: number, + classification: $Values, + ... + }; + + declare type Classifier = { + getClassificationsForLine( + text: string, + lexState: $Values, + syntacticClassifierAbsent: boolean + ): ClassificationResult, + getEncodedLexicalClassifications( + text: string, + endOfLineState: $Values, + syntacticClassifierAbsent: boolean + ): Classifications, + ... + }; + + declare var ScriptElementKind: { + // "" + +unknown: "", + // "warning" + +warning: "warning", + // "keyword" + +keyword: "keyword", + // "script" + +scriptElement: "script", + // "module" + +moduleElement: "module", + // "class" + +classElement: "class", + // "local class" + +localClassElement: "local class", + // "interface" + +interfaceElement: "interface", + // "type" + +typeElement: "type", + // "enum" + +enumElement: "enum", + // "enum member" + +enumMemberElement: "enum member", + // "var" + +variableElement: "var", + // "local var" + +localVariableElement: "local var", + // "function" + +functionElement: "function", + // "local function" + +localFunctionElement: "local function", + // "method" + +memberFunctionElement: "method", + // "getter" + +memberGetAccessorElement: "getter", + // "setter" + +memberSetAccessorElement: "setter", + // "property" + +memberVariableElement: "property", + // "constructor" + +constructorImplementationElement: "constructor", + // "call" + +callSignatureElement: "call", + // "index" + +indexSignatureElement: "index", + // "construct" + +constructSignatureElement: "construct", + // "parameter" + +parameterElement: "parameter", + // "type parameter" + +typeParameterElement: "type parameter", + // "primitive type" + +primitiveType: "primitive type", + // "label" + +label: "label", + // "alias" + +alias: "alias", + // "const" + +constElement: "const", + // "let" + +letElement: "let", + // "directory" + +directory: "directory", + // "external module name" + +externalModuleName: "external module name", + // "JSX attribute" + +jsxAttribute: "JSX attribute", + // "string" + +string: "string", + ... + }; + + declare var ScriptElementKindModifier: { + // "" + +none: "", + // "public" + +publicMemberModifier: "public", + // "private" + +privateMemberModifier: "private", + // "protected" + +protectedMemberModifier: "protected", + // "export" + +exportedModifier: "export", + // "declare" + +ambientModifier: "declare", + // "static" + +staticModifier: "static", + // "abstract" + +abstractModifier: "abstract", + // "optional" + +optionalModifier: "optional", + // ".d.ts" + +dtsModifier: ".d.ts", + // ".ts" + +tsModifier: ".ts", + // ".tsx" + +tsxModifier: ".tsx", + // ".js" + +jsModifier: ".js", + // ".jsx" + +jsxModifier: ".jsx", + // ".json" + +jsonModifier: ".json", + ... + }; + + declare var ClassificationTypeNames: { + // "comment" + +comment: "comment", + // "identifier" + +identifier: "identifier", + // "keyword" + +keyword: "keyword", + // "number" + +numericLiteral: "number", + // "bigint" + +bigintLiteral: "bigint", + // "operator" + +operator: "operator", + // "string" + +stringLiteral: "string", + // "whitespace" + +whiteSpace: "whitespace", + // "text" + +text: "text", + // "punctuation" + +punctuation: "punctuation", + // "class name" + +className: "class name", + // "enum name" + +enumName: "enum name", + // "interface name" + +interfaceName: "interface name", + // "module name" + +moduleName: "module name", + // "type parameter name" + +typeParameterName: "type parameter name", + // "type alias name" + +typeAliasName: "type alias name", + // "parameter name" + +parameterName: "parameter name", + // "doc comment tag name" + +docCommentTagName: "doc comment tag name", + // "jsx open tag name" + +jsxOpenTagName: "jsx open tag name", + // "jsx close tag name" + +jsxCloseTagName: "jsx close tag name", + // "jsx self closing tag name" + +jsxSelfClosingTagName: "jsx self closing tag name", + // "jsx attribute" + +jsxAttribute: "jsx attribute", + // "jsx text" + +jsxText: "jsx text", + // "jsx attribute string literal value" + +jsxAttributeStringLiteralValue: "jsx attribute string literal value", + ... + }; + + declare var ClassificationType: { + // 1 + +comment: 1, + // 2 + +identifier: 2, + // 3 + +keyword: 3, + // 4 + +numericLiteral: 4, + // 5 + +operator: 5, + // 6 + +stringLiteral: 6, + // 7 + +regularExpressionLiteral: 7, + // 8 + +whiteSpace: 8, + // 9 + +text: 9, + // 10 + +punctuation: 10, + // 11 + +className: 11, + // 12 + +enumName: 12, + // 13 + +interfaceName: 13, + // 14 + +moduleName: 14, + // 15 + +typeParameterName: 15, + // 16 + +typeAliasName: 16, + // 17 + +parameterName: 17, + // 18 + +docCommentTagName: 18, + // 19 + +jsxOpenTagName: 19, + // 20 + +jsxCloseTagName: 20, + // 21 + +jsxSelfClosingTagName: 21, + // 22 + +jsxAttribute: 22, + // 23 + +jsxText: 23, + // 24 + +jsxAttributeStringLiteralValue: 24, + // 25 + +bigintLiteral: 25, + ... + }; + + declare function createClassifier(): Classifier; + + declare type DocumentRegistry = { + acquireDocument( + fileName: string, + compilationSettings: CompilerOptions, + scriptSnapshot: IScriptSnapshot, + version: string, + scriptKind?: $Values + ): SourceFile, + acquireDocumentWithKey( + fileName: string, + path: Path, + compilationSettings: CompilerOptions, + key: DocumentRegistryBucketKey, + scriptSnapshot: IScriptSnapshot, + version: string, + scriptKind?: $Values + ): SourceFile, + updateDocument( + fileName: string, + compilationSettings: CompilerOptions, + scriptSnapshot: IScriptSnapshot, + version: string, + scriptKind?: $Values + ): SourceFile, + updateDocumentWithKey( + fileName: string, + path: Path, + compilationSettings: CompilerOptions, + key: DocumentRegistryBucketKey, + scriptSnapshot: IScriptSnapshot, + version: string, + scriptKind?: $Values + ): SourceFile, + getKeyForCompilationSettings( + settings: CompilerOptions + ): DocumentRegistryBucketKey, + releaseDocument( + fileName: string, + compilationSettings: CompilerOptions + ): void, + releaseDocumentWithKey(path: Path, key: DocumentRegistryBucketKey): void, + reportStats(): string, + ... + }; + + declare type DocumentRegistryBucketKey = string & { __bucketKey: any, ... }; + declare function createDocumentRegistry( + useCaseSensitiveFileNames?: boolean, + currentDirectory?: string + ): DocumentRegistry; + + declare function preProcessFile( + sourceText: string, + readImportFiles?: boolean, + detectJavaScriptImports?: boolean + ): PreProcessedFileInfo; + + declare type TranspileOptions = { + compilerOptions?: CompilerOptions, + fileName?: string, + reportDiagnostics?: boolean, + moduleName?: string, + renamedDependencies?: MapLike, + transformers?: CustomTransformers, + ... + }; + + declare type TranspileOutput = { + outputText: string, + diagnostics?: Diagnostic[], + sourceMapText?: string, + ... + }; + + declare function transpileModule( + input: string, + transpileOptions: TranspileOptions + ): TranspileOutput; + + declare function transpile( + input: string, + compilerOptions?: CompilerOptions, + fileName?: string, + diagnostics?: Diagnostic[], + moduleName?: string + ): string; + + declare function generateTypesForModule( + name: string, + moduleValue: mixed, + formatSettings: FormatCodeSettings + ): string; + + declare function generateTypesForGlobal( + name: string, + globalValue: mixed, + formatSettings: FormatCodeSettings + ): string; + + declare var servicesVersion: any; // "0.8"; + declare function toEditorSettings( + options: EditorOptions | EditorSettings + ): EditorSettings; + + declare function displayPartsToString( + displayParts: SymbolDisplayPart[] | void + ): string; + + declare function getDefaultCompilerOptions(): CompilerOptions; + + declare function getSupportedCodeFixes(): string[]; + + declare function createLanguageServiceSourceFile( + fileName: string, + scriptSnapshot: IScriptSnapshot, + scriptTarget: $Values, + version: string, + setNodeParents: boolean, + scriptKind?: $Values + ): SourceFile; + + declare var disableIncrementalParsing: boolean; + declare function updateLanguageServiceSourceFile( + sourceFile: SourceFile, + scriptSnapshot: IScriptSnapshot, + version: string, + textChangeRange: TextChangeRange | void, + aggressiveChecks?: boolean + ): SourceFile; + + declare function createLanguageService( + host: LanguageServiceHost, + documentRegistry?: DocumentRegistry, + syntaxOnly?: boolean + ): LanguageService; + + declare function getDefaultLibFilePath(options: CompilerOptions): string; + + declare function transform( + source: T | T[], + transformers: TransformerFactory[], + compilerOptions?: CompilerOptions + ): TransformationResult; + declare type ActionSet = "action::set"; + declare type ActionInvalidate = "action::invalidate"; + declare type ActionPackageInstalled = "action::packageInstalled"; + declare type ActionValueInspected = "action::valueInspected"; + declare type EventTypesRegistry = "event::typesRegistry"; + declare type EventBeginInstallTypes = "event::beginInstallTypes"; + declare type EventEndInstallTypes = "event::endInstallTypes"; + declare type EventInitializationFailed = "event::initializationFailed"; + declare type TypingInstallerResponse = { +kind: + | ActionSet + | ActionInvalidate + | EventTypesRegistry + | ActionPackageInstalled + | ActionValueInspected + | EventBeginInstallTypes + | EventEndInstallTypes + | EventInitializationFailed, ... }; + + declare type TypingInstallerRequestWithProjectName = { +projectName: string, ... }; + + declare type DiscoverTypings = { + ...$Exact, + +fileNames: string[], + +projectRootPath: Path, + +compilerOptions: CompilerOptions, + +typeAcquisition: TypeAcquisition, + +unresolvedImports: SortedReadonlyArray, + +cachePath?: string, + +kind: "discover", + ... + }; + + declare type CloseProject = { + ...$Exact, + +kind: "closeProject", + ... + }; + + declare type TypesRegistryRequest = { +kind: "typesRegistry", ... }; + + declare type InstallPackageRequest = { + ...$Exact, + +kind: "installPackage", + +fileName: Path, + +packageName: string, + +projectRootPath: Path, + ... + }; + + declare type PackageInstalledResponse = { + ...$Exact, + +kind: ActionPackageInstalled, + +success: boolean, + +message: string, + ... + }; + + declare type InitializationFailedResponse = { + ...$Exact, + +kind: EventInitializationFailed, + +message: string, + ... + }; + + declare type ProjectResponse = { + ...$Exact, + +projectName: string, + ... + }; + + declare type InvalidateCachedTypings = { + ...$Exact, + +kind: ActionInvalidate, + ... + }; + + declare type InstallTypes = { + ...$Exact, + +kind: EventBeginInstallTypes | EventEndInstallTypes, + +eventId: number, + +typingsInstallerVersion: string, + +packagesToInstall: $ReadOnlyArray, + ... + }; + + declare type BeginInstallTypes = { + ...$Exact, + +kind: EventBeginInstallTypes, + ... + }; + + declare type EndInstallTypes = { + ...$Exact, + +kind: EventEndInstallTypes, + +installSuccess: boolean, + ... + }; + + declare type SetTypings = { + ...$Exact, + +typeAcquisition: TypeAcquisition, + +compilerOptions: CompilerOptions, + +typings: string[], + +unresolvedImports: SortedReadonlyArray, + +kind: ActionSet, + ... + }; +} diff --git a/package-lock.json b/package-lock.json index 60d8957..ff18deb 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,64 +1,128 @@ { "name": "simple-markdown", - "version": "0.4.2", + "version": "0.7.1", "lockfileVersion": 1, "requires": true, "dependencies": { "@babel/code-frame": { - "version": "7.0.0", - "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.0.0.tgz", - "integrity": "sha512-OfC2uemaknXr87bdLUkWog7nYuliM9Ij5HUcajsVcMCpQrcLmtxRbVFTIqmcSkSeYRBFBRxs2FiUqFJDLdiebA==", + "version": "7.5.5", + "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.5.5.tgz", + "integrity": "sha512-27d4lZoomVyo51VegxI20xZPuSHusqbQag/ztrBC7wegWoQ1nLREPVSKSW8byhTlzTKyNE4ifaTA6lCp7JjpFw==", "dev": true, "requires": { "@babel/highlight": "^7.0.0" } }, + "@babel/core": { + "version": "7.7.7", + "resolved": "https://registry.npmjs.org/@babel/core/-/core-7.7.7.tgz", + "integrity": "sha512-jlSjuj/7z138NLZALxVgrx13AOtqip42ATZP7+kYl53GvDV6+4dCek1mVUo8z8c8Xnw/mx2q3d9HWh3griuesQ==", + "dev": true, + "requires": { + "@babel/code-frame": "^7.5.5", + "@babel/generator": "^7.7.7", + "@babel/helpers": "^7.7.4", + "@babel/parser": "^7.7.7", + "@babel/template": "^7.7.4", + "@babel/traverse": "^7.7.4", + "@babel/types": "^7.7.4", + "convert-source-map": "^1.7.0", + "debug": "^4.1.0", + "json5": "^2.1.0", + "lodash": "^4.17.13", + "resolve": "^1.3.2", + "semver": "^5.4.1", + "source-map": "^0.5.0" + }, + "dependencies": { + "debug": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.1.1.tgz", + "integrity": "sha512-pYAIzeRo8J6KPEaJ0VWOh5Pzkbw/RetuzehGM7QRRX5he4fPHx2rdKMB256ehJCkX+XRQm16eZLqLNS8RSZXZw==", + "dev": true, + "requires": { + "ms": "^2.1.1" + } + }, + "json5": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/json5/-/json5-2.1.1.tgz", + "integrity": "sha512-l+3HXD0GEI3huGq1njuqtzYK8OYJyXMkOLtQ53pjWh89tvWS2h6l+1zMkYWqlb57+SiQodKZyvMEFb2X+KrFhQ==", + "dev": true, + "requires": { + "minimist": "^1.2.0" + } + }, + "minimist": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.0.tgz", + "integrity": "sha1-o1AIsg9BOD7sH7kU9M1d95omQoQ=", + "dev": true + }, + "ms": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", + "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", + "dev": true + } + } + }, "@babel/generator": { - "version": "7.3.4", - "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.3.4.tgz", - "integrity": "sha512-8EXhHRFqlVVWXPezBW5keTiQi/rJMQTg/Y9uVCEZ0CAF3PKtCCaVRnp64Ii1ujhkoDhhF1fVsImoN4yJ2uz4Wg==", + "version": "7.7.7", + "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.7.7.tgz", + "integrity": "sha512-/AOIBpHh/JU1l0ZFS4kiRCBnLi6OTHzh0RPk3h9isBxkkqELtQNFi1Vr/tiG9p1yfoUdKVwISuXWQR+hwwM4VQ==", "dev": true, "requires": { - "@babel/types": "^7.3.4", + "@babel/types": "^7.7.4", "jsesc": "^2.5.1", - "lodash": "^4.17.11", - "source-map": "^0.5.0", - "trim-right": "^1.0.1" + "lodash": "^4.17.13", + "source-map": "^0.5.0" } }, "@babel/helper-function-name": { - "version": "7.1.0", - "resolved": "https://registry.npmjs.org/@babel/helper-function-name/-/helper-function-name-7.1.0.tgz", - "integrity": "sha512-A95XEoCpb3TO+KZzJ4S/5uW5fNe26DjBGqf1o9ucyLyCmi1dXq/B3c8iaWTfBk3VvetUxl16e8tIrd5teOCfGw==", + "version": "7.7.4", + "resolved": "https://registry.npmjs.org/@babel/helper-function-name/-/helper-function-name-7.7.4.tgz", + "integrity": "sha512-AnkGIdiBhEuiwdoMnKm7jfPfqItZhgRaZfMg1XX3bS25INOnLPjPG1Ppnajh8eqgt5kPJnfqrRHqFqmjKDZLzQ==", "dev": true, "requires": { - "@babel/helper-get-function-arity": "^7.0.0", - "@babel/template": "^7.1.0", - "@babel/types": "^7.0.0" + "@babel/helper-get-function-arity": "^7.7.4", + "@babel/template": "^7.7.4", + "@babel/types": "^7.7.4" } }, "@babel/helper-get-function-arity": { - "version": "7.0.0", - "resolved": "https://registry.npmjs.org/@babel/helper-get-function-arity/-/helper-get-function-arity-7.0.0.tgz", - "integrity": "sha512-r2DbJeg4svYvt3HOS74U4eWKsUAMRH01Z1ds1zx8KNTPtpTL5JAsdFv8BNyOpVqdFhHkkRDIg5B4AsxmkjAlmQ==", + "version": "7.7.4", + "resolved": "https://registry.npmjs.org/@babel/helper-get-function-arity/-/helper-get-function-arity-7.7.4.tgz", + "integrity": "sha512-QTGKEdCkjgzgfJ3bAyRwF4yyT3pg+vDgan8DSivq1eS0gwi+KGKE5x8kRcbeFTb/673mkO5SN1IZfmCfA5o+EA==", "dev": true, "requires": { - "@babel/types": "^7.0.0" + "@babel/types": "^7.7.4" } }, "@babel/helper-split-export-declaration": { - "version": "7.0.0", - "resolved": "https://registry.npmjs.org/@babel/helper-split-export-declaration/-/helper-split-export-declaration-7.0.0.tgz", - "integrity": "sha512-MXkOJqva62dfC0w85mEf/LucPPS/1+04nmmRMPEBUB++hiiThQ2zPtX/mEWQ3mtzCEjIJvPY8nuwxXtQeQwUag==", + "version": "7.7.4", + "resolved": "https://registry.npmjs.org/@babel/helper-split-export-declaration/-/helper-split-export-declaration-7.7.4.tgz", + "integrity": "sha512-guAg1SXFcVr04Guk9eq0S4/rWS++sbmyqosJzVs8+1fH5NI+ZcmkaSkc7dmtAFbHFva6yRJnjW3yAcGxjueDug==", + "dev": true, + "requires": { + "@babel/types": "^7.7.4" + } + }, + "@babel/helpers": { + "version": "7.7.4", + "resolved": "https://registry.npmjs.org/@babel/helpers/-/helpers-7.7.4.tgz", + "integrity": "sha512-ak5NGZGJ6LV85Q1Zc9gn2n+ayXOizryhjSUBTdu5ih1tlVCJeuQENzc4ItyCVhINVXvIT/ZQ4mheGIsfBkpskg==", "dev": true, "requires": { - "@babel/types": "^7.0.0" + "@babel/template": "^7.7.4", + "@babel/traverse": "^7.7.4", + "@babel/types": "^7.7.4" } }, "@babel/highlight": { - "version": "7.0.0", - "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.0.0.tgz", - "integrity": "sha512-UFMC4ZeFC48Tpvj7C8UgLvtkaUuovQX+5xNWrsIoMG8o2z+XFKjKaN9iVmS84dPwVN00W4wPmqvYoZF3EGAsfw==", + "version": "7.5.0", + "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.5.0.tgz", + "integrity": "sha512-7dV4eu9gBxoM0dAnj/BCFDW9LFU0zvTrkq0ugM7pnHEgguOEeOz1so2ZghEdzviYzQEED0r4EAgpsBChKy1TRQ==", "dev": true, "requires": { "chalk": "^2.0.0", @@ -67,37 +131,47 @@ } }, "@babel/parser": { - "version": "7.3.4", - "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.3.4.tgz", - "integrity": "sha512-tXZCqWtlOOP4wgCp6RjRvLmfuhnqTLy9VHwRochJBCP2nDm27JnnuFEnXFASVyQNHk36jD1tAammsCEEqgscIQ==", + "version": "7.7.7", + "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.7.7.tgz", + "integrity": "sha512-WtTZMZAZLbeymhkd/sEaPD8IQyGAhmuTuvTzLiCFM7iXiVdY0gc0IaI+cW0fh1BnSMbJSzXX6/fHllgHKwHhXw==", "dev": true }, + "@babel/polyfill": { + "version": "7.6.0", + "resolved": "https://registry.npmjs.org/@babel/polyfill/-/polyfill-7.6.0.tgz", + "integrity": "sha512-q5BZJI0n/B10VaQQvln1IlDK3BTBJFbADx7tv+oXDPIDZuTo37H5Adb9jhlXm/fEN4Y7/64qD9mnrJJG7rmaTw==", + "dev": true, + "requires": { + "core-js": "^2.6.5", + "regenerator-runtime": "^0.13.2" + } + }, "@babel/template": { - "version": "7.2.2", - "resolved": "https://registry.npmjs.org/@babel/template/-/template-7.2.2.tgz", - "integrity": "sha512-zRL0IMM02AUDwghf5LMSSDEz7sBCO2YnNmpg3uWTZj/v1rcG2BmQUvaGU8GhU8BvfMh1k2KIAYZ7Ji9KXPUg7g==", + "version": "7.7.4", + "resolved": "https://registry.npmjs.org/@babel/template/-/template-7.7.4.tgz", + "integrity": "sha512-qUzihgVPguAzXCK7WXw8pqs6cEwi54s3E+HrejlkuWO6ivMKx9hZl3Y2fSXp9i5HgyWmj7RKP+ulaYnKM4yYxw==", "dev": true, "requires": { "@babel/code-frame": "^7.0.0", - "@babel/parser": "^7.2.2", - "@babel/types": "^7.2.2" + "@babel/parser": "^7.7.4", + "@babel/types": "^7.7.4" } }, "@babel/traverse": { - "version": "7.3.4", - "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.3.4.tgz", - "integrity": "sha512-TvTHKp6471OYEcE/91uWmhR6PrrYywQntCHSaZ8CM8Vmp+pjAusal4nGB2WCCQd0rvI7nOMKn9GnbcvTUz3/ZQ==", + "version": "7.7.4", + "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.7.4.tgz", + "integrity": "sha512-P1L58hQyupn8+ezVA2z5KBm4/Zr4lCC8dwKCMYzsa5jFMDMQAzaBNy9W5VjB+KAmBjb40U7a/H6ao+Xo+9saIw==", "dev": true, "requires": { - "@babel/code-frame": "^7.0.0", - "@babel/generator": "^7.3.4", - "@babel/helper-function-name": "^7.1.0", - "@babel/helper-split-export-declaration": "^7.0.0", - "@babel/parser": "^7.3.4", - "@babel/types": "^7.3.4", + "@babel/code-frame": "^7.5.5", + "@babel/generator": "^7.7.4", + "@babel/helper-function-name": "^7.7.4", + "@babel/helper-split-export-declaration": "^7.7.4", + "@babel/parser": "^7.7.4", + "@babel/types": "^7.7.4", "debug": "^4.1.0", "globals": "^11.1.0", - "lodash": "^4.17.11" + "lodash": "^4.17.13" }, "dependencies": { "debug": { @@ -110,24 +184,78 @@ } }, "ms": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.1.tgz", - "integrity": "sha512-tgp+dl5cGk28utYktBsrFqA7HKgrhgPsg6Z/EfhWI4gl1Hwq8B/GmY/0oXZ6nF8hDVesS/FpnYaD/kOWhYQvyg==", + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", + "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", "dev": true } } }, "@babel/types": { - "version": "7.3.4", - "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.3.4.tgz", - "integrity": "sha512-WEkp8MsLftM7O/ty580wAmZzN1nDmCACc5+jFzUt+GUFNNIi3LdRlueYz0YIlmJhlZx1QYDMZL5vdWCL0fNjFQ==", + "version": "7.7.4", + "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.7.4.tgz", + "integrity": "sha512-cz5Ji23KCi4T+YIE/BolWosrJuSmoZeN1EFnRtBwF+KKLi8GG/Z2c2hOJJeCXPk4mwk4QFvTmwIodJowXgttRA==", "dev": true, "requires": { "esutils": "^2.0.2", - "lodash": "^4.17.11", + "lodash": "^4.17.13", "to-fast-properties": "^2.0.0" } }, + "@istanbuljs/load-nyc-config": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/@istanbuljs/load-nyc-config/-/load-nyc-config-1.0.0.tgz", + "integrity": "sha512-ZR0rq/f/E4f4XcgnDvtMWXCUJpi8eO0rssVhmztsZqLIEFA9UUP9zmpE0VxlM+kv/E1ul2I876Fwil2ayptDVg==", + "dev": true, + "requires": { + "camelcase": "^5.3.1", + "find-up": "^4.1.0", + "js-yaml": "^3.13.1", + "resolve-from": "^5.0.0" + }, + "dependencies": { + "find-up": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-4.1.0.tgz", + "integrity": "sha512-PpOwAdQ/YlXQ2vj8a3h8IipDuYRi3wceVQQGYWxNINccq40Anw7BlsEXCMbt1Zt+OLA6Fq9suIpIWD0OsnISlw==", + "dev": true, + "requires": { + "locate-path": "^5.0.0", + "path-exists": "^4.0.0" + } + }, + "locate-path": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-5.0.0.tgz", + "integrity": "sha512-t7hw9pI+WvuwNJXwk5zVHpyhIqzg2qTlklJOf0mVxGSbe3Fp2VieZcduNYjaLDoy6p9uGpQEGWG87WpMKlNq8g==", + "dev": true, + "requires": { + "p-locate": "^4.1.0" + } + }, + "p-locate": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-4.1.0.tgz", + "integrity": "sha512-R79ZZ/0wAxKGu3oYMlz8jy/kbhsNrS7SKZ7PxEHBgJ5+F2mtFW2fK2cOtBh1cHYkQsbzFV7I+EoRKe6Yt0oK7A==", + "dev": true, + "requires": { + "p-limit": "^2.2.0" + } + }, + "resolve-from": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-5.0.0.tgz", + "integrity": "sha512-qYg9KP24dD5qka9J47d0aVky0N+b4fTU89LN9iDnjB5waksiC49rvMB0PrUJQGoTmH50XPiqOvAjDfaijGxYZw==", + "dev": true + } + } + }, + "@istanbuljs/schema": { + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/@istanbuljs/schema/-/schema-0.1.2.tgz", + "integrity": "sha512-tsAQNx32a8CoFhjhijUIhI4kccIAgmGhy8LZMZgGfmXcpMbPRUqn5LWmgRttILi6yeGmBJd2xsPkFMs0PzgPCw==", + "dev": true + }, "@mrmlnc/readdir-enhanced": { "version": "2.2.1", "resolved": "https://registry.npmjs.org/@mrmlnc/readdir-enhanced/-/readdir-enhanced-2.2.1.tgz", @@ -144,46 +272,166 @@ "integrity": "sha512-shAmDyaQC4H92APFoIaVDHCx5bStIocgvbwQyxPRrbUY20V1EYTbSDchWbuwlMG3V17cprZhA6+78JfB+3DTPw==", "dev": true }, - "@octokit/rest": { - "version": "15.18.1", - "resolved": "https://registry.npmjs.org/@octokit/rest/-/rest-15.18.1.tgz", - "integrity": "sha512-g2tecjp2TEtYV8bKAFvfQtu+W29HM7ektmWmw8zrMy9/XCKDEYRErR2YvvhN9+IxkLC4O3lDqYP4b6WgsL6Utw==", + "@octokit/endpoint": { + "version": "5.5.1", + "resolved": "https://registry.npmjs.org/@octokit/endpoint/-/endpoint-5.5.1.tgz", + "integrity": "sha512-nBFhRUb5YzVTCX/iAK1MgQ4uWo89Gu0TH00qQHoYRCsE12dWcG1OiLd7v2EIo2+tpUKPMOQ62QFy9hy9Vg2ULg==", "dev": true, "requires": { - "before-after-hook": "^1.1.0", - "btoa-lite": "^1.0.0", - "debug": "^3.1.0", - "http-proxy-agent": "^2.1.0", - "https-proxy-agent": "^2.2.0", - "lodash": "^4.17.4", - "node-fetch": "^2.1.1", - "universal-user-agent": "^2.0.0", - "url-template": "^2.0.8" + "@octokit/types": "^2.0.0", + "is-plain-object": "^3.0.0", + "universal-user-agent": "^4.0.0" }, "dependencies": { - "debug": { - "version": "3.2.6", - "resolved": "https://registry.npmjs.org/debug/-/debug-3.2.6.tgz", - "integrity": "sha512-mel+jf7nrtEl5Pn1Qx46zARXKDpBbvzezse7p7LqINmdoIk8PYP5SySaxEmYv6TZ0JyEKA1hsCId6DIhgITtWQ==", + "is-plain-object": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/is-plain-object/-/is-plain-object-3.0.0.tgz", + "integrity": "sha512-tZIpofR+P05k8Aocp7UI/2UTa9lTJSebCXpFFoR9aibpokDj/uXBsJ8luUu0tTVYKkMU6URDUuOfJZ7koewXvg==", "dev": true, "requires": { - "ms": "^2.1.1" + "isobject": "^4.0.0" } }, - "ms": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.1.tgz", - "integrity": "sha512-tgp+dl5cGk28utYktBsrFqA7HKgrhgPsg6Z/EfhWI4gl1Hwq8B/GmY/0oXZ6nF8hDVesS/FpnYaD/kOWhYQvyg==", + "isobject": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/isobject/-/isobject-4.0.0.tgz", + "integrity": "sha512-S/2fF5wH8SJA/kmwr6HYhK/RI/OkhD84k8ntalo0iJjZikgq1XFvR5M8NPT1x5F7fBwCG3qHfnzeP/Vh/ZxCUA==", + "dev": true + } + } + }, + "@octokit/request": { + "version": "5.3.1", + "resolved": "https://registry.npmjs.org/@octokit/request/-/request-5.3.1.tgz", + "integrity": "sha512-5/X0AL1ZgoU32fAepTfEoggFinO3rxsMLtzhlUX+RctLrusn/CApJuGFCd0v7GMFhF+8UiCsTTfsu7Fh1HnEJg==", + "dev": true, + "requires": { + "@octokit/endpoint": "^5.5.0", + "@octokit/request-error": "^1.0.1", + "@octokit/types": "^2.0.0", + "deprecation": "^2.0.0", + "is-plain-object": "^3.0.0", + "node-fetch": "^2.3.0", + "once": "^1.4.0", + "universal-user-agent": "^4.0.0" + }, + "dependencies": { + "is-plain-object": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/is-plain-object/-/is-plain-object-3.0.0.tgz", + "integrity": "sha512-tZIpofR+P05k8Aocp7UI/2UTa9lTJSebCXpFFoR9aibpokDj/uXBsJ8luUu0tTVYKkMU6URDUuOfJZ7koewXvg==", + "dev": true, + "requires": { + "isobject": "^4.0.0" + } + }, + "isobject": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/isobject/-/isobject-4.0.0.tgz", + "integrity": "sha512-S/2fF5wH8SJA/kmwr6HYhK/RI/OkhD84k8ntalo0iJjZikgq1XFvR5M8NPT1x5F7fBwCG3qHfnzeP/Vh/ZxCUA==", "dev": true } } }, + "@octokit/request-error": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/@octokit/request-error/-/request-error-1.1.0.tgz", + "integrity": "sha512-06lt8PulL3rKpmwzYLCeLEt1iHFoj8l0PLkObAtp5Cx0Wwd1+5FAa9u6UXjA0kzYsfbjBKF9TtO9CuXelKiYlw==", + "dev": true, + "requires": { + "@octokit/types": "^2.0.0", + "deprecation": "^2.0.0", + "once": "^1.4.0" + } + }, + "@octokit/rest": { + "version": "16.34.1", + "resolved": "https://registry.npmjs.org/@octokit/rest/-/rest-16.34.1.tgz", + "integrity": "sha512-JUoS12cdktf1fv86rgrjC/RvYLuL+o7p57W7zX1x7ANFJ7OvdV8emvUNkFlcidEaOkYrxK3SoWgQFt3FhNmabA==", + "dev": true, + "requires": { + "@octokit/request": "^5.2.0", + "@octokit/request-error": "^1.0.2", + "atob-lite": "^2.0.0", + "before-after-hook": "^2.0.0", + "btoa-lite": "^1.0.0", + "deprecation": "^2.0.0", + "lodash.get": "^4.4.2", + "lodash.set": "^4.3.2", + "lodash.uniq": "^4.5.0", + "octokit-pagination-methods": "^1.1.0", + "once": "^1.4.0", + "universal-user-agent": "^4.0.0" + } + }, + "@octokit/types": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/@octokit/types/-/types-2.0.0.tgz", + "integrity": "sha512-467rp1g6YuxuNbu1m3A5BuGWxtzyVE8sAyN9+k3kb2LdnpmLPTiPsywbYmcckgfGZ+/AGpAaNrVx7131iSUXbQ==", + "dev": true, + "requires": { + "@types/node": "^12.11.1" + } + }, + "@sindresorhus/is": { + "version": "0.7.0", + "resolved": "https://registry.npmjs.org/@sindresorhus/is/-/is-0.7.0.tgz", + "integrity": "sha512-ONhaKPIufzzrlNbqtWFFd+jlnemX6lJAgq9ZeiZtS7I1PIf/la7CW4m83rTXRnVnsMbW2k56pGYu7AUFJD9Pow==", + "dev": true + }, + "@types/color-name": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/@types/color-name/-/color-name-1.1.1.tgz", + "integrity": "sha512-rr+OQyAjxze7GgWrSaJwydHStIhHq2lvY3BOC2Mj7KnzI7XK0Uw1TOOdI9lDoajEbSWLiYgoo4f1R51erQfhPQ==", + "dev": true + }, + "@types/estree": { + "version": "0.0.39", + "resolved": "https://registry.npmjs.org/@types/estree/-/estree-0.0.39.tgz", + "integrity": "sha512-EYNwp3bU+98cpU4lAWYYL7Zz+2gryWH1qbdDTidVd6hkiR6weksdbMadyXKXNPEkQFhXM+hVO9ZygomHXp+AIw==", + "dev": true + }, + "@types/mocha": { + "version": "5.2.7", + "resolved": "https://registry.npmjs.org/@types/mocha/-/mocha-5.2.7.tgz", + "integrity": "sha512-NYrtPht0wGzhwe9+/idPaBB+TqkY9AhTvOLMkThm0IoEfLaiVQZwBwyJ5puCkO3AUCWrmcoePjp2mbFocKy4SQ==", + "dev": true + }, + "@types/node": { + "version": "12.11.7", + "resolved": "https://registry.npmjs.org/@types/node/-/node-12.11.7.tgz", + "integrity": "sha512-JNbGaHFCLwgHn/iCckiGSOZ1XYHsKFwREtzPwSGCVld1SGhOlmZw2D4ZI94HQCrBHbADzW9m4LER/8olJTRGHA==", + "dev": true + }, + "@types/prop-types": { + "version": "15.7.3", + "resolved": "https://registry.npmjs.org/@types/prop-types/-/prop-types-15.7.3.tgz", + "integrity": "sha512-KfRL3PuHmqQLOG+2tGpRO26Ctg+Cq1E01D2DMriKEATHgWLfeNDmq9e29Q9WIky0dQ3NPkd1mzYH8Lm936Z9qw==" + }, "@types/q": { "version": "1.5.2", "resolved": "https://registry.npmjs.org/@types/q/-/q-1.5.2.tgz", "integrity": "sha512-ce5d3q03Ex0sy4R14722Rmt6MT07Ua+k4FwDfdcToYJcMKNtRVQvJ6JCAPdAmAnbRb6CsX6aYb9m96NGod9uTw==", "dev": true }, + "@types/react": { + "version": "16.9.10", + "resolved": "https://registry.npmjs.org/@types/react/-/react-16.9.10.tgz", + "integrity": "sha512-J1sinqwBCzazC+DOmbwRc96pNf0KBOVkefV5DVfLX9qiHdltfFH2BUqc36UYcYSU5tIrZtaaVMAx4JwOq5/Q/g==", + "requires": { + "@types/prop-types": "*", + "csstype": "^2.2.0" + } + }, + "@types/react-dom": { + "version": "16.9.2", + "resolved": "https://registry.npmjs.org/@types/react-dom/-/react-dom-16.9.2.tgz", + "integrity": "sha512-hgPbBoI1aTSTvZwo8HYw35UaTldW6n2ETLvHAcfcg1FaOuBV3olmyCe5eMpx2WybWMBPv0MdU2t5GOcQhP+3zA==", + "dev": true, + "requires": { + "@types/react": "*" + } + }, "@webassemblyjs/ast": { "version": "1.8.5", "resolved": "https://registry.npmjs.org/@webassemblyjs/ast/-/ast-1.8.5.tgz", @@ -373,13 +621,13 @@ "dev": true }, "accepts": { - "version": "1.3.5", - "resolved": "https://registry.npmjs.org/accepts/-/accepts-1.3.5.tgz", - "integrity": "sha1-63d99gEXI6OxTopywIBcjoZ0a9I=", + "version": "1.3.7", + "resolved": "https://registry.npmjs.org/accepts/-/accepts-1.3.7.tgz", + "integrity": "sha512-Il80Qs2WjYlJIBNzNkK6KYqlVMTbZLXgHx2oT0pU/fjRHyEp+PEfEPY0R3WCwAGVOtauxh1hOxNgIf5bv7dQpA==", "dev": true, "requires": { - "mime-types": "~2.1.18", - "negotiator": "0.6.1" + "mime-types": "~2.1.24", + "negotiator": "0.6.2" } }, "acorn": { @@ -400,13 +648,14 @@ "integrity": "sha512-OtUw6JUTgxA2QoqqmrmQ7F2NYqiBPi/L2jqHyFtllhOUvXYQXf0Z1CYUinIfyT4bTCGmrA7gX9FvHA81uzCoVw==", "dev": true }, - "agent-base": { - "version": "4.2.1", - "resolved": "https://registry.npmjs.org/agent-base/-/agent-base-4.2.1.tgz", - "integrity": "sha512-JVwXMr9nHYTUXsBFKUqhJwvlcYU/blreOEUkhNR2eXZIvwd+c+o5V4MgDPKWnMS/56awN3TRzIP+KoPn+roQtg==", + "aggregate-error": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/aggregate-error/-/aggregate-error-3.0.1.tgz", + "integrity": "sha512-quoaXsZ9/BLNae5yiNoUz+Nhkwz83GhWwtYFglcjEQB2NDHCIpApbqXxIFnm4Pq/Nvhrsq5sYJFyohrrxnTGAA==", "dev": true, "requires": { - "es6-promisify": "^5.0.0" + "clean-stack": "^2.0.0", + "indent-string": "^4.0.0" } }, "ajv": { @@ -481,12 +730,27 @@ } } }, + "append-transform": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/append-transform/-/append-transform-2.0.0.tgz", + "integrity": "sha512-7yeyCEurROLQJFv5Xj4lEGTy0borxepjFv1g22oAdqFu//SrAlDl1O1Nxx15SH1RoliUml6p8dwJW9jvZughhg==", + "dev": true, + "requires": { + "default-require-extensions": "^3.0.0" + } + }, "aproba": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/aproba/-/aproba-1.2.0.tgz", "integrity": "sha512-Y9J6ZjXtoYh8RnXVCMOU/ttDmk1aBjunq9vO0ta5x85WDQiQfUF9sIPBITdbiiIVcBo03Hi3jMxigBtsddlXRw==", "dev": true }, + "archy": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/archy/-/archy-1.0.0.tgz", + "integrity": "sha1-+cjBN1fMHde8N5rHeyxipcKGjEA=", + "dev": true + }, "argparse": { "version": "1.0.10", "resolved": "https://registry.npmjs.org/argparse/-/argparse-1.0.10.tgz", @@ -590,6 +854,12 @@ "integrity": "sha1-WWZ/QfrdTyDMvCu5a41Pf3jsA2c=", "dev": true }, + "astral-regex": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/astral-regex/-/astral-regex-1.0.0.tgz", + "integrity": "sha512-+Ryf6g3BKoRc7jfp7ad8tM4TtMiaWvbF/1/sQcZPkkS7ag3D5nMBCe2UfOTONtAkaG0tO0ij3C5Lwmf1EiyjHg==", + "dev": true + }, "async-each": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/async-each/-/async-each-1.0.1.tgz", @@ -608,34 +878,11 @@ "integrity": "sha512-Wm6ukoaOGJi/73p/cl2GvLjTI5JM1k/O14isD73YML8StrH/7/lRFgmg8nICZgD3bZZvjwCGxtMOD3wWNAu8cg==", "dev": true }, - "babel-polyfill": { - "version": "6.26.0", - "resolved": "https://registry.npmjs.org/babel-polyfill/-/babel-polyfill-6.26.0.tgz", - "integrity": "sha1-N5k3q8Z9eJWXCtxiHyhM2WbPIVM=", - "dev": true, - "requires": { - "babel-runtime": "^6.26.0", - "core-js": "^2.5.0", - "regenerator-runtime": "^0.10.5" - } - }, - "babel-runtime": { - "version": "6.26.0", - "resolved": "https://registry.npmjs.org/babel-runtime/-/babel-runtime-6.26.0.tgz", - "integrity": "sha1-llxwWGaOgrVde/4E/yM3vItWR/4=", - "dev": true, - "requires": { - "core-js": "^2.4.0", - "regenerator-runtime": "^0.11.0" - }, - "dependencies": { - "regenerator-runtime": { - "version": "0.11.1", - "resolved": "https://registry.npmjs.org/regenerator-runtime/-/regenerator-runtime-0.11.1.tgz", - "integrity": "sha512-MguG95oij0fC3QV3URf4V2SDYGJhJnJGqvIIgdECeODCT98wSWDAJ94SSuVpYQUoTcGUIL6L4yNB7j1DFFHSBg==", - "dev": true - } - } + "atob-lite": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/atob-lite/-/atob-lite-2.0.0.tgz", + "integrity": "sha1-D+9a1G8b16hQLGVyfwNn1e5D1pY=", + "dev": true }, "balanced-match": { "version": "1.0.0", @@ -705,9 +952,9 @@ "dev": true }, "before-after-hook": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/before-after-hook/-/before-after-hook-1.4.0.tgz", - "integrity": "sha512-l5r9ir56nda3qu14nAXIlyq1MmUSs0meCIaFAh8HwkFwP1F8eToOuS3ah2VAHHcY04jaYD7FpJC5JTXHYRbkzg==", + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/before-after-hook/-/before-after-hook-2.1.0.tgz", + "integrity": "sha512-IWIbu7pMqyw3EAJHzzHbWa85b6oud/yfKYg5rqB5hNE8CeMi3nX+2C2sj0HswfblST86hpVEOAb9x34NZd6P7A==", "dev": true }, "bfj": { @@ -731,9 +978,9 @@ } }, "big-integer": { - "version": "1.6.42", - "resolved": "https://registry.npmjs.org/big-integer/-/big-integer-1.6.42.tgz", - "integrity": "sha512-3UQFKcRMx+5Z+IK5vYTMYK2jzLRJkt+XqyDdacgWgtMjjuifKpKTFneJLEgeBElOE2/lXZ1LcMcb5s8pwG2U8Q==", + "version": "1.6.47", + "resolved": "https://registry.npmjs.org/big-integer/-/big-integer-1.6.47.tgz", + "integrity": "sha512-9t9f7X3as2XGX8b52GqG6ox0GvIdM86LyIXASJnDCFhYNgt+A+MByQZ3W2PyMRZjEvG5f8TEbSPfEotVuMJnQg==", "dev": true }, "big.js": { @@ -771,21 +1018,29 @@ "dev": true }, "body-parser": { - "version": "1.18.3", - "resolved": "https://registry.npmjs.org/body-parser/-/body-parser-1.18.3.tgz", - "integrity": "sha1-WykhmP/dVTs6DyDe0FkrlWlVyLQ=", + "version": "1.19.0", + "resolved": "https://registry.npmjs.org/body-parser/-/body-parser-1.19.0.tgz", + "integrity": "sha512-dhEPs72UPbDnAQJ9ZKMNTP6ptJaionhP5cBb541nXPlW60Jepo9RV/a4fX4XWW9CuFNK22krhrj1+rgzifNCsw==", "dev": true, "requires": { - "bytes": "3.0.0", + "bytes": "3.1.0", "content-type": "~1.0.4", "debug": "2.6.9", "depd": "~1.1.2", - "http-errors": "~1.6.3", - "iconv-lite": "0.4.23", + "http-errors": "1.7.2", + "iconv-lite": "0.4.24", "on-finished": "~2.3.0", - "qs": "6.5.2", - "raw-body": "2.3.3", - "type-is": "~1.6.16" + "qs": "6.7.0", + "raw-body": "2.4.0", + "type-is": "~1.6.17" + }, + "dependencies": { + "bytes": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/bytes/-/bytes-3.1.0.tgz", + "integrity": "sha512-zauLjrfCG+xvoyaqLoV8bLVXXNGC4JqlxFCutSDWA6fJrTo2ZuvLYTqZ7aHBLZSMOopbzwv8f+wZcVzfVTI2Dg==", + "dev": true + } } }, "boolbase": { @@ -1039,6 +1294,75 @@ "unset-value": "^1.0.0" } }, + "cacheable-request": { + "version": "2.1.4", + "resolved": "https://registry.npmjs.org/cacheable-request/-/cacheable-request-2.1.4.tgz", + "integrity": "sha1-DYCIAbY0KtM8kd+dC0TcCbkeXD0=", + "dev": true, + "requires": { + "clone-response": "1.0.2", + "get-stream": "3.0.0", + "http-cache-semantics": "3.8.1", + "keyv": "3.0.0", + "lowercase-keys": "1.0.0", + "normalize-url": "2.0.1", + "responselike": "1.0.2" + }, + "dependencies": { + "get-stream": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-3.0.0.tgz", + "integrity": "sha1-jpQ9E1jcN1VQVOy+LtsFqhdO3hQ=", + "dev": true + }, + "lowercase-keys": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/lowercase-keys/-/lowercase-keys-1.0.0.tgz", + "integrity": "sha1-TjNms55/VFfjXxMkvfb4jQv8cwY=", + "dev": true + }, + "normalize-url": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/normalize-url/-/normalize-url-2.0.1.tgz", + "integrity": "sha512-D6MUW4K/VzoJ4rJ01JFKxDrtY1v9wrgzCX5f2qj/lzH1m/lW6MhUZFKerVsnyjOhOsYzI9Kqqak+10l4LvLpMw==", + "dev": true, + "requires": { + "prepend-http": "^2.0.0", + "query-string": "^5.0.1", + "sort-keys": "^2.0.0" + } + } + } + }, + "caching-transform": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/caching-transform/-/caching-transform-4.0.0.tgz", + "integrity": "sha512-kpqOvwXnjjN44D89K5ccQC+RUrsy7jB/XLlRrx0D7/2HNcTPqzsb6XgYoErwko6QsV184CA2YgS1fxDiiDZMWA==", + "dev": true, + "requires": { + "hasha": "^5.0.0", + "make-dir": "^3.0.0", + "package-hash": "^4.0.0", + "write-file-atomic": "^3.0.0" + }, + "dependencies": { + "make-dir": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/make-dir/-/make-dir-3.0.0.tgz", + "integrity": "sha512-grNJDhb8b1Jm1qeqW5R/O63wUo4UXo2v2HMic6YT9i/HBlF93S8jkMgH7yugvY9ABDShH4VZMn8I+U8+fCNegw==", + "dev": true, + "requires": { + "semver": "^6.0.0" + } + }, + "semver": { + "version": "6.3.0", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", + "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==", + "dev": true + } + } + }, "call-me-maybe": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/call-me-maybe/-/call-me-maybe-1.0.1.tgz", @@ -1070,9 +1394,9 @@ "dev": true }, "camelcase": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-3.0.0.tgz", - "integrity": "sha1-MvxLn82vhF/N9+c7uXysImHwqwo=", + "version": "5.3.1", + "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-5.3.1.tgz", + "integrity": "sha512-L28STB170nwWS63UjtlEOE3dldQApaJXZkOI1uMFfzf3rRuPegHaHesyee+YxQ+W6SvRDQV6UrdOdRiR153wJg==", "dev": true }, "caniuse-api": { @@ -1210,56 +1534,34 @@ } } }, + "clean-stack": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/clean-stack/-/clean-stack-2.2.0.tgz", + "integrity": "sha512-4diC9HaTE+KRAMWhDhrGOECgWZxoevMc5TlkObMqNSsVU62PYzXZ/SMTjzyGAFF1YusgxGcSWTEXBhp0CPwQ1A==", + "dev": true + }, "cliui": { - "version": "3.2.0", - "resolved": "https://registry.npmjs.org/cliui/-/cliui-3.2.0.tgz", - "integrity": "sha1-EgYBU3qRbSmUD5NNo7SNWFo5IT0=", + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/cliui/-/cliui-4.1.0.tgz", + "integrity": "sha512-4FG+RSG9DL7uEwRUZXZn3SS34DiDPfzP0VOiEwtUWlE+AR2EIg+hSyvrIgUUfhdgR/UkAeW2QHgeP+hWrXs7jQ==", "dev": true, "requires": { - "string-width": "^1.0.1", - "strip-ansi": "^3.0.1", + "string-width": "^2.1.1", + "strip-ansi": "^4.0.0", "wrap-ansi": "^2.0.0" - }, - "dependencies": { - "ansi-regex": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-2.1.1.tgz", - "integrity": "sha1-w7M6te42DYbg5ijwRorn7yfWVN8=", - "dev": true - }, - "is-fullwidth-code-point": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-1.0.0.tgz", - "integrity": "sha1-754xOG8DGn8NZDr4L95QxFfvAMs=", - "dev": true, - "requires": { - "number-is-nan": "^1.0.0" - } - }, - "string-width": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/string-width/-/string-width-1.0.2.tgz", - "integrity": "sha1-EYvfW4zcUaKn5w0hHgfisLmxB9M=", - "dev": true, - "requires": { - "code-point-at": "^1.0.0", - "is-fullwidth-code-point": "^1.0.0", - "strip-ansi": "^3.0.0" - } - }, - "strip-ansi": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.1.tgz", - "integrity": "sha1-ajhfuIU9lS1f8F0Oiq+UJ43GPc8=", - "dev": true, - "requires": { - "ansi-regex": "^2.0.0" - } - } } }, - "coa": { - "version": "2.0.2", + "clone-response": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/clone-response/-/clone-response-1.0.2.tgz", + "integrity": "sha1-0dyXOSAxTfZ/vrlCI7TuNQI56Ws=", + "dev": true, + "requires": { + "mimic-response": "^1.0.0" + } + }, + "coa": { + "version": "2.0.2", "resolved": "https://registry.npmjs.org/coa/-/coa-2.0.2.tgz", "integrity": "sha512-q5/jG+YQnSy4nRTV4F7lPepBJZ8qBNJJDBuJdoejDyLXgmL7IEo+Le2JDZudFTFt7mrCqIRaSjws4ygRCTCAXA==", "dev": true, @@ -1321,9 +1623,9 @@ } }, "colors": { - "version": "1.3.3", - "resolved": "https://registry.npmjs.org/colors/-/colors-1.3.3.tgz", - "integrity": "sha512-mmGt/1pZqYRjMxB1axhTo16/snVZ5krrKkcmMeVKxzECMMXoCgnvTPp10QgHfcbQZw8Dq2jMNG6je4JlWU0gWg==", + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/colors/-/colors-1.4.0.tgz", + "integrity": "sha512-a+UqTh4kgZg/SlGvfbzDHpgRu7AAQOmmqRHJnxhRZICKFUT91brVhNNt58CMWU9PsBbv3PDCZUHbVxuDiH2mtA==", "dev": true }, "commander": { @@ -1424,10 +1726,13 @@ "dev": true }, "content-disposition": { - "version": "0.5.2", - "resolved": "https://registry.npmjs.org/content-disposition/-/content-disposition-0.5.2.tgz", - "integrity": "sha1-DPaLud318r55YcOoUXjLhdunjLQ=", - "dev": true + "version": "0.5.3", + "resolved": "https://registry.npmjs.org/content-disposition/-/content-disposition-0.5.3.tgz", + "integrity": "sha512-ExO0774ikEObIAEV9kDo50o+79VCUdEB6n6lzKgGwupcVeRlhrj3qGAfwq8G6uBJjkqLrhT0qEYFcWng8z1z0g==", + "dev": true, + "requires": { + "safe-buffer": "5.1.2" + } }, "content-type": { "version": "1.0.4", @@ -1435,10 +1740,19 @@ "integrity": "sha512-hIP3EEPs8tB9AT1L+NUqtwOAps4mk2Zob89MWXMHjHWg9milF/j4osnnQLXBCBFBk/tvIG/tUc9mOUJiPBhPXA==", "dev": true }, + "convert-source-map": { + "version": "1.7.0", + "resolved": "https://registry.npmjs.org/convert-source-map/-/convert-source-map-1.7.0.tgz", + "integrity": "sha512-4FJkXzKXEDB1snCFZlLP4gpC3JILicCpGbzG9f9G7tGqGCzETQ2hWPrcinA9oU4wtf2biUaEH5065UnMeR33oA==", + "dev": true, + "requires": { + "safe-buffer": "~5.1.1" + } + }, "cookie": { - "version": "0.3.1", - "resolved": "https://registry.npmjs.org/cookie/-/cookie-0.3.1.tgz", - "integrity": "sha1-5+Ch+e9DtMi6klxcWpboBtFoc7s=", + "version": "0.4.0", + "resolved": "https://registry.npmjs.org/cookie/-/cookie-0.4.0.tgz", + "integrity": "sha512-+Hp8fLp57wnUSt0tY0tHEXh4voZRDnoIrZPqlo3DPiI4y9lwg/jqx+1Om94/W6ZaPDOUbnjOt/99w66zk+l1Xg==", "dev": true }, "cookie-signature": { @@ -1468,9 +1782,9 @@ "dev": true }, "core-js": { - "version": "2.6.5", - "resolved": "https://registry.npmjs.org/core-js/-/core-js-2.6.5.tgz", - "integrity": "sha512-klh/kDpwX8hryYL14M9w/xei6vrv6sE8gTHDG7/T/+SEovB/G4ejwcfE/CBzO6Edsu+OETZMZ3wcX/EjUkrl5A==", + "version": "2.6.10", + "resolved": "https://registry.npmjs.org/core-js/-/core-js-2.6.10.tgz", + "integrity": "sha512-I39t74+4t+zau64EN1fE5v2W31Adtc/REhzWN+gWRRXg6WH5qAsZm62DHpQ1+Yhe4047T55jvzz7MUqF/dBBlA==", "dev": true }, "core-util-is": { @@ -1772,6 +2086,11 @@ } } }, + "csstype": { + "version": "2.6.7", + "resolved": "https://registry.npmjs.org/csstype/-/csstype-2.6.7.tgz", + "integrity": "sha512-9Mcn9sFbGBAdmimWb2gLVDtFJzeKtDGIr76TUqmjZrw9LFXBMSU70lcs+C0/7fyCd6iBDqmksUcCOUIkisPHsQ==" + }, "cyclist": { "version": "0.2.2", "resolved": "https://registry.npmjs.org/cyclist/-/cyclist-0.2.2.tgz", @@ -1814,6 +2133,15 @@ "mimic-response": "^1.0.0" } }, + "default-require-extensions": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/default-require-extensions/-/default-require-extensions-3.0.0.tgz", + "integrity": "sha512-ek6DpXq/SCpvjhpFsLFRVtIxJCRw6fUR42lYMVZuUMK7n8eMz4Uh5clckdBjEpLhn/gEBZo7hDJnJcwdKLKQjg==", + "dev": true, + "requires": { + "strip-bom": "^4.0.0" + } + }, "define-properties": { "version": "1.1.3", "resolved": "https://registry.npmjs.org/define-properties/-/define-properties-1.1.3.tgz", @@ -1870,6 +2198,12 @@ "integrity": "sha1-m81S4UwJd2PnSbJ0xDRu0uVgtak=", "dev": true }, + "deprecation": { + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/deprecation/-/deprecation-2.3.1.tgz", + "integrity": "sha512-xmHIy4F3scKVwMsQ4WnVaS8bHOx0DmVwRywosKhaILI0ywMDWPtBSku2HNxRvF7jtwDRsoEwYQSfbxj8b7RlJQ==", + "dev": true + }, "des.js": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/des.js/-/des.js-1.0.0.tgz", @@ -1886,12 +2220,6 @@ "integrity": "sha1-l4hXRCxEdJ5CBmE+N5RiBYJqvYA=", "dev": true }, - "detect-file": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/detect-file/-/detect-file-1.0.0.tgz", - "integrity": "sha1-8NZtA2cqglyxtzvbP+YjEMjlUrc=", - "dev": true - }, "diff": { "version": "3.5.0", "resolved": "https://registry.npmjs.org/diff/-/diff-3.5.0.tgz", @@ -2043,6 +2371,12 @@ "minimalistic-crypto-utils": "^1.0.0" } }, + "emoji-regex": { + "version": "7.0.3", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-7.0.3.tgz", + "integrity": "sha512-CwBLREIQ7LvYFB0WyRvwhq5N5qPhc6PMjD6bYggFlI5YyDgl+0vxq5VHbMOFqLg7hfWzmu8T5Z1QofhmTIhItA==", + "dev": true + }, "emojis-list": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/emojis-list/-/emojis-list-2.1.0.tgz", @@ -2124,21 +2458,12 @@ "is-symbol": "^1.0.2" } }, - "es6-promise": { - "version": "4.2.6", - "resolved": "https://registry.npmjs.org/es6-promise/-/es6-promise-4.2.6.tgz", - "integrity": "sha512-aRVgGdnmW2OiySVPUC9e6m+plolMAJKjZnQlCwNSuK5yQ0JN61DZSO1X1Ufd1foqWRAlig0rhduTCHe7sVtK5Q==", + "es6-error": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/es6-error/-/es6-error-4.1.1.tgz", + "integrity": "sha512-Um/+FxMr9CISWh0bi5Zv0iOD+4cFh5qLeks1qhAopKVAJw3drgKbKySikp7wGhDL0HPeaja0P5ULZrxLkniUVg==", "dev": true }, - "es6-promisify": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/es6-promisify/-/es6-promisify-5.0.0.tgz", - "integrity": "sha1-UQnWLz5W6pZ8S2NQWu8IKRyKUgM=", - "dev": true, - "requires": { - "es6-promise": "^4.0.3" - } - }, "escape-html": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/escape-html/-/escape-html-1.0.3.tgz", @@ -2183,9 +2508,9 @@ "dev": true }, "esutils": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/esutils/-/esutils-2.0.2.tgz", - "integrity": "sha1-Cr9PHKpbyx96nYrMbepPqqBLrJs=", + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/esutils/-/esutils-2.0.3.tgz", + "integrity": "sha512-kVscqXk4OCp68SZ0dkgEKVi6/8ij300KBWTJq32P/dYeWTSwK41WyTxalN1eRmA5Z9UU/LX9D7FWSmV9SAYx6g==", "dev": true }, "etag": { @@ -2211,13 +2536,13 @@ } }, "execa": { - "version": "0.10.0", - "resolved": "https://registry.npmjs.org/execa/-/execa-0.10.0.tgz", - "integrity": "sha512-7XOMnz8Ynx1gGo/3hyV9loYNPWM94jG3+3T3Y8tsfSstFmETmENCMU/A/zj8Lyaj1lkgEepKepvd6240tBRvlw==", + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/execa/-/execa-1.0.0.tgz", + "integrity": "sha512-adbxcyWV46qiHyvSp50TKt05tB4tK3HcmF7/nxfAdhnox83seTDbwnaqKO4sXRy7roHAIFqJP/Rw/AuEbX61LA==", "dev": true, "requires": { "cross-spawn": "^6.0.0", - "get-stream": "^3.0.0", + "get-stream": "^4.0.0", "is-stream": "^1.1.0", "npm-run-path": "^2.0.0", "p-finally": "^1.0.0", @@ -2260,49 +2585,40 @@ } } }, - "expand-tilde": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/expand-tilde/-/expand-tilde-2.0.2.tgz", - "integrity": "sha1-l+gBqgUt8CRU3kawK/YhZCzchQI=", - "dev": true, - "requires": { - "homedir-polyfill": "^1.0.1" - } - }, "express": { - "version": "4.16.4", - "resolved": "https://registry.npmjs.org/express/-/express-4.16.4.tgz", - "integrity": "sha512-j12Uuyb4FMrd/qQAm6uCHAkPtO8FDTRJZBDd5D2KOL2eLaz1yUNdUB/NOIyq0iU4q4cFarsUCrnFDPBcnksuOg==", + "version": "4.17.1", + "resolved": "https://registry.npmjs.org/express/-/express-4.17.1.tgz", + "integrity": "sha512-mHJ9O79RqluphRrcw2X/GTh3k9tVv8YcoyY4Kkh4WDMUYKRZUq0h1o0w2rrrxBqM7VoeUVqgb27xlEMXTnYt4g==", "dev": true, "requires": { - "accepts": "~1.3.5", + "accepts": "~1.3.7", "array-flatten": "1.1.1", - "body-parser": "1.18.3", - "content-disposition": "0.5.2", + "body-parser": "1.19.0", + "content-disposition": "0.5.3", "content-type": "~1.0.4", - "cookie": "0.3.1", + "cookie": "0.4.0", "cookie-signature": "1.0.6", "debug": "2.6.9", "depd": "~1.1.2", "encodeurl": "~1.0.2", "escape-html": "~1.0.3", "etag": "~1.8.1", - "finalhandler": "1.1.1", + "finalhandler": "~1.1.2", "fresh": "0.5.2", "merge-descriptors": "1.0.1", "methods": "~1.1.2", "on-finished": "~2.3.0", - "parseurl": "~1.3.2", + "parseurl": "~1.3.3", "path-to-regexp": "0.1.7", - "proxy-addr": "~2.0.4", - "qs": "6.5.2", - "range-parser": "~1.2.0", + "proxy-addr": "~2.0.5", + "qs": "6.7.0", + "range-parser": "~1.2.1", "safe-buffer": "5.1.2", - "send": "0.16.2", - "serve-static": "1.13.2", - "setprototypeof": "1.1.0", - "statuses": "~1.4.0", - "type-is": "~1.6.16", + "send": "0.17.1", + "serve-static": "1.14.1", + "setprototypeof": "1.1.1", + "statuses": "~1.5.0", + "type-is": "~1.6.18", "utils-merge": "1.0.1", "vary": "~1.1.2" } @@ -2476,17 +2792,17 @@ } }, "finalhandler": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/finalhandler/-/finalhandler-1.1.1.tgz", - "integrity": "sha512-Y1GUDo39ez4aHAw7MysnUD5JzYX+WaIj8I57kO3aEPT1fFRL4sr7mjei97FgnwhAyyzRYmQZaTHb2+9uZ1dPtg==", + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/finalhandler/-/finalhandler-1.1.2.tgz", + "integrity": "sha512-aAWcW57uxVNrQZqFXjITpW3sIUQmHGG3qSb9mUah9MgMC4NeWhNOlNjXEYq3HjRAvL6arUviZGGJsBg6z0zsWA==", "dev": true, "requires": { "debug": "2.6.9", "encodeurl": "~1.0.2", "escape-html": "~1.0.3", "on-finished": "~2.3.0", - "parseurl": "~1.3.2", - "statuses": "~1.4.0", + "parseurl": "~1.3.3", + "statuses": "~1.5.0", "unpipe": "~1.0.0" } }, @@ -2502,25 +2818,12 @@ } }, "find-up": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/find-up/-/find-up-1.1.2.tgz", - "integrity": "sha1-ay6YIrGizgpgq2TWEOzK1TyyTQ8=", - "dev": true, - "requires": { - "path-exists": "^2.0.0", - "pinkie-promise": "^2.0.0" - } - }, - "findup-sync": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/findup-sync/-/findup-sync-2.0.0.tgz", - "integrity": "sha1-kyaxSIwi0aYIhlCoaQGy2akKLLw=", + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-3.0.0.tgz", + "integrity": "sha512-1yD6RmLI1XBfxugvORwlck6f75tYL+iR0jqwsOrOxMZyGYqUuDhJ0l4AXdO1iX/FTs9cBAMEk1gWSEx1kSbylg==", "dev": true, "requires": { - "detect-file": "^1.0.0", - "is-glob": "^3.1.0", - "micromatch": "^3.0.4", - "resolve-dir": "^1.0.1" + "locate-path": "^3.0.0" } }, "flat": { @@ -2533,40 +2836,59 @@ }, "dependencies": { "is-buffer": { - "version": "2.0.3", - "resolved": "https://registry.npmjs.org/is-buffer/-/is-buffer-2.0.3.tgz", - "integrity": "sha512-U15Q7MXTuZlrbymiz95PJpZxu8IlipAp4dtS3wOdgPXx3mqBnslrWU14kxfHB+Py/+2PVKSr37dMAgM2A4uArw==", + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/is-buffer/-/is-buffer-2.0.4.tgz", + "integrity": "sha512-Kq1rokWXOPXWuaMAqZiJW4XxsmD9zGx9q4aePabbn3qCRGedtH7Cm+zV8WETitMfu1wdh+Rvd6w5egwSngUX2A==", "dev": true } } }, "flow-bin": { - "version": "0.94.0", - "resolved": "https://registry.npmjs.org/flow-bin/-/flow-bin-0.94.0.tgz", - "integrity": "sha512-DYF7r9CJ/AksfmmB4+q+TyLMoeQPRnqtF1Pk7KY3zgfkB/nVuA3nXyzqgsIPIvnMSiFEXQcFK4z+iPxSLckZhQ==", + "version": "0.111.1", + "resolved": "https://registry.npmjs.org/flow-bin/-/flow-bin-0.111.1.tgz", + "integrity": "sha512-fOFFy4rsvV4zYXUqpNY2bChpzEMYbmumO6DlbcpndbJIHY3W8+UzyiWb8+iRDf2ME1YJgTIvKSJCzHpQ40OBOQ==", "dev": true }, "flow-typed": { - "version": "2.5.1", - "resolved": "https://registry.npmjs.org/flow-typed/-/flow-typed-2.5.1.tgz", - "integrity": "sha1-D/VlzJTSr4xVd0S6NktvFHJqa58=", + "version": "2.6.2", + "resolved": "https://registry.npmjs.org/flow-typed/-/flow-typed-2.6.2.tgz", + "integrity": "sha512-brTh8SukLidVpR1u8hSR3OcZSvLtptpwLEGgEhK/qBhWCB7zxPZmnmChYi40JQH6vB448ck380+qbkDo3fJ6qA==", "dev": true, "requires": { - "@octokit/rest": "^15.2.6", - "babel-polyfill": "^6.26.0", - "colors": "^1.1.2", - "fs-extra": "^5.0.0", - "glob": "^7.1.2", - "got": "^7.1.0", - "md5": "^2.1.0", + "@babel/polyfill": "^7.0.0", + "@octokit/rest": "^16.33.1", + "colors": "^1.3.2", + "flowgen": "^1.9.0", + "fs-extra": "^7.0.0", + "glob": "^7.1.3", + "got": "^8.3.2", + "md5": "^2.2.1", "mkdirp": "^0.5.1", + "prettier": "^1.18.2", "rimraf": "^2.6.2", - "semver": "^5.5.0", - "table": "^4.0.2", + "semver": "^5.5.1", + "table": "^5.0.2", "through": "^2.3.8", - "unzipper": "^0.8.11", - "which": "^1.3.0", - "yargs": "^4.2.0" + "unzipper": "^0.9.3", + "which": "^1.3.1", + "yargs": "^12.0.2" + } + }, + "flowgen": { + "version": "1.10.0", + "resolved": "https://registry.npmjs.org/flowgen/-/flowgen-1.10.0.tgz", + "integrity": "sha512-3lsoaa1vxGXhnkHuoE4mLPJi/klvpR3ID8R9CFJ/GBNi+cxJXecWQaUPrWMdNI5tGs8Y+7wrIZaCVFKFLQiGOg==", + "dev": true, + "requires": { + "@babel/code-frame": "^7.0.0", + "@babel/highlight": "^7.0.0", + "commander": "^2.11.0", + "lodash": "^4.17.4", + "paralleljs": "^0.2.1", + "prettier": "^1.16.4", + "shelljs": "^0.8.3", + "typescript": "^3.4", + "typescript-compiler": "^1.4.1-2" } }, "flush-write-stream": { @@ -2617,6 +2939,59 @@ "integrity": "sha1-gQaNKVqBQuwKxybG4iAMMPttXoA=", "dev": true }, + "foreground-child": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/foreground-child/-/foreground-child-2.0.0.tgz", + "integrity": "sha512-dCIq9FpEcyQyXKCkyzmlPTFNgrCzPudOe+mhvJU5zAtlBnGVy2yKxtfsxK2tQBThwq225jcvBjpw1Gr40uzZCA==", + "dev": true, + "requires": { + "cross-spawn": "^7.0.0", + "signal-exit": "^3.0.2" + }, + "dependencies": { + "cross-spawn": { + "version": "7.0.1", + "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.1.tgz", + "integrity": "sha512-u7v4o84SwFpD32Z8IIcPZ6z1/ie24O6RU3RbtL5Y316l3KuHVPx9ItBgWQ6VlfAFnRnTtMUrsQ9MUUTuEZjogg==", + "dev": true, + "requires": { + "path-key": "^3.1.0", + "shebang-command": "^2.0.0", + "which": "^2.0.1" + } + }, + "path-key": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/path-key/-/path-key-3.1.1.tgz", + "integrity": "sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==", + "dev": true + }, + "shebang-command": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-2.0.0.tgz", + "integrity": "sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA==", + "dev": true, + "requires": { + "shebang-regex": "^3.0.0" + } + }, + "shebang-regex": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-3.0.0.tgz", + "integrity": "sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==", + "dev": true + }, + "which": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz", + "integrity": "sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==", + "dev": true, + "requires": { + "isexe": "^2.0.0" + } + } + } + }, "forwarded": { "version": "0.1.2", "resolved": "https://registry.npmjs.org/forwarded/-/forwarded-0.1.2.tgz", @@ -2648,10 +3023,16 @@ "readable-stream": "^2.0.0" } }, + "fromentries": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/fromentries/-/fromentries-1.2.0.tgz", + "integrity": "sha512-33X7H/wdfO99GdRLLgkjUrD4geAFdq/Uv0kl3HD4da6HDixd2GUg8Mw7dahLCV9r/EARkmtYBB6Tch4EEokFTQ==", + "dev": true + }, "fs-extra": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-5.0.0.tgz", - "integrity": "sha512-66Pm4RYbjzdyeuqudYqhFiNBbCIuI9kgRqLPSHIlXHidW8NIQtVdkM1yeZ4lXwuhbTETv3EUGMNHAAw6hiundQ==", + "version": "7.0.1", + "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-7.0.1.tgz", + "integrity": "sha512-YJDaCJZEnBmcbw13fvdAM9AwNOJwOzrE4pqMqBq5nFiEqXUqHwlK4B+3pUw6JNvfSPtX05xFHtYy/1ni01eGCw==", "dev": true, "requires": { "graceful-fs": "^4.1.2", @@ -3226,9 +3607,9 @@ } }, "fstream": { - "version": "1.0.11", - "resolved": "https://registry.npmjs.org/fstream/-/fstream-1.0.11.tgz", - "integrity": "sha1-XB+x8RdHcRTwYyoOtLcbPLD9MXE=", + "version": "1.0.12", + "resolved": "https://registry.npmjs.org/fstream/-/fstream-1.0.12.tgz", + "integrity": "sha512-WvJ193OHa0GHPEL+AycEJgxvBEwyfRkN1vhjca23OaPVMCaLCXTd5qAu82AjTcgP1UJmytkOKb63Ypde7raDIg==", "dev": true, "requires": { "graceful-fs": "^4.1.2", @@ -3250,10 +3631,13 @@ "dev": true }, "get-stream": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-3.0.0.tgz", - "integrity": "sha1-jpQ9E1jcN1VQVOy+LtsFqhdO3hQ=", - "dev": true + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-4.1.0.tgz", + "integrity": "sha512-GMat4EJ5161kIy2HevLlr4luNjBgvmj413KaQA7jt4V8B4RDsfpHk7WQ9GVqfYyyx8OS/L66Kox+rJRNklLK7w==", + "dev": true, + "requires": { + "pump": "^3.0.0" + } }, "get-value": { "version": "2.0.6", @@ -3291,34 +3675,10 @@ "integrity": "sha1-jFoUlNIGbFcMw7/kSWF1rMTVAqs=", "dev": true }, - "global-modules": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/global-modules/-/global-modules-1.0.0.tgz", - "integrity": "sha512-sKzpEkf11GpOFuw0Zzjzmt4B4UZwjOcG757PPvrfhxcLFbq0wpsgpOqxpxtxFiCG4DtG93M6XRVbF2oGdev7bg==", - "dev": true, - "requires": { - "global-prefix": "^1.0.1", - "is-windows": "^1.0.1", - "resolve-dir": "^1.0.0" - } - }, - "global-prefix": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/global-prefix/-/global-prefix-1.0.2.tgz", - "integrity": "sha1-2/dDxsFJklk8ZVVoy2btMsASLr4=", - "dev": true, - "requires": { - "expand-tilde": "^2.0.2", - "homedir-polyfill": "^1.0.1", - "ini": "^1.3.4", - "is-windows": "^1.0.1", - "which": "^1.2.14" - } - }, "globals": { - "version": "11.11.0", - "resolved": "https://registry.npmjs.org/globals/-/globals-11.11.0.tgz", - "integrity": "sha512-WHq43gS+6ufNOEqlrDBxVEbb8ntfXrfAUU2ZOpCxrBdGKW3gyv8mCxAfIBD0DroPKGrJ2eSsXsLtY9MPntsyTw==", + "version": "11.12.0", + "resolved": "https://registry.npmjs.org/globals/-/globals-11.12.0.tgz", + "integrity": "sha512-WOBp/EEGUiIsJSp7wcv/y6MO+lV9UoncWqxuFfm8eBwzWNgyfBd6Gz+IeKQ9jCmyhoH99g15M3T+QaVHFjizVA==", "dev": true }, "globby": { @@ -3345,25 +3705,36 @@ } }, "got": { - "version": "7.1.0", - "resolved": "https://registry.npmjs.org/got/-/got-7.1.0.tgz", - "integrity": "sha512-Y5WMo7xKKq1muPsxD+KmrR8DH5auG7fBdDVueZwETwV6VytKyU9OX/ddpq2/1hp1vIPvVb4T81dKQz3BivkNLw==", + "version": "8.3.2", + "resolved": "https://registry.npmjs.org/got/-/got-8.3.2.tgz", + "integrity": "sha512-qjUJ5U/hawxosMryILofZCkm3C84PLJS/0grRIpjAwu+Lkxxj5cxeCU25BG0/3mDSpXKTyZr8oh8wIgLaH0QCw==", "dev": true, "requires": { - "decompress-response": "^3.2.0", + "@sindresorhus/is": "^0.7.0", + "cacheable-request": "^2.1.1", + "decompress-response": "^3.3.0", "duplexer3": "^0.1.4", "get-stream": "^3.0.0", - "is-plain-obj": "^1.1.0", - "is-retry-allowed": "^1.0.0", - "is-stream": "^1.0.0", + "into-stream": "^3.1.0", + "is-retry-allowed": "^1.1.0", "isurl": "^1.0.0-alpha5", "lowercase-keys": "^1.0.0", - "p-cancelable": "^0.3.0", - "p-timeout": "^1.1.1", - "safe-buffer": "^5.0.1", - "timed-out": "^4.0.0", - "url-parse-lax": "^1.0.0", + "mimic-response": "^1.0.0", + "p-cancelable": "^0.4.0", + "p-timeout": "^2.0.1", + "pify": "^3.0.0", + "safe-buffer": "^5.1.1", + "timed-out": "^4.0.1", + "url-parse-lax": "^3.0.0", "url-to-options": "^1.0.1" + }, + "dependencies": { + "get-stream": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-3.0.0.tgz", + "integrity": "sha1-jpQ9E1jcN1VQVOy+LtsFqhdO3hQ=", + "dev": true + } } }, "graceful-fs": { @@ -3484,6 +3855,24 @@ "minimalistic-assert": "^1.0.1" } }, + "hasha": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/hasha/-/hasha-5.1.0.tgz", + "integrity": "sha512-OFPDWmzPN1l7atOV1TgBVmNtBxaIysToK6Ve9DK+vT6pYuklw/nPNT+HJbZi0KDcI6vWB+9tgvZ5YD7fA3CXcA==", + "dev": true, + "requires": { + "is-stream": "^2.0.0", + "type-fest": "^0.8.0" + }, + "dependencies": { + "is-stream": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/is-stream/-/is-stream-2.0.0.tgz", + "integrity": "sha512-XCoy+WlUr7d1+Z8GgSuXmpuUFC9fOhRXglJMx+dwLKTkL44Cjd4W1Z5P+BQZpr+cR93aGP4S/s7Ftw6Nd/kiEw==", + "dev": true + } + } + }, "he": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/he/-/he-1.2.0.tgz", @@ -3507,15 +3896,6 @@ "minimalistic-crypto-utils": "^1.0.1" } }, - "homedir-polyfill": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/homedir-polyfill/-/homedir-polyfill-1.0.3.tgz", - "integrity": "sha512-eSmmWE5bZTK2Nou4g0AI3zZ9rswp7GRKoKXS1BLUkvPviOqs4YTN1djQIqrXy9k5gEtdLPy86JjRwsNM9tnDcA==", - "dev": true, - "requires": { - "parse-passwd": "^1.0.0" - } - }, "hoopy": { "version": "0.1.4", "resolved": "https://registry.npmjs.org/hoopy/-/hoopy-0.1.4.tgz", @@ -3546,37 +3926,29 @@ "integrity": "sha512-P+M65QY2JQ5Y0G9KKdlDpo0zK+/OHptU5AaBwUfAIDJZk1MYf32Frm84EcOytfJE0t5JvkAnKlmjsXDnWzCJmQ==", "dev": true }, + "html-escaper": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/html-escaper/-/html-escaper-2.0.0.tgz", + "integrity": "sha512-a4u9BeERWGu/S8JiWEAQcdrg9v4QArtP9keViQjGMdff20fBdd8waotXaNmODqBe6uZ3Nafi7K/ho4gCQHV3Ig==", + "dev": true + }, + "http-cache-semantics": { + "version": "3.8.1", + "resolved": "https://registry.npmjs.org/http-cache-semantics/-/http-cache-semantics-3.8.1.tgz", + "integrity": "sha512-5ai2iksyV8ZXmnZhHH4rWPoxxistEexSi5936zIQ1bnNTW5VnA85B6P/VpXiRM017IgRvb2kKo1a//y+0wSp3w==", + "dev": true + }, "http-errors": { - "version": "1.6.3", - "resolved": "https://registry.npmjs.org/http-errors/-/http-errors-1.6.3.tgz", - "integrity": "sha1-i1VoC7S+KDoLW/TqLjhYC+HZMg0=", + "version": "1.7.2", + "resolved": "https://registry.npmjs.org/http-errors/-/http-errors-1.7.2.tgz", + "integrity": "sha512-uUQBt3H/cSIVfch6i1EuPNy/YsRSOUBXTVfZ+yR7Zjez3qjBz6i9+i4zjNaoqcoFVI4lQJ5plg63TvGfRSDCRg==", "dev": true, "requires": { "depd": "~1.1.2", "inherits": "2.0.3", - "setprototypeof": "1.1.0", - "statuses": ">= 1.4.0 < 2" - } - }, - "http-proxy-agent": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/http-proxy-agent/-/http-proxy-agent-2.1.0.tgz", - "integrity": "sha512-qwHbBLV7WviBl0rQsOzH6o5lwyOIvwp/BdFnvVxXORldu5TmjFfjzBcWUWS5kWAZhmv+JtiDhSuQCp4sBfbIgg==", - "dev": true, - "requires": { - "agent-base": "4", - "debug": "3.1.0" - }, - "dependencies": { - "debug": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/debug/-/debug-3.1.0.tgz", - "integrity": "sha512-OX8XqP7/1a9cqkxYw2yXss15f26NKWBpDXQd0/uK/KPqdQhxbPa994hnzjcE2VqQpDslf55723cKPUOGSmMY3g==", - "dev": true, - "requires": { - "ms": "2.0.0" - } - } + "setprototypeof": "1.1.1", + "statuses": ">= 1.5.0 < 2", + "toidentifier": "1.0.0" } }, "https-browserify": { @@ -3585,37 +3957,10 @@ "integrity": "sha1-7AbBDgo0wPL68Zn3/X/Hj//QPHM=", "dev": true }, - "https-proxy-agent": { - "version": "2.2.1", - "resolved": "https://registry.npmjs.org/https-proxy-agent/-/https-proxy-agent-2.2.1.tgz", - "integrity": "sha512-HPCTS1LW51bcyMYbxUIOO4HEOlQ1/1qRaFWcyxvwaqUS9TY88aoEuHUY33kuAh1YhVVaDQhLZsnPd+XNARWZlQ==", - "dev": true, - "requires": { - "agent-base": "^4.1.0", - "debug": "^3.1.0" - }, - "dependencies": { - "debug": { - "version": "3.2.6", - "resolved": "https://registry.npmjs.org/debug/-/debug-3.2.6.tgz", - "integrity": "sha512-mel+jf7nrtEl5Pn1Qx46zARXKDpBbvzezse7p7LqINmdoIk8PYP5SySaxEmYv6TZ0JyEKA1hsCId6DIhgITtWQ==", - "dev": true, - "requires": { - "ms": "^2.1.1" - } - }, - "ms": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.1.tgz", - "integrity": "sha512-tgp+dl5cGk28utYktBsrFqA7HKgrhgPsg6Z/EfhWI4gl1Hwq8B/GmY/0oXZ6nF8hDVesS/FpnYaD/kOWhYQvyg==", - "dev": true - } - } - }, "iconv-lite": { - "version": "0.4.23", - "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.23.tgz", - "integrity": "sha512-neyTUVFtahjf0mB3dZT77u+8O0QB89jFdnBkd5P1JgYPbPaia3gXXOVL2fq8VyU2gMMD7SaN7QukTB/pmXYvDA==", + "version": "0.4.24", + "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.24.tgz", + "integrity": "sha512-v3MXnZAcvnywkTUEZomIActle7RXXeedOR31wwl7VlyoXO4Qi9arvSenNQWne1TcRwhCL1HwLI21bEqdpj8/rA==", "dev": true, "requires": { "safer-buffer": ">= 2.1.2 < 3" @@ -3670,6 +4015,12 @@ "integrity": "sha1-khi5srkoojixPcT7a21XbyMUU+o=", "dev": true }, + "indent-string": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/indent-string/-/indent-string-4.0.0.tgz", + "integrity": "sha512-EdDDZu4A2OyIK7Lr/2zG+w5jmbuk1DVBnEwREQvBzspBJkCEbRa8GxU1lghYcaGJCnRWibjDXlq779X1/y5xwg==", + "dev": true + }, "indexes-of": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/indexes-of/-/indexes-of-1.0.1.tgz", @@ -3698,22 +4049,40 @@ "integrity": "sha1-Yzwsg+PaQqUC9SRmAiSA9CCCYd4=", "dev": true }, - "ini": { - "version": "1.3.5", - "resolved": "https://registry.npmjs.org/ini/-/ini-1.3.5.tgz", - "integrity": "sha512-RZY5huIKCMRWDUqZlEi72f/lmXKMvuszcMBduliQ3nnWbx9X/ZBQO7DijMEYS9EhHBb2qacRUMtC7svLwe0lcw==", + "interpret": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/interpret/-/interpret-1.2.0.tgz", + "integrity": "sha512-mT34yGKMNceBQUoVn7iCDKDntA7SC6gycMAWzGx1z/CMCTV7b2AAtXlo3nRyHZ1FelRkQbQjprHSYGwzLtkVbw==", "dev": true }, + "into-stream": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/into-stream/-/into-stream-3.1.0.tgz", + "integrity": "sha1-lvsKk2wSur1v8XUqF9BWFqvQlMY=", + "dev": true, + "requires": { + "from2": "^2.1.1", + "p-is-promise": "^1.1.0" + }, + "dependencies": { + "p-is-promise": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/p-is-promise/-/p-is-promise-1.1.0.tgz", + "integrity": "sha1-nJRWmJ6fZYgBewQ01WCXZ1w9oF4=", + "dev": true + } + } + }, "invert-kv": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/invert-kv/-/invert-kv-1.0.0.tgz", - "integrity": "sha1-EEqOSqym09jNFXqO+L+rLXo//bY=", + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/invert-kv/-/invert-kv-2.0.0.tgz", + "integrity": "sha512-wPVv/y/QQ/Uiirj/vh3oP+1Ww+AWehmi1g5fFWGPF6IpCBCDVrhgHRMvrLfdYcwDh3QJbGXDW4JAuzxElLSqKA==", "dev": true }, "ipaddr.js": { - "version": "1.8.0", - "resolved": "https://registry.npmjs.org/ipaddr.js/-/ipaddr.js-1.8.0.tgz", - "integrity": "sha1-6qM9bd16zo9/b+DJygRA5wZzix4=", + "version": "1.9.0", + "resolved": "https://registry.npmjs.org/ipaddr.js/-/ipaddr.js-1.9.0.tgz", + "integrity": "sha512-M4Sjn6N/+O6/IXSJseKqHoFc+5FdGJ22sXqnjTpdZweHK64MzEPAyQZyEU3R/KRv2GLoa7nNtg/C2Ev6m7z+eA==", "dev": true }, "is-absolute-url": { @@ -3924,9 +4293,9 @@ "dev": true }, "is-retry-allowed": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/is-retry-allowed/-/is-retry-allowed-1.1.0.tgz", - "integrity": "sha1-EaBgVotnM5REAz0BJaYaINVk+zQ=", + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/is-retry-allowed/-/is-retry-allowed-1.2.0.tgz", + "integrity": "sha512-RUbUeKwvm3XG2VYamhJL1xFktgjvPzL0Hq8C+6yrWIswDy3BIXGqCxhxkc30N9jqK311gVU137K8Ei55/zVJRg==", "dev": true }, "is-stream": { @@ -3953,10 +4322,10 @@ "has-symbols": "^1.0.0" } }, - "is-utf8": { - "version": "0.2.1", - "resolved": "https://registry.npmjs.org/is-utf8/-/is-utf8-0.2.1.tgz", - "integrity": "sha1-Sw2hRCEE0bM2NA6AeX6GXPOffXI=", + "is-typedarray": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-typedarray/-/is-typedarray-1.0.0.tgz", + "integrity": "sha1-5HnICFjfDBsR3dppQPlgEfzaSpo=", "dev": true }, "is-windows": { @@ -3984,64 +4353,256 @@ "dev": true }, "istanbul-lib-coverage": { - "version": "2.0.3", - "resolved": "https://registry.npmjs.org/istanbul-lib-coverage/-/istanbul-lib-coverage-2.0.3.tgz", - "integrity": "sha512-dKWuzRGCs4G+67VfW9pBFFz2Jpi4vSp/k7zBcJ888ofV5Mi1g5CUML5GvMvV6u9Cjybftu+E8Cgp+k0dI1E5lw==", + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/istanbul-lib-coverage/-/istanbul-lib-coverage-3.0.0.tgz", + "integrity": "sha512-UiUIqxMgRDET6eR+o5HbfRYP1l0hqkWOs7vNxC/mggutCMUIhWMm8gAHb8tHlyfD3/l6rlgNA5cKdDzEAf6hEg==", "dev": true }, - "istanbul-lib-instrument": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/istanbul-lib-instrument/-/istanbul-lib-instrument-3.1.0.tgz", - "integrity": "sha512-ooVllVGT38HIk8MxDj/OIHXSYvH+1tq/Vb38s8ixt9GoJadXska4WkGY+0wkmtYCZNYtaARniH/DixUGGLZ0uA==", + "istanbul-lib-hook": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/istanbul-lib-hook/-/istanbul-lib-hook-3.0.0.tgz", + "integrity": "sha512-Pt/uge1Q9s+5VAZ+pCo16TYMWPBIl+oaNIjgLQxcX0itS6ueeaA+pEfThZpH8WxhFgCiEb8sAJY6MdUKgiIWaQ==", "dev": true, "requires": { - "@babel/generator": "^7.0.0", - "@babel/parser": "^7.0.0", - "@babel/template": "^7.0.0", - "@babel/traverse": "^7.0.0", - "@babel/types": "^7.0.0", - "istanbul-lib-coverage": "^2.0.3", - "semver": "^5.5.0" + "append-transform": "^2.0.0" } }, - "isurl": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/isurl/-/isurl-1.0.0.tgz", - "integrity": "sha512-1P/yWsxPlDtn7QeRD+ULKQPaIaN6yF368GZ2vDfv0AL0NwpStafjWCDDdn0k8wgFMWpVAqG7oJhxHnlud42i9w==", + "istanbul-lib-instrument": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/istanbul-lib-instrument/-/istanbul-lib-instrument-4.0.0.tgz", + "integrity": "sha512-Nm4wVHdo7ZXSG30KjZ2Wl5SU/Bw7bDx1PdaiIFzEStdjs0H12mOTncn1GVYuqQSaZxpg87VGBRsVRPGD2cD1AQ==", "dev": true, "requires": { - "has-to-string-tag-x": "^1.2.0", - "is-object": "^1.0.1" + "@babel/core": "^7.7.5", + "@babel/parser": "^7.7.5", + "@babel/template": "^7.7.4", + "@babel/traverse": "^7.7.4", + "@istanbuljs/schema": "^0.1.2", + "istanbul-lib-coverage": "^3.0.0", + "semver": "^6.3.0" + }, + "dependencies": { + "semver": { + "version": "6.3.0", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", + "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==", + "dev": true + } } }, - "js-tokens": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz", - "integrity": "sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==", - "dev": true - }, - "js-yaml": { - "version": "3.12.0", - "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-3.12.0.tgz", - "integrity": "sha512-PIt2cnwmPfL4hKNwqeiuz4bKfnzHTBv6HyVgjahA6mPLwPDzjDWrplJBMjHUFxku/N3FlmrbyPclad+I+4mJ3A==", + "istanbul-lib-processinfo": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/istanbul-lib-processinfo/-/istanbul-lib-processinfo-2.0.2.tgz", + "integrity": "sha512-kOwpa7z9hme+IBPZMzQ5vdQj8srYgAtaRqeI48NGmAQ+/5yKiHLV0QbYqQpxsdEF0+w14SoB8YbnHKcXE2KnYw==", "dev": true, "requires": { - "argparse": "^1.0.7", - "esprima": "^4.0.0" - } - }, - "jsesc": { - "version": "2.5.2", - "resolved": "https://registry.npmjs.org/jsesc/-/jsesc-2.5.2.tgz", - "integrity": "sha512-OYu7XEzjkCQ3C5Ps3QIZsQfNpqoJyZZA99wd9aWd05NCtC5pWOkShK2mkL6HXQR6/Cy2lbNdPlZBpuQHXE63gA==", - "dev": true - }, - "json-parse-better-errors": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/json-parse-better-errors/-/json-parse-better-errors-1.0.2.tgz", - "integrity": "sha512-mrqyZKfX5EhL7hvqcV6WG1yYjnjeuYDzDhhcAAUrq8Po85NBQBJP+ZDUT75qZQ98IkUoBqdkExkukOU7Ts2wrw==", - "dev": true - }, + "archy": "^1.0.0", + "cross-spawn": "^7.0.0", + "istanbul-lib-coverage": "^3.0.0-alpha.1", + "make-dir": "^3.0.0", + "p-map": "^3.0.0", + "rimraf": "^3.0.0", + "uuid": "^3.3.3" + }, + "dependencies": { + "cross-spawn": { + "version": "7.0.1", + "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.1.tgz", + "integrity": "sha512-u7v4o84SwFpD32Z8IIcPZ6z1/ie24O6RU3RbtL5Y316l3KuHVPx9ItBgWQ6VlfAFnRnTtMUrsQ9MUUTuEZjogg==", + "dev": true, + "requires": { + "path-key": "^3.1.0", + "shebang-command": "^2.0.0", + "which": "^2.0.1" + } + }, + "make-dir": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/make-dir/-/make-dir-3.0.0.tgz", + "integrity": "sha512-grNJDhb8b1Jm1qeqW5R/O63wUo4UXo2v2HMic6YT9i/HBlF93S8jkMgH7yugvY9ABDShH4VZMn8I+U8+fCNegw==", + "dev": true, + "requires": { + "semver": "^6.0.0" + } + }, + "path-key": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/path-key/-/path-key-3.1.1.tgz", + "integrity": "sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==", + "dev": true + }, + "rimraf": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-3.0.0.tgz", + "integrity": "sha512-NDGVxTsjqfunkds7CqsOiEnxln4Bo7Nddl3XhS4pXg5OzwkLqJ971ZVAAnB+DDLnF76N+VnDEiBHaVV8I06SUg==", + "dev": true, + "requires": { + "glob": "^7.1.3" + } + }, + "semver": { + "version": "6.3.0", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", + "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==", + "dev": true + }, + "shebang-command": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-2.0.0.tgz", + "integrity": "sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA==", + "dev": true, + "requires": { + "shebang-regex": "^3.0.0" + } + }, + "shebang-regex": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-3.0.0.tgz", + "integrity": "sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==", + "dev": true + }, + "which": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz", + "integrity": "sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==", + "dev": true, + "requires": { + "isexe": "^2.0.0" + } + } + } + }, + "istanbul-lib-report": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/istanbul-lib-report/-/istanbul-lib-report-3.0.0.tgz", + "integrity": "sha512-wcdi+uAKzfiGT2abPpKZ0hSU1rGQjUQnLvtY5MpQ7QCTahD3VODhcu4wcfY1YtkGaDD5yuydOLINXsfbus9ROw==", + "dev": true, + "requires": { + "istanbul-lib-coverage": "^3.0.0", + "make-dir": "^3.0.0", + "supports-color": "^7.1.0" + }, + "dependencies": { + "has-flag": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", + "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", + "dev": true + }, + "make-dir": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/make-dir/-/make-dir-3.0.0.tgz", + "integrity": "sha512-grNJDhb8b1Jm1qeqW5R/O63wUo4UXo2v2HMic6YT9i/HBlF93S8jkMgH7yugvY9ABDShH4VZMn8I+U8+fCNegw==", + "dev": true, + "requires": { + "semver": "^6.0.0" + } + }, + "semver": { + "version": "6.3.0", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", + "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==", + "dev": true + }, + "supports-color": { + "version": "7.1.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.1.0.tgz", + "integrity": "sha512-oRSIpR8pxT1Wr2FquTNnGet79b3BWljqOuoW/h4oBhxJ/HUbX5nX6JSruTkvXDCFMwDPvsaTTbvMLKZWSy0R5g==", + "dev": true, + "requires": { + "has-flag": "^4.0.0" + } + } + } + }, + "istanbul-lib-source-maps": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/istanbul-lib-source-maps/-/istanbul-lib-source-maps-4.0.0.tgz", + "integrity": "sha512-c16LpFRkR8vQXyHZ5nLpY35JZtzj1PQY1iZmesUbf1FZHbIupcWfjgOXBY9YHkLEQ6puz1u4Dgj6qmU/DisrZg==", + "dev": true, + "requires": { + "debug": "^4.1.1", + "istanbul-lib-coverage": "^3.0.0", + "source-map": "^0.6.1" + }, + "dependencies": { + "debug": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.1.1.tgz", + "integrity": "sha512-pYAIzeRo8J6KPEaJ0VWOh5Pzkbw/RetuzehGM7QRRX5he4fPHx2rdKMB256ehJCkX+XRQm16eZLqLNS8RSZXZw==", + "dev": true, + "requires": { + "ms": "^2.1.1" + } + }, + "ms": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", + "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", + "dev": true + }, + "source-map": { + "version": "0.6.1", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", + "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", + "dev": true + } + } + }, + "istanbul-reports": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/istanbul-reports/-/istanbul-reports-3.0.0.tgz", + "integrity": "sha512-2osTcC8zcOSUkImzN2EWQta3Vdi4WjjKw99P2yWx5mLnigAM0Rd5uYFn1cf2i/Ois45GkNjaoTqc5CxgMSX80A==", + "dev": true, + "requires": { + "html-escaper": "^2.0.0", + "istanbul-lib-report": "^3.0.0" + } + }, + "isurl": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/isurl/-/isurl-1.0.0.tgz", + "integrity": "sha512-1P/yWsxPlDtn7QeRD+ULKQPaIaN6yF368GZ2vDfv0AL0NwpStafjWCDDdn0k8wgFMWpVAqG7oJhxHnlud42i9w==", + "dev": true, + "requires": { + "has-to-string-tag-x": "^1.2.0", + "is-object": "^1.0.1" + } + }, + "js-tokens": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz", + "integrity": "sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==", + "dev": true + }, + "js-yaml": { + "version": "3.13.1", + "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-3.13.1.tgz", + "integrity": "sha512-YfbcO7jXDdyj0DGxYVSlSeQNHbD7XPWvrVWeVUujrQEoZzWJIRrCPoyk6kL6IAjAG2IolMK4T0hNUe0HOUs5Jw==", + "dev": true, + "requires": { + "argparse": "^1.0.7", + "esprima": "^4.0.0" + } + }, + "jsesc": { + "version": "2.5.2", + "resolved": "https://registry.npmjs.org/jsesc/-/jsesc-2.5.2.tgz", + "integrity": "sha512-OYu7XEzjkCQ3C5Ps3QIZsQfNpqoJyZZA99wd9aWd05NCtC5pWOkShK2mkL6HXQR6/Cy2lbNdPlZBpuQHXE63gA==", + "dev": true + }, + "json-buffer": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/json-buffer/-/json-buffer-3.0.0.tgz", + "integrity": "sha1-Wx85evx11ne96Lz8Dkfh+aPZqJg=", + "dev": true + }, + "json-parse-better-errors": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/json-parse-better-errors/-/json-parse-better-errors-1.0.2.tgz", + "integrity": "sha512-mrqyZKfX5EhL7hvqcV6WG1yYjnjeuYDzDhhcAAUrq8Po85NBQBJP+ZDUT75qZQ98IkUoBqdkExkukOU7Ts2wrw==", + "dev": true + }, "json-schema-traverse": { "version": "0.4.1", "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz", @@ -4074,6 +4635,15 @@ "graceful-fs": "^4.1.6" } }, + "keyv": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/keyv/-/keyv-3.0.0.tgz", + "integrity": "sha512-eguHnq22OE3uVoSYG0LVWNP+4ppamWr9+zWBe1bsNcovIMy6huUJFPgy4mGwCd/rnl3vOLGW1MTlu4c57CT1xA==", + "dev": true, + "requires": { + "json-buffer": "3.0.0" + } + }, "kind-of": { "version": "6.0.2", "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-6.0.2.tgz", @@ -4091,12 +4661,12 @@ } }, "lcid": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/lcid/-/lcid-1.0.0.tgz", - "integrity": "sha1-MIrMr6C8SDo4Z7S28rlQYlHRuDU=", + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/lcid/-/lcid-2.0.0.tgz", + "integrity": "sha512-avPEb8P8EGnwXKClwsNUgryVjllcRqtMYa49NTsbQagYuT1DcXnl1915oxWjoyGrXR6zH/Y0Zc96xWsPcoDKeA==", "dev": true, "requires": { - "invert-kv": "^1.0.0" + "invert-kv": "^2.0.0" } }, "listenercount": { @@ -4105,19 +4675,6 @@ "integrity": "sha1-hMinKrWcRyUyFIDJdeZQg0LnCTc=", "dev": true }, - "load-json-file": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/load-json-file/-/load-json-file-1.1.0.tgz", - "integrity": "sha1-lWkFcI1YtLq0wiYbBPWfMcmTdMA=", - "dev": true, - "requires": { - "graceful-fs": "^4.1.2", - "parse-json": "^2.2.0", - "pify": "^2.0.0", - "pinkie-promise": "^2.0.0", - "strip-bom": "^2.0.0" - } - }, "loader-runner": { "version": "2.4.0", "resolved": "https://registry.npmjs.org/loader-runner/-/loader-runner-2.4.0.tgz", @@ -4154,15 +4711,15 @@ } }, "lodash": { - "version": "4.17.11", - "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.11.tgz", - "integrity": "sha512-cQKh8igo5QUhZ7lg38DYWAxMvjSAKG0A8wGSVimP07SIUEK2UO+arSRKbRZWtelMtN5V0Hkwh5ryOto/SshYIg==", + "version": "4.17.15", + "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.15.tgz", + "integrity": "sha512-8xOcRHvCjnocdS5cpwXQXVzmmh5e5+saE2QGoeQmbKmRS6J3VQppPOIt0MnmE+4xlZoumy0GPG0D0MVIQbNA1A==", "dev": true }, - "lodash.assign": { - "version": "4.2.0", - "resolved": "https://registry.npmjs.org/lodash.assign/-/lodash.assign-4.2.0.tgz", - "integrity": "sha1-DZnzzNem0mHRm9rrkkUAXShYCOc=", + "lodash.flattendeep": { + "version": "4.4.0", + "resolved": "https://registry.npmjs.org/lodash.flattendeep/-/lodash.flattendeep-4.4.0.tgz", + "integrity": "sha1-+wMJF/hqMTTlvJvsDWngAT3f7bI=", "dev": true }, "lodash.get": { @@ -4177,6 +4734,12 @@ "integrity": "sha1-vMbEmkKihA7Zl/Mj6tpezRguC/4=", "dev": true }, + "lodash.set": { + "version": "4.3.2", + "resolved": "https://registry.npmjs.org/lodash.set/-/lodash.set-4.3.2.tgz", + "integrity": "sha1-2HV7HagH3eJIFrDWqEvqGnYjCyM=", + "dev": true + }, "lodash.uniq": { "version": "4.5.0", "resolved": "https://registry.npmjs.org/lodash.uniq/-/lodash.uniq-4.5.0.tgz", @@ -4217,9 +4780,9 @@ } }, "macos-release": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/macos-release/-/macos-release-2.0.0.tgz", - "integrity": "sha512-iCM3ZGeqIzlrH7KxYK+fphlJpCCczyHXc+HhRVbEu9uNTCrzYJjvvtefzeKTCVHd5AP/aD/fzC80JZ4ZP+dQ/A==", + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/macos-release/-/macos-release-2.3.0.tgz", + "integrity": "sha512-OHhSbtcviqMPt7yfw5ef5aghS2jzFVKEFyCJndQt2YpSQ9qRVSEv2axSJI1paVThEu+FFGs584h/1YhxjVqajA==", "dev": true }, "make-dir": { @@ -4375,24 +4938,24 @@ } }, "mime": { - "version": "1.4.1", - "resolved": "https://registry.npmjs.org/mime/-/mime-1.4.1.tgz", - "integrity": "sha512-KI1+qOZu5DcW6wayYHSzR/tXKCDC5Om4s1z2QJjDULzLcmf3DvzS7oluY4HCTrc+9FiKmWUgeNLg7W3uIQvxtQ==", + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/mime/-/mime-1.6.0.tgz", + "integrity": "sha512-x0Vn8spI+wuJ1O6S7gnbaQg8Pxh4NNHb7KSINmEWKiPE4RKOplvijn+NkmYmmRgP68mc70j2EbeTFRsrswaQeg==", "dev": true }, "mime-db": { - "version": "1.38.0", - "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.38.0.tgz", - "integrity": "sha512-bqVioMFFzc2awcdJZIzR3HjZFX20QhilVS7hytkKrv7xFAn8bM1gzc/FOX2awLISvWe0PV8ptFKcon+wZ5qYkg==", + "version": "1.40.0", + "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.40.0.tgz", + "integrity": "sha512-jYdeOMPy9vnxEqFRRo6ZvTZ8d9oPb+k18PKoYNYUe2stVEBPPwsln/qWzdbmaIvnhZ9v2P+CuecK+fpUfsV2mA==", "dev": true }, "mime-types": { - "version": "2.1.22", - "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.22.tgz", - "integrity": "sha512-aGl6TZGnhm/li6F7yx82bJiBZwgiEa4Hf6CNr8YO+r5UHr53tSTYZb102zyU50DOWWKeOv0uQLRL0/9EiKWCog==", + "version": "2.1.24", + "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.24.tgz", + "integrity": "sha512-WaFHS3MCl5fapm3oLxU4eYDw77IQM2ACcxQ9RIxfaC3ooc6PFuBMGZZsYpvoXS5D5QTWPieo1jjLdAm3TBP3cQ==", "dev": true, "requires": { - "mime-db": "~1.38.0" + "mime-db": "1.40.0" } }, "mimic-fn": { @@ -4453,9 +5016,9 @@ } }, "mixin-deep": { - "version": "1.3.1", - "resolved": "https://registry.npmjs.org/mixin-deep/-/mixin-deep-1.3.1.tgz", - "integrity": "sha512-8ZItLHeEgaqEvd5lYBXfm4EZSFCX29Jb9K+lAHhDKzReKBQKj3R+7NOF6tjqYi9t4oI8VUfaWITJQm86wnXGNQ==", + "version": "1.3.2", + "resolved": "https://registry.npmjs.org/mixin-deep/-/mixin-deep-1.3.2.tgz", + "integrity": "sha512-WRoDn//mXBiJ1H40rqa3vH0toePwSsGb45iInWlTySa+Uu4k3tYUSxa2v1KqAiLtvlrSzaExqS1gtk96A9zvEA==", "dev": true, "requires": { "for-in": "^1.0.2", @@ -4483,9 +5046,9 @@ } }, "mocha": { - "version": "6.0.2", - "resolved": "https://registry.npmjs.org/mocha/-/mocha-6.0.2.tgz", - "integrity": "sha512-RtTJsmmToGyeTznSOMoM6TPEk1A84FQaHIciKrRqARZx+B5ccJ5tXlmJzEKGBxZdqk9UjpRsesZTUkZmR5YnuQ==", + "version": "6.2.2", + "resolved": "https://registry.npmjs.org/mocha/-/mocha-6.2.2.tgz", + "integrity": "sha512-FgDS9Re79yU1xz5d+C4rv1G7QagNGHZ+iXF81hO8zY35YZZcLEsJVfFolfsqKFWunATEvNzMK0r/CwWd/szO9A==", "dev": true, "requires": { "ansi-colors": "3.2.3", @@ -4493,41 +5056,41 @@ "debug": "3.2.6", "diff": "3.5.0", "escape-string-regexp": "1.0.5", - "findup-sync": "2.0.0", + "find-up": "3.0.0", "glob": "7.1.3", "growl": "1.10.5", "he": "1.2.0", - "js-yaml": "3.12.0", + "js-yaml": "3.13.1", "log-symbols": "2.2.0", "minimatch": "3.0.4", "mkdirp": "0.5.1", "ms": "2.1.1", - "node-environment-flags": "1.0.4", + "node-environment-flags": "1.0.5", "object.assign": "4.1.0", "strip-json-comments": "2.0.1", "supports-color": "6.0.0", "which": "1.3.1", "wide-align": "1.1.3", - "yargs": "12.0.5", - "yargs-parser": "11.1.1", - "yargs-unparser": "1.5.0" + "yargs": "13.3.0", + "yargs-parser": "13.1.1", + "yargs-unparser": "1.6.0" }, "dependencies": { - "camelcase": { - "version": "5.2.0", - "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-5.2.0.tgz", - "integrity": "sha512-IXFsBS2pC+X0j0N/GE7Dm7j3bsEBp+oTpb7F50dwEVX7rf3IgwO9XatnegTsDtniKCUtEJH4fSU6Asw7uoVLfQ==", + "ansi-regex": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-4.1.0.tgz", + "integrity": "sha512-1apePfXM1UOSqw0o9IiFAovVz9M5S1Dg+4TrDwfMewQ6p/rmMueb7tWZjQ1rx4Loy1ArBggoqGpfqqdI4rondg==", "dev": true }, "cliui": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/cliui/-/cliui-4.1.0.tgz", - "integrity": "sha512-4FG+RSG9DL7uEwRUZXZn3SS34DiDPfzP0VOiEwtUWlE+AR2EIg+hSyvrIgUUfhdgR/UkAeW2QHgeP+hWrXs7jQ==", + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/cliui/-/cliui-5.0.0.tgz", + "integrity": "sha512-PYeGSEmmHM6zvoef2w8TPzlrnNpXIjTipYK780YswmIP9vjxmd6Y2a3CB2Ks6/AU8NHjZugXvo8w3oWM2qnwXA==", "dev": true, "requires": { - "string-width": "^2.1.1", - "strip-ansi": "^4.0.0", - "wrap-ansi": "^2.0.0" + "string-width": "^3.1.0", + "strip-ansi": "^5.2.0", + "wrap-ansi": "^5.1.0" } }, "debug": { @@ -4539,69 +5102,42 @@ "ms": "^2.1.1" } }, - "execa": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/execa/-/execa-1.0.0.tgz", - "integrity": "sha512-adbxcyWV46qiHyvSp50TKt05tB4tK3HcmF7/nxfAdhnox83seTDbwnaqKO4sXRy7roHAIFqJP/Rw/AuEbX61LA==", - "dev": true, - "requires": { - "cross-spawn": "^6.0.0", - "get-stream": "^4.0.0", - "is-stream": "^1.1.0", - "npm-run-path": "^2.0.0", - "p-finally": "^1.0.0", - "signal-exit": "^3.0.0", - "strip-eof": "^1.0.0" - } - }, - "find-up": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/find-up/-/find-up-3.0.0.tgz", - "integrity": "sha512-1yD6RmLI1XBfxugvORwlck6f75tYL+iR0jqwsOrOxMZyGYqUuDhJ0l4AXdO1iX/FTs9cBAMEk1gWSEx1kSbylg==", - "dev": true, - "requires": { - "locate-path": "^3.0.0" - } - }, - "get-stream": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-4.1.0.tgz", - "integrity": "sha512-GMat4EJ5161kIy2HevLlr4luNjBgvmj413KaQA7jt4V8B4RDsfpHk7WQ9GVqfYyyx8OS/L66Kox+rJRNklLK7w==", - "dev": true, - "requires": { - "pump": "^3.0.0" - } - }, - "invert-kv": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/invert-kv/-/invert-kv-2.0.0.tgz", - "integrity": "sha512-wPVv/y/QQ/Uiirj/vh3oP+1Ww+AWehmi1g5fFWGPF6IpCBCDVrhgHRMvrLfdYcwDh3QJbGXDW4JAuzxElLSqKA==", + "get-caller-file": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/get-caller-file/-/get-caller-file-2.0.5.tgz", + "integrity": "sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg==", "dev": true }, - "lcid": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/lcid/-/lcid-2.0.0.tgz", - "integrity": "sha512-avPEb8P8EGnwXKClwsNUgryVjllcRqtMYa49NTsbQagYuT1DcXnl1915oxWjoyGrXR6zH/Y0Zc96xWsPcoDKeA==", - "dev": true, - "requires": { - "invert-kv": "^2.0.0" - } - }, "ms": { "version": "2.1.1", "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.1.tgz", "integrity": "sha512-tgp+dl5cGk28utYktBsrFqA7HKgrhgPsg6Z/EfhWI4gl1Hwq8B/GmY/0oXZ6nF8hDVesS/FpnYaD/kOWhYQvyg==", "dev": true }, - "os-locale": { + "require-main-filename": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/require-main-filename/-/require-main-filename-2.0.0.tgz", + "integrity": "sha512-NKN5kMDylKuldxYLSUfrbo5Tuzh4hd+2E8NPPX02mZtn1VuREQToYe/ZdlJy+J3uCpfaiGF05e7B8W0iXbQHmg==", + "dev": true + }, + "string-width": { "version": "3.1.0", - "resolved": "https://registry.npmjs.org/os-locale/-/os-locale-3.1.0.tgz", - "integrity": "sha512-Z8l3R4wYWM40/52Z+S265okfFj8Kt2cC2MKY+xNi3kFs+XGI7WXu/I309QQQYbRW4ijiZ+yxs9pqEhJh0DqW3Q==", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-3.1.0.tgz", + "integrity": "sha512-vafcv6KjVZKSgz06oM/H6GDBrAtz8vdhQakGjFIvNrHA6y3HCF1CInLy+QLq8dTJPQ1b+KDUqDFctkdRW44e1w==", "dev": true, "requires": { - "execa": "^1.0.0", - "lcid": "^2.0.0", - "mem": "^4.0.0" + "emoji-regex": "^7.0.1", + "is-fullwidth-code-point": "^2.0.0", + "strip-ansi": "^5.1.0" + } + }, + "strip-ansi": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-5.2.0.tgz", + "integrity": "sha512-DuRs1gKbBqsMKIZlrffwlug8MHkcnpjs5VPmL1PAh+mA30U0DTotfDZ0d2UUsXpPmPmMMJ6W773MaA3J+lbiWA==", + "dev": true, + "requires": { + "ansi-regex": "^4.1.0" } }, "supports-color": { @@ -4613,36 +5149,45 @@ "has-flag": "^3.0.0" } }, - "which-module": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/which-module/-/which-module-2.0.0.tgz", - "integrity": "sha1-2e8H3Od7mQK4o6j6SzHD4/fm6Ho=", + "wrap-ansi": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-5.1.0.tgz", + "integrity": "sha512-QC1/iN/2/RPVJ5jYK8BGttj5z83LmSKmvbvrXPNCLZSEb32KKVDJDl/MOt2N01qU2H/FkzEa9PKto1BqDjtd7Q==", + "dev": true, + "requires": { + "ansi-styles": "^3.2.0", + "string-width": "^3.0.0", + "strip-ansi": "^5.0.0" + } + }, + "y18n": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/y18n/-/y18n-4.0.0.tgz", + "integrity": "sha512-r9S/ZyXu/Xu9q1tYlpsLIsa3EeLXXk0VwlxqTcFRfg9EhMW+17kbt9G0NrgCmhGb5vT2hyhJZLfDGx+7+5Uj/w==", "dev": true }, "yargs": { - "version": "12.0.5", - "resolved": "https://registry.npmjs.org/yargs/-/yargs-12.0.5.tgz", - "integrity": "sha512-Lhz8TLaYnxq/2ObqHDql8dX8CJi97oHxrjUcYtzKbbykPtVW9WB+poxI+NM2UIzsMgNCZTIf0AQwsjK5yMAqZw==", + "version": "13.3.0", + "resolved": "https://registry.npmjs.org/yargs/-/yargs-13.3.0.tgz", + "integrity": "sha512-2eehun/8ALW8TLoIl7MVaRUrg+yCnenu8B4kBlRxj3GJGDKU1Og7sMXPNm1BYyM1DOJmTZ4YeN/Nwxv+8XJsUA==", "dev": true, "requires": { - "cliui": "^4.0.0", - "decamelize": "^1.2.0", + "cliui": "^5.0.0", "find-up": "^3.0.0", - "get-caller-file": "^1.0.1", - "os-locale": "^3.0.0", + "get-caller-file": "^2.0.1", "require-directory": "^2.1.1", - "require-main-filename": "^1.0.1", + "require-main-filename": "^2.0.0", "set-blocking": "^2.0.0", - "string-width": "^2.0.0", + "string-width": "^3.0.0", "which-module": "^2.0.0", - "y18n": "^3.2.1 || ^4.0.0", - "yargs-parser": "^11.1.1" + "y18n": "^4.0.0", + "yargs-parser": "^13.1.1" } }, "yargs-parser": { - "version": "11.1.1", - "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-11.1.1.tgz", - "integrity": "sha512-C6kB/WJDiaxONLJQnF8ccx9SEeoTTLek8RVbaOIsrAUS8VrBEXfmeSnCZxygc+XC2sNMBIwOOnfcxiynjHsVSQ==", + "version": "13.1.1", + "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-13.1.1.tgz", + "integrity": "sha512-oVAVsHz6uFrg3XQheFII8ESO2ssAf9luWuAd6Wexsu4F3OtIW0o8IribPXYrD4WC24LWtPrJlGy87y5udK+dxQ==", "dev": true, "requires": { "camelcase": "^5.0.0", @@ -4698,9 +5243,9 @@ } }, "negotiator": { - "version": "0.6.1", - "resolved": "https://registry.npmjs.org/negotiator/-/negotiator-0.6.1.tgz", - "integrity": "sha1-KzJxhOiZIQEXeyhWP7XnECrNDKk=", + "version": "0.6.2", + "resolved": "https://registry.npmjs.org/negotiator/-/negotiator-0.6.2.tgz", + "integrity": "sha512-hZXc7K2e+PgeI1eDBe/10Ard4ekbfrrqG8Ep+8Jmf4JID2bNg7NvCPOZN+kfF574pFQI7mum2AUqDidoKqcTOw==", "dev": true }, "neo-async": { @@ -4716,18 +5261,27 @@ "dev": true }, "node-environment-flags": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/node-environment-flags/-/node-environment-flags-1.0.4.tgz", - "integrity": "sha512-M9rwCnWVLW7PX+NUWe3ejEdiLYinRpsEre9hMkU/6NS4h+EEulYaDH1gCEZ2gyXsmw+RXYDaV2JkkTNcsPDJ0Q==", + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/node-environment-flags/-/node-environment-flags-1.0.5.tgz", + "integrity": "sha512-VNYPRfGfmZLx0Ye20jWzHUjyTW/c+6Wq+iLhDzUI4XmhrDd9l/FozXV3F2xOaXjvp0co0+v1YSR3CMP6g+VvLQ==", "dev": true, "requires": { - "object.getownpropertydescriptors": "^2.0.3" + "object.getownpropertydescriptors": "^2.0.3", + "semver": "^5.7.0" + }, + "dependencies": { + "semver": { + "version": "5.7.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz", + "integrity": "sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==", + "dev": true + } } }, "node-fetch": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.3.0.tgz", - "integrity": "sha512-MOd8pV3fxENbryESLgVIeaGKrdl+uaYhCSSVkjeOb/31/njTpcis5aWfdqgNlHIrKOLRbMnfPINPOML2CIFeXA==", + "version": "2.6.0", + "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.6.0.tgz", + "integrity": "sha512-8dG4H5ujfvFiqDmVu9fQ5bOHUC15JMjMY/Zumv26oOvvVJjM67KF8koCWIabKQ1GJIa9r2mMZscBq/TbdOcmNA==", "dev": true }, "node-libs-browser": { @@ -4810,6 +5364,15 @@ } } }, + "node-preload": { + "version": "0.2.1", + "resolved": "https://registry.npmjs.org/node-preload/-/node-preload-0.2.1.tgz", + "integrity": "sha512-RM5oyBy45cLEoHqCeh+MNuFAxO0vTFBLskvQbOKnEE7YTTSN4tbN8QWDIPQ6L+WvKsB/qLEGpYe2ZZ9d4W9OIQ==", + "dev": true, + "requires": { + "process-on-spawn": "^1.0.0" + } + }, "node-releases": { "version": "1.1.10", "resolved": "https://registry.npmjs.org/node-releases/-/node-releases-1.1.10.tgz", @@ -4868,264 +5431,120 @@ "dev": true }, "nyc": { - "version": "13.3.0", - "resolved": "https://registry.npmjs.org/nyc/-/nyc-13.3.0.tgz", - "integrity": "sha512-P+FwIuro2aFG6B0Esd9ZDWUd51uZrAEoGutqZxzrVmYl3qSfkLgcQpBPBjtDFsUQLFY1dvTQJPOyeqr8S9GF8w==", - "dev": true, - "requires": { - "archy": "^1.0.0", - "arrify": "^1.0.1", - "caching-transform": "^3.0.1", - "convert-source-map": "^1.6.0", - "find-cache-dir": "^2.0.0", - "find-up": "^3.0.0", - "foreground-child": "^1.5.6", - "glob": "^7.1.3", - "istanbul-lib-coverage": "^2.0.3", - "istanbul-lib-hook": "^2.0.3", - "istanbul-lib-instrument": "^3.1.0", - "istanbul-lib-report": "^2.0.4", - "istanbul-lib-source-maps": "^3.0.2", - "istanbul-reports": "^2.1.1", - "make-dir": "^1.3.0", - "merge-source-map": "^1.1.0", - "resolve-from": "^4.0.0", - "rimraf": "^2.6.3", + "version": "15.0.0", + "resolved": "https://registry.npmjs.org/nyc/-/nyc-15.0.0.tgz", + "integrity": "sha512-qcLBlNCKMDVuKb7d1fpxjPR8sHeMVX0CHarXAVzrVWoFrigCkYR8xcrjfXSPi5HXM7EU78L6ywO7w1c5rZNCNg==", + "dev": true, + "requires": { + "@istanbuljs/load-nyc-config": "^1.0.0", + "@istanbuljs/schema": "^0.1.2", + "caching-transform": "^4.0.0", + "convert-source-map": "^1.7.0", + "decamelize": "^1.2.0", + "find-cache-dir": "^3.2.0", + "find-up": "^4.1.0", + "foreground-child": "^2.0.0", + "glob": "^7.1.6", + "istanbul-lib-coverage": "^3.0.0", + "istanbul-lib-hook": "^3.0.0", + "istanbul-lib-instrument": "^4.0.0", + "istanbul-lib-processinfo": "^2.0.2", + "istanbul-lib-report": "^3.0.0", + "istanbul-lib-source-maps": "^4.0.0", + "istanbul-reports": "^3.0.0", + "js-yaml": "^3.13.1", + "make-dir": "^3.0.0", + "node-preload": "^0.2.0", + "p-map": "^3.0.0", + "process-on-spawn": "^1.0.0", + "resolve-from": "^5.0.0", + "rimraf": "^3.0.0", "signal-exit": "^3.0.2", - "spawn-wrap": "^1.4.2", - "test-exclude": "^5.1.0", - "uuid": "^3.3.2", - "yargs": "^12.0.5", - "yargs-parser": "^11.1.1" + "spawn-wrap": "^2.0.0", + "test-exclude": "^6.0.0", + "uuid": "^3.3.3", + "yargs": "^15.0.2" }, "dependencies": { "ansi-regex": { - "version": "3.0.0", - "bundled": true, - "dev": true - }, - "append-transform": { - "version": "1.0.0", - "bundled": true, - "dev": true, - "requires": { - "default-require-extensions": "^2.0.0" - } - }, - "archy": { - "version": "1.0.0", - "bundled": true, - "dev": true - }, - "arrify": { - "version": "1.0.1", - "bundled": true, - "dev": true - }, - "async": { - "version": "2.6.2", - "bundled": true, - "dev": true, - "requires": { - "lodash": "^4.17.11" - } - }, - "balanced-match": { - "version": "1.0.0", - "bundled": true, - "dev": true - }, - "brace-expansion": { - "version": "1.1.11", - "bundled": true, - "dev": true, - "requires": { - "balanced-match": "^1.0.0", - "concat-map": "0.0.1" - } - }, - "caching-transform": { - "version": "3.0.1", - "bundled": true, - "dev": true, - "requires": { - "hasha": "^3.0.0", - "make-dir": "^1.3.0", - "package-hash": "^3.0.0", - "write-file-atomic": "^2.3.0" - } - }, - "camelcase": { "version": "5.0.0", - "bundled": true, - "dev": true - }, - "cliui": { - "version": "4.1.0", - "bundled": true, - "dev": true, - "requires": { - "string-width": "^2.1.1", - "strip-ansi": "^4.0.0", - "wrap-ansi": "^2.0.0" - } - }, - "code-point-at": { - "version": "1.1.0", - "bundled": true, - "dev": true - }, - "commander": { - "version": "2.17.1", - "bundled": true, - "dev": true, - "optional": true - }, - "commondir": { - "version": "1.0.1", - "bundled": true, - "dev": true - }, - "concat-map": { - "version": "0.0.1", - "bundled": true, + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.0.tgz", + "integrity": "sha512-bY6fj56OUQ0hU1KjFNDQuJFezqKdrAyFdIevADiqrWHwSlbmBNMHp5ak2f40Pm8JTFyM2mqxkG6ngkHO11f/lg==", "dev": true }, - "convert-source-map": { - "version": "1.6.0", - "bundled": true, + "ansi-styles": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.2.0.tgz", + "integrity": "sha512-7kFQgnEaMdRtwf6uSfUnVr9gSGC7faurn+J/Mv90/W+iTtN0405/nLdopfMWwchyxhbGYl6TC4Sccn9TUkGAgg==", "dev": true, "requires": { - "safe-buffer": "~5.1.1" + "@types/color-name": "^1.1.1", + "color-convert": "^2.0.1" } }, - "cross-spawn": { - "version": "4.0.2", - "bundled": true, + "cliui": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/cliui/-/cliui-6.0.0.tgz", + "integrity": "sha512-t6wbgtoCXvAzst7QgXxJYqPt0usEfbgQdftEPbLL/cvv6HPE5VgvqCuAIDR0NgU52ds6rFwqrgakNLrHEjCbrQ==", "dev": true, "requires": { - "lru-cache": "^4.0.1", - "which": "^1.2.9" + "string-width": "^4.2.0", + "strip-ansi": "^6.0.0", + "wrap-ansi": "^6.2.0" } }, - "debug": { - "version": "4.1.1", - "bundled": true, + "color-convert": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", "dev": true, "requires": { - "ms": "^2.1.1" + "color-name": "~1.1.4" } }, - "decamelize": { - "version": "1.2.0", - "bundled": true, + "color-name": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", "dev": true }, - "default-require-extensions": { - "version": "2.0.0", - "bundled": true, - "dev": true, - "requires": { - "strip-bom": "^3.0.0" - } - }, - "end-of-stream": { - "version": "1.4.1", - "bundled": true, - "dev": true, - "requires": { - "once": "^1.4.0" - } - }, - "error-ex": { - "version": "1.3.2", - "bundled": true, - "dev": true, - "requires": { - "is-arrayish": "^0.2.1" - } - }, - "es6-error": { - "version": "4.1.1", - "bundled": true, + "emoji-regex": { + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", + "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==", "dev": true }, - "execa": { - "version": "1.0.0", - "bundled": true, - "dev": true, - "requires": { - "cross-spawn": "^6.0.0", - "get-stream": "^4.0.0", - "is-stream": "^1.1.0", - "npm-run-path": "^2.0.0", - "p-finally": "^1.0.0", - "signal-exit": "^3.0.0", - "strip-eof": "^1.0.0" - }, - "dependencies": { - "cross-spawn": { - "version": "6.0.5", - "bundled": true, - "dev": true, - "requires": { - "nice-try": "^1.0.4", - "path-key": "^2.0.1", - "semver": "^5.5.0", - "shebang-command": "^1.2.0", - "which": "^1.2.9" - } - } - } - }, "find-cache-dir": { - "version": "2.0.0", - "bundled": true, + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/find-cache-dir/-/find-cache-dir-3.2.0.tgz", + "integrity": "sha512-1JKclkYYsf1q9WIJKLZa9S9muC+08RIjzAlLrK4QcYLJMS6mk9yombQ9qf+zJ7H9LS800k0s44L4sDq9VYzqyg==", "dev": true, "requires": { "commondir": "^1.0.1", - "make-dir": "^1.0.0", - "pkg-dir": "^3.0.0" + "make-dir": "^3.0.0", + "pkg-dir": "^4.1.0" } }, "find-up": { - "version": "3.0.0", - "bundled": true, - "dev": true, - "requires": { - "locate-path": "^3.0.0" - } - }, - "foreground-child": { - "version": "1.5.6", - "bundled": true, + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-4.1.0.tgz", + "integrity": "sha512-PpOwAdQ/YlXQ2vj8a3h8IipDuYRi3wceVQQGYWxNINccq40Anw7BlsEXCMbt1Zt+OLA6Fq9suIpIWD0OsnISlw==", "dev": true, "requires": { - "cross-spawn": "^4", - "signal-exit": "^3.0.0" + "locate-path": "^5.0.0", + "path-exists": "^4.0.0" } }, - "fs.realpath": { - "version": "1.0.0", - "bundled": true, - "dev": true - }, "get-caller-file": { - "version": "1.0.3", - "bundled": true, + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/get-caller-file/-/get-caller-file-2.0.5.tgz", + "integrity": "sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg==", "dev": true }, - "get-stream": { - "version": "4.1.0", - "bundled": true, - "dev": true, - "requires": { - "pump": "^3.0.0" - } - }, "glob": { - "version": "7.1.3", - "bundled": true, + "version": "7.1.6", + "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.6.tgz", + "integrity": "sha512-LwaxwyZ72Lk7vZINtNNrywX0ZuLyStrdDtabefZKAY5ZGJhVtgdznluResxNmPitE0SAO+O26sWTHeKSI2wMBA==", "dev": true, "requires": { "fs.realpath": "^1.0.0", @@ -5136,763 +5555,135 @@ "path-is-absolute": "^1.0.0" } }, - "graceful-fs": { - "version": "4.1.15", - "bundled": true, + "is-fullwidth-code-point": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", + "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==", "dev": true }, - "handlebars": { - "version": "4.1.0", - "bundled": true, + "locate-path": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-5.0.0.tgz", + "integrity": "sha512-t7hw9pI+WvuwNJXwk5zVHpyhIqzg2qTlklJOf0mVxGSbe3Fp2VieZcduNYjaLDoy6p9uGpQEGWG87WpMKlNq8g==", "dev": true, "requires": { - "async": "^2.5.0", - "optimist": "^0.6.1", - "source-map": "^0.6.1", - "uglify-js": "^3.1.4" - }, - "dependencies": { - "source-map": { - "version": "0.6.1", - "bundled": true, - "dev": true - } + "p-locate": "^4.1.0" } }, - "has-flag": { - "version": "3.0.0", - "bundled": true, - "dev": true - }, - "hasha": { + "make-dir": { "version": "3.0.0", - "bundled": true, + "resolved": "https://registry.npmjs.org/make-dir/-/make-dir-3.0.0.tgz", + "integrity": "sha512-grNJDhb8b1Jm1qeqW5R/O63wUo4UXo2v2HMic6YT9i/HBlF93S8jkMgH7yugvY9ABDShH4VZMn8I+U8+fCNegw==", "dev": true, "requires": { - "is-stream": "^1.0.1" + "semver": "^6.0.0" } }, - "hosted-git-info": { - "version": "2.7.1", - "bundled": true, - "dev": true - }, - "imurmurhash": { - "version": "0.1.4", - "bundled": true, - "dev": true - }, - "inflight": { - "version": "1.0.6", - "bundled": true, + "p-locate": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-4.1.0.tgz", + "integrity": "sha512-R79ZZ/0wAxKGu3oYMlz8jy/kbhsNrS7SKZ7PxEHBgJ5+F2mtFW2fK2cOtBh1cHYkQsbzFV7I+EoRKe6Yt0oK7A==", "dev": true, "requires": { - "once": "^1.3.0", - "wrappy": "1" + "p-limit": "^2.2.0" } }, - "inherits": { - "version": "2.0.3", - "bundled": true, - "dev": true - }, - "invert-kv": { - "version": "2.0.0", - "bundled": true, - "dev": true - }, - "is-arrayish": { - "version": "0.2.1", - "bundled": true, - "dev": true + "pkg-dir": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/pkg-dir/-/pkg-dir-4.2.0.tgz", + "integrity": "sha512-HRDzbaKjC+AOWVXxAU/x54COGeIv9eb+6CkDSQoNTt4XyWoIJvuPsXizxu/Fr23EiekbtZwmh1IcIG/l/a10GQ==", + "dev": true, + "requires": { + "find-up": "^4.0.0" + } }, - "is-fullwidth-code-point": { + "require-main-filename": { "version": "2.0.0", - "bundled": true, - "dev": true - }, - "is-stream": { - "version": "1.1.0", - "bundled": true, + "resolved": "https://registry.npmjs.org/require-main-filename/-/require-main-filename-2.0.0.tgz", + "integrity": "sha512-NKN5kMDylKuldxYLSUfrbo5Tuzh4hd+2E8NPPX02mZtn1VuREQToYe/ZdlJy+J3uCpfaiGF05e7B8W0iXbQHmg==", "dev": true }, - "isexe": { - "version": "2.0.0", - "bundled": true, - "dev": true - }, - "istanbul-lib-coverage": { - "version": "2.0.3", - "bundled": true, - "dev": true - }, - "istanbul-lib-hook": { - "version": "2.0.3", - "bundled": true, - "dev": true, - "requires": { - "append-transform": "^1.0.0" - } - }, - "istanbul-lib-report": { - "version": "2.0.4", - "bundled": true, - "dev": true, - "requires": { - "istanbul-lib-coverage": "^2.0.3", - "make-dir": "^1.3.0", - "supports-color": "^6.0.0" - }, - "dependencies": { - "supports-color": { - "version": "6.1.0", - "bundled": true, - "dev": true, - "requires": { - "has-flag": "^3.0.0" - } - } - } - }, - "istanbul-lib-source-maps": { - "version": "3.0.2", - "bundled": true, - "dev": true, - "requires": { - "debug": "^4.1.1", - "istanbul-lib-coverage": "^2.0.3", - "make-dir": "^1.3.0", - "rimraf": "^2.6.2", - "source-map": "^0.6.1" - }, - "dependencies": { - "source-map": { - "version": "0.6.1", - "bundled": true, - "dev": true - } - } - }, - "istanbul-reports": { - "version": "2.1.1", - "bundled": true, - "dev": true, - "requires": { - "handlebars": "^4.1.0" - } - }, - "json-parse-better-errors": { - "version": "1.0.2", - "bundled": true, - "dev": true - }, - "lcid": { - "version": "2.0.0", - "bundled": true, - "dev": true, - "requires": { - "invert-kv": "^2.0.0" - } - }, - "load-json-file": { - "version": "4.0.0", - "bundled": true, - "dev": true, - "requires": { - "graceful-fs": "^4.1.2", - "parse-json": "^4.0.0", - "pify": "^3.0.0", - "strip-bom": "^3.0.0" - } - }, - "locate-path": { - "version": "3.0.0", - "bundled": true, - "dev": true, - "requires": { - "p-locate": "^3.0.0", - "path-exists": "^3.0.0" - } - }, - "lodash": { - "version": "4.17.11", - "bundled": true, - "dev": true - }, - "lodash.flattendeep": { - "version": "4.4.0", - "bundled": true, - "dev": true - }, - "lru-cache": { - "version": "4.1.5", - "bundled": true, - "dev": true, - "requires": { - "pseudomap": "^1.0.2", - "yallist": "^2.1.2" - } - }, - "make-dir": { - "version": "1.3.0", - "bundled": true, - "dev": true, - "requires": { - "pify": "^3.0.0" - } - }, - "map-age-cleaner": { - "version": "0.1.3", - "bundled": true, - "dev": true, - "requires": { - "p-defer": "^1.0.0" - } - }, - "mem": { - "version": "4.1.0", - "bundled": true, - "dev": true, - "requires": { - "map-age-cleaner": "^0.1.1", - "mimic-fn": "^1.0.0", - "p-is-promise": "^2.0.0" - } - }, - "merge-source-map": { - "version": "1.1.0", - "bundled": true, - "dev": true, - "requires": { - "source-map": "^0.6.1" - }, - "dependencies": { - "source-map": { - "version": "0.6.1", - "bundled": true, - "dev": true - } - } - }, - "mimic-fn": { - "version": "1.2.0", - "bundled": true, - "dev": true - }, - "minimatch": { - "version": "3.0.4", - "bundled": true, - "dev": true, - "requires": { - "brace-expansion": "^1.1.7" - } - }, - "minimist": { - "version": "0.0.10", - "bundled": true, - "dev": true - }, - "mkdirp": { - "version": "0.5.1", - "bundled": true, - "dev": true, - "requires": { - "minimist": "0.0.8" - }, - "dependencies": { - "minimist": { - "version": "0.0.8", - "bundled": true, - "dev": true - } - } - }, - "ms": { - "version": "2.1.1", - "bundled": true, - "dev": true - }, - "nice-try": { - "version": "1.0.5", - "bundled": true, - "dev": true - }, - "normalize-package-data": { - "version": "2.5.0", - "bundled": true, - "dev": true, - "requires": { - "hosted-git-info": "^2.1.4", - "resolve": "^1.10.0", - "semver": "2 || 3 || 4 || 5", - "validate-npm-package-license": "^3.0.1" - } - }, - "npm-run-path": { - "version": "2.0.2", - "bundled": true, - "dev": true, - "requires": { - "path-key": "^2.0.0" - } - }, - "number-is-nan": { - "version": "1.0.1", - "bundled": true, - "dev": true - }, - "once": { - "version": "1.4.0", - "bundled": true, - "dev": true, - "requires": { - "wrappy": "1" - } - }, - "optimist": { - "version": "0.6.1", - "bundled": true, - "dev": true, - "requires": { - "minimist": "~0.0.1", - "wordwrap": "~0.0.2" - } - }, - "os-homedir": { - "version": "1.0.2", - "bundled": true, - "dev": true - }, - "os-locale": { - "version": "3.1.0", - "bundled": true, - "dev": true, - "requires": { - "execa": "^1.0.0", - "lcid": "^2.0.0", - "mem": "^4.0.0" - } - }, - "p-defer": { - "version": "1.0.0", - "bundled": true, - "dev": true - }, - "p-finally": { - "version": "1.0.0", - "bundled": true, - "dev": true - }, - "p-is-promise": { - "version": "2.0.0", - "bundled": true, - "dev": true - }, - "p-limit": { - "version": "2.1.0", - "bundled": true, - "dev": true, - "requires": { - "p-try": "^2.0.0" - } - }, - "p-locate": { - "version": "3.0.0", - "bundled": true, - "dev": true, - "requires": { - "p-limit": "^2.0.0" - } - }, - "p-try": { - "version": "2.0.0", - "bundled": true, - "dev": true - }, - "package-hash": { - "version": "3.0.0", - "bundled": true, - "dev": true, - "requires": { - "graceful-fs": "^4.1.15", - "hasha": "^3.0.0", - "lodash.flattendeep": "^4.4.0", - "release-zalgo": "^1.0.0" - } - }, - "parse-json": { - "version": "4.0.0", - "bundled": true, - "dev": true, - "requires": { - "error-ex": "^1.3.1", - "json-parse-better-errors": "^1.0.1" - } - }, - "path-exists": { - "version": "3.0.0", - "bundled": true, - "dev": true - }, - "path-is-absolute": { - "version": "1.0.1", - "bundled": true, - "dev": true - }, - "path-key": { - "version": "2.0.1", - "bundled": true, - "dev": true - }, - "path-parse": { - "version": "1.0.6", - "bundled": true, - "dev": true - }, - "path-type": { - "version": "3.0.0", - "bundled": true, - "dev": true, - "requires": { - "pify": "^3.0.0" - } - }, - "pify": { - "version": "3.0.0", - "bundled": true, - "dev": true - }, - "pkg-dir": { - "version": "3.0.0", - "bundled": true, - "dev": true, - "requires": { - "find-up": "^3.0.0" - } - }, - "pseudomap": { - "version": "1.0.2", - "bundled": true, - "dev": true - }, - "pump": { - "version": "3.0.0", - "bundled": true, - "dev": true, - "requires": { - "end-of-stream": "^1.1.0", - "once": "^1.3.1" - } - }, - "read-pkg": { - "version": "3.0.0", - "bundled": true, - "dev": true, - "requires": { - "load-json-file": "^4.0.0", - "normalize-package-data": "^2.3.2", - "path-type": "^3.0.0" - } - }, - "read-pkg-up": { - "version": "4.0.0", - "bundled": true, - "dev": true, - "requires": { - "find-up": "^3.0.0", - "read-pkg": "^3.0.0" - } - }, - "release-zalgo": { - "version": "1.0.0", - "bundled": true, - "dev": true, - "requires": { - "es6-error": "^4.0.1" - } - }, - "require-directory": { - "version": "2.1.1", - "bundled": true, - "dev": true - }, - "require-main-filename": { - "version": "1.0.1", - "bundled": true, - "dev": true - }, - "resolve": { - "version": "1.10.0", - "bundled": true, - "dev": true, - "requires": { - "path-parse": "^1.0.6" - } - }, - "resolve-from": { - "version": "4.0.0", - "bundled": true, + "resolve-from": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-5.0.0.tgz", + "integrity": "sha512-qYg9KP24dD5qka9J47d0aVky0N+b4fTU89LN9iDnjB5waksiC49rvMB0PrUJQGoTmH50XPiqOvAjDfaijGxYZw==", "dev": true }, "rimraf": { - "version": "2.6.3", - "bundled": true, - "dev": true, - "requires": { - "glob": "^7.1.3" - } - }, - "safe-buffer": { - "version": "5.1.2", - "bundled": true, - "dev": true - }, - "semver": { - "version": "5.6.0", - "bundled": true, - "dev": true - }, - "set-blocking": { - "version": "2.0.0", - "bundled": true, - "dev": true - }, - "shebang-command": { - "version": "1.2.0", - "bundled": true, - "dev": true, - "requires": { - "shebang-regex": "^1.0.0" - } - }, - "shebang-regex": { - "version": "1.0.0", - "bundled": true, - "dev": true - }, - "signal-exit": { - "version": "3.0.2", - "bundled": true, - "dev": true - }, - "spawn-wrap": { - "version": "1.4.2", - "bundled": true, - "dev": true, - "requires": { - "foreground-child": "^1.5.6", - "mkdirp": "^0.5.0", - "os-homedir": "^1.0.1", - "rimraf": "^2.6.2", - "signal-exit": "^3.0.2", - "which": "^1.3.0" - } - }, - "spdx-correct": { - "version": "3.1.0", - "bundled": true, - "dev": true, - "requires": { - "spdx-expression-parse": "^3.0.0", - "spdx-license-ids": "^3.0.0" - } - }, - "spdx-exceptions": { - "version": "2.2.0", - "bundled": true, - "dev": true - }, - "spdx-expression-parse": { - "version": "3.0.0", - "bundled": true, - "dev": true, - "requires": { - "spdx-exceptions": "^2.1.0", - "spdx-license-ids": "^3.0.0" - } - }, - "spdx-license-ids": { - "version": "3.0.3", - "bundled": true, - "dev": true - }, - "string-width": { - "version": "2.1.1", - "bundled": true, - "dev": true, - "requires": { - "is-fullwidth-code-point": "^2.0.0", - "strip-ansi": "^4.0.0" - } - }, - "strip-ansi": { - "version": "4.0.0", - "bundled": true, - "dev": true, - "requires": { - "ansi-regex": "^3.0.0" - } - }, - "strip-bom": { "version": "3.0.0", - "bundled": true, - "dev": true - }, - "strip-eof": { - "version": "1.0.0", - "bundled": true, - "dev": true - }, - "test-exclude": { - "version": "5.1.0", - "bundled": true, - "dev": true, - "requires": { - "arrify": "^1.0.1", - "minimatch": "^3.0.4", - "read-pkg-up": "^4.0.0", - "require-main-filename": "^1.0.1" - } - }, - "uglify-js": { - "version": "3.4.9", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "commander": "~2.17.1", - "source-map": "~0.6.1" - }, - "dependencies": { - "source-map": { - "version": "0.6.1", - "bundled": true, - "dev": true, - "optional": true - } - } - }, - "uuid": { - "version": "3.3.2", - "bundled": true, - "dev": true - }, - "validate-npm-package-license": { - "version": "3.0.4", - "bundled": true, - "dev": true, - "requires": { - "spdx-correct": "^3.0.0", - "spdx-expression-parse": "^3.0.0" - } - }, - "which": { - "version": "1.3.1", - "bundled": true, + "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-3.0.0.tgz", + "integrity": "sha512-NDGVxTsjqfunkds7CqsOiEnxln4Bo7Nddl3XhS4pXg5OzwkLqJ971ZVAAnB+DDLnF76N+VnDEiBHaVV8I06SUg==", "dev": true, "requires": { - "isexe": "^2.0.0" + "glob": "^7.1.3" } }, - "which-module": { - "version": "2.0.0", - "bundled": true, - "dev": true - }, - "wordwrap": { - "version": "0.0.3", - "bundled": true, + "semver": { + "version": "6.3.0", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", + "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==", "dev": true }, - "wrap-ansi": { - "version": "2.1.0", - "bundled": true, + "string-width": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.0.tgz", + "integrity": "sha512-zUz5JD+tgqtuDjMhwIg5uFVV3dtqZ9yQJlZVfq4I01/K5Paj5UHj7VyrQOJvzawSVlKpObApbfD0Ed6yJc+1eg==", "dev": true, "requires": { - "string-width": "^1.0.1", - "strip-ansi": "^3.0.1" - }, - "dependencies": { - "ansi-regex": { - "version": "2.1.1", - "bundled": true, - "dev": true - }, - "is-fullwidth-code-point": { - "version": "1.0.0", - "bundled": true, - "dev": true, - "requires": { - "number-is-nan": "^1.0.0" - } - }, - "string-width": { - "version": "1.0.2", - "bundled": true, - "dev": true, - "requires": { - "code-point-at": "^1.0.0", - "is-fullwidth-code-point": "^1.0.0", - "strip-ansi": "^3.0.0" - } - }, - "strip-ansi": { - "version": "3.0.1", - "bundled": true, - "dev": true, - "requires": { - "ansi-regex": "^2.0.0" - } - } + "emoji-regex": "^8.0.0", + "is-fullwidth-code-point": "^3.0.0", + "strip-ansi": "^6.0.0" } }, - "wrappy": { - "version": "1.0.2", - "bundled": true, - "dev": true + "strip-ansi": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.0.tgz", + "integrity": "sha512-AuvKTrTfQNYNIctbR1K/YGTR1756GycPsg7b9bdV9Duqur4gv6aKqHXah67Z8ImS7WEz5QVcOtlfW2rZEugt6w==", + "dev": true, + "requires": { + "ansi-regex": "^5.0.0" + } }, - "write-file-atomic": { - "version": "2.4.2", - "bundled": true, + "wrap-ansi": { + "version": "6.2.0", + "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-6.2.0.tgz", + "integrity": "sha512-r6lPcBGxZXlIcymEu7InxDMhdW0KDxpLgoFLcguasxCaJ/SOIZwINatK9KY/tf+ZrlywOKU0UDj3ATXUBfxJXA==", "dev": true, "requires": { - "graceful-fs": "^4.1.11", - "imurmurhash": "^0.1.4", - "signal-exit": "^3.0.2" + "ansi-styles": "^4.0.0", + "string-width": "^4.1.0", + "strip-ansi": "^6.0.0" } }, "y18n": { "version": "4.0.0", - "bundled": true, - "dev": true - }, - "yallist": { - "version": "2.1.2", - "bundled": true, + "resolved": "https://registry.npmjs.org/y18n/-/y18n-4.0.0.tgz", + "integrity": "sha512-r9S/ZyXu/Xu9q1tYlpsLIsa3EeLXXk0VwlxqTcFRfg9EhMW+17kbt9G0NrgCmhGb5vT2hyhJZLfDGx+7+5Uj/w==", "dev": true }, "yargs": { - "version": "12.0.5", - "bundled": true, + "version": "15.0.2", + "resolved": "https://registry.npmjs.org/yargs/-/yargs-15.0.2.tgz", + "integrity": "sha512-GH/X/hYt+x5hOat4LMnCqMd8r5Cv78heOMIJn1hr7QPPBqfeC6p89Y78+WB9yGDvfpCvgasfmWLzNzEioOUD9Q==", "dev": true, "requires": { - "cliui": "^4.0.0", + "cliui": "^6.0.0", "decamelize": "^1.2.0", - "find-up": "^3.0.0", - "get-caller-file": "^1.0.1", - "os-locale": "^3.0.0", + "find-up": "^4.1.0", + "get-caller-file": "^2.0.1", "require-directory": "^2.1.1", - "require-main-filename": "^1.0.1", + "require-main-filename": "^2.0.0", "set-blocking": "^2.0.0", - "string-width": "^2.0.0", + "string-width": "^4.2.0", "which-module": "^2.0.0", - "y18n": "^3.2.1 || ^4.0.0", - "yargs-parser": "^11.1.1" + "y18n": "^4.0.0", + "yargs-parser": "^16.1.0" } }, "yargs-parser": { - "version": "11.1.1", - "bundled": true, + "version": "16.1.0", + "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-16.1.0.tgz", + "integrity": "sha512-H/V41UNZQPkUMIT5h5hiwg4QKIY1RPvoBV4XcjUbRM8Bk2oKqqyZ0DIEbTFZB0XjbtSPG8SAa/0DxCQmiRgzKg==", "dev": true, "requires": { "camelcase": "^5.0.0", @@ -5996,6 +5787,12 @@ "has": "^1.0.3" } }, + "octokit-pagination-methods": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/octokit-pagination-methods/-/octokit-pagination-methods-1.1.0.tgz", + "integrity": "sha512-fZ4qZdQ2nxJvtcasX7Ghl+WlWS/d9IgnBIwFZXVNNZUmzpno91SX5bc5vuxiuKoCtK78XxGGNuSCrDC7xYB3OQ==", + "dev": true + }, "on-finished": { "version": "2.3.0", "resolved": "https://registry.npmjs.org/on-finished/-/on-finished-2.3.0.tgz", @@ -6037,28 +5834,30 @@ "dev": true }, "os-locale": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/os-locale/-/os-locale-1.4.0.tgz", - "integrity": "sha1-IPnxeuKe00XoveWDsT0gCYA8FNk=", + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/os-locale/-/os-locale-3.1.0.tgz", + "integrity": "sha512-Z8l3R4wYWM40/52Z+S265okfFj8Kt2cC2MKY+xNi3kFs+XGI7WXu/I309QQQYbRW4ijiZ+yxs9pqEhJh0DqW3Q==", "dev": true, "requires": { - "lcid": "^1.0.0" + "execa": "^1.0.0", + "lcid": "^2.0.0", + "mem": "^4.0.0" } }, "os-name": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/os-name/-/os-name-3.0.0.tgz", - "integrity": "sha512-7c74tib2FsdFbQ3W+qj8Tyd1R3Z6tuVRNNxXjJcZ4NgjIEQU9N/prVMqcW29XZPXGACqaXN3jq58/6hoaoXH6g==", + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/os-name/-/os-name-3.1.0.tgz", + "integrity": "sha512-h8L+8aNjNcMpo/mAIBPn5PXCM16iyPGjHNWo6U1YO8sJTMHtEtyczI6QJnLoplswm6goopQkqc7OAnjhWcugVg==", "dev": true, "requires": { - "macos-release": "^2.0.0", + "macos-release": "^2.2.0", "windows-release": "^3.1.0" } }, "p-cancelable": { - "version": "0.3.0", - "resolved": "https://registry.npmjs.org/p-cancelable/-/p-cancelable-0.3.0.tgz", - "integrity": "sha512-RVbZPLso8+jFeq1MfNvgXtCRED2raz/dKpacfTNxsx6pLEpEomM7gah6VeHSYV3+vo0OAi4MkArtQcWWXuQoyw==", + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/p-cancelable/-/p-cancelable-0.4.1.tgz", + "integrity": "sha512-HNa1A8LvB1kie7cERyy21VNeHb2CWJJYqyyC2o3klWFfMGlFmWv2Z7sFgZH8ZiaYL95ydToKTFVXgMV/Os0bBQ==", "dev": true }, "p-defer": { @@ -6097,10 +5896,19 @@ "p-limit": "^2.0.0" } }, + "p-map": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/p-map/-/p-map-3.0.0.tgz", + "integrity": "sha512-d3qXVTF/s+W+CdJ5A29wywV2n8CQQYahlgz2bFiA+4eVNJbHJodPZ+/gXwPGh0bOqA+j8S+6+ckmvLGPk1QpxQ==", + "dev": true, + "requires": { + "aggregate-error": "^3.0.0" + } + }, "p-timeout": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/p-timeout/-/p-timeout-1.2.1.tgz", - "integrity": "sha1-XrOzU7f86Z8QGhA4iAuwVOu+o4Y=", + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/p-timeout/-/p-timeout-2.0.1.tgz", + "integrity": "sha512-88em58dDVB/KzPEx1X0N3LwFfYZPyDc4B6eF38M1rk9VTZMbxXXgjugz8mmwpS9Ox4BDZ+t6t3QP5+/gazweIA==", "dev": true, "requires": { "p-finally": "^1.0.0" @@ -6112,6 +5920,18 @@ "integrity": "sha512-hMp0onDKIajHfIkdRk3P4CdCmErkYAxxDtP3Wx/4nZ3aGlau2VKh3mZpcuFkH27WQkL/3WBCPOktzA9ZOAnMQQ==", "dev": true }, + "package-hash": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/package-hash/-/package-hash-4.0.0.tgz", + "integrity": "sha512-whdkPIooSu/bASggZ96BWVvZTRMOFxnyUG5PnTSGKoJE2gd5mbVNmR2Nj20QFzxYYgAXpoqC+AiXzl+UMRh7zQ==", + "dev": true, + "requires": { + "graceful-fs": "^4.1.15", + "hasha": "^5.0.0", + "lodash.flattendeep": "^4.4.0", + "release-zalgo": "^1.0.0" + } + }, "pako": { "version": "1.0.10", "resolved": "https://registry.npmjs.org/pako/-/pako-1.0.10.tgz", @@ -6129,6 +5949,12 @@ "readable-stream": "^2.1.5" } }, + "paralleljs": { + "version": "0.2.1", + "resolved": "https://registry.npmjs.org/paralleljs/-/paralleljs-0.2.1.tgz", + "integrity": "sha1-68p0XT4JwB4r68wUhYiR/0UQ6SY=", + "dev": true + }, "parse-asn1": { "version": "5.1.4", "resolved": "https://registry.npmjs.org/parse-asn1/-/parse-asn1-5.1.4.tgz", @@ -6143,25 +5969,10 @@ "safe-buffer": "^5.1.1" } }, - "parse-json": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/parse-json/-/parse-json-2.2.0.tgz", - "integrity": "sha1-9ID0BDTvgHQfhGkJn43qGPVaTck=", - "dev": true, - "requires": { - "error-ex": "^1.2.0" - } - }, - "parse-passwd": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/parse-passwd/-/parse-passwd-1.0.0.tgz", - "integrity": "sha1-bVuTSkVpk7I9N/QKOC1vFmao5cY=", - "dev": true - }, "parseurl": { - "version": "1.3.2", - "resolved": "https://registry.npmjs.org/parseurl/-/parseurl-1.3.2.tgz", - "integrity": "sha1-/CidTtiZMRlGDBViUyYs3I3mW/M=", + "version": "1.3.3", + "resolved": "https://registry.npmjs.org/parseurl/-/parseurl-1.3.3.tgz", + "integrity": "sha512-CiyeOxFT/JZyN5m0z9PfXw4SCBJ6Sygz1Dpl0wqjlhDEGGBP1GnsUVEL0p63hoG1fcj3fHynXi9NYO4nWOL+qQ==", "dev": true }, "pascalcase": { @@ -6183,13 +5994,10 @@ "dev": true }, "path-exists": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-2.1.0.tgz", - "integrity": "sha1-D+tsZPD8UY2adU3V77YscCJ2H0s=", - "dev": true, - "requires": { - "pinkie-promise": "^2.0.0" - } + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-4.0.0.tgz", + "integrity": "sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==", + "dev": true }, "path-is-absolute": { "version": "1.0.1", @@ -6215,17 +6023,6 @@ "integrity": "sha1-32BBeABfUi8V60SQ5yR6G/qmf4w=", "dev": true }, - "path-type": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/path-type/-/path-type-1.1.0.tgz", - "integrity": "sha1-WcRPfuSR2nBNpBXaWkBwuk+P5EE=", - "dev": true, - "requires": { - "graceful-fs": "^4.1.2", - "pify": "^2.0.0", - "pinkie-promise": "^2.0.0" - } - }, "pbkdf2": { "version": "3.0.17", "resolved": "https://registry.npmjs.org/pbkdf2/-/pbkdf2-3.0.17.tgz", @@ -6240,26 +6037,11 @@ } }, "pify": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/pify/-/pify-2.3.0.tgz", - "integrity": "sha1-7RQaasBDqEnqWISY59yosVMw6Qw=", - "dev": true - }, - "pinkie": { - "version": "2.0.4", - "resolved": "https://registry.npmjs.org/pinkie/-/pinkie-2.0.4.tgz", - "integrity": "sha1-clVrgM+g1IqXToDnckjoDtT3+HA=", + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/pify/-/pify-3.0.0.tgz", + "integrity": "sha1-5aSs0sEB/fPZpNB/DbxNtJ3SgXY=", "dev": true }, - "pinkie-promise": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/pinkie-promise/-/pinkie-promise-2.0.1.tgz", - "integrity": "sha1-ITXW36ejWMBprJsXh3YogihFD/o=", - "dev": true, - "requires": { - "pinkie": "^2.0.0" - } - }, "pkg-dir": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/pkg-dir/-/pkg-dir-3.0.0.tgz", @@ -6719,9 +6501,15 @@ "dev": true }, "prepend-http": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/prepend-http/-/prepend-http-1.0.4.tgz", - "integrity": "sha1-1PRWKwzjaW5BrFLQ4ALlemNdxtw=", + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/prepend-http/-/prepend-http-2.0.0.tgz", + "integrity": "sha1-6SQ0v6XqjBn0HN/UAddBo8gZ2Jc=", + "dev": true + }, + "prettier": { + "version": "1.18.2", + "resolved": "https://registry.npmjs.org/prettier/-/prettier-1.18.2.tgz", + "integrity": "sha512-OeHeMc0JhFE9idD4ZdtNibzY0+TPHSpSSb9h8FqtP+YnoZZ1sl8Vc9b1sasjfymH3SonAF4QcA2+mzHPhMvIiw==", "dev": true }, "process": { @@ -6736,6 +6524,15 @@ "integrity": "sha1-FQ4gt1ZZCtP5EJPyWk8q2L/zC6M=", "dev": true }, + "process-on-spawn": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/process-on-spawn/-/process-on-spawn-1.0.0.tgz", + "integrity": "sha512-1WsPDsUSMmZH5LeMLegqkPDrsGgsWwk1Exipy2hvB0o/F0ASzbpIctSCcZIK1ykJvtTJULEH+20WOFjMvGnCTg==", + "dev": true, + "requires": { + "fromentries": "^1.2.0" + } + }, "promise-inflight": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/promise-inflight/-/promise-inflight-1.0.1.tgz", @@ -6754,13 +6551,13 @@ } }, "proxy-addr": { - "version": "2.0.4", - "resolved": "https://registry.npmjs.org/proxy-addr/-/proxy-addr-2.0.4.tgz", - "integrity": "sha512-5erio2h9jp5CHGwcybmxmVqHmnCBZeewlfJ0pex+UW7Qny7OOZXTtH56TGNyBizkgiOwhJtMKrVzDTeKcySZwA==", + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/proxy-addr/-/proxy-addr-2.0.5.tgz", + "integrity": "sha512-t/7RxHXPH6cJtP0pRG6smSr9QJidhB+3kXu0KgXnbGYMgzEnUxRQ4/LDdfOwZEMyIh3/xHb8PX3t+lfL9z+YVQ==", "dev": true, "requires": { "forwarded": "~0.1.2", - "ipaddr.js": "1.8.0" + "ipaddr.js": "1.9.0" } }, "prr": { @@ -6829,11 +6626,22 @@ "dev": true }, "qs": { - "version": "6.5.2", - "resolved": "https://registry.npmjs.org/qs/-/qs-6.5.2.tgz", - "integrity": "sha512-N5ZAX4/LxJmF+7wN74pUD6qAh9/wnvdQcjq9TZjevvXzSUo7bfmw91saqMjzGS2xq91/odN2dW/WOl7qQHNDGA==", + "version": "6.7.0", + "resolved": "https://registry.npmjs.org/qs/-/qs-6.7.0.tgz", + "integrity": "sha512-VCdBRNFTX1fyE7Nb6FYoURo/SPe62QCaAyzJvUjwRaIsc+NePBEniHlvxFmmX56+HZphIGtV0XeCirBtpDrTyQ==", "dev": true }, + "query-string": { + "version": "5.1.1", + "resolved": "https://registry.npmjs.org/query-string/-/query-string-5.1.1.tgz", + "integrity": "sha512-gjWOsm2SoGlgLEdAGt7a6slVOk9mGiXmPFMqrEhLQ68rhQuBnpfs3+EmlvqKyxnCo9/PPlF+9MtY02S1aFg+Jw==", + "dev": true, + "requires": { + "decode-uri-component": "^0.2.0", + "object-assign": "^4.1.0", + "strict-uri-encode": "^1.0.0" + } + }, "querystring": { "version": "0.2.0", "resolved": "https://registry.npmjs.org/querystring/-/querystring-0.2.0.tgz", @@ -6866,74 +6674,60 @@ } }, "range-parser": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/range-parser/-/range-parser-1.2.0.tgz", - "integrity": "sha1-9JvmtIeJTdxA3MlKMi9hEJLgDV4=", + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/range-parser/-/range-parser-1.2.1.tgz", + "integrity": "sha512-Hrgsx+orqoygnmhFbKaHE6c296J+HTAQXoxEF6gNupROmmGJRoyzfG3ccAveqCBrwr/2yxQ5BVd/GTl5agOwSg==", "dev": true }, "raw-body": { - "version": "2.3.3", - "resolved": "https://registry.npmjs.org/raw-body/-/raw-body-2.3.3.tgz", - "integrity": "sha512-9esiElv1BrZoI3rCDuOuKCBRbuApGGaDPQfjSflGxdy4oyzqghxu6klEkkVIvBje+FF0BX9coEv8KqW6X/7njw==", + "version": "2.4.0", + "resolved": "https://registry.npmjs.org/raw-body/-/raw-body-2.4.0.tgz", + "integrity": "sha512-4Oz8DUIwdvoa5qMJelxipzi/iJIi40O5cGV1wNYp5hvZP8ZN0T+jiNkL0QepXs+EsQ9XJ8ipEDoiH70ySUJP3Q==", "dev": true, "requires": { - "bytes": "3.0.0", - "http-errors": "1.6.3", - "iconv-lite": "0.4.23", + "bytes": "3.1.0", + "http-errors": "1.7.2", + "iconv-lite": "0.4.24", "unpipe": "1.0.0" + }, + "dependencies": { + "bytes": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/bytes/-/bytes-3.1.0.tgz", + "integrity": "sha512-zauLjrfCG+xvoyaqLoV8bLVXXNGC4JqlxFCutSDWA6fJrTo2ZuvLYTqZ7aHBLZSMOopbzwv8f+wZcVzfVTI2Dg==", + "dev": true + } } }, "react": { - "version": "16.8.4", - "resolved": "https://registry.npmjs.org/react/-/react-16.8.4.tgz", - "integrity": "sha512-0GQ6gFXfUH7aZcjGVymlPOASTuSjlQL4ZtVC5YKH+3JL6bBLCVO21DknzmaPlI90LN253ojj02nsapy+j7wIjg==", + "version": "16.11.0", + "resolved": "https://registry.npmjs.org/react/-/react-16.11.0.tgz", + "integrity": "sha512-M5Y8yITaLmU0ynd0r1Yvfq98Rmll6q8AxaEe88c8e7LxO8fZ2cNgmFt0aGAS9wzf1Ao32NKXtCl+/tVVtkxq6g==", "dev": true, "requires": { "loose-envify": "^1.1.0", "object-assign": "^4.1.1", - "prop-types": "^15.6.2", - "scheduler": "^0.13.4" + "prop-types": "^15.6.2" } }, "react-dom": { - "version": "16.8.4", - "resolved": "https://registry.npmjs.org/react-dom/-/react-dom-16.8.4.tgz", - "integrity": "sha512-Ob2wK7XG2tUDt7ps7LtLzGYYB6DXMCLj0G5fO6WeEICtT4/HdpOi7W/xLzZnR6RCG1tYza60nMdqtxzA8FaPJQ==", + "version": "16.11.0", + "resolved": "https://registry.npmjs.org/react-dom/-/react-dom-16.11.0.tgz", + "integrity": "sha512-nrRyIUE1e7j8PaXSPtyRKtz+2y9ubW/ghNgqKFHHAHaeP0fpF5uXR+sq8IMRHC+ZUxw7W9NyCDTBtwWxvkb0iA==", "dev": true, "requires": { "loose-envify": "^1.1.0", "object-assign": "^4.1.1", "prop-types": "^15.6.2", - "scheduler": "^0.13.4" + "scheduler": "^0.17.0" } }, "react-is": { - "version": "16.8.4", - "resolved": "https://registry.npmjs.org/react-is/-/react-is-16.8.4.tgz", - "integrity": "sha512-PVadd+WaUDOAciICm/J1waJaSvgq+4rHE/K70j0PFqKhkTBsPv/82UGQJNXAngz1fOQLLxI6z1sEDmJDQhCTAA==", + "version": "16.11.0", + "resolved": "https://registry.npmjs.org/react-is/-/react-is-16.11.0.tgz", + "integrity": "sha512-gbBVYR2p8mnriqAwWx9LbuUrShnAuSCNnuPGyc7GJrMVQtPDAh8iLpv7FRuMPFb56KkaVZIYSz1PrjI9q0QPCw==", "dev": true }, - "read-pkg": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/read-pkg/-/read-pkg-1.1.0.tgz", - "integrity": "sha1-9f+qXs0pyzHAR0vKfXVra7KePyg=", - "dev": true, - "requires": { - "load-json-file": "^1.0.0", - "normalize-package-data": "^2.3.2", - "path-type": "^1.0.0" - } - }, - "read-pkg-up": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/read-pkg-up/-/read-pkg-up-1.0.1.tgz", - "integrity": "sha1-nWPBMnbAZZGNV/ACpX9AobZD+wI=", - "dev": true, - "requires": { - "find-up": "^1.0.0", - "read-pkg": "^1.0.0" - } - }, "readable-stream": { "version": "2.1.5", "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.1.5.tgz", @@ -6960,10 +6754,19 @@ "readable-stream": "^2.0.2" } }, + "rechoir": { + "version": "0.6.2", + "resolved": "https://registry.npmjs.org/rechoir/-/rechoir-0.6.2.tgz", + "integrity": "sha1-hSBLVNuoLVdC4oyWdW70OvUOM4Q=", + "dev": true, + "requires": { + "resolve": "^1.1.6" + } + }, "regenerator-runtime": { - "version": "0.10.5", - "resolved": "https://registry.npmjs.org/regenerator-runtime/-/regenerator-runtime-0.10.5.tgz", - "integrity": "sha1-M2w+/BIgrc7dosn6tntaeVWjNlg=", + "version": "0.13.3", + "resolved": "https://registry.npmjs.org/regenerator-runtime/-/regenerator-runtime-0.13.3.tgz", + "integrity": "sha512-naKIZz2GQ8JWh///G7L3X6LaQUAMp2lvb1rvwwsURe/VXwD6VMfr+/1NuNw3ag8v2kY1aQ/go5SNn79O9JU7yw==", "dev": true }, "regex-not": { @@ -6976,6 +6779,15 @@ "safe-regex": "^1.1.0" } }, + "release-zalgo": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/release-zalgo/-/release-zalgo-1.0.0.tgz", + "integrity": "sha1-CXALflB0Mpc5Mw5TXFqQ+2eFFzA=", + "dev": true, + "requires": { + "es6-error": "^4.0.1" + } + }, "remove-trailing-separator": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/remove-trailing-separator/-/remove-trailing-separator-1.1.0.tgz", @@ -7015,16 +6827,6 @@ "path-parse": "^1.0.6" } }, - "resolve-dir": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/resolve-dir/-/resolve-dir-1.0.1.tgz", - "integrity": "sha1-eaQGRMNivoLybv/nOcm7U4IEb0M=", - "dev": true, - "requires": { - "expand-tilde": "^2.0.0", - "global-modules": "^1.0.0" - } - }, "resolve-from": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-3.0.0.tgz", @@ -7037,6 +6839,15 @@ "integrity": "sha1-LGN/53yJOv0qZj/iGqkIAGjiBSo=", "dev": true }, + "responselike": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/responselike/-/responselike-1.0.2.tgz", + "integrity": "sha1-kYcg7ztjHFZCvgaPFa3lpG9Loec=", + "dev": true, + "requires": { + "lowercase-keys": "^1.0.0" + } + }, "ret": { "version": "0.1.15", "resolved": "https://registry.npmjs.org/ret/-/ret-0.1.15.tgz", @@ -7074,6 +6885,25 @@ "inherits": "^2.0.1" } }, + "rollup": { + "version": "1.26.3", + "resolved": "https://registry.npmjs.org/rollup/-/rollup-1.26.3.tgz", + "integrity": "sha512-8MhY/M8gnv3Q/pQQSWYWzbeJ5J1C5anCNY5BK1kV8Yzw9RFS0FF4lbLt+uyPO3wLKWXSXrhAL5pWL85TZAh+Sw==", + "dev": true, + "requires": { + "@types/estree": "*", + "@types/node": "*", + "acorn": "^7.1.0" + }, + "dependencies": { + "acorn": { + "version": "7.1.0", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-7.1.0.tgz", + "integrity": "sha512-kL5CuoXA/dgxlBbVrflsflzQ3PAas7RYZB52NOm/6839iVYJgKMJ3cQJD+t2i5+qFa8h3MDpEOJiS64E8JLnSQ==", + "dev": true + } + } + }, "run-queue": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/run-queue/-/run-queue-1.0.3.tgz", @@ -7111,9 +6941,9 @@ "dev": true }, "scheduler": { - "version": "0.13.4", - "resolved": "https://registry.npmjs.org/scheduler/-/scheduler-0.13.4.tgz", - "integrity": "sha512-cvSOlRPxOHs5dAhP9yiS/6IDmVAVxmk33f0CtTJRkmUWcb1Us+t7b1wqdzoC0REw2muC9V5f1L/w5R5uKGaepA==", + "version": "0.17.0", + "resolved": "https://registry.npmjs.org/scheduler/-/scheduler-0.17.0.tgz", + "integrity": "sha512-7rro8Io3tnCPuY4la/NuI5F2yfESpnfZyT6TtkXnSWVkcu0BCDJ+8gk5ozUaFaxpIyNuWAPXrH0yFcSi28fnDA==", "dev": true, "requires": { "loose-envify": "^1.1.0", @@ -7138,9 +6968,9 @@ "dev": true }, "send": { - "version": "0.16.2", - "resolved": "https://registry.npmjs.org/send/-/send-0.16.2.tgz", - "integrity": "sha512-E64YFPUssFHEFBvpbbjr44NCLtI1AohxQ8ZSiJjQLskAdKuriYEP6VyGEsRDH8ScozGpkaX1BGvhanqCwkcEZw==", + "version": "0.17.1", + "resolved": "https://registry.npmjs.org/send/-/send-0.17.1.tgz", + "integrity": "sha512-BsVKsiGcQMFwT8UxypobUKyv7irCNRHk1T0G680vk88yf6LBByGcZJOTJCrTP2xVN6yI+XjPJcNuE3V4fT9sAg==", "dev": true, "requires": { "debug": "2.6.9", @@ -7150,12 +6980,20 @@ "escape-html": "~1.0.3", "etag": "~1.8.1", "fresh": "0.5.2", - "http-errors": "~1.6.2", - "mime": "1.4.1", - "ms": "2.0.0", + "http-errors": "~1.7.2", + "mime": "1.6.0", + "ms": "2.1.1", "on-finished": "~2.3.0", - "range-parser": "~1.2.0", - "statuses": "~1.4.0" + "range-parser": "~1.2.1", + "statuses": "~1.5.0" + }, + "dependencies": { + "ms": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.1.tgz", + "integrity": "sha512-tgp+dl5cGk28utYktBsrFqA7HKgrhgPsg6Z/EfhWI4gl1Hwq8B/GmY/0oXZ6nF8hDVesS/FpnYaD/kOWhYQvyg==", + "dev": true + } } }, "serialize-javascript": { @@ -7165,15 +7003,15 @@ "dev": true }, "serve-static": { - "version": "1.13.2", - "resolved": "https://registry.npmjs.org/serve-static/-/serve-static-1.13.2.tgz", - "integrity": "sha512-p/tdJrO4U387R9oMjb1oj7qSMaMfmOyd4j9hOFoxZe2baQszgHcSWjuya/CiT5kgZZKRudHNOA0pYXOl8rQ5nw==", + "version": "1.14.1", + "resolved": "https://registry.npmjs.org/serve-static/-/serve-static-1.14.1.tgz", + "integrity": "sha512-JMrvUwE54emCYWlTI+hGrGv5I8dEwmco/00EvkzIIsR7MqrHonbD9pO2MOfFnpFntl7ecpZs+3mW+XbQZu9QCg==", "dev": true, "requires": { "encodeurl": "~1.0.2", "escape-html": "~1.0.3", - "parseurl": "~1.3.2", - "send": "0.16.2" + "parseurl": "~1.3.3", + "send": "0.17.1" } }, "set-blocking": { @@ -7183,9 +7021,9 @@ "dev": true }, "set-value": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/set-value/-/set-value-2.0.0.tgz", - "integrity": "sha512-hw0yxk9GT/Hr5yJEYnHNKYXkIA8mVJgd9ditYZCe16ZczcaELYYcfvaXesNACk2O8O0nTiPQcQhGUQj8JLzeeg==", + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/set-value/-/set-value-2.0.1.tgz", + "integrity": "sha512-JxHc1weCN68wRY0fhCoXpyK55m/XPHafOmK4UWD7m2CI14GMcFypt4w/0+NV5f/ZMby2F6S2wwA7fgynh9gWSw==", "dev": true, "requires": { "extend-shallow": "^2.0.1", @@ -7212,9 +7050,9 @@ "dev": true }, "setprototypeof": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/setprototypeof/-/setprototypeof-1.1.0.tgz", - "integrity": "sha512-BvE/TwpZX4FXExxOxZyRGQQv651MSwmWKZGqvmPcRIjDqWub67kTKuIMx43cZZrS/cBBzwBcNDWoFxt2XEFIpQ==", + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/setprototypeof/-/setprototypeof-1.1.1.tgz", + "integrity": "sha512-JvdAWfbXeIGaZ9cILp38HntZSFSo3mWg6xGcJJsd+d4aRMOqauag1C63dJfDw7OaMYwEbHMOxEZ1lqVRYP2OAw==", "dev": true }, "sha.js": { @@ -7242,6 +7080,17 @@ "integrity": "sha1-2kL0l0DAtC2yypcoVxyxkMmO/qM=", "dev": true }, + "shelljs": { + "version": "0.8.3", + "resolved": "https://registry.npmjs.org/shelljs/-/shelljs-0.8.3.tgz", + "integrity": "sha512-fc0BKlAWiLpwZljmOvAOTE/gXawtCoNrP5oaY7KIaQbbyHeQVg01pSEuEGvGh3HEdBU4baCD7wQBwADmM/7f7A==", + "dev": true, + "requires": { + "glob": "^7.0.0", + "interpret": "^1.0.0", + "rechoir": "^0.6.2" + } + }, "signal-exit": { "version": "3.0.2", "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.2.tgz", @@ -7475,11 +7324,13 @@ "dev": true }, "slice-ansi": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/slice-ansi/-/slice-ansi-1.0.0.tgz", - "integrity": "sha512-POqxBK6Lb3q6s047D/XsDVNPnF9Dl8JSaqe9h9lURl0OdNqy/ujDrOiIHtsqXMGbWWTIomRzAMaTyawAU//Reg==", + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/slice-ansi/-/slice-ansi-2.1.0.tgz", + "integrity": "sha512-Qu+VC3EwYLldKa1fCxuuvULvSJOKEgk9pi8dZeCVK7TqBfUNTH4sFkk4joj8afVSfAYgJoSOetjx9QWOJ5mYoQ==", "dev": true, "requires": { + "ansi-styles": "^3.2.0", + "astral-regex": "^1.0.0", "is-fullwidth-code-point": "^2.0.0" } }, @@ -7590,6 +7441,15 @@ } } }, + "sort-keys": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/sort-keys/-/sort-keys-2.0.0.tgz", + "integrity": "sha1-ZYU1WEhh7JfXMNbPQYIuH1ZoQSg=", + "dev": true, + "requires": { + "is-plain-obj": "^1.0.0" + } + }, "source-list-map": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/source-list-map/-/source-list-map-2.0.1.tgz", @@ -7639,6 +7499,55 @@ "integrity": "sha1-PpNdfd1zYxuXZZlW1VEo6HtQhKM=", "dev": true }, + "spawn-wrap": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/spawn-wrap/-/spawn-wrap-2.0.0.tgz", + "integrity": "sha512-EeajNjfN9zMnULLwhZZQU3GWBoFNkbngTUPfaawT4RkMiviTxcX0qfhVbGey39mfctfDHkWtuecgQ8NJcyQWHg==", + "dev": true, + "requires": { + "foreground-child": "^2.0.0", + "is-windows": "^1.0.2", + "make-dir": "^3.0.0", + "rimraf": "^3.0.0", + "signal-exit": "^3.0.2", + "which": "^2.0.1" + }, + "dependencies": { + "make-dir": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/make-dir/-/make-dir-3.0.0.tgz", + "integrity": "sha512-grNJDhb8b1Jm1qeqW5R/O63wUo4UXo2v2HMic6YT9i/HBlF93S8jkMgH7yugvY9ABDShH4VZMn8I+U8+fCNegw==", + "dev": true, + "requires": { + "semver": "^6.0.0" + } + }, + "rimraf": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-3.0.0.tgz", + "integrity": "sha512-NDGVxTsjqfunkds7CqsOiEnxln4Bo7Nddl3XhS4pXg5OzwkLqJ971ZVAAnB+DDLnF76N+VnDEiBHaVV8I06SUg==", + "dev": true, + "requires": { + "glob": "^7.1.3" + } + }, + "semver": { + "version": "6.3.0", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", + "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==", + "dev": true + }, + "which": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz", + "integrity": "sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==", + "dev": true, + "requires": { + "isexe": "^2.0.0" + } + } + } + }, "spdx-correct": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/spdx-correct/-/spdx-correct-3.1.0.tgz", @@ -7723,9 +7632,9 @@ } }, "statuses": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/statuses/-/statuses-1.4.0.tgz", - "integrity": "sha512-zhSCtt8v2NDrRlPQpCNtw/heZLtfUDqxBM1udqikb/Hbk52LK4nQSwr10u77iopCW5LsyHpuXS0GnEc48mLeew==", + "version": "1.5.0", + "resolved": "https://registry.npmjs.org/statuses/-/statuses-1.5.0.tgz", + "integrity": "sha1-Fhx9rBd2Wf2YEfQ3cfqZOBR4Yow=", "dev": true }, "stream-browserify": { @@ -7799,6 +7708,12 @@ "integrity": "sha1-1cdSgl5TZ+eG944Y5EXqIjoVWVI=", "dev": true }, + "strict-uri-encode": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/strict-uri-encode/-/strict-uri-encode-1.1.0.tgz", + "integrity": "sha1-J5siXfHVgrH1TmWt3UNS4Y+qBxM=", + "dev": true + }, "string-width": { "version": "2.1.1", "resolved": "https://registry.npmjs.org/string-width/-/string-width-2.1.1.tgz", @@ -7825,13 +7740,10 @@ } }, "strip-bom": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/strip-bom/-/strip-bom-2.0.0.tgz", - "integrity": "sha1-YhmoVhZSBJHzV4i9vxRHqZx+aw4=", - "dev": true, - "requires": { - "is-utf8": "^0.2.0" - } + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/strip-bom/-/strip-bom-4.0.0.tgz", + "integrity": "sha512-3xurFv5tEgii33Zi8Jtp55wEIILR9eh34FAW00PZf+JnSsTmV/ioewSgQl97JHvgjoRGwPShsWm+IdrxB35d0w==", + "dev": true }, "strip-eof": { "version": "1.0.0", @@ -7911,17 +7823,55 @@ } }, "table": { - "version": "4.0.3", - "resolved": "https://registry.npmjs.org/table/-/table-4.0.3.tgz", - "integrity": "sha512-S7rnFITmBH1EnyKcvxBh1LjYeQMmnZtCXSEbHcH6S0NoKit24ZuFO/T1vDcLdYsLQkM188PVVhQmzKIuThNkKg==", + "version": "5.4.6", + "resolved": "https://registry.npmjs.org/table/-/table-5.4.6.tgz", + "integrity": "sha512-wmEc8m4fjnob4gt5riFRtTu/6+4rSe12TpAELNSqHMfF3IqnA+CH37USM6/YR3qRZv7e56kAEAtd6nKZaxe0Ug==", "dev": true, "requires": { - "ajv": "^6.0.1", - "ajv-keywords": "^3.0.0", - "chalk": "^2.1.0", - "lodash": "^4.17.4", - "slice-ansi": "1.0.0", - "string-width": "^2.1.1" + "ajv": "^6.10.2", + "lodash": "^4.17.14", + "slice-ansi": "^2.1.0", + "string-width": "^3.0.0" + }, + "dependencies": { + "ajv": { + "version": "6.10.2", + "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.10.2.tgz", + "integrity": "sha512-TXtUUEYHuaTEbLZWIKUr5pmBuhDLy+8KYtPYdcV8qC+pOZL+NKqYwvWSRrVXHn+ZmRRAu8vJTAznH7Oag6RVRw==", + "dev": true, + "requires": { + "fast-deep-equal": "^2.0.1", + "fast-json-stable-stringify": "^2.0.0", + "json-schema-traverse": "^0.4.1", + "uri-js": "^4.2.2" + } + }, + "ansi-regex": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-4.1.0.tgz", + "integrity": "sha512-1apePfXM1UOSqw0o9IiFAovVz9M5S1Dg+4TrDwfMewQ6p/rmMueb7tWZjQ1rx4Loy1ArBggoqGpfqqdI4rondg==", + "dev": true + }, + "string-width": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-3.1.0.tgz", + "integrity": "sha512-vafcv6KjVZKSgz06oM/H6GDBrAtz8vdhQakGjFIvNrHA6y3HCF1CInLy+QLq8dTJPQ1b+KDUqDFctkdRW44e1w==", + "dev": true, + "requires": { + "emoji-regex": "^7.0.1", + "is-fullwidth-code-point": "^2.0.0", + "strip-ansi": "^5.1.0" + } + }, + "strip-ansi": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-5.2.0.tgz", + "integrity": "sha512-DuRs1gKbBqsMKIZlrffwlug8MHkcnpjs5VPmL1PAh+mA30U0DTotfDZ0d2UUsXpPmPmMMJ6W773MaA3J+lbiWA==", + "dev": true, + "requires": { + "ansi-regex": "^4.1.0" + } + } } }, "tapable": { @@ -7973,6 +7923,33 @@ } } }, + "test-exclude": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/test-exclude/-/test-exclude-6.0.0.tgz", + "integrity": "sha512-cAGWPIyOHU6zlmg88jwm7VRyXnMN7iV68OGAbYDk/Mh/xC/pzVPlQtY6ngoIH/5/tciuhGfvESU8GrHrcxD56w==", + "dev": true, + "requires": { + "@istanbuljs/schema": "^0.1.2", + "glob": "^7.1.4", + "minimatch": "^3.0.4" + }, + "dependencies": { + "glob": { + "version": "7.1.6", + "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.6.tgz", + "integrity": "sha512-LwaxwyZ72Lk7vZINtNNrywX0ZuLyStrdDtabefZKAY5ZGJhVtgdznluResxNmPitE0SAO+O26sWTHeKSI2wMBA==", + "dev": true, + "requires": { + "fs.realpath": "^1.0.0", + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "^3.0.4", + "once": "^1.3.0", + "path-is-absolute": "^1.0.0" + } + } + } + }, "through": { "version": "2.3.8", "resolved": "https://registry.npmjs.org/through/-/through-2.3.8.tgz", @@ -8096,18 +8073,18 @@ "repeat-string": "^1.6.1" } }, + "toidentifier": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/toidentifier/-/toidentifier-1.0.0.tgz", + "integrity": "sha512-yaOH/Pk/VEhBWWTlhI+qXxDFXlejDGcQipMlyxda9nthulaxLZUNcUqFxokp0vcYnvteJln5FNQDRrxj3YcbVw==", + "dev": true + }, "traverse": { "version": "0.3.9", "resolved": "https://registry.npmjs.org/traverse/-/traverse-0.3.9.tgz", "integrity": "sha1-cXuPIgzAu3tE5AUUwisui7xw2Lk=", "dev": true }, - "trim-right": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/trim-right/-/trim-right-1.0.1.tgz", - "integrity": "sha1-yy4SAwZ+DI3h9hQJS5/kVwTqYAM=", - "dev": true - }, "tryer": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/tryer/-/tryer-1.0.1.tgz", @@ -8126,14 +8103,20 @@ "integrity": "sha1-oVe6QC2iTpv5V/mqadUk7tQpAaY=", "dev": true }, + "type-fest": { + "version": "0.8.1", + "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.8.1.tgz", + "integrity": "sha512-4dbzIzqvjtgiM5rw1k5rEHtBANKmdudhGyBEajN01fEyhaAIhsoKNy6y7+IN93IfpFtwY9iqi7kD+xwKhQsNJA==", + "dev": true + }, "type-is": { - "version": "1.6.16", - "resolved": "https://registry.npmjs.org/type-is/-/type-is-1.6.16.tgz", - "integrity": "sha512-HRkVv/5qY2G6I8iab9cI7v1bOIdhm94dVjQCPFElW9W+3GeDOSHmy2EBYe4VTApuzolPcmgFTN3ftVJRKR2J9Q==", + "version": "1.6.18", + "resolved": "https://registry.npmjs.org/type-is/-/type-is-1.6.18.tgz", + "integrity": "sha512-TkRKr9sUTxEH8MdfuCSP7VizJyzRNMjj2J2do2Jr3Kym598JVdEksuzPQCnlFPW4ky9Q+iA+ma9BGm06XQBy8g==", "dev": true, "requires": { "media-typer": "0.3.0", - "mime-types": "~2.1.18" + "mime-types": "~2.1.24" } }, "typedarray": { @@ -8142,20 +8125,41 @@ "integrity": "sha1-hnrHTjhkGHsdPUfZlqeOxciDB3c=", "dev": true }, + "typedarray-to-buffer": { + "version": "3.1.5", + "resolved": "https://registry.npmjs.org/typedarray-to-buffer/-/typedarray-to-buffer-3.1.5.tgz", + "integrity": "sha512-zdu8XMNEDepKKR+XYOXAVPtWui0ly0NtohUscw+UmaHiAWT8hrV1rr//H6V+0DvJ3OQ19S979M0laLfX8rm82Q==", + "dev": true, + "requires": { + "is-typedarray": "^1.0.0" + } + }, + "typescript": { + "version": "3.6.4", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-3.6.4.tgz", + "integrity": "sha512-unoCll1+l+YK4i4F8f22TaNVPRHcD9PA3yCuZ8g5e0qGqlVlJ/8FSateOLLSagn+Yg5+ZwuPkL8LFUc0Jcvksg==", + "dev": true + }, + "typescript-compiler": { + "version": "1.4.1-2", + "resolved": "https://registry.npmjs.org/typescript-compiler/-/typescript-compiler-1.4.1-2.tgz", + "integrity": "sha1-uk99si2RU0oZKdkACdzhYety/T8=", + "dev": true + }, "uglify-js": { - "version": "3.4.9", - "resolved": "https://registry.npmjs.org/uglify-js/-/uglify-js-3.4.9.tgz", - "integrity": "sha512-8CJsbKOtEbnJsTyv6LE6m6ZKniqMiFWmm9sRbopbkGs3gMPPfd3Fh8iIA4Ykv5MgaTbqHr4BaoGLJLZNhsrW1Q==", + "version": "3.6.7", + "resolved": "https://registry.npmjs.org/uglify-js/-/uglify-js-3.6.7.tgz", + "integrity": "sha512-4sXQDzmdnoXiO+xvmTzQsfIiwrjUCSA95rSP4SEd8tDb51W2TiDOlL76Hl+Kw0Ie42PSItCW8/t6pBNCF2R48A==", "dev": true, "requires": { - "commander": "~2.17.1", + "commander": "~2.20.3", "source-map": "~0.6.1" }, "dependencies": { "commander": { - "version": "2.17.1", - "resolved": "https://registry.npmjs.org/commander/-/commander-2.17.1.tgz", - "integrity": "sha512-wPMUt6FnH2yzG95SA6mzjQOEKUU3aLaDEmzs1ti+1E9h+CsrZghRlqEM/EJ4KscsQVG8uNN4uVreUeT8+drlgg==", + "version": "2.20.3", + "resolved": "https://registry.npmjs.org/commander/-/commander-2.20.3.tgz", + "integrity": "sha512-GpVkmM8vF2vQUkj2LvZmD35JxeJOLCwJ9cUkugyk2nuhbv3+mJvpLYYt+0+USMxE+oj+ey/lJEnhZw75x/OMcQ==", "dev": true }, "source-map": { @@ -8166,45 +8170,16 @@ } } }, - "underscore": { - "version": "1.9.1", - "resolved": "https://registry.npmjs.org/underscore/-/underscore-1.9.1.tgz", - "integrity": "sha512-5/4etnCkd9c8gwgowi5/om/mYO5ajCaOgdzj/oW+0eQV9WxKBDZw5+ycmKmeaTXjInS/W0BzpGLo2xR2aBwZdg==", - "dev": true - }, "union-value": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/union-value/-/union-value-1.0.0.tgz", - "integrity": "sha1-XHHDTLW61dzr4+oM0IIHulqhrqQ=", + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/union-value/-/union-value-1.0.1.tgz", + "integrity": "sha512-tJfXmxMeWYnczCVs7XAEvIV7ieppALdyepWMkHkwciRpZraG/xwT+s2JN8+pr1+8jCRf80FFzvr+MpQeeoF4Xg==", "dev": true, "requires": { "arr-union": "^3.1.0", "get-value": "^2.0.6", "is-extendable": "^0.1.1", - "set-value": "^0.4.3" - }, - "dependencies": { - "extend-shallow": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", - "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", - "dev": true, - "requires": { - "is-extendable": "^0.1.0" - } - }, - "set-value": { - "version": "0.4.3", - "resolved": "https://registry.npmjs.org/set-value/-/set-value-0.4.3.tgz", - "integrity": "sha1-fbCPnT0i3H945Trzw79GZuzfzPE=", - "dev": true, - "requires": { - "extend-shallow": "^2.0.1", - "is-extendable": "^0.1.1", - "is-plain-object": "^2.0.1", - "to-object-path": "^0.3.0" - } - } + "set-value": "^2.0.1" } }, "uniq": { @@ -8238,12 +8213,12 @@ } }, "universal-user-agent": { - "version": "2.0.3", - "resolved": "https://registry.npmjs.org/universal-user-agent/-/universal-user-agent-2.0.3.tgz", - "integrity": "sha512-eRHEHhChCBHrZsA4WEhdgiOKgdvgrMIHwnwnqD0r5C6AO8kwKcG7qSku3iXdhvHL3YvsS9ZkSGN8h/hIpoFC8g==", + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/universal-user-agent/-/universal-user-agent-4.0.0.tgz", + "integrity": "sha512-eM8knLpev67iBDizr/YtqkJsF3GK8gzDc6st/WKzrTuPtcsOKW/0IdL4cnMBsU69pOx0otavLWBDGTwg+dB0aA==", "dev": true, "requires": { - "os-name": "^3.0.0" + "os-name": "^3.1.0" } }, "universalify": { @@ -8305,9 +8280,9 @@ } }, "unzipper": { - "version": "0.8.14", - "resolved": "https://registry.npmjs.org/unzipper/-/unzipper-0.8.14.tgz", - "integrity": "sha512-8rFtE7EP5ssOwGpN2dt1Q4njl0N1hUXJ7sSPz0leU2hRdq6+pra57z4YPBlVqm40vcgv6ooKZEAx48fMTv9x4w==", + "version": "0.9.15", + "resolved": "https://registry.npmjs.org/unzipper/-/unzipper-0.9.15.tgz", + "integrity": "sha512-2aaUvO4RAeHDvOCuEtth7jrHFaCKTSXPqUkXwADaLBzGbgZGzUDccoEdJ5lW+3RmfpOZYNx0Rw6F6PUzM6caIA==", "dev": true, "requires": { "big-integer": "^1.6.17", @@ -8315,10 +8290,42 @@ "bluebird": "~3.4.1", "buffer-indexof-polyfill": "~1.0.0", "duplexer2": "~0.1.4", - "fstream": "~1.0.10", + "fstream": "^1.0.12", "listenercount": "~1.0.1", - "readable-stream": "~2.1.5", + "readable-stream": "~2.3.6", "setimmediate": "~1.0.4" + }, + "dependencies": { + "process-nextick-args": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-2.0.1.tgz", + "integrity": "sha512-3ouUOpQhtgrbOa17J7+uxOTpITYWaGP7/AhoR3+A+/1e9skrzelGi/dXzEYyvbxubEF6Wn2ypscTKiKJFFn1ag==", + "dev": true + }, + "readable-stream": { + "version": "2.3.6", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.6.tgz", + "integrity": "sha512-tQtKA9WIAhBF3+VLAseyMqZeBjW0AHJoxOtYqSUZNJxauErmLbVm2FW1y+J/YA9dUrAC39ITejlZWhVIwawkKw==", + "dev": true, + "requires": { + "core-util-is": "~1.0.0", + "inherits": "~2.0.3", + "isarray": "~1.0.0", + "process-nextick-args": "~2.0.0", + "safe-buffer": "~5.1.1", + "string_decoder": "~1.1.1", + "util-deprecate": "~1.0.1" + } + }, + "string_decoder": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", + "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", + "dev": true, + "requires": { + "safe-buffer": "~5.1.0" + } + } } }, "upath": { @@ -8361,20 +8368,14 @@ } }, "url-parse-lax": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/url-parse-lax/-/url-parse-lax-1.0.0.tgz", - "integrity": "sha1-evjzA2Rem9eaJy56FKxovAYJ2nM=", + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/url-parse-lax/-/url-parse-lax-3.0.0.tgz", + "integrity": "sha1-FrXK/Afb42dsGxmZF3gj1lA6yww=", "dev": true, "requires": { - "prepend-http": "^1.0.1" + "prepend-http": "^2.0.0" } }, - "url-template": { - "version": "2.0.8", - "resolved": "https://registry.npmjs.org/url-template/-/url-template-2.0.8.tgz", - "integrity": "sha1-/FZaPMy/93MMd19WQflVV5FDnyE=", - "dev": true - }, "url-to-options": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/url-to-options/-/url-to-options-1.0.1.tgz", @@ -8418,6 +8419,12 @@ "integrity": "sha1-n5VxD1CiZ5R7LMwSR0HBAoQn5xM=", "dev": true }, + "uuid": { + "version": "3.3.3", + "resolved": "https://registry.npmjs.org/uuid/-/uuid-3.3.3.tgz", + "integrity": "sha512-pW0No1RGHgzlpHJO1nsVrHKpOEIxkGg1xB+v0ZmdNH5OAeAwzAVrCnI2/6Mtx+Uys6iaylxa+D3g4j63IKKjSQ==", + "dev": true + }, "validate-npm-package-license": { "version": "3.0.4", "resolved": "https://registry.npmjs.org/validate-npm-package-license/-/validate-npm-package-license-3.0.4.tgz", @@ -8493,9 +8500,9 @@ } }, "webpack-bundle-analyzer": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/webpack-bundle-analyzer/-/webpack-bundle-analyzer-3.1.0.tgz", - "integrity": "sha512-nyDyWEs7C6DZlgvu1pR1zzJfIWSiGPbtaByZr8q+Fd2xp70FuM/8ngCJzj3Er1TYRLSFmp1F1OInbEm4DZH8NA==", + "version": "3.5.0", + "resolved": "https://registry.npmjs.org/webpack-bundle-analyzer/-/webpack-bundle-analyzer-3.5.0.tgz", + "integrity": "sha512-NzueflueLSJxWGzDlMq5oUV+P8Qoq6yiaQlXGCbDYUpHEKlmzWdPLBJ4k/B6HTdAP/vHM8ply1Fx08mDnY+S8Q==", "dev": true, "requires": { "acorn": "^6.0.7", @@ -8507,7 +8514,7 @@ "express": "^4.16.3", "filesize": "^3.6.1", "gzip-size": "^5.0.0", - "lodash": "^4.17.10", + "lodash": "^4.17.15", "mkdirp": "^0.5.1", "opener": "^1.5.1", "ws": "^6.0.0" @@ -8541,9 +8548,9 @@ } }, "which-module": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/which-module/-/which-module-1.0.0.tgz", - "integrity": "sha1-u6Y8qGGUiZT/MHc2CJ47lgJsKk8=", + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/which-module/-/which-module-2.0.0.tgz", + "integrity": "sha1-2e8H3Od7mQK4o6j6SzHD4/fm6Ho=", "dev": true }, "wide-align": { @@ -8555,19 +8562,13 @@ "string-width": "^1.0.2 || 2" } }, - "window-size": { - "version": "0.2.0", - "resolved": "https://registry.npmjs.org/window-size/-/window-size-0.2.0.tgz", - "integrity": "sha1-tDFbtCFKPXBY6+7okuE/ok2YsHU=", - "dev": true - }, "windows-release": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/windows-release/-/windows-release-3.1.0.tgz", - "integrity": "sha512-hBb7m7acFgQPQc222uEQTmdcGLeBmQLNLFIh0rDk3CwFOBrfjefLzEfEfmpMq8Af/n/GnFf3eYf203FY1PmudA==", + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/windows-release/-/windows-release-3.2.0.tgz", + "integrity": "sha512-QTlz2hKLrdqukrsapKsINzqMgOUpQW268eJ0OaOpJN32h272waxR9fkB9VoWRtK7uKHG5EHJcTXQBD8XZVJkFA==", "dev": true, "requires": { - "execa": "^0.10.0" + "execa": "^1.0.0" } }, "worker-farm": { @@ -8632,6 +8633,18 @@ "integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=", "dev": true }, + "write-file-atomic": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/write-file-atomic/-/write-file-atomic-3.0.1.tgz", + "integrity": "sha512-JPStrIyyVJ6oCSz/691fAjFtefZ6q+fP6tm+OS4Qw6o+TGQxNp1ziY2PgS+X/m0V8OWhZiO/m4xSj+Pr4RrZvw==", + "dev": true, + "requires": { + "imurmurhash": "^0.1.4", + "is-typedarray": "^1.0.0", + "signal-exit": "^3.0.2", + "typedarray-to-buffer": "^3.1.5" + } + }, "ws": { "version": "6.2.0", "resolved": "https://registry.npmjs.org/ws/-/ws-6.2.0.tgz", @@ -8660,191 +8673,134 @@ "dev": true }, "yargs": { - "version": "4.8.1", - "resolved": "https://registry.npmjs.org/yargs/-/yargs-4.8.1.tgz", - "integrity": "sha1-wMQpJMpKqmsObaFznfshZDn53cA=", + "version": "12.0.5", + "resolved": "https://registry.npmjs.org/yargs/-/yargs-12.0.5.tgz", + "integrity": "sha512-Lhz8TLaYnxq/2ObqHDql8dX8CJi97oHxrjUcYtzKbbykPtVW9WB+poxI+NM2UIzsMgNCZTIf0AQwsjK5yMAqZw==", "dev": true, "requires": { - "cliui": "^3.2.0", - "decamelize": "^1.1.1", + "cliui": "^4.0.0", + "decamelize": "^1.2.0", + "find-up": "^3.0.0", "get-caller-file": "^1.0.1", - "lodash.assign": "^4.0.3", - "os-locale": "^1.4.0", - "read-pkg-up": "^1.0.1", + "os-locale": "^3.0.0", "require-directory": "^2.1.1", "require-main-filename": "^1.0.1", "set-blocking": "^2.0.0", - "string-width": "^1.0.1", - "which-module": "^1.0.0", - "window-size": "^0.2.0", - "y18n": "^3.2.1", - "yargs-parser": "^2.4.1" - }, - "dependencies": { - "ansi-regex": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-2.1.1.tgz", - "integrity": "sha1-w7M6te42DYbg5ijwRorn7yfWVN8=", - "dev": true - }, - "is-fullwidth-code-point": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-1.0.0.tgz", - "integrity": "sha1-754xOG8DGn8NZDr4L95QxFfvAMs=", - "dev": true, - "requires": { - "number-is-nan": "^1.0.0" - } - }, - "string-width": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/string-width/-/string-width-1.0.2.tgz", - "integrity": "sha1-EYvfW4zcUaKn5w0hHgfisLmxB9M=", - "dev": true, - "requires": { - "code-point-at": "^1.0.0", - "is-fullwidth-code-point": "^1.0.0", - "strip-ansi": "^3.0.0" - } - }, - "strip-ansi": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.1.tgz", - "integrity": "sha1-ajhfuIU9lS1f8F0Oiq+UJ43GPc8=", - "dev": true, - "requires": { - "ansi-regex": "^2.0.0" - } - } + "string-width": "^2.0.0", + "which-module": "^2.0.0", + "y18n": "^3.2.1 || ^4.0.0", + "yargs-parser": "^11.1.1" } }, "yargs-parser": { - "version": "2.4.1", - "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-2.4.1.tgz", - "integrity": "sha1-hVaN488VD/SfpRgl8DqMiA3cxcQ=", + "version": "11.1.1", + "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-11.1.1.tgz", + "integrity": "sha512-C6kB/WJDiaxONLJQnF8ccx9SEeoTTLek8RVbaOIsrAUS8VrBEXfmeSnCZxygc+XC2sNMBIwOOnfcxiynjHsVSQ==", "dev": true, "requires": { - "camelcase": "^3.0.0", - "lodash.assign": "^4.0.6" + "camelcase": "^5.0.0", + "decamelize": "^1.2.0" } }, "yargs-unparser": { - "version": "1.5.0", - "resolved": "https://registry.npmjs.org/yargs-unparser/-/yargs-unparser-1.5.0.tgz", - "integrity": "sha512-HK25qidFTCVuj/D1VfNiEndpLIeJN78aqgR23nL3y4N0U/91cOAzqfHlF8n2BvoNDcZmJKin3ddNSvOxSr8flw==", + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/yargs-unparser/-/yargs-unparser-1.6.0.tgz", + "integrity": "sha512-W9tKgmSn0DpSatfri0nx52Joq5hVXgeLiqR/5G0sZNDoLZFOr/xjBUDcShCOGNsBnEMNo1KAMBkTej1Hm62HTw==", "dev": true, "requires": { "flat": "^4.1.0", - "lodash": "^4.17.11", - "yargs": "^12.0.5" + "lodash": "^4.17.15", + "yargs": "^13.3.0" }, "dependencies": { - "camelcase": { - "version": "5.2.0", - "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-5.2.0.tgz", - "integrity": "sha512-IXFsBS2pC+X0j0N/GE7Dm7j3bsEBp+oTpb7F50dwEVX7rf3IgwO9XatnegTsDtniKCUtEJH4fSU6Asw7uoVLfQ==", + "ansi-regex": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-4.1.0.tgz", + "integrity": "sha512-1apePfXM1UOSqw0o9IiFAovVz9M5S1Dg+4TrDwfMewQ6p/rmMueb7tWZjQ1rx4Loy1ArBggoqGpfqqdI4rondg==", "dev": true }, "cliui": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/cliui/-/cliui-4.1.0.tgz", - "integrity": "sha512-4FG+RSG9DL7uEwRUZXZn3SS34DiDPfzP0VOiEwtUWlE+AR2EIg+hSyvrIgUUfhdgR/UkAeW2QHgeP+hWrXs7jQ==", + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/cliui/-/cliui-5.0.0.tgz", + "integrity": "sha512-PYeGSEmmHM6zvoef2w8TPzlrnNpXIjTipYK780YswmIP9vjxmd6Y2a3CB2Ks6/AU8NHjZugXvo8w3oWM2qnwXA==", "dev": true, "requires": { - "string-width": "^2.1.1", - "strip-ansi": "^4.0.0", - "wrap-ansi": "^2.0.0" + "string-width": "^3.1.0", + "strip-ansi": "^5.2.0", + "wrap-ansi": "^5.1.0" } }, - "execa": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/execa/-/execa-1.0.0.tgz", - "integrity": "sha512-adbxcyWV46qiHyvSp50TKt05tB4tK3HcmF7/nxfAdhnox83seTDbwnaqKO4sXRy7roHAIFqJP/Rw/AuEbX61LA==", - "dev": true, - "requires": { - "cross-spawn": "^6.0.0", - "get-stream": "^4.0.0", - "is-stream": "^1.1.0", - "npm-run-path": "^2.0.0", - "p-finally": "^1.0.0", - "signal-exit": "^3.0.0", - "strip-eof": "^1.0.0" - } + "get-caller-file": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/get-caller-file/-/get-caller-file-2.0.5.tgz", + "integrity": "sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg==", + "dev": true }, - "find-up": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/find-up/-/find-up-3.0.0.tgz", - "integrity": "sha512-1yD6RmLI1XBfxugvORwlck6f75tYL+iR0jqwsOrOxMZyGYqUuDhJ0l4AXdO1iX/FTs9cBAMEk1gWSEx1kSbylg==", - "dev": true, - "requires": { - "locate-path": "^3.0.0" - } + "require-main-filename": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/require-main-filename/-/require-main-filename-2.0.0.tgz", + "integrity": "sha512-NKN5kMDylKuldxYLSUfrbo5Tuzh4hd+2E8NPPX02mZtn1VuREQToYe/ZdlJy+J3uCpfaiGF05e7B8W0iXbQHmg==", + "dev": true }, - "get-stream": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-4.1.0.tgz", - "integrity": "sha512-GMat4EJ5161kIy2HevLlr4luNjBgvmj413KaQA7jt4V8B4RDsfpHk7WQ9GVqfYyyx8OS/L66Kox+rJRNklLK7w==", + "string-width": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-3.1.0.tgz", + "integrity": "sha512-vafcv6KjVZKSgz06oM/H6GDBrAtz8vdhQakGjFIvNrHA6y3HCF1CInLy+QLq8dTJPQ1b+KDUqDFctkdRW44e1w==", "dev": true, "requires": { - "pump": "^3.0.0" + "emoji-regex": "^7.0.1", + "is-fullwidth-code-point": "^2.0.0", + "strip-ansi": "^5.1.0" } }, - "invert-kv": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/invert-kv/-/invert-kv-2.0.0.tgz", - "integrity": "sha512-wPVv/y/QQ/Uiirj/vh3oP+1Ww+AWehmi1g5fFWGPF6IpCBCDVrhgHRMvrLfdYcwDh3QJbGXDW4JAuzxElLSqKA==", - "dev": true - }, - "lcid": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/lcid/-/lcid-2.0.0.tgz", - "integrity": "sha512-avPEb8P8EGnwXKClwsNUgryVjllcRqtMYa49NTsbQagYuT1DcXnl1915oxWjoyGrXR6zH/Y0Zc96xWsPcoDKeA==", + "strip-ansi": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-5.2.0.tgz", + "integrity": "sha512-DuRs1gKbBqsMKIZlrffwlug8MHkcnpjs5VPmL1PAh+mA30U0DTotfDZ0d2UUsXpPmPmMMJ6W773MaA3J+lbiWA==", "dev": true, "requires": { - "invert-kv": "^2.0.0" + "ansi-regex": "^4.1.0" } }, - "os-locale": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/os-locale/-/os-locale-3.1.0.tgz", - "integrity": "sha512-Z8l3R4wYWM40/52Z+S265okfFj8Kt2cC2MKY+xNi3kFs+XGI7WXu/I309QQQYbRW4ijiZ+yxs9pqEhJh0DqW3Q==", + "wrap-ansi": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-5.1.0.tgz", + "integrity": "sha512-QC1/iN/2/RPVJ5jYK8BGttj5z83LmSKmvbvrXPNCLZSEb32KKVDJDl/MOt2N01qU2H/FkzEa9PKto1BqDjtd7Q==", "dev": true, "requires": { - "execa": "^1.0.0", - "lcid": "^2.0.0", - "mem": "^4.0.0" + "ansi-styles": "^3.2.0", + "string-width": "^3.0.0", + "strip-ansi": "^5.0.0" } }, - "which-module": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/which-module/-/which-module-2.0.0.tgz", - "integrity": "sha1-2e8H3Od7mQK4o6j6SzHD4/fm6Ho=", + "y18n": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/y18n/-/y18n-4.0.0.tgz", + "integrity": "sha512-r9S/ZyXu/Xu9q1tYlpsLIsa3EeLXXk0VwlxqTcFRfg9EhMW+17kbt9G0NrgCmhGb5vT2hyhJZLfDGx+7+5Uj/w==", "dev": true }, "yargs": { - "version": "12.0.5", - "resolved": "https://registry.npmjs.org/yargs/-/yargs-12.0.5.tgz", - "integrity": "sha512-Lhz8TLaYnxq/2ObqHDql8dX8CJi97oHxrjUcYtzKbbykPtVW9WB+poxI+NM2UIzsMgNCZTIf0AQwsjK5yMAqZw==", + "version": "13.3.0", + "resolved": "https://registry.npmjs.org/yargs/-/yargs-13.3.0.tgz", + "integrity": "sha512-2eehun/8ALW8TLoIl7MVaRUrg+yCnenu8B4kBlRxj3GJGDKU1Og7sMXPNm1BYyM1DOJmTZ4YeN/Nwxv+8XJsUA==", "dev": true, "requires": { - "cliui": "^4.0.0", - "decamelize": "^1.2.0", + "cliui": "^5.0.0", "find-up": "^3.0.0", - "get-caller-file": "^1.0.1", - "os-locale": "^3.0.0", + "get-caller-file": "^2.0.1", "require-directory": "^2.1.1", - "require-main-filename": "^1.0.1", + "require-main-filename": "^2.0.0", "set-blocking": "^2.0.0", - "string-width": "^2.0.0", + "string-width": "^3.0.0", "which-module": "^2.0.0", - "y18n": "^3.2.1 || ^4.0.0", - "yargs-parser": "^11.1.1" + "y18n": "^4.0.0", + "yargs-parser": "^13.1.1" } }, "yargs-parser": { - "version": "11.1.1", - "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-11.1.1.tgz", - "integrity": "sha512-C6kB/WJDiaxONLJQnF8ccx9SEeoTTLek8RVbaOIsrAUS8VrBEXfmeSnCZxygc+XC2sNMBIwOOnfcxiynjHsVSQ==", + "version": "13.1.1", + "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-13.1.1.tgz", + "integrity": "sha512-oVAVsHz6uFrg3XQheFII8ESO2ssAf9luWuAd6Wexsu4F3OtIW0o8IribPXYrD4WC24LWtPrJlGy87y5udK+dxQ==", "dev": true, "requires": { "camelcase": "^5.0.0", diff --git a/package.json b/package.json index 0c2fae6..edbd3ad 100644 --- a/package.json +++ b/package.json @@ -1,11 +1,13 @@ { "name": "simple-markdown", - "version": "0.4.4", + "version": "0.7.2", "description": "Javascript markdown parsing, made simple", "main": "simple-markdown.js", + "types": "simple-markdown.d.ts", "scripts": { + "build": "make build", "test": "make test", - "prepublishOnly": "make minify", + "prepublishOnly": "make build", "size": "size-limit", "heroku": "node babelmark.js" }, @@ -20,7 +22,10 @@ "html", "ast", "markup", - "text processing" + "text processing", + "extension", + "flow", + "typescript" ], "author": "Aria Buckles", "license": "MIT", @@ -28,18 +33,30 @@ "url": "https://github.com/Khan/simple-markdown/issues" }, "homepage": "https://github.com/Khan/simple-markdown", - "dependencies": {}, + "files": [ + "index.js", + "simple-markdown.js", + "simple-markdown.d.ts", + "simple-markdown.min.js", + "README.md" + ], + "dependencies": { + "@types/react": ">=16.0.0" + }, "devDependencies": { - "express": "^4.16.4", - "flow-bin": "^0.94.0", - "flow-typed": "^2.5.1", - "mocha": "^6.0.2", - "nyc": "^13.3.0", - "react": "^16.8.4", - "react-dom": "^16.8.4", + "@types/mocha": "^5.2.7", + "@types/react-dom": ">=16.0.0", + "express": "^4.17.1", + "flow-bin": "^0.111.1", + "flow-typed": "^2.6.2", + "mocha": "^6.2.2", + "nyc": "^15.0.0", + "react": "^16.11.0", + "react-dom": "^16.11.0", + "rollup": "^1.26.3", "size-limit": "^0.21.1", - "uglify-js": "^3.4.9", - "underscore": "^1.9.1" + "typescript": "^3.6.4", + "uglify-js": "^3.6.7" }, "size-limit": [ { diff --git a/rollup.config.js b/rollup.config.js new file mode 100644 index 0000000..2a7824a --- /dev/null +++ b/rollup.config.js @@ -0,0 +1,10 @@ +export default { + input: 'src/index.js', + + output: { + format: 'umd', + indent: false, + file: 'simple-markdown.js', + name: 'SimpleMarkdown', + } +} diff --git a/simple-markdown.d.ts b/simple-markdown.d.ts new file mode 100644 index 0000000..3fe94c6 --- /dev/null +++ b/simple-markdown.d.ts @@ -0,0 +1,262 @@ +/** + * Typings are current as of simple-markdown 0.3.1. + */ + +import "node"; +import * as React from "react"; + +export as namespace SimpleMarkdown; + +// +// INTERFACES & TYPES +// + +export interface Capture extends Array { + index?: number, + input?: string, +} +type Attr = string | number | boolean | null | undefined; +export type TableAlignment = "right" | "center" | "left" | null; + +export interface SingleASTNode { + type: string, + [prop: string]: any, +} + +export interface UnTypedASTNode { + [prop: string]: any +} + +export type ASTNode = SingleASTNode | Array; + +export interface State { + key?: string | number | undefined; + inline?: boolean | undefined; + [prop: string]: any, +} +export type OptionalState = State | null | undefined; + +export type ReactElement = React.ReactElement; +export type ReactElements = React.ReactNode; + +export interface MatchFunction { + (source: string, state: State, prevCapture: string): Capture | null, + regex?: RegExp, +} + +export type Parser = ( + source: string, + state?: OptionalState, +) => Array; + +export type ParseFunction = ( + capture: Capture, + nestedParse: Parser, + state: State, +) => (UnTypedASTNode | ASTNode); + +export type SingleNodeParseFunction = ( + capture: Capture, + nestedParse: Parser, + state: State, +) => UnTypedASTNode; + +export type Output = ( + node: ASTNode, + state?: OptionalState +) => Result; + +export type RefiningNodeOutput = ( + node: SingleASTNode, + nestedOutput: Output, + state: State +) => Result; + +export type NodeOutput = RefiningNodeOutput; + +export type ArrayNodeOutput = ( + node: Array, + nestedOutput: Output, + state: State +) => Result; + +export type ReactOutput = Output; +export type ReactNodeOutput = NodeOutput; +export type HtmlOutput = Output; +export type HtmlNodeOutput = NodeOutput; + +export interface ParserRule { + readonly order: number, + readonly match: MatchFunction, + readonly quality?: (capture: Capture, state: State, prevCapture: string) => number, + readonly parse: ParseFunction, +} + +export interface SingleNodeParserRule extends ParserRule { + readonly order: number, + readonly match: MatchFunction, + readonly quality?: (capture: Capture, state: State, prevCapture: string) => number, + readonly parse: SingleNodeParseFunction, +} + +export interface ReactOutputRule { + // we allow null because some rules are never output results, and that's + // legal as long as no parsers return an AST node matching that rule. + // We don't use ? because this makes it be explicitly defined as either + // a valid function or null, so it can't be forgotten. + readonly react: ReactNodeOutput | null, +} + +export interface HtmlOutputRule { + readonly html: HtmlNodeOutput | null, +} + +export interface ArrayRule { + readonly react?: ArrayNodeOutput, + readonly html?: ArrayNodeOutput, + readonly [other: string]: ArrayNodeOutput | undefined, +} +export interface ReactArrayRule extends ArrayRule { + readonly react: ArrayNodeOutput, + readonly html?: ArrayNodeOutput, + readonly [other: string]: ArrayNodeOutput | undefined, +} +export interface HtmlArrayRule extends ArrayRule { + readonly react?: ArrayNodeOutput, + readonly html: ArrayNodeOutput, + readonly [other: string]: ArrayNodeOutput | undefined, +} +export interface DefaultArrayRule extends ArrayRule { + readonly react: ArrayNodeOutput, + readonly html: ArrayNodeOutput +} + +export interface ParserRules { + readonly Array?: ArrayRule, + readonly [type: string]: ParserRule | /* only for Array: */ ArrayRule | undefined, +} + +export interface OutputRules { + readonly Array?: ArrayRule, + readonly [type: string]: Rule | /* only for Array: */ ArrayRule | undefined, +} +export interface Rules { + readonly Array?: ArrayRule, + readonly [type: string]: ParserRule & OutputRule | /* only for Array: */ ArrayRule | undefined, +} +export interface ReactRules { + readonly Array?: ReactArrayRule, + readonly [type: string]: ParserRule & ReactOutputRule | ReactArrayRule | undefined, +} +export interface HtmlRules { + readonly Array?: HtmlArrayRule, + readonly [type: string]: ParserRule & HtmlOutputRule | HtmlArrayRule | undefined, +} + +// We want to clarify our defaultRules types a little bit more so clients can +// reuse defaultRules built-ins. So we make some stronger guarantess when +// we can: +export interface NonNullReactOutputRule extends ReactOutputRule { + readonly react: ReactNodeOutput, +} +export interface ElementReactOutputRule extends ReactOutputRule { + readonly react: RefiningNodeOutput, +} +export interface TextReactOutputRule extends ReactOutputRule { + readonly react: RefiningNodeOutput, +} +export interface NonNullHtmlOutputRule extends HtmlOutputRule { + readonly html: HtmlNodeOutput, +} + +export interface ReactMarkdownProps { + source: string, + [prop: string]: any, +} + +export type DefaultInRule = SingleNodeParserRule & ReactOutputRule & HtmlOutputRule; +export type TextInOutRule = SingleNodeParserRule & TextReactOutputRule & NonNullHtmlOutputRule; +export type LenientInOutRule = SingleNodeParserRule & NonNullReactOutputRule & NonNullHtmlOutputRule; +export type DefaultInOutRule = SingleNodeParserRule & ElementReactOutputRule & NonNullHtmlOutputRule; + +type DefaultRulesIndexer = ReactRules & HtmlRules; +export interface DefaultRules extends DefaultRulesIndexer { + readonly Array: DefaultArrayRule, + readonly heading: DefaultInOutRule, + readonly nptable: DefaultInRule, + readonly lheading: DefaultInRule, + readonly hr: DefaultInOutRule, + readonly codeBlock: DefaultInOutRule, + readonly fence: DefaultInRule, + readonly blockQuote: DefaultInOutRule, + readonly list: DefaultInOutRule, + readonly def: LenientInOutRule, + readonly table: DefaultInOutRule, + readonly tableSeparator: DefaultInRule, + readonly newline: TextInOutRule, + readonly paragraph: DefaultInOutRule, + readonly escape: DefaultInRule, + readonly autolink: DefaultInRule, + readonly mailto: DefaultInRule, + readonly url: DefaultInRule, + readonly link: DefaultInOutRule, + readonly image: DefaultInOutRule, + readonly reflink: DefaultInRule, + readonly refimage: DefaultInRule, + readonly em: DefaultInOutRule, + readonly strong: DefaultInOutRule, + readonly u: DefaultInOutRule, + readonly del: DefaultInOutRule, + readonly inlineCode: DefaultInOutRule, + readonly br: DefaultInOutRule, + readonly text: TextInOutRule, +} + +export interface RefNode { + type: string, + content?: ASTNode, + target?: string, + title?: string, + alt?: string, +} + + +// +// EXPORTED FUNCTIONS +// + +type OutputFor = ( + rules: SimpleMarkdown.OutputRules, + property: Type, + defaultState?: OptionalState +) => Output; + +export const defaultRules: DefaultRules; +export const parserFor: (rules: ParserRules, defaultState?: OptionalState) => Parser; + +export const outputFor: OutputFor; + +export const inlineRegex: (regex: RegExp) => MatchFunction; +export const blockRegex: (regex: RegExp) => MatchFunction; +export const anyScopeRegex: (regex: RegExp) => MatchFunction; +export const parseInline: (parse: Parser, content: string, state: State) => ASTNode; +export const parseBlock: (parse: Parser, content: string, state: State) => ASTNode; + +export const markdownToReact: (source: string, state?: OptionalState) => ReactElements; +export const markdownToHtml: (source: string, state?: OptionalState) => string; +export const ReactMarkdown: (props: { source: string, [prop: string]: any }) => ReactElement; + +export const defaultRawParse: (source: string, state?: OptionalState) => Array; +export const defaultBlockParse: (source: string, state?: OptionalState) => Array; +export const defaultInlineParse: (source: string, state?: OptionalState) => Array; +export const defaultImplicitParse: (source: string, state?: OptionalState) => Array; + +export const defaultReactOutput: ReactOutput; +export const defaultHtmlOutput: HtmlOutput; + +export const preprocess: (source: string) => string; +export const sanitizeText: (text: Attr) => string; +export const sanitizeUrl: (url: string | null | undefined) => string | null; +export const unescapeUrl: (url: string) => string; +export const htmlTag: (tagName: string, content: string, attributes?: { [attr: string]: Attr }, isClosed?: boolean) => string; +export const reactElement: (type: string, key: string | null, props: { [prop: string]: any }) => ReactElement; diff --git a/simple-markdown.js b/simple-markdown.js index fb077e5..3a86f28 100644 --- a/simple-markdown.js +++ b/simple-markdown.js @@ -1,4 +1,11 @@ +(function (global, factory) { +typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() : +typeof define === 'function' && define.amd ? define(factory) : +(global = global || self, global.SimpleMarkdown = factory()); +}(this, (function () { 'use strict'; + /* @flow */ +/* @ts-check */ /** * Simple-Markdown @@ -44,6 +51,10 @@ * THE SOFTWARE. */ +// Typescript language & simple-markdown.d.ts references: +/// +/// + /*:: // Flow Type Definitions: @@ -51,7 +62,7 @@ type Capture = Array & {index: number} | Array & {index?: number}; -type Attr = string | number | boolean; +type Attr = string | number | boolean | null | void; type SingleASTNode = { type: string, @@ -64,12 +75,16 @@ type UnTypedASTNode = { type ASTNode = SingleASTNode | Array; -type State = {[string]: any}; +type State = { + key?: string | number | void, + inline?: ?boolean, + [string]: any, +}; type ReactElement = React$Element; type ReactElements = React$Node; -type MatchFunction = ( +type MatchFunction = { regex?: RegExp } & ( source: string, state: State, prevCapture: string @@ -78,7 +93,7 @@ type MatchFunction = ( type Parser = ( source: string, state?: ?State -) => ASTNode; +) => Array; type ParseFunction = ( capture: Capture, @@ -158,7 +173,7 @@ type OutputRules = { type Rules = { +Array?: ArrayRule, +[type: string]: ParserRule & OutputRule, -} +}; type ReactRules = { +Array?: { +react: ArrayNodeOutput, @@ -208,6 +223,7 @@ type DefaultRules = { +list: DefaultInOutRule, +def: LenientInOutRule, +table: DefaultInOutRule, + +tableSeparator: DefaultInRule, +newline: TextInOutRule, +paragraph: DefaultInOutRule, +escape: DefaultInRule, @@ -232,24 +248,32 @@ type RefNode = { content?: ASTNode, target?: string, title?: string, + alt?: string, }; // End Flow Definitions */ -// Open IIFE, and immediately close it in flow -(function() { /*::})*/ - var CR_NEWLINE_R = /\r\n?/g; var TAB_R = /\t/g; var FORMFEED_R = /\f/g; -// Turn various crazy whitespace into easy to process things + +/** + * Turn various whitespace into easy-to-process whitespace + * @param {string} source + * @returns {string} + */ var preprocess = function(source /* : string */) { return source.replace(CR_NEWLINE_R, '\n') .replace(FORMFEED_R, '') .replace(TAB_R, ' '); }; +/** + * @param {SimpleMarkdown.OptionalState} givenState + * @param {SimpleMarkdown.OptionalState} defaultState + * @returns {SimpleMarkdown.State} + */ var populateInitialState = function( givenState /* : ?State */, defaultState /* : ?State */ @@ -269,20 +293,20 @@ var populateInitialState = function( * Creates a parser for a given set of rules, with the precedence * specified as a list of rules. * - * @rules: an object containing - * rule type -> {match, order, parse} objects - * (lower order is higher precedence) - * (Note: `order` is added to defaultRules after creation so that - * the `order` of defaultRules in the source matches the `order` - * of defaultRules in terms of `order` fields.) + * @param {SimpleMarkdown.ParserRules} rules + * an object containing + * rule type -> {match, order, parse} objects + * (lower order is higher precedence) + * @param {SimpleMarkdown.OptionalState} [defaultState] * - * @returns The resulting parse function, with the following parameters: - * @source: the input source string to be parsed - * @state: an optional object to be threaded through parse - * calls. Allows clients to add stateful operations to - * parsing, such as keeping track of how many levels deep - * some nesting is. For an example use-case, see passage-ref - * parsing in src/widgets/passage/passage-markdown.jsx + * @returns {SimpleMarkdown.Parser} + * The resulting parse function, with the following parameters: + * @source: the input source string to be parsed + * @state: an optional object to be threaded through parse + * calls. Allows clients to add stateful operations to + * parsing, such as keeping track of how many levels deep + * some nesting is. For an example use-case, see passage-ref + * parsing in src/widgets/passage/passage-markdown.jsx */ var parserFor = function(rules /*: ParserRules */, defaultState /*: ?State */) { // Sorts rules in order of increasing order, then @@ -304,8 +328,8 @@ var parserFor = function(rules /*: ParserRules */, defaultState /*: ?State */) { }); ruleList.sort(function(typeA, typeB) { - var ruleA /* : ParserRule */ = /*::(*/ rules[typeA] /*:: :any)*/; - var ruleB /* : ParserRule */ = /*::(*/ rules[typeB] /*:: :any)*/; + var ruleA /* : ParserRule */ = /** @type {SimpleMarkdown.ParserRule} */ (rules[typeA] /*:: :any */); + var ruleB /* : ParserRule */ = /** @type {SimpleMarkdown.ParserRule} */ (rules[typeB] /*:: :any */); var orderA = ruleA.order; var orderB = ruleB.order; @@ -333,16 +357,14 @@ var parserFor = function(rules /*: ParserRules */, defaultState /*: ?State */) { } }); + /** @type {SimpleMarkdown.State} */ var latestState; + /** @type {SimpleMarkdown.Parser} */ var nestedParse = function(source /* : string */, state /* : ?State */) { + /** @type Array */ var result = []; state = state || latestState; latestState = state; - // We store the previous capture so that match functions can - // use some limited amount of lookbehind. Lists use this to - // ensure they don't match arbitrary '- ' or '* ' in inline - // text (see the list rule for more information). - var prevCapture = ""; while (source) { // store the best match, it's rule, and quality: var ruleType = null; @@ -353,17 +375,18 @@ var parserFor = function(rules /*: ParserRules */, defaultState /*: ?State */) { // loop control variables: var i = 0; var currRuleType = ruleList[0]; - var currRule /* : ParserRule */ = /*::(*/ rules[currRuleType] /*:: : any)*/; + var currRule /* : ParserRule */ = /** @type {SimpleMarkdown.ParserRule} */ ( rules[currRuleType] /*:: :any */ ); do { var currOrder = currRule.order; - var currCapture = currRule.match(source, state, prevCapture); + var prevCaptureStr = state.prevCapture == null ? "" : state.prevCapture[0]; + var currCapture = currRule.match(source, state, prevCaptureStr); if (currCapture) { var currQuality = currRule.quality ? currRule.quality( currCapture, state, - prevCapture + prevCaptureStr ) : 0; // This should always be true the first time because // the initial quality is NaN (that's why there's the @@ -380,7 +403,7 @@ var parserFor = function(rules /*: ParserRules */, defaultState /*: ?State */) { // Note that this makes `currRule` be the next item i++; currRuleType = ruleList[i]; - currRule = /*::((*/ rules[currRuleType] /*:: : any) : ParserRule)*/; + currRule = /*::((*/ /** @type {SimpleMarkdown.ParserRule} */ (rules[currRuleType]) /*:: : any) : ParserRule)*/; } while ( // keep looping while we're still within the ruleList @@ -400,28 +423,23 @@ var parserFor = function(rules /*: ParserRules */, defaultState /*: ?State */) { ); // TODO(aria): Write tests for these - // Lie to flow and say these checks always happen - if (state.disableErrorGuards !== true) { /*:: } { */ - if (rule == null || capture == null /*:: || ruleType == null */) { - throw new Error( - "Could not find a matching rule for the below " + - "content. The rule with highest `order` should " + - "always match content provided to it. Check " + - "the definition of `match` for '" + - ruleList[ruleList.length - 1] + - "'. It seems to not match the following source:\n" + - source - ); - } - if (capture.index !== 0 && - source.slice(0, capture[0].length) !== capture[0] - ) { - throw new Error( - "`match` must return a capture starting at index 0 " + - "(the current parse index). Did you forget a ^ at the " + - "start of the RegExp?" - ); - } + if (rule == null || capture == null /*:: || ruleType == null */) { + throw new Error( + "Could not find a matching rule for the below " + + "content. The rule with highest `order` should " + + "always match content provided to it. Check " + + "the definition of `match` for '" + + ruleList[ruleList.length - 1] + + "'. It seems to not match the following source:\n" + + source + ); + } + if (capture.index) { // If present and non-zero, i.e. a non-^ regexp result: + throw new Error( + "`match` must return a capture starting at index 0 " + + "(the current parse index). Did you forget a ^ at the " + + "start of the RegExp?" + ); } var parsed = rule.parse(capture, nestedParse, state); @@ -439,27 +457,36 @@ var parserFor = function(rules /*: ParserRules */, defaultState /*: ?State */) { if (parsed.type == null) { parsed.type = ruleType; } - result.push(parsed); + result.push(/** @type {SimpleMarkdown.SingleASTNode} */ (parsed)); } - prevCapture = capture[0]; - source = source.substring(prevCapture.length); + state.prevCapture = capture; + source = source.substring(state.prevCapture[0].length); } return result; }; + /** @type {SimpleMarkdown.Parser} */ var outerParse = function(source /* : string */, state /* : ?State */) { latestState = populateInitialState(state, defaultState); if (!latestState.inline && !latestState.disableAutoBlockNewlines) { source = source + "\n\n"; } + // We store the previous capture so that match functions can + // use some limited amount of lookbehind. Lists use this to + // ensure they don't match arbitrary '- ' or '* ' in inline + // text (see the list rule for more information). This stores + // the full regex capture object, if there is one. + latestState.prevCapture = null; return nestedParse(preprocess(source), latestState); }; return outerParse; }; // Creates a match function for an inline scoped element from a regex +/** @type {(regex: RegExp) => SimpleMarkdown.MatchFunction} */ var inlineRegex = function(regex /* : RegExp */) { + /** @type {SimpleMarkdown.MatchFunction} */ var match /* : MatchFunction */ = function(source, state) { if (state.inline) { return regex.exec(source); @@ -472,7 +499,9 @@ var inlineRegex = function(regex /* : RegExp */) { }; // Creates a match function for a block scoped element from a regex +/** @type {(regex: RegExp) => SimpleMarkdown.MatchFunction} */ var blockRegex = function(regex /* : RegExp */) { + /** @type {SimpleMarkdown.MatchFunction} */ var match /* : MatchFunction */ = function(source, state) { if (state.inline) { return null; @@ -485,7 +514,9 @@ var blockRegex = function(regex /* : RegExp */) { }; // Creates a match function from a regex, ignoring block/inline scope +/** @type {(regex: RegExp) => SimpleMarkdown.MatchFunction} */ var anyScopeRegex = function(regex /* : RegExp */) { + /** @type {SimpleMarkdown.MatchFunction} */ var match /* : MatchFunction */ = function(source, state) { return regex.exec(source); }; @@ -498,29 +529,36 @@ var TYPE_SYMBOL = Symbol.for('react.element')) || 0xeac7; +/** + * @param {string} type + * @param {string | number | null | undefined} key + * @param {Object} props + * @returns {SimpleMarkdown.ReactElement} + */ var reactElement = function( type /* : string */, - key /* : string | null */, + key /* : string | number | null | void */, props /* : { [string]: any } */ -) { - var element = { +) /* : ReactElement */ { + var element /* : ReactElement */ = /** @type {SimpleMarkdown.ReactElement} */ ({ $$typeof: TYPE_SYMBOL, type: type, - key: key, + key: key == null ? undefined : key, ref: null, props: props, _owner: null - }; - return /* :: (( */ element /* :: : any ) : ReactElement) */; + } /* : any */); + return element; }; -// Returns a closed HTML tag. -// tagName: Name of HTML tag (eg. "em" or "a") -// content: Inner content of tag -// attributes: Optional extra attributes of tag as an object of key-value pairs -// eg. { "href": "http://google.com" }. Falsey attributes are filtered out. -// isClosed: boolean that controls whether tag is closed or not (eg. img tags). -// defaults to true +/** Returns a closed HTML tag. + * @param {string} tagName - Name of HTML tag (eg. "em" or "a") + * @param {string} content - Inner content of tag + * @param {{ [attr: string]: SimpleMarkdown.Attr }} [attributes] - Optional extra attributes of tag as an object of key-value pairs + * eg. { "href": "http://google.com" }. Falsey attributes are filtered out. + * @param {boolean} [isClosed] - boolean that controls whether tag is closed or not (eg. img tags). + * defaults to true + */ var htmlTag = function( tagName /* : string */, content /* : string */, @@ -553,6 +591,10 @@ var htmlTag = function( var EMPTY_PROPS = {}; +/** + * @param {string | null | undefined} url - url to sanitize + * @returns {string | null} - url if safe, or null if a safe url could not be made + */ var sanitizeUrl = function(url /* : ?string */) { if (url == null) { return null; @@ -574,6 +616,7 @@ var sanitizeUrl = function(url /* : ?string */) { }; var SANITIZE_TEXT_R = /[<>&"']/g; +/** @type {any} */ var SANITIZE_TEXT_CODES = { '<': '<', '>': '>', @@ -583,6 +626,10 @@ var SANITIZE_TEXT_CODES = { '/': '/', "`": '`' }; +/** + * @param {SimpleMarkdown.Attr} text + * @returns {string} + */ var sanitizeText = function(text /* : Attr */) { return String(text).replace(SANITIZE_TEXT_R, function(chr) { return SANITIZE_TEXT_CODES[chr]; @@ -591,13 +638,24 @@ var sanitizeText = function(text /* : Attr */) { var UNESCAPE_URL_R = /\\([^0-9A-Za-z\s])/g; +/** + * @param {string} rawUrlString + * @returns {string} + */ var unescapeUrl = function(rawUrlString /* : string */) { return rawUrlString.replace(UNESCAPE_URL_R, "$1"); }; -// Parse some content with the parser `parse`, with state.inline -// set to true. Useful for block elements; not generally necessary -// to be used by inline elements (where state.inline is already true. +/** + * Parse some content with the parser `parse`, with state.inline + * set to true. Useful for block elements; not generally necessary + * to be used by inline elements (where state.inline is already true. + * + * @param {SimpleMarkdown.Parser} parse + * @param {string} content + * @param {SimpleMarkdown.State} state + * @returns {SimpleMarkdown.ASTNode} + */ var parseInline = function(parse, content, state) { var isCurrentlyInline = state.inline || false; state.inline = true; @@ -605,6 +663,12 @@ var parseInline = function(parse, content, state) { state.inline = isCurrentlyInline; return result; }; +/** + * @param {SimpleMarkdown.Parser} parse + * @param {string} content + * @param {SimpleMarkdown.State} state + * @returns {SimpleMarkdown.ASTNode} + */ var parseBlock = function(parse, content, state) { var isCurrentlyInline = state.inline || false; state.inline = false; @@ -613,11 +677,20 @@ var parseBlock = function(parse, content, state) { return result; }; +/** + * @param {SimpleMarkdown.Capture} capture + * @param {SimpleMarkdown.Parser} parse + * @param {SimpleMarkdown.State} state + * @returns {SimpleMarkdown.UnTypedASTNode} + */ var parseCaptureInline = function(capture, parse, state) { return { content: parseInline(parse, capture[1], state) }; }; +/** + * @returns {SimpleMarkdown.UnTypedASTNode} + */ var ignoreCapture = function() { return {}; }; // recognize a `*` `-`, `+`, `1.`, `2.`... list bullet @@ -640,6 +713,7 @@ var LIST_ITEM_R = new RegExp( "gm" ); var BLOCK_END_R = /\n{2,}$/; +var INLINE_CODE_ESCAPE_BACKTICKS_R = /^ (?= *`)|(` *) $/g; // recognize the end of a paragraph block inside a list item: // two or more newlines at end end of the item var LIST_BLOCK_END_R = BLOCK_END_R; @@ -657,19 +731,16 @@ var LIST_R = new RegExp( var LIST_LOOKBEHIND_R = /(?:^|\n)( *)$/; var TABLES = (function() { - // predefine regexes so we don't have to create them inside functions - // sure, regex literals should be fast, even inside functions, but they - // aren't in all browsers. - var TABLE_HEADER_TRIM = /^ *| *\| *$/g; - var TABLE_CELLS_TRIM = /\n+$/; - var PLAIN_TABLE_ROW_TRIM = /^ *\| *| *\| *$/g; - var NPTABLE_ROW_TRIM = /^ *| *$/g; - var TABLE_ROW_SPLIT = / *\| */; - + var TABLE_ROW_SEPARATOR_TRIM = /^ *\| *| *\| *$/g; + var TABLE_CELL_END_TRIM = / *$/; var TABLE_RIGHT_ALIGN = /^ *-+: *$/; var TABLE_CENTER_ALIGN = /^ *:-+: *$/; var TABLE_LEFT_ALIGN = /^ *:-+ *$/; + /** + * @param {string} alignCapture + * @returns {SimpleMarkdown.TableAlignment} + */ var parseTableAlignCapture = function(alignCapture) { if (TABLE_RIGHT_ALIGN.test(alignCapture)) { return "right"; @@ -682,93 +753,113 @@ var TABLES = (function() { } }; - var parseTableHeader = function(trimRegex, capture, parse, state) { - var headerText = capture[1] - .replace(trimRegex, "") - .split(TABLE_ROW_SPLIT); - return headerText.map(function(text) { - return parse(text, state); - }); - }; - - var parseTableAlign = function(trimRegex, capture, parse, state) { - var alignText = capture[2] - .replace(trimRegex, "") - .split(TABLE_ROW_SPLIT); - + /** + * @param {string} source + * @param {SimpleMarkdown.Parser} parse + * @param {SimpleMarkdown.State} state + * @param {boolean} trimEndSeparators + * @returns {Array} + */ + var parseTableAlign = function(source, parse, state, trimEndSeparators) { + if (trimEndSeparators) { + source = source.replace(TABLE_ROW_SEPARATOR_TRIM, ""); + } + var alignText = source.trim().split("|"); return alignText.map(parseTableAlignCapture); }; - var parseTableCells = function(capture, parse, state) { - var rowsText = capture[3] - .replace(TABLE_CELLS_TRIM, "") - .split("\n"); - - return rowsText.map(function(rowText) { - var cellText = rowText - .replace(PLAIN_TABLE_ROW_TRIM, "") - .split(TABLE_ROW_SPLIT); - return cellText.map(function(text) { - return parse(text, state); - }); + /** + * @param {string} source + * @param {SimpleMarkdown.Parser} parse + * @param {SimpleMarkdown.State} state + * @param {boolean} trimEndSeparators + * @returns {SimpleMarkdown.SingleASTNode[][]} + */ + var parseTableRow = function(source, parse, state, trimEndSeparators) { + var prevInTable = state.inTable; + state.inTable = true; + var tableRow = parse(source.trim(), state); + state.inTable = prevInTable; + + /** @type {SimpleMarkdown.SingleASTNode[][]} */ + var cells = [[]]; + tableRow.forEach(function(node, i) { + if (node.type === 'tableSeparator') { + // Filter out empty table separators at the start/end: + if (!trimEndSeparators || i !== 0 && i !== tableRow.length - 1) { + // Split the current row: + cells.push([]); + } + } else { + if (node.type === 'text' && ( + tableRow[i + 1] == null || + tableRow[i + 1].type === 'tableSeparator' + )) { + node.content = node.content.replace(TABLE_CELL_END_TRIM, ""); + } + cells[cells.length - 1].push(node); + } }); + + return cells; }; - var parseNpTableCells = function(capture, parse, state) { - var rowsText = capture[3] - .replace(TABLE_CELLS_TRIM, "") - .split("\n"); + /** + * @param {string} source + * @param {SimpleMarkdown.Parser} parse + * @param {SimpleMarkdown.State} state + * @param {boolean} trimEndSeparators + * @returns {SimpleMarkdown.ASTNode[][]} + */ + var parseTableCells = function(source, parse, state, trimEndSeparators) { + var rowsText = source.trim().split("\n"); return rowsText.map(function(rowText) { - var cellText = rowText.split(TABLE_ROW_SPLIT); - return cellText.map(function(text) { - return parse(text, state); - }); + return parseTableRow(rowText, parse, state, trimEndSeparators); }); }; - var parseTable = function(capture, parse, state) { - state.inline = true; - var header = parseTableHeader(TABLE_HEADER_TRIM, capture, parse, state); - var align = parseTableAlign(TABLE_HEADER_TRIM, capture, parse, state); - var cells = parseTableCells(capture, parse, state); - state.inline = false; - - return { - type: "table", - header: header, - align: align, - cells: cells - }; - }; + /** + * @param {boolean} trimEndSeparators + * @returns {SimpleMarkdown.SingleNodeParseFunction} + */ + var parseTable = function(trimEndSeparators) { + /** @type {SimpleMarkdown.SingleNodeParseFunction} */ + return function(capture, parse, state) { + state.inline = true; + var header = parseTableRow(capture[1], parse, state, trimEndSeparators); + var align = parseTableAlign(capture[2], parse, state, trimEndSeparators); + var cells = parseTableCells(capture[3], parse, state, trimEndSeparators); + state.inline = false; - var parseNpTable = function(capture, parse, state) { - state.inline = true; - var header = parseTableHeader(NPTABLE_ROW_TRIM, capture, parse, state); - var align = parseTableAlign(NPTABLE_ROW_TRIM, capture, parse, state); - var cells = parseNpTableCells(capture, parse, state); - state.inline = false; - - return { - type: "table", - header: header, - align: align, - cells: cells + return { + type: "table", + header: header, + align: align, + cells: cells + }; }; }; return { - parseTable: parseTable, - parseNpTable: parseNpTable, + parseTable: parseTable(true), + parseNpTable: parseTable(false), + TABLE_REGEX: /^ *(\|.+)\n *\|( *[-:]+[-| :]*)\n((?: *\|.*(?:\n|$))*)\n*/, NPTABLE_REGEX: /^ *(\S.*\|.*)\n *([-:]+ *\|[-| :]*)\n((?:.*\|.*(?:\n|$))*)\n*/ }; })(); var LINK_INSIDE = "(?:\\[[^\\]]*\\]|[^\\[\\]]|\\](?=[^\\[]*\\]))*"; var LINK_HREF_AND_TITLE = - "\\s*?(?:\\s+['\"]([\\s\\S]*?)['\"])?\\s*"; + "\\s*?(?:\\s+['\"]([\\s\\S]*?)['\"])?\\s*"; var AUTOLINK_MAILTO_CHECK_R = /mailto:/i; +/** + * @param {SimpleMarkdown.Capture} capture + * @param {SimpleMarkdown.State} state + * @param {SimpleMarkdown.RefNode} refNode + * @returns {SimpleMarkdown.RefNode} + */ var parseRef = function(capture, state, refNode /* : RefNode */) { var ref = (capture[2] || capture[1]) .replace(/\s+/g, ' ') @@ -801,6 +892,7 @@ var parseRef = function(capture, state, refNode /* : RefNode */) { }; var currOrder = 0; +/** @type {SimpleMarkdown.DefaultRules} */ var defaultRules /* : DefaultRules */ = { Array: { react: function(arr, output, state) { @@ -834,7 +926,7 @@ var defaultRules /* : DefaultRules */ = { // map output over the ast, except group any text // nodes together into a single string output. - for (var i = 0, key = 0; i < arr.length; i++) { + for (var i = 0; i < arr.length; i++) { var node = arr[i]; if (node.type === 'text') { @@ -851,11 +943,11 @@ var defaultRules /* : DefaultRules */ = { }, heading: { order: currOrder++, - match: blockRegex(/^ *(#{1,6}) *([^\n]+?) *#* *(?:\n *)+\n/), + match: blockRegex(/^ *(#{1,6})([^\n]+?)#* *(?:\n *)+\n/), parse: function(capture, parse, state) { return { level: capture[1].length, - content: parseInline(parse, capture[2], state) + content: parseInline(parse, capture[2].trim(), state) }; }, react: function(node, output, state) { @@ -951,7 +1043,7 @@ var defaultRules /* : DefaultRules */ = { }, fence: { order: currOrder++, - match: blockRegex(/^ *(`{3,}|~{3,}) *(\S+)? *\n([\s\S]+?)\s*\1 *(?:\n *)+\n/), + match: blockRegex(/^ *(`{3,}|~{3,}) *(?:(\S+) *)?\n([\s\S]+?)\n?\1 *(?:\n *)+\n/), parse: function(capture, parse, state) { return { type: "codeBlock", @@ -986,7 +1078,7 @@ var defaultRules /* : DefaultRules */ = { }, list: { order: currOrder++, - match: function(source, state, prevCapture) { + match: function(source, state) { // We only want to break into a list if we are at the start of a // line. This is to avoid parsing "hi * there" with "* there" // becoming a part of a list. @@ -995,12 +1087,12 @@ var defaultRules /* : DefaultRules */ = { // lists can be inline, because they might be inside another list, // in which case we can parse with inline scope, but need to allow // nested lists inside this inline scope. - var isStartOfLineCapture = LIST_LOOKBEHIND_R.exec(prevCapture); + var prevCaptureStr = state.prevCapture == null ? "" : state.prevCapture[0]; + var isStartOfLineCapture = LIST_LOOKBEHIND_R.exec(prevCaptureStr); var isListBlock = state._list || !state.inline; if (isStartOfLineCapture && isListBlock) { source = isStartOfLineCapture[1] + source; - var res = LIST_R.exec(source); return LIST_R.exec(source); } else { return null; @@ -1010,16 +1102,18 @@ var defaultRules /* : DefaultRules */ = { var bullet = capture[2]; var ordered = bullet.length > 1; var start = ordered ? +bullet : undefined; - var items = capture[0] - .replace(LIST_BLOCK_END_R, "\n") - .match(LIST_ITEM_R); + var items = /** @type {string[]} */ ( + capture[0] + .replace(LIST_BLOCK_END_R, "\n") + .match(LIST_ITEM_R) + ); // We know this will match here, because of how the regexes are // defined /*:: items = ((items : any) : Array) */ var lastItemWasAParagraph = false; - var itemContent = items.map(function(item, i) { + var itemContent = items.map(function(/** @type {string} */ item, /** @type {number} */ i) { // We need to see how far indented this item is: var prefixCapture = LIST_ITEM_PREFIX_R.exec(item); var space = prefixCapture ? prefixCapture[0].length : 0; @@ -1097,7 +1191,10 @@ var defaultRules /* : DefaultRules */ = { state.key, { start: node.start, - children: node.items.map(function(item, i) { + children: node.items.map(function( + /** @type {SimpleMarkdown.ASTNode} */ item, + /** @type {number} */ i + ) { return reactElement( 'li', '' + i, @@ -1110,7 +1207,7 @@ var defaultRules /* : DefaultRules */ = { ); }, html: function(node, output, state) { - var listItems = node.items.map(function(item) { + var listItems = node.items.map(function(/** @type {SimpleMarkdown.ASTNode} */ item) { return htmlTag("li", output(item, state)); }).join(""); @@ -1145,7 +1242,7 @@ var defaultRules /* : DefaultRules */ = { // Sorry :(. if (state._refs && state._refs[def]) { // `refNode` can be a link or an image - state._refs[def].forEach(function(refNode) { + state._refs[def].forEach(function(/** @type {SimpleMarkdown.RefNode} */ refNode) { refNode.target = target; refNode.title = title; }); @@ -1175,18 +1272,23 @@ var defaultRules /* : DefaultRules */ = { }, table: { order: currOrder++, - match: blockRegex( - /^ *\|(.+)\n *\|( *[-:]+[-| :]*)\n((?: *\|.*(?:\n|$))*)\n*/ - ), + match: blockRegex(TABLES.TABLE_REGEX), parse: TABLES.parseTable, react: function(node, output, state) { + /** + * @param {number} colIndex + * @returns {{ [attr: string]: SimpleMarkdown.Attr }} + */ var getStyle = function(colIndex) { return node.align[colIndex] == null ? {} : { textAlign: node.align[colIndex] }; }; - var headers = node.header.map(function(content, i) { + var headers = node.header.map(function( + /** @type {SimpleMarkdown.ASTNode} */ content, + /** @type {number} */ i + ) { return reactElement( 'th', '' + i, @@ -1198,12 +1300,18 @@ var defaultRules /* : DefaultRules */ = { ); }); - var rows = node.cells.map(function(row, r) { + var rows = node.cells.map(function( + /** @type {SimpleMarkdown.ASTNode[]} */ row, + /** @type {number} */ r + ) { return reactElement( 'tr', '' + r, { - children: row.map(function(content, c) { + children: row.map(function( + /** @type {SimpleMarkdown.ASTNode} */ content, + /** @type {number} */ c + ) { return reactElement( 'td', '' + c, @@ -1244,18 +1352,28 @@ var defaultRules /* : DefaultRules */ = { ); }, html: function(node, output, state) { + /** + * @param {number} colIndex + * @returns {string} + */ var getStyle = function(colIndex) { return node.align[colIndex] == null ? "" : "text-align:" + node.align[colIndex] + ";"; }; - var headers = node.header.map(function(content, i) { + var headers = node.header.map(function( + /** @type {SimpleMarkdown.ASTNode} */ content, + /** @type {number} */ i + ) { return htmlTag("th", output(content, state), { style: getStyle(i), scope: "col" }); }).join(""); - var rows = node.cells.map(function(row) { - var cols = row.map(function(content, c) { + var rows = node.cells.map(function(/** @type {SimpleMarkdown.ASTNode[]} */ row) { + var cols = row.map(function( + /** @type {SimpleMarkdown.ASTNode} */ content, + /** @type {number} */ c + ) { return htmlTag("td", output(content, state), { style: getStyle(c) }); }).join(""); @@ -1313,9 +1431,24 @@ var defaultRules /* : DefaultRules */ = { react: null, html: null }, + tableSeparator: { + order: currOrder++, + match: function(source, state) { + if (!state.inTable) { + return null; + } + return /^ *\| */.exec(source); + }, + parse: function() { + return { type: 'tableSeparator' }; + }, + // These shouldn't be reached, but in case they are, be reasonable: + react: function() { return ' | '; }, + html: function() { return ' | '; }, + }, autolink: { order: currOrder++, - match: inlineRegex(/^<([^ >]+:\/[^ >]+)>/), + match: inlineRegex(/^<([^: >]+:\/[^ >]+)>/), parse: function(capture, parse, state) { return { type: "link", @@ -1567,7 +1700,7 @@ var defaultRules /* : DefaultRules */ = { }, del: { order: currOrder++, - match: inlineRegex(/^~~(?=\S)((?:\\[\s\S]|~(?!~)|[^\s\\~]|\s+(?!~~))+?)~~/), + match: inlineRegex(/^~~(?=\S)((?:\\[\s\S]|~(?!~)|[^\s~]|\s(?!~~))+?)~~/), parse: parseCaptureInline, react: function(node, output, state) { return reactElement( @@ -1584,10 +1717,10 @@ var defaultRules /* : DefaultRules */ = { }, inlineCode: { order: currOrder++, - match: inlineRegex(/^(`+)\s*([\s\S]*?[^`])\s*\1(?!`)/), + match: inlineRegex(/^(`+)([\s\S]*?[^`])\1(?!`)/), parse: function(capture, parse, state) { return { - content: capture[2] + content: capture[2].replace(INLINE_CODE_ESCAPE_BACKTICKS_R, "$1") }; }, react: function(node, output, state) { @@ -1641,6 +1774,11 @@ var defaultRules /* : DefaultRules */ = { } }; +/** (deprecated) + * @param {any} rules + * @param {any} property + * @returns {any} + */ var ruleOutput = function/* :: */( rules /* : OutputRules */, property /* : $Keys */ @@ -1651,9 +1789,10 @@ var ruleOutput = function/* :: */( ); } + /** @type {SimpleMarkdown.NodeOutput} */ var nestedRuleOutput /* : NodeOutput */ = function( ast /* : SingleASTNode */, - outputFunc /* : NodeOutput */, + outputFunc /* : Output */, state /* : State */ ) { return rules[ast.type][property](ast, outputFunc, state); @@ -1661,7 +1800,12 @@ var ruleOutput = function/* :: */( return nestedRuleOutput; }; +/** (deprecated) + * @param {any} outputFunc + * @returns {any} + */ var reactFor = function(outputFunc /* : ReactNodeOutput */) /* : ReactOutput */ { + /** @type {SimpleMarkdown.ReactOutput} */ var nestedOutput /* : ReactOutput */ = function(ast, state) { state = state || {}; if (Array.isArray(ast)) { @@ -1692,7 +1836,12 @@ var reactFor = function(outputFunc /* : ReactNodeOutput */) /* : ReactOutput */ return nestedOutput; }; +/** (deprecated) + * @param {any} outputFunc + * @returns {any} + */ var htmlFor = function(outputFunc /* : HtmlNodeOutput */) /* : HtmlOutput */ { + /** @type {SimpleMarkdown.HtmlOutput} */ var nestedOutput /* : HtmlOutput */ = function(ast, state) { state = state || {}; if (Array.isArray(ast)) { @@ -1706,6 +1855,9 @@ var htmlFor = function(outputFunc /* : HtmlNodeOutput */) /* : HtmlOutput */ { return nestedOutput; }; +/** + * @type {SimpleMarkdown.OutputFor} + */ var outputFor = function/* :: */( rules /* : OutputRules */, property /* : $Keys */, @@ -1719,18 +1871,33 @@ var outputFor = function/* :: */( ); } + /** @type {SimpleMarkdown.State} */ var latestState; + /** @type {SimpleMarkdown.ArrayRule} */ var arrayRule = rules.Array || defaultRules.Array; + + // Tricks to convince tsc that this var is not null: + var arrayRuleCheck = arrayRule[property]; + if (!arrayRuleCheck) { + throw new Error('simple-markdown: outputFor: to join nodes of type `' + + property + '` you must provide an `Array:` joiner rule with that type, ' + + 'Please see the docs for details on specifying an Array rule.' + ); + } + var arrayRuleOutput = arrayRuleCheck; + + /** @type {SimpleMarkdown.Output} */ var nestedOutput /* : Output */ = function(ast, state) { state = state || latestState; latestState = state; if (Array.isArray(ast)) { - return arrayRule[property](ast, nestedOutput, state); + return arrayRuleOutput(ast, nestedOutput, state); } else { return rules[ast.type][property](ast, nestedOutput, state); } }; + /** @type {SimpleMarkdown.Output} */ var outerOutput = function(ast, state) { latestState = populateInitialState(state, defaultState); return nestedOutput(ast, latestState); @@ -1739,16 +1906,31 @@ var outputFor = function/* :: */( }; var defaultRawParse = parserFor(defaultRules); +/** + * @param {string} source + * @param {SimpleMarkdown.OptionalState} [state] + * @returns {Array} + */ var defaultBlockParse = function(source, state) { state = state || {}; state.inline = false; return defaultRawParse(source, state); }; +/** + * @param {string} source + * @param {SimpleMarkdown.OptionalState} [state] + * @returns {Array} + */ var defaultInlineParse = function(source, state) { state = state || {}; state.inline = true; return defaultRawParse(source, state); }; +/** + * @param {string} source + * @param {SimpleMarkdown.OptionalState} [state] + * @returns {Array} + */ var defaultImplicitParse = function(source, state) { var isBlock = BLOCK_END_R.test(source); state = state || {}; @@ -1756,17 +1938,34 @@ var defaultImplicitParse = function(source, state) { return defaultRawParse(source, state); }; +/** @type {SimpleMarkdown.ReactOutput} */ var defaultReactOutput /* : ReactOutput */ = outputFor(defaultRules, "react"); +/** @type {SimpleMarkdown.HtmlOutput} */ var defaultHtmlOutput /* : HtmlOutput */ = outputFor(defaultRules, "html"); +/** + * @param {string} source + * @param {SimpleMarkdown.OptionalState} [state] + * @returns {SimpleMarkdown.ReactElements} + */ var markdownToReact = function(source, state) /* : ReactElements */ { return defaultReactOutput(defaultBlockParse(source, state), state); }; +/** + * @param {string} source + * @param {SimpleMarkdown.OptionalState} [state] + * @returns {string} + */ var markdownToHtml = function(source, state) /* : string */ { return defaultHtmlOutput(defaultBlockParse(source, state), state); }; +/** + * @param {SimpleMarkdown.ReactMarkdownProps} props + * @returns {SimpleMarkdown.ReactElement} + */ var ReactMarkdown = function(props) { + /** @type {Object} */ var divProps = {}; for (var prop in props) { @@ -1818,7 +2017,7 @@ type Exports = { +sanitizeText: (text: Attr) => string, +sanitizeUrl: (url: ?string) => ?string, +unescapeUrl: (url: string) => string, - +htmlTag: (tagName: string, content: string, attributes: ?{[any]: ?Attr}, isClosed: ?boolean) => string, + +htmlTag: (tagName: string, content: string, attributes: ?{ [any]: ?Attr }, isClosed: ?boolean) => string, +reactElement: (type: string, key: string | null, props: { [string]: any }) => ReactElement, }; @@ -1897,25 +2096,16 @@ var SimpleMarkdown /* : Exports */ = { if (typeof console !== 'undefined') { console.warn('defaultParse is deprecated, please use `defaultImplicitParse`'); } - return defaultImplicitParse.apply(null, arguments); + return defaultImplicitParse.apply(null, /** @type {any} */ (arguments)); }, defaultOutput: function() { if (typeof console !== 'undefined') { console.warn('defaultOutput is deprecated, please use `defaultReactOutput`'); } - return defaultReactOutput.apply(null, arguments); + return defaultReactOutput.apply(null, /** @type {any} */ (arguments)); } }; -if (typeof module !== "undefined" && module.exports) { - module.exports = SimpleMarkdown; -} else if (typeof global !== "undefined") { - global.SimpleMarkdown = SimpleMarkdown; -} else { - window.SimpleMarkdown = SimpleMarkdown; -} -/*:: module.exports = SimpleMarkdown; */ - -// Close the IIFE -/*:: (function() { */})(); +return SimpleMarkdown; +}))); diff --git a/simple-markdown.min.js b/simple-markdown.min.js index f3a0124..daf0609 100644 --- a/simple-markdown.min.js +++ b/simple-markdown.min.js @@ -1 +1 @@ -!function(){var c,i,f,s,p,t,e,r,l,d,h,u=/\r\n?/g,a=/\t/g,o=/\f/g,k=function(n){return n.replace(u,"\n").replace(o,"").replace(a," ")},w=function(n,t){var e=n||{};if(null!=t)for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e},n=function(m,e){var g,y=Object.keys(m).filter(function(n){var t=m[n];if(null==t||null==t.match)return!1;var e=t.order;return"number"==typeof e&&isFinite(e)||"undefined"==typeof console||console.warn("simple-markdown: Invalid order for rule `"+n+"`: "+String(e)),!0});y.sort(function(n,t){var e=m[n],r=m[t],l=e.order,u=r.order;if(l!==u)return l-u;var a=e.quality?0:1,o=r.quality?0:1;return a!==o?a-o:n";return r?o+t+"":o},_={},S=function(n){if(null==n)return null;try{var t=decodeURIComponent(n).replace(/[^A-Za-z0-9/:]/g,"").toLowerCase();if(0===t.indexOf("javascript:")||0===t.indexOf("vbscript:")||0===t.indexOf("data:"))return null}catch(n){return null}return n},E=/[<>&"']/g,R={"<":"<",">":">","&":"&",'"':""","'":"'","/":"/","`":"`"},A=function(n){return String(n).replace(E,function(n){return R[n]})},$=/\\([^0-9A-Za-z\s])/g,O=function(n){return n.replace($,"$1")},P=function(n,t,e){var r=e.inline||!1;e.inline=!0;var l=n(t,e);return e.inline=r,l},j=function(n,t,e){return{content:P(t,n[1],e)}},q=function(){return{}},T="(?:[*+-]|\\d+\\.)",F="( *)("+T+") +",N=new RegExp("^"+F),B=new RegExp(F+"[^\\n]*(?:\\n(?!\\1"+T+" )[^\\n]*)*(\n|$)","gm"),C=/\n{2,}$/,I=C,z=/ *\n+$/,L=new RegExp("^( *)("+T+") [\\s\\S]+?(?:\n{2,}(?! )(?!\\1"+T+" )\\n*|\\s*\n*$)"),Z=/(?:^|\n)( *)$/,G=(c=/^ *| *\| *$/g,i=/\n+$/,f=/^ *\| *| *\| *$/g,s=/^ *| *$/g,p=/ *\| */,t=/^ *-+: *$/,e=/^ *:-+: *$/,r=/^ *:-+ *$/,l=function(n){return t.test(n)?"right":e.test(n)?"center":r.test(n)?"left":null},d=function(n,t,e,r){return t[1].replace(n,"").split(p).map(function(n){return e(n,r)})},h=function(n,t,e,r){return t[2].replace(n,"").split(p).map(l)},{parseTable:function(n,t,e){e.inline=!0;var r,l,u=d(c,n,t,e),a=h(c,n),o=(r=t,l=e,n[3].replace(i,"").split("\n").map(function(n){return n.replace(f,"").split(p).map(function(n){return r(n,l)})}));return e.inline=!1,{type:"table",header:u,align:a,cells:o}},parseNpTable:function(n,t,e){e.inline=!0;var r,l,u=d(s,n,t,e),a=h(s,n),o=(r=t,l=e,n[3].replace(i,"").split("\n").map(function(n){return n.split(p).map(function(n){return r(n,l)})}));return e.inline=!1,{type:"table",header:u,align:a,cells:o}},NPTABLE_REGEX:/^ *(\S.*\|.*)\n *([-:]+ *\|[-| :]*)\n((?:.*\|.*(?:\n|$))*)\n*/}),M="(?:\\[[^\\]]*\\]|[^\\[\\]]|\\](?=[^\\[]*\\]))*",U="\\s*?(?:\\s+['\"]([\\s\\S]*?)['\"])?\\s*",H=/mailto:/i,X=function(n,t,e){var r=(n[2]||n[1]).replace(/\s+/g," ").toLowerCase();if(t._defs&&t._defs[r]){var l=t._defs[r];e.target=l.target,e.title=l.title}return t._refs=t._refs||{},t._refs[r]=t._refs[r]||[],t._refs[r].push(e),e},D=0,Q={Array:{react:function(n,t,e){for(var r=e.key,l=[],u=0,a=0;u"}},codeBlock:{order:D++,match:g(/^(?: [^\n]+\n*)+(?:\n *)+\n/),parse:function(n,t,e){return{lang:void 0,content:n[0].replace(/^ /gm,"").replace(/\n+$/,"")}},react:function(n,t,e){var r=n.lang?"markdown-code-"+n.lang:void 0;return x("pre",e.key,{children:x("code",null,{className:r,children:n.content})})},html:function(n,t,e){var r=n.lang?"markdown-code-"+n.lang:void 0,l=b("code",A(n.content),{class:r});return b("pre",l)}},fence:{order:D++,match:g(/^ *(`{3,}|~{3,}) *(\S+)? *\n([\s\S]+?)\s*\1 *(?:\n *)+\n/),parse:function(n,t,e){return{type:"codeBlock",lang:n[2]||void 0,content:n[3]}},react:null,html:null},blockQuote:{order:D++,match:g(/^( *>[^\n]+(\n[^\n]+)*\n*)+\n{2,}/),parse:function(n,t,e){return{content:t(n[0].replace(/^ *> ?/gm,""),e)}},react:function(n,t,e){return x("blockquote",e.key,{children:t(n.content,e)})},html:function(n,t,e){return b("blockquote",t(n.content,e))}},list:{order:D++,match:function(n,t,e){var r=Z.exec(e),l=t._list||!t.inline;return r&&l?(n=r[1]+n,L.exec(n),L.exec(n)):null},parse:function(n,p,d){var t=n[2],e=1]*)>?(?: +["(]([^\n]+)[")])? *\n(?: *\n)*/),parse:function(n,t,e){var r=n[1].replace(/\s+/g," ").toLowerCase(),l=n[2],u=n[3];return e._refs&&e._refs[r]&&e._refs[r].forEach(function(n){n.target=l,n.title=u}),e._defs=e._defs||{},e._defs[r]={target:l,title:u},{def:r,target:l,title:u}},react:function(){return null},html:function(){return""}},table:{order:D++,match:g(/^ *\|(.+)\n *\|( *[-:]+[-| :]*)\n((?: *\|.*(?:\n|$))*)\n*/),parse:G.parseTable,react:function(t,e,r){var l=function(n){return null==t.align[n]?{}:{textAlign:t.align[n]}},n=t.header.map(function(n,t){return x("th",""+t,{style:l(t),scope:"col",children:e(n,r)})}),u=t.cells.map(function(n,t){return x("tr",""+t,{children:n.map(function(n,t){return x("td",""+t,{style:l(t),children:e(n,r)})})})});return x("table",r.key,{children:[x("thead","thead",{children:x("tr",null,{children:n})}),x("tbody","tbody",{children:u})]})},html:function(t,e,r){var l=function(n){return null==t.align[n]?"":"text-align:"+t.align[n]+";"},n=t.header.map(function(n,t){return b("th",e(n,r),{style:l(t),scope:"col"})}).join(""),u=t.cells.map(function(n){var t=n.map(function(n,t){return b("td",e(n,r),{style:l(t)})}).join("");return b("tr",t)}).join(""),a=b("thead",b("tr",n)),o=b("tbody",u);return b("table",a+o)}},newline:{order:D++,match:g(/^(?:\n *)*\n/),parse:q,react:function(n,t,e){return"\n"},html:function(n,t,e){return"\n"}},paragraph:{order:D++,match:g(/^((?:[^\n]|\n(?! *\n))+)(?:\n *)+\n/),parse:j,react:function(n,t,e){return x("div",e.key,{className:"paragraph",children:t(n.content,e)})},html:function(n,t,e){return b("div",t(n.content,e),{class:"paragraph"})}},escape:{order:D++,match:m(/^\\([^0-9A-Za-z\s])/),parse:function(n,t,e){return{type:"text",content:n[1]}},react:null,html:null},autolink:{order:D++,match:m(/^<([^ >]+:\/[^ >]+)>/),parse:function(n,t,e){return{type:"link",content:[{type:"text",content:n[1]}],target:n[1]}},react:null,html:null},mailto:{order:D++,match:m(/^<([^ >]+@[^ >]+)>/),parse:function(n,t,e){var r=n[1],l=n[1];return H.test(l)||(l="mailto:"+l),{type:"link",content:[{type:"text",content:r}],target:l}},react:null,html:null},url:{order:D++,match:m(/^(https?:\/\/[^\s<]+[^<.,:;"')\]\s])/),parse:function(n,t,e){return{type:"link",content:[{type:"text",content:n[1]}],target:n[1],title:void 0}},react:null,html:null},link:{order:D++,match:m(new RegExp("^\\[("+M+")\\]\\("+U+"\\)")),parse:function(n,t,e){return{content:t(n[1],e),target:O(n[2]),title:n[3]}},react:function(n,t,e){return x("a",e.key,{href:S(n.target),title:n.title,children:t(n.content,e)})},html:function(n,t,e){var r={href:S(n.target),title:n.title};return b("a",t(n.content,e),r)}},image:{order:D++,match:m(new RegExp("^!\\[("+M+")\\]\\("+U+"\\)")),parse:function(n,t,e){return{alt:n[1],target:O(n[2]),title:n[3]}},react:function(n,t,e){return x("img",e.key,{src:S(n.target),alt:n.alt,title:n.title})},html:function(n,t,e){var r={src:S(n.target),alt:n.alt,title:n.title};return b("img","",r,!1)}},reflink:{order:D++,match:m(new RegExp("^\\[("+M+")\\]\\s*\\[([^\\]]*)\\]")),parse:function(n,t,e){return X(n,e,{type:"link",content:t(n[1],e)})},react:null,html:null},refimage:{order:D++,match:m(new RegExp("^!\\[("+M+")\\]\\s*\\[([^\\]]*)\\]")),parse:function(n,t,e){return X(n,e,{type:"image",alt:n[1]})},react:null,html:null},em:{order:D,match:m(new RegExp("^\\b_((?:__|\\\\[\\s\\S]|[^\\\\_])+?)_\\b|^\\*(?=\\S)((?:\\*\\*|\\\\[\\s\\S]|\\s+(?:\\\\[\\s\\S]|[^\\s\\*\\\\]|\\*\\*)|[^\\s\\*\\\\])+?)\\*(?!\\*)")),quality:function(n){return n[0].length+.2},parse:function(n,t,e){return{content:t(n[2]||n[1],e)}},react:function(n,t,e){return x("em",e.key,{children:t(n.content,e)})},html:function(n,t,e){return b("em",t(n.content,e))}},strong:{order:D,match:m(/^\*\*((?:\\[\s\S]|[^\\])+?)\*\*(?!\*)/),quality:function(n){return n[0].length+.1},parse:j,react:function(n,t,e){return x("strong",e.key,{children:t(n.content,e)})},html:function(n,t,e){return b("strong",t(n.content,e))}},u:{order:D++,match:m(/^__((?:\\[\s\S]|[^\\])+?)__(?!_)/),quality:function(n){return n[0].length},parse:j,react:function(n,t,e){return x("u",e.key,{children:t(n.content,e)})},html:function(n,t,e){return b("u",t(n.content,e))}},del:{order:D++,match:m(/^~~(?=\S)((?:\\[\s\S]|~(?!~)|[^\s\\~]|\s+(?!~~))+?)~~/),parse:j,react:function(n,t,e){return x("del",e.key,{children:t(n.content,e)})},html:function(n,t,e){return b("del",t(n.content,e))}},inlineCode:{order:D++,match:m(/^(`+)\s*([\s\S]*?[^`])\s*\1(?!`)/),parse:function(n,t,e){return{content:n[2]}},react:function(n,t,e){return x("code",e.key,{children:n.content})},html:function(n,t,e){return b("code",A(n.content))}},br:{order:D++,match:y(/^ {2,}\n/),parse:q,react:function(n,t,e){return x("br",e.key,_)},html:function(n,t,e){return"
"}},text:{order:D++,match:y(/^[\s\S]+?(?=[^0-9A-Za-z\s\u00c0-\uffff]|\n\n| {2,}\n|\w+:\S|$)/),parse:function(n,t,e){return{content:n[0]}},react:function(n,t,e){return n.content},html:function(n,t,e){return A(n.content)}}},J=function(e,r,l){if(!r)throw new Error("simple-markdown: outputFor: `property` must be defined. if you just upgraded, you probably need to replace `outputFor` with `reactFor`");var u,a=e.Array||Q.Array,o=function(n,t){return u=t=t||u,Array.isArray(n)?a[r](n,o,t):e[n.type][r](n,o,t)};return function(n,t){return u=w(t,l),o(n,u)}},K=n(Q),V=function(n,t){return(t=t||{}).inline=!1,K(n,t)},W=function(n,t){var e=C.test(n);return(t=t||{}).inline=!e,K(n,t)},Y=J(Q,"react"),nn=J(Q,"html"),tn=function(n,t){return Y(V(n,t),t)},en={defaultRules:Q,parserFor:n,outputFor:J,inlineRegex:m,blockRegex:g,anyScopeRegex:y,parseInline:P,parseBlock:function(n,t,e){var r=e.inline||!1;e.inline=!1;var l=n(t+"\n\n",e);return e.inline=r,l},markdownToReact:tn,markdownToHtml:function(n,t){return nn(V(n,t),t)},ReactMarkdown:function(n){var t={};for(var e in n)"source"!==e&&Object.prototype.hasOwnProperty.call(n,e)&&(t[e]=n[e]);return t.children=tn(n.source),x("div",null,t)},defaultBlockParse:V,defaultInlineParse:function(n,t){return(t=t||{}).inline=!0,K(n,t)},defaultImplicitParse:W,defaultReactOutput:Y,defaultHtmlOutput:nn,preprocess:k,sanitizeText:A,sanitizeUrl:S,unescapeUrl:O,htmlTag:b,reactElement:x,defaultRawParse:K,ruleOutput:function(r,l){return l||"undefined"==typeof console||console.warn("simple-markdown ruleOutput should take 'react' or 'html' as the second argument."),function(n,t,e){return r[n.type][l](n,t,e)}},reactFor:function(o){var c=function(n,t){if(t=t||{},Array.isArray(n)){for(var e=t.key,r=[],l=null,u=0;u";return r?l+e+"":l}function u(t){if(null==t)return null;try{var e=decodeURIComponent(t).replace(/[^A-Za-z0-9/:]/g,"").toLowerCase();if(0===e.indexOf("javascript:")||0===e.indexOf("vbscript:")||0===e.indexOf("data:"))return null}catch(t){return null}return t}function l(t){return t.replace(A,"$1")}function f(t,e,n){var r=n.inline||!1;n.inline=!0;var o=t(e,n);return n.inline=r,o}function p(t,e,n){return{content:f(e,t[1],n)}}function s(){return{}}function d(t){return String(t).replace(E,function(t){return S[t]})}var h,m,y,g,v,k=/\r\n?/g,w=/\t/g,x=/\f/g,b="function"==typeof Symbol&&Symbol.for&&Symbol.for("react.element")||60103,_={},E=/[<>&"']/g,S={"<":"<",">":">","&":"&",'"':""","'":"'","/":"/","`":"`"},A=/\\([^0-9A-Za-z\s])/g,R="(?:[*+-]|\\d+\\.)",$="( *)("+R+") +",O=new RegExp("^"+$),T=new RegExp($+"[^\\n]*(?:\\n(?!\\1"+R+" )[^\\n]*)*(\n|$)","gm"),j=/\n{2,}$/,C=/^ (?= *`)|(` *) $/g,P=j,q=/ *\n+$/,F=new RegExp("^( *)("+R+") [\\s\\S]+?(?:\n{2,}(?! )(?!\\1"+R+" )\\n*|\\s*\n*$)"),B=/(?:^|\n)( *)$/,N=(h=/^ *\| *| *\| *$/g,m=/ *$/,y=/^ *-+: *$/,g=/^ *:-+: *$/,v=/^ *:-+ *$/,{parseTable:z(!0),parseNpTable:z(!1),TABLE_REGEX:/^ *(\|.+)\n *\|( *[-:]+[-| :]*)\n((?: *\|.*(?:\n|$))*)\n*/,NPTABLE_REGEX:/^ *(\S.*\|.*)\n *([-:]+ *\|[-| :]*)\n((?:.*\|.*(?:\n|$))*)\n*/});function I(t){return y.test(t)?"right":g.test(t)?"center":v.test(t)?"left":null}function L(t,e,n,r){var o=n.inTable;n.inTable=!0;var u=e(t.trim(),n);n.inTable=o;var a=[[]];return u.forEach(function(t,e){"tableSeparator"===t.type?r&&(0===e||e===u.length-1)||a.push([]):("text"!==t.type||null!=u[e+1]&&"tableSeparator"!==u[e+1].type||(t.content=t.content.replace(m,"")),a[a.length-1].push(t))}),a}function z(p){return function(t,e,n){n.inline=!0;var r,o,u,a,l,c=L(t[1],e,n,p),i=(l=t[2],p&&(l=l.replace(h,"")),l.trim().split("|").map(I)),f=(r=t[3],o=e,u=n,a=p,r.trim().split("\n").map(function(t){return L(t,o,u,a)}));return n.inline=!1,{type:"table",header:c,align:i,cells:f}}}function G(t,e,n){var r=(t[2]||t[1]).replace(/\s+/g," ").toLowerCase();if(e._defs&&e._defs[r]){var o=e._defs[r];n.target=o.target,n.title=o.title}return e._refs=e._refs||{},e._refs[r]=e._refs[r]||[],e._refs[r].push(n),n}function X(n,r,o){if(!r)throw new Error("simple-markdown: outputFor: `property` must be defined. if you just upgraded, you probably need to replace `outputFor` with `reactFor`");var u,t=(n.Array||K.Array)[r];if(!t)throw new Error("simple-markdown: outputFor: to join nodes of type `"+r+"` you must provide an `Array:` joiner rule with that type, Please see the docs for details on specifying an Array rule.");var a=t,l=function(t,e){return u=e=e||u,Array.isArray(t)?a(t,l,e):n[t.type][r](t,l,e)};return function(t,e){return u=c(e,o),l(t,u)}}function Z(t,e){return(e=e||{}).inline=!1,V(t,e)}function U(t,e){var n=j.test(t);return(e=e||{}).inline=!n,V(t,e)}function H(t,e){return W(Z(t,e),e)}var M="(?:\\[[^\\]]*\\]|[^\\[\\]]|\\](?=[^\\[]*\\]))*",D="\\s*?(?:\\s+['\"]([\\s\\S]*?)['\"])?\\s*",Q=/mailto:/i,J=0,K={Array:{react:function(t,e,n){for(var r=n.key,o=[],u=0;u"}},codeBlock:{order:J++,match:n(/^(?: [^\n]+\n*)+(?:\n *)+\n/),parse:function(t,e,n){return{lang:void 0,content:t[0].replace(/^ /gm,"").replace(/\n+$/,"")}},react:function(t,e,n){var r=t.lang?"markdown-code-"+t.lang:void 0;return a("pre",n.key,{children:a("code",null,{className:r,children:t.content})})},html:function(t,e,n){var r=t.lang?"markdown-code-"+t.lang:void 0,o=i("code",d(t.content),{class:r});return i("pre",o)}},fence:{order:J++,match:n(/^ *(`{3,}|~{3,}) *(?:(\S+) *)?\n([\s\S]+?)\n?\1 *(?:\n *)+\n/),parse:function(t,e,n){return{type:"codeBlock",lang:t[2]||void 0,content:t[3]}},react:null,html:null},blockQuote:{order:J++,match:n(/^( *>[^\n]+(\n[^\n]+)*\n*)+\n{2,}/),parse:function(t,e,n){return{content:e(t[0].replace(/^ *> ?/gm,""),n)}},react:function(t,e,n){return a("blockquote",n.key,{children:e(t.content,n)})},html:function(t,e,n){return i("blockquote",e(t.content,n))}},list:{order:J++,match:function(t,e){var n=null==e.prevCapture?"":e.prevCapture[0],r=B.exec(n),o=e._list||!e.inline;return r&&o?(t=r[1]+t,F.exec(t)):null},parse:function(t,s,d){var e=t[2],n=1]*)>?(?: +["(]([^\n]+)[")])? *\n(?: *\n)*/),parse:function(t,e,n){var r=t[1].replace(/\s+/g," ").toLowerCase(),o=t[2],u=t[3];return n._refs&&n._refs[r]&&n._refs[r].forEach(function(t){t.target=o,t.title=u}),n._defs=n._defs||{},n._defs[r]={target:o,title:u},{def:r,target:o,title:u}},react:function(){return null},html:function(){return""}},table:{order:J++,match:n(N.TABLE_REGEX),parse:N.parseTable,react:function(e,n,r){function o(t){return null==e.align[t]?{}:{textAlign:e.align[t]}}var t=e.header.map(function(t,e){return a("th",""+e,{style:o(e),scope:"col",children:n(t,r)})}),u=e.cells.map(function(t,e){return a("tr",""+e,{children:t.map(function(t,e){return a("td",""+e,{style:o(e),children:n(t,r)})})})});return a("table",r.key,{children:[a("thead","thead",{children:a("tr",null,{children:t})}),a("tbody","tbody",{children:u})]})},html:function(e,n,r){function o(t){return null==e.align[t]?"":"text-align:"+e.align[t]+";"}var t=e.header.map(function(t,e){return i("th",n(t,r),{style:o(e),scope:"col"})}).join(""),u=e.cells.map(function(t){var e=t.map(function(t,e){return i("td",n(t,r),{style:o(e)})}).join("");return i("tr",e)}).join(""),a=i("thead",i("tr",t)),l=i("tbody",u);return i("table",a+l)}},newline:{order:J++,match:n(/^(?:\n *)*\n/),parse:s,react:function(t,e,n){return"\n"},html:function(t,e,n){return"\n"}},paragraph:{order:J++,match:n(/^((?:[^\n]|\n(?! *\n))+)(?:\n *)+\n/),parse:p,react:function(t,e,n){return a("div",n.key,{className:"paragraph",children:e(t.content,n)})},html:function(t,e,n){return i("div",e(t.content,n),{class:"paragraph"})}},escape:{order:J++,match:e(/^\\([^0-9A-Za-z\s])/),parse:function(t,e,n){return{type:"text",content:t[1]}},react:null,html:null},tableSeparator:{order:J++,match:function(t,e){return e.inTable?/^ *\| */.exec(t):null},parse:function(){return{type:"tableSeparator"}},react:function(){return" | "},html:function(){return" | "}},autolink:{order:J++,match:e(/^<([^: >]+:\/[^ >]+)>/),parse:function(t,e,n){return{type:"link",content:[{type:"text",content:t[1]}],target:t[1]}},react:null,html:null},mailto:{order:J++,match:e(/^<([^ >]+@[^ >]+)>/),parse:function(t,e,n){var r=t[1],o=t[1];return Q.test(o)||(o="mailto:"+o),{type:"link",content:[{type:"text",content:r}],target:o}},react:null,html:null},url:{order:J++,match:e(/^(https?:\/\/[^\s<]+[^<.,:;"')\]\s])/),parse:function(t,e,n){return{type:"link",content:[{type:"text",content:t[1]}],target:t[1],title:void 0}},react:null,html:null},link:{order:J++,match:e(new RegExp("^\\[("+M+")\\]\\("+D+"\\)")),parse:function(t,e,n){return{content:e(t[1],n),target:l(t[2]),title:t[3]}},react:function(t,e,n){return a("a",n.key,{href:u(t.target),title:t.title,children:e(t.content,n)})},html:function(t,e,n){var r={href:u(t.target),title:t.title};return i("a",e(t.content,n),r)}},image:{order:J++,match:e(new RegExp("^!\\[("+M+")\\]\\("+D+"\\)")),parse:function(t,e,n){return{alt:t[1],target:l(t[2]),title:t[3]}},react:function(t,e,n){return a("img",n.key,{src:u(t.target),alt:t.alt,title:t.title})},html:function(t,e,n){return i("img","",{src:u(t.target),alt:t.alt,title:t.title},!1)}},reflink:{order:J++,match:e(new RegExp("^\\[("+M+")\\]\\s*\\[([^\\]]*)\\]")),parse:function(t,e,n){return G(t,n,{type:"link",content:e(t[1],n)})},react:null,html:null},refimage:{order:J++,match:e(new RegExp("^!\\[("+M+")\\]\\s*\\[([^\\]]*)\\]")),parse:function(t,e,n){return G(t,n,{type:"image",alt:t[1]})},react:null,html:null},em:{order:J,match:e(new RegExp("^\\b_((?:__|\\\\[\\s\\S]|[^\\\\_])+?)_\\b|^\\*(?=\\S)((?:\\*\\*|\\\\[\\s\\S]|\\s+(?:\\\\[\\s\\S]|[^\\s\\*\\\\]|\\*\\*)|[^\\s\\*\\\\])+?)\\*(?!\\*)")),quality:function(t){return t[0].length+.2},parse:function(t,e,n){return{content:e(t[2]||t[1],n)}},react:function(t,e,n){return a("em",n.key,{children:e(t.content,n)})},html:function(t,e,n){return i("em",e(t.content,n))}},strong:{order:J,match:e(/^\*\*((?:\\[\s\S]|[^\\])+?)\*\*(?!\*)/),quality:function(t){return t[0].length+.1},parse:p,react:function(t,e,n){return a("strong",n.key,{children:e(t.content,n)})},html:function(t,e,n){return i("strong",e(t.content,n))}},u:{order:J++,match:e(/^__((?:\\[\s\S]|[^\\])+?)__(?!_)/),quality:function(t){return t[0].length},parse:p,react:function(t,e,n){return a("u",n.key,{children:e(t.content,n)})},html:function(t,e,n){return i("u",e(t.content,n))}},del:{order:J++,match:e(/^~~(?=\S)((?:\\[\s\S]|~(?!~)|[^\s~]|\s(?!~~))+?)~~/),parse:p,react:function(t,e,n){return a("del",n.key,{children:e(t.content,n)})},html:function(t,e,n){return i("del",e(t.content,n))}},inlineCode:{order:J++,match:e(/^(`+)([\s\S]*?[^`])\1(?!`)/),parse:function(t,e,n){return{content:t[2].replace(C,"$1")}},react:function(t,e,n){return a("code",n.key,{children:t.content})},html:function(t,e,n){return i("code",d(t.content))}},br:{order:J++,match:o(/^ {2,}\n/),parse:s,react:function(t,e,n){return a("br",n.key,_)},html:function(t,e,n){return"
"}},text:{order:J++,match:o(/^[\s\S]+?(?=[^0-9A-Za-z\s\u00c0-\uffff]|\n\n| {2,}\n|\w+:\S|$)/),parse:function(t,e,n){return{content:t[0]}},react:function(t,e,n){return t.content},html:function(t,e,n){return d(t.content)}}},V=t(K),W=X(K,"react"),Y=X(K,"html");return{defaultRules:K,parserFor:t,outputFor:X,inlineRegex:e,blockRegex:n,anyScopeRegex:o,parseInline:f,parseBlock:function(t,e,n){var r=n.inline||!1;n.inline=!1;var o=t(e+"\n\n",n);return n.inline=r,o},markdownToReact:H,markdownToHtml:function(t,e){return Y(Z(t,e),e)},ReactMarkdown:function(t){var e={};for(var n in t)"source"!==n&&Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e.children=H(t.source),a("div",null,e)},defaultBlockParse:Z,defaultInlineParse:function(t,e){return(e=e||{}).inline=!0,V(t,e)},defaultImplicitParse:U,defaultReactOutput:W,defaultHtmlOutput:Y,preprocess:r,sanitizeText:d,sanitizeUrl:u,unescapeUrl:l,htmlTag:i,reactElement:a,defaultRawParse:V,ruleOutput:function(r,o){return o||"undefined"==typeof console||console.warn("simple-markdown ruleOutput should take 'react' or 'html' as the second argument."),function(t,e,n){return r[t.type][o](t,e,n)}},reactFor:function(l){var c=function(t,e){if(e=e||{},Array.isArray(t)){for(var n=e.key,r=[],o=null,u=0;u +/// + +/*:: +// Flow Type Definitions: + +type Capture = + Array & {index: number} | + Array & {index?: number}; + +type Attr = string | number | boolean | null | void; + +type SingleASTNode = { + type: string, + [string]: any, +}; + +type UnTypedASTNode = { + [string]: any +}; + +type ASTNode = SingleASTNode | Array; + +type State = { + key?: string | number | void, + inline?: ?boolean, + [string]: any, +}; + +type ReactElement = React$Element; +type ReactElements = React$Node; + +type MatchFunction = { regex?: RegExp } & ( + source: string, + state: State, + prevCapture: string +) => ?Capture; + +type Parser = ( + source: string, + state?: ?State +) => Array; + +type ParseFunction = ( + capture: Capture, + nestedParse: Parser, + state: State, +) => (UnTypedASTNode | ASTNode); + +type SingleNodeParseFunction = ( + capture: Capture, + nestedParse: Parser, + state: State, +) => UnTypedASTNode; + +type Output = ( + node: ASTNode, + state?: ?State +) => Result; + +type NodeOutput = ( + node: SingleASTNode, + nestedOutput: Output, + state: State +) => Result; + +type ArrayNodeOutput = ( + node: Array, + nestedOutput: Output, + state: State +) => Result; + +type ReactOutput = Output; +type ReactNodeOutput = NodeOutput; +type HtmlOutput = Output; +type HtmlNodeOutput = NodeOutput; + +type ParserRule = { + +order: number, + +match: MatchFunction, + +quality?: (capture: Capture, state: State, prevCapture: string) => number, + +parse: ParseFunction, +}; + +type SingleNodeParserRule = { + +order: number, + +match: MatchFunction, + +quality?: (capture: Capture, state: State, prevCapture: string) => number, + +parse: SingleNodeParseFunction, +}; + +type ReactOutputRule = { + // we allow null because some rules are never output results, and that's + // legal as long as no parsers return an AST node matching that rule. + // We don't use ? because this makes it be explicitly defined as either + // a valid function or null, so it can't be forgotten. + +react: ReactNodeOutput | null, +}; + +type HtmlOutputRule = { + +html: HtmlNodeOutput | null, +}; + +type ArrayRule = { + +react?: ArrayNodeOutput, + +html?: ArrayNodeOutput, + +[string]: ArrayNodeOutput, +}; + +type ParserRules = { + +Array?: ArrayRule, + +[type: string]: ParserRule, +}; + +type OutputRules = { + +Array?: ArrayRule, + +[type: string]: Rule +}; +type Rules = { + +Array?: ArrayRule, + +[type: string]: ParserRule & OutputRule, +}; +type ReactRules = { + +Array?: { + +react: ArrayNodeOutput, + }, + +[type: string]: ParserRule & ReactOutputRule, +}; +type HtmlRules = { + +Array?: { + +html: ArrayNodeOutput, + }, + +[type: string]: ParserRule & HtmlOutputRule, +}; + +// We want to clarify our defaultRules types a little bit more so clients can +// reuse defaultRules built-ins. So we make some stronger guarantess when +// we can: +type NonNullReactOutputRule = { + +react: ReactNodeOutput, +}; +type ElementReactOutputRule = { + +react: NodeOutput, +}; +type TextReactOutputRule = { + +react: NodeOutput, +}; +type NonNullHtmlOutputRule = { + +html: HtmlNodeOutput, +}; + +type DefaultInRule = SingleNodeParserRule & ReactOutputRule & HtmlOutputRule; +type TextInOutRule = SingleNodeParserRule & TextReactOutputRule & NonNullHtmlOutputRule; +type LenientInOutRule = SingleNodeParserRule & NonNullReactOutputRule & NonNullHtmlOutputRule; +type DefaultInOutRule = SingleNodeParserRule & ElementReactOutputRule & NonNullHtmlOutputRule; + +type DefaultRules = { + +Array: { + +react: ArrayNodeOutput, + +html: ArrayNodeOutput + }, + +heading: DefaultInOutRule, + +nptable: DefaultInRule, + +lheading: DefaultInRule, + +hr: DefaultInOutRule, + +codeBlock: DefaultInOutRule, + +fence: DefaultInRule, + +blockQuote: DefaultInOutRule, + +list: DefaultInOutRule, + +def: LenientInOutRule, + +table: DefaultInOutRule, + +tableSeparator: DefaultInRule, + +newline: TextInOutRule, + +paragraph: DefaultInOutRule, + +escape: DefaultInRule, + +autolink: DefaultInRule, + +mailto: DefaultInRule, + +url: DefaultInRule, + +link: DefaultInOutRule, + +image: DefaultInOutRule, + +reflink: DefaultInRule, + +refimage: DefaultInRule, + +em: DefaultInOutRule, + +strong: DefaultInOutRule, + +u: DefaultInOutRule, + +del: DefaultInOutRule, + +inlineCode: DefaultInOutRule, + +br: DefaultInOutRule, + +text: TextInOutRule, +}; + +type RefNode = { + type: string, + content?: ASTNode, + target?: string, + title?: string, + alt?: string, +}; + +// End Flow Definitions +*/ + +var CR_NEWLINE_R = /\r\n?/g; +var TAB_R = /\t/g; +var FORMFEED_R = /\f/g; + +/** + * Turn various whitespace into easy-to-process whitespace + * @param {string} source + * @returns {string} + */ +var preprocess = function(source /* : string */) { + return source.replace(CR_NEWLINE_R, '\n') + .replace(FORMFEED_R, '') + .replace(TAB_R, ' '); +}; + +/** + * @param {SimpleMarkdown.OptionalState} givenState + * @param {SimpleMarkdown.OptionalState} defaultState + * @returns {SimpleMarkdown.State} + */ +var populateInitialState = function( + givenState /* : ?State */, + defaultState /* : ?State */ +) /* : State */{ + var state /* : State */ = givenState || {}; + if (defaultState != null) { + for (var prop in defaultState) { + if (Object.prototype.hasOwnProperty.call(defaultState, prop)) { + state[prop] = defaultState[prop]; + } + } + } + return state; +}; + +/** + * Creates a parser for a given set of rules, with the precedence + * specified as a list of rules. + * + * @param {SimpleMarkdown.ParserRules} rules + * an object containing + * rule type -> {match, order, parse} objects + * (lower order is higher precedence) + * @param {SimpleMarkdown.OptionalState} [defaultState] + * + * @returns {SimpleMarkdown.Parser} + * The resulting parse function, with the following parameters: + * @source: the input source string to be parsed + * @state: an optional object to be threaded through parse + * calls. Allows clients to add stateful operations to + * parsing, such as keeping track of how many levels deep + * some nesting is. For an example use-case, see passage-ref + * parsing in src/widgets/passage/passage-markdown.jsx + */ +var parserFor = function(rules /*: ParserRules */, defaultState /*: ?State */) { + // Sorts rules in order of increasing order, then + // ascending rule name in case of ties. + var ruleList = Object.keys(rules).filter(function(type) { + var rule = rules[type]; + if (rule == null || rule.match == null) { + return false; + } + var order = rule.order; + if ((typeof order !== 'number' || !isFinite(order)) && + typeof console !== 'undefined') { + console.warn( + "simple-markdown: Invalid order for rule `" + type + "`: " + + String(order) + ); + } + return true; + }); + + ruleList.sort(function(typeA, typeB) { + var ruleA /* : ParserRule */ = /** @type {SimpleMarkdown.ParserRule} */ (rules[typeA] /*:: :any */); + var ruleB /* : ParserRule */ = /** @type {SimpleMarkdown.ParserRule} */ (rules[typeB] /*:: :any */); + var orderA = ruleA.order; + var orderB = ruleB.order; + + // First sort based on increasing order + if (orderA !== orderB) { + return orderA - orderB; + } + + var secondaryOrderA = ruleA.quality ? 0 : 1; + var secondaryOrderB = ruleB.quality ? 0 : 1; + + if (secondaryOrderA !== secondaryOrderB) { + return secondaryOrderA - secondaryOrderB; + + // Then based on increasing unicode lexicographic ordering + } else if (typeA < typeB) { + return -1; + } else if (typeA > typeB) { + return 1; + + } else { + // Rules should never have the same name, + // but this is provided for completeness. + return 0; + } + }); + + /** @type {SimpleMarkdown.State} */ + var latestState; + /** @type {SimpleMarkdown.Parser} */ + var nestedParse = function(source /* : string */, state /* : ?State */) { + /** @type Array */ + var result = []; + state = state || latestState; + latestState = state; + while (source) { + // store the best match, it's rule, and quality: + var ruleType = null; + var rule = null; + var capture = null; + var quality = NaN; + + // loop control variables: + var i = 0; + var currRuleType = ruleList[0]; + var currRule /* : ParserRule */ = /** @type {SimpleMarkdown.ParserRule} */ ( rules[currRuleType] /*:: :any */ ); + + do { + var currOrder = currRule.order; + var prevCaptureStr = state.prevCapture == null ? "" : state.prevCapture[0]; + var currCapture = currRule.match(source, state, prevCaptureStr); + + if (currCapture) { + var currQuality = currRule.quality ? currRule.quality( + currCapture, + state, + prevCaptureStr + ) : 0; + // This should always be true the first time because + // the initial quality is NaN (that's why there's the + // condition negation). + if (!(currQuality <= quality)) { + ruleType = currRuleType; + rule = currRule; + capture = currCapture; + quality = currQuality; + } + } + + // Move on to the next item. + // Note that this makes `currRule` be the next item + i++; + currRuleType = ruleList[i]; + currRule = /*::((*/ /** @type {SimpleMarkdown.ParserRule} */ (rules[currRuleType]) /*:: : any) : ParserRule)*/; + + } while ( + // keep looping while we're still within the ruleList + currRule && ( + // if we don't have a match yet, continue + !capture || ( + // or if we have a match, but the next rule is + // at the same order, and has a quality measurement + // functions, then this rule must have a quality + // measurement function (since they are sorted before + // those without), and we need to check if there is + // a better quality match + currRule.order === currOrder && + currRule.quality + ) + ) + ); + + // TODO(aria): Write tests for these + if (rule == null || capture == null /*:: || ruleType == null */) { + throw new Error( + "Could not find a matching rule for the below " + + "content. The rule with highest `order` should " + + "always match content provided to it. Check " + + "the definition of `match` for '" + + ruleList[ruleList.length - 1] + + "'. It seems to not match the following source:\n" + + source + ); + } + if (capture.index) { // If present and non-zero, i.e. a non-^ regexp result: + throw new Error( + "`match` must return a capture starting at index 0 " + + "(the current parse index). Did you forget a ^ at the " + + "start of the RegExp?" + ); + } + + var parsed = rule.parse(capture, nestedParse, state); + // We maintain the same object here so that rules can + // store references to the objects they return and + // modify them later. (oops sorry! but this adds a lot + // of power--see reflinks.) + if (Array.isArray(parsed)) { + Array.prototype.push.apply(result, parsed); + } else { + // We also let rules override the default type of + // their parsed node if they would like to, so that + // there can be a single output function for all links, + // even if there are several rules to parse them. + if (parsed.type == null) { + parsed.type = ruleType; + } + result.push(/** @type {SimpleMarkdown.SingleASTNode} */ (parsed)); + } + + state.prevCapture = capture; + source = source.substring(state.prevCapture[0].length); + } + return result; + }; + + /** @type {SimpleMarkdown.Parser} */ + var outerParse = function(source /* : string */, state /* : ?State */) { + latestState = populateInitialState(state, defaultState); + if (!latestState.inline && !latestState.disableAutoBlockNewlines) { + source = source + "\n\n"; + } + // We store the previous capture so that match functions can + // use some limited amount of lookbehind. Lists use this to + // ensure they don't match arbitrary '- ' or '* ' in inline + // text (see the list rule for more information). This stores + // the full regex capture object, if there is one. + latestState.prevCapture = null; + return nestedParse(preprocess(source), latestState); + }; + return outerParse; +}; + +// Creates a match function for an inline scoped element from a regex +/** @type {(regex: RegExp) => SimpleMarkdown.MatchFunction} */ +var inlineRegex = function(regex /* : RegExp */) { + /** @type {SimpleMarkdown.MatchFunction} */ + var match /* : MatchFunction */ = function(source, state) { + if (state.inline) { + return regex.exec(source); + } else { + return null; + } + }; + match.regex = regex; + return match; +}; + +// Creates a match function for a block scoped element from a regex +/** @type {(regex: RegExp) => SimpleMarkdown.MatchFunction} */ +var blockRegex = function(regex /* : RegExp */) { + /** @type {SimpleMarkdown.MatchFunction} */ + var match /* : MatchFunction */ = function(source, state) { + if (state.inline) { + return null; + } else { + return regex.exec(source); + } + }; + match.regex = regex; + return match; +}; + +// Creates a match function from a regex, ignoring block/inline scope +/** @type {(regex: RegExp) => SimpleMarkdown.MatchFunction} */ +var anyScopeRegex = function(regex /* : RegExp */) { + /** @type {SimpleMarkdown.MatchFunction} */ + var match /* : MatchFunction */ = function(source, state) { + return regex.exec(source); + }; + match.regex = regex; + return match; +}; + +var TYPE_SYMBOL = + (typeof Symbol === 'function' && Symbol.for && + Symbol.for('react.element')) || + 0xeac7; + +/** + * @param {string} type + * @param {string | number | null | undefined} key + * @param {Object} props + * @returns {SimpleMarkdown.ReactElement} + */ +var reactElement = function( + type /* : string */, + key /* : string | number | null | void */, + props /* : { [string]: any } */ +) /* : ReactElement */ { + var element /* : ReactElement */ = /** @type {SimpleMarkdown.ReactElement} */ ({ + $$typeof: TYPE_SYMBOL, + type: type, + key: key == null ? undefined : key, + ref: null, + props: props, + _owner: null + } /* : any */); + return element; +}; + +/** Returns a closed HTML tag. + * @param {string} tagName - Name of HTML tag (eg. "em" or "a") + * @param {string} content - Inner content of tag + * @param {{ [attr: string]: SimpleMarkdown.Attr }} [attributes] - Optional extra attributes of tag as an object of key-value pairs + * eg. { "href": "http://google.com" }. Falsey attributes are filtered out. + * @param {boolean} [isClosed] - boolean that controls whether tag is closed or not (eg. img tags). + * defaults to true + */ +var htmlTag = function( + tagName /* : string */, + content /* : string */, + attributes /* : ?{[any]: ?Attr} */, + isClosed /* : ?boolean */ +) { + attributes = attributes || {}; + isClosed = typeof isClosed !== 'undefined' ? isClosed : true; + + var attributeString = ""; + for (var attr in attributes) { + var attribute = attributes[attr]; + // Removes falsey attributes + if (Object.prototype.hasOwnProperty.call(attributes, attr) && + attribute) { + attributeString += " " + + sanitizeText(attr) + '="' + + sanitizeText(attribute) + '"'; + } + } + + var unclosedTag = "<" + tagName + attributeString + ">"; + + if (isClosed) { + return unclosedTag + content + ""; + } else { + return unclosedTag; + } +}; + +var EMPTY_PROPS = {}; + +/** + * @param {string | null | undefined} url - url to sanitize + * @returns {string | null} - url if safe, or null if a safe url could not be made + */ +var sanitizeUrl = function(url /* : ?string */) { + if (url == null) { + return null; + } + try { + var prot = decodeURIComponent(url) + .replace(/[^A-Za-z0-9/:]/g, '') + .toLowerCase(); + if (prot.indexOf('javascript:') === 0 || prot.indexOf('vbscript:') === 0 || prot.indexOf('data:') === 0) { + return null; + } + } catch (e) { + // decodeURIComponent sometimes throws a URIError + // See `decodeURIComponent('a%AFc');` + // http://stackoverflow.com/questions/9064536/javascript-decodeuricomponent-malformed-uri-exception + return null; + } + return url; +}; + +var SANITIZE_TEXT_R = /[<>&"']/g; +/** @type {any} */ +var SANITIZE_TEXT_CODES = { + '<': '<', + '>': '>', + '&': '&', + '"': '"', + "'": ''', + '/': '/', + "`": '`' +}; +/** + * @param {SimpleMarkdown.Attr} text + * @returns {string} + */ +var sanitizeText = function(text /* : Attr */) { + return String(text).replace(SANITIZE_TEXT_R, function(chr) { + return SANITIZE_TEXT_CODES[chr]; + }); +}; + +var UNESCAPE_URL_R = /\\([^0-9A-Za-z\s])/g; + +/** + * @param {string} rawUrlString + * @returns {string} + */ +var unescapeUrl = function(rawUrlString /* : string */) { + return rawUrlString.replace(UNESCAPE_URL_R, "$1"); +}; + +/** + * Parse some content with the parser `parse`, with state.inline + * set to true. Useful for block elements; not generally necessary + * to be used by inline elements (where state.inline is already true. + * + * @param {SimpleMarkdown.Parser} parse + * @param {string} content + * @param {SimpleMarkdown.State} state + * @returns {SimpleMarkdown.ASTNode} + */ +var parseInline = function(parse, content, state) { + var isCurrentlyInline = state.inline || false; + state.inline = true; + var result = parse(content, state); + state.inline = isCurrentlyInline; + return result; +}; +/** + * @param {SimpleMarkdown.Parser} parse + * @param {string} content + * @param {SimpleMarkdown.State} state + * @returns {SimpleMarkdown.ASTNode} + */ +var parseBlock = function(parse, content, state) { + var isCurrentlyInline = state.inline || false; + state.inline = false; + var result = parse(content + "\n\n", state); + state.inline = isCurrentlyInline; + return result; +}; + +/** + * @param {SimpleMarkdown.Capture} capture + * @param {SimpleMarkdown.Parser} parse + * @param {SimpleMarkdown.State} state + * @returns {SimpleMarkdown.UnTypedASTNode} + */ +var parseCaptureInline = function(capture, parse, state) { + return { + content: parseInline(parse, capture[1], state) + }; +}; +/** + * @returns {SimpleMarkdown.UnTypedASTNode} + */ +var ignoreCapture = function() { return {}; }; + +// recognize a `*` `-`, `+`, `1.`, `2.`... list bullet +var LIST_BULLET = "(?:[*+-]|\\d+\\.)"; +// recognize the start of a list item: +// leading space plus a bullet plus a space (` * `) +var LIST_ITEM_PREFIX = "( *)(" + LIST_BULLET + ") +"; +var LIST_ITEM_PREFIX_R = new RegExp("^" + LIST_ITEM_PREFIX); +// recognize an individual list item: +// * hi +// this is part of the same item +// +// as is this, which is a new paragraph in the same item +// +// * but this is not part of the same item +var LIST_ITEM_R = new RegExp( + LIST_ITEM_PREFIX + + "[^\\n]*(?:\\n" + + "(?!\\1" + LIST_BULLET + " )[^\\n]*)*(\n|$)", + "gm" +); +var BLOCK_END_R = /\n{2,}$/; +var INLINE_CODE_ESCAPE_BACKTICKS_R = /^ (?= *`)|(` *) $/g; +// recognize the end of a paragraph block inside a list item: +// two or more newlines at end end of the item +var LIST_BLOCK_END_R = BLOCK_END_R; +var LIST_ITEM_END_R = / *\n+$/; +// check whether a list item has paragraphs: if it does, +// we leave the newlines at the end +var LIST_R = new RegExp( + "^( *)(" + LIST_BULLET + ") " + + "[\\s\\S]+?(?:\n{2,}(?! )" + + "(?!\\1" + LIST_BULLET + " )\\n*" + + // the \\s*$ here is so that we can parse the inside of nested + // lists, where our content might end before we receive two `\n`s + "|\\s*\n*$)" +); +var LIST_LOOKBEHIND_R = /(?:^|\n)( *)$/; + +var TABLES = (function() { + // predefine regexes so we don't have to create them inside functions + // sure, regex literals should be fast, even inside functions, but they + // aren't in all browsers. + var TABLE_BLOCK_TRIM = /\n+/g; + var TABLE_ROW_SEPARATOR_TRIM = /^ *\| *| *\| *$/g; + var TABLE_CELL_END_TRIM = / *$/; + var TABLE_RIGHT_ALIGN = /^ *-+: *$/; + var TABLE_CENTER_ALIGN = /^ *:-+: *$/; + var TABLE_LEFT_ALIGN = /^ *:-+ *$/; + + /** + * @param {string} alignCapture + * @returns {SimpleMarkdown.TableAlignment} + */ + var parseTableAlignCapture = function(alignCapture) { + if (TABLE_RIGHT_ALIGN.test(alignCapture)) { + return "right"; + } else if (TABLE_CENTER_ALIGN.test(alignCapture)) { + return "center"; + } else if (TABLE_LEFT_ALIGN.test(alignCapture)) { + return "left"; + } else { + return null; + } + }; + + /** + * @param {string} source + * @param {SimpleMarkdown.Parser} parse + * @param {SimpleMarkdown.State} state + * @param {boolean} trimEndSeparators + * @returns {Array} + */ + var parseTableAlign = function(source, parse, state, trimEndSeparators) { + if (trimEndSeparators) { + source = source.replace(TABLE_ROW_SEPARATOR_TRIM, ""); + } + var alignText = source.trim().split("|"); + return alignText.map(parseTableAlignCapture); + }; + + /** + * @param {string} source + * @param {SimpleMarkdown.Parser} parse + * @param {SimpleMarkdown.State} state + * @param {boolean} trimEndSeparators + * @returns {SimpleMarkdown.SingleASTNode[][]} + */ + var parseTableRow = function(source, parse, state, trimEndSeparators) { + var prevInTable = state.inTable; + state.inTable = true; + var tableRow = parse(source.trim(), state); + state.inTable = prevInTable; + + /** @type {SimpleMarkdown.SingleASTNode[][]} */ + var cells = [[]]; + tableRow.forEach(function(node, i) { + if (node.type === 'tableSeparator') { + // Filter out empty table separators at the start/end: + if (!trimEndSeparators || i !== 0 && i !== tableRow.length - 1) { + // Split the current row: + cells.push([]); + } + } else { + if (node.type === 'text' && ( + tableRow[i + 1] == null || + tableRow[i + 1].type === 'tableSeparator' + )) { + node.content = node.content.replace(TABLE_CELL_END_TRIM, ""); + } + cells[cells.length - 1].push(node); + } + }); + + return cells; + }; + + /** + * @param {string} source + * @param {SimpleMarkdown.Parser} parse + * @param {SimpleMarkdown.State} state + * @param {boolean} trimEndSeparators + * @returns {SimpleMarkdown.ASTNode[][]} + */ + var parseTableCells = function(source, parse, state, trimEndSeparators) { + var rowsText = source.trim().split("\n"); + + return rowsText.map(function(rowText) { + return parseTableRow(rowText, parse, state, trimEndSeparators); + }); + }; + + /** + * @param {boolean} trimEndSeparators + * @returns {SimpleMarkdown.SingleNodeParseFunction} + */ + var parseTable = function(trimEndSeparators) { + /** @type {SimpleMarkdown.SingleNodeParseFunction} */ + return function(capture, parse, state) { + state.inline = true; + var header = parseTableRow(capture[1], parse, state, trimEndSeparators); + var align = parseTableAlign(capture[2], parse, state, trimEndSeparators); + var cells = parseTableCells(capture[3], parse, state, trimEndSeparators); + state.inline = false; + + return { + type: "table", + header: header, + align: align, + cells: cells + }; + }; + }; + + return { + parseTable: parseTable(true), + parseNpTable: parseTable(false), + TABLE_REGEX: /^ *(\|.+)\n *\|( *[-:]+[-| :]*)\n((?: *\|.*(?:\n|$))*)\n*/, + NPTABLE_REGEX: /^ *(\S.*\|.*)\n *([-:]+ *\|[-| :]*)\n((?:.*\|.*(?:\n|$))*)\n*/ + }; +})(); + +var LINK_INSIDE = "(?:\\[[^\\]]*\\]|[^\\[\\]]|\\](?=[^\\[]*\\]))*"; +var LINK_HREF_AND_TITLE = + "\\s*?(?:\\s+['\"]([\\s\\S]*?)['\"])?\\s*"; +var AUTOLINK_MAILTO_CHECK_R = /mailto:/i; + +/** + * @param {SimpleMarkdown.Capture} capture + * @param {SimpleMarkdown.State} state + * @param {SimpleMarkdown.RefNode} refNode + * @returns {SimpleMarkdown.RefNode} + */ +var parseRef = function(capture, state, refNode /* : RefNode */) { + var ref = (capture[2] || capture[1]) + .replace(/\s+/g, ' ') + .toLowerCase(); + + // We store information about previously seen defs on + // state._defs (_ to deconflict with client-defined + // state). If the def for this reflink/refimage has + // already been seen, we can use its target/source + // and title here: + if (state._defs && state._defs[ref]) { + var def = state._defs[ref]; + // `refNode` can be a link or an image. Both use + // target and title properties. + refNode.target = def.target; + refNode.title = def.title; + } + + // In case we haven't seen our def yet (or if someone + // overwrites that def later on), we add this node + // to the list of ref nodes for that def. Then, when + // we find the def, we can modify this link/image AST + // node :). + // I'm sorry. + state._refs = state._refs || {}; + state._refs[ref] = state._refs[ref] || []; + state._refs[ref].push(refNode); + + return refNode; +}; + +var currOrder = 0; +/** @type {SimpleMarkdown.DefaultRules} */ +var defaultRules /* : DefaultRules */ = { + Array: { + react: function(arr, output, state) { + var oldKey = state.key; + var result /* : Array */ = []; + + // map output over the ast, except group any text + // nodes together into a single string output. + for (var i = 0, key = 0; i < arr.length; i++, key++) { + // `key` is our numerical `state.key`, which we increment for + // every output node, but don't change for joined text nodes. + // (i, however, must change for joined text nodes) + state.key = '' + i; + + var node = arr[i]; + if (node.type === 'text') { + node = { type: 'text', content: node.content }; + for (; i + 1 < arr.length && arr[i + 1].type === 'text'; i++) { + node.content += arr[i + 1].content; + } + } + + result.push(output(node, state)); + } + + state.key = oldKey; + return result; + }, + html: function(arr, output, state) { + var result = ""; + + // map output over the ast, except group any text + // nodes together into a single string output. + for (var i = 0, key = 0; i < arr.length; i++) { + + var node = arr[i]; + if (node.type === 'text') { + node = { type: 'text', content: node.content }; + for (; i + 1 < arr.length && arr[i + 1].type === 'text'; i++) { + node.content += arr[i + 1].content; + } + } + + result += output(node, state); + } + return result; + } + }, + heading: { + order: currOrder++, + match: blockRegex(/^ *(#{1,6})([^\n]+?)#* *(?:\n *)+\n/), + parse: function(capture, parse, state) { + return { + level: capture[1].length, + content: parseInline(parse, capture[2].trim(), state) + }; + }, + react: function(node, output, state) { + return reactElement( + 'h' + node.level, + state.key, + { + children: output(node.content, state) + } + ); + }, + html: function(node, output, state) { + return htmlTag("h" + node.level, output(node.content, state)); + } + }, + nptable: { + order: currOrder++, + match: blockRegex(TABLES.NPTABLE_REGEX), + parse: TABLES.parseNpTable, + react: null, + html: null + }, + lheading: { + order: currOrder++, + match: blockRegex(/^([^\n]+)\n *(=|-){3,} *(?:\n *)+\n/), + parse: function(capture, parse, state) { + return { + type: "heading", + level: capture[2] === '=' ? 1 : 2, + content: parseInline(parse, capture[1], state) + }; + }, + react: null, + html: null + }, + hr: { + order: currOrder++, + match: blockRegex(/^( *[-*_]){3,} *(?:\n *)+\n/), + parse: ignoreCapture, + react: function(node, output, state) { + return reactElement( + 'hr', + state.key, + EMPTY_PROPS + ); + }, + html: function(node, output, state) { + return "
"; + } + }, + codeBlock: { + order: currOrder++, + match: blockRegex(/^(?: [^\n]+\n*)+(?:\n *)+\n/), + parse: function(capture, parse, state) { + var content = capture[0] + .replace(/^ /gm, '') + .replace(/\n+$/, ''); + return { + lang: undefined, + content: content + }; + }, + react: function(node, output, state) { + var className = node.lang ? + "markdown-code-" + node.lang : + undefined; + + return reactElement( + 'pre', + state.key, + { + children: reactElement( + 'code', + null, + { + className: className, + children: node.content + } + ) + } + ); + }, + html: function(node, output, state) { + var className = node.lang ? + "markdown-code-" + node.lang : + undefined; + + var codeBlock = htmlTag("code", sanitizeText(node.content), { + class: className + }); + return htmlTag("pre", codeBlock); + } + }, + fence: { + order: currOrder++, + match: blockRegex(/^ *(`{3,}|~{3,}) *(?:(\S+) *)?\n([\s\S]+?)\n?\1 *(?:\n *)+\n/), + parse: function(capture, parse, state) { + return { + type: "codeBlock", + lang: capture[2] || undefined, + content: capture[3] + }; + }, + react: null, + html: null + }, + blockQuote: { + order: currOrder++, + match: blockRegex(/^( *>[^\n]+(\n[^\n]+)*\n*)+\n{2,}/), + parse: function(capture, parse, state) { + var content = capture[0].replace(/^ *> ?/gm, ''); + return { + content: parse(content, state) + }; + }, + react: function(node, output, state) { + return reactElement( + 'blockquote', + state.key, + { + children: output(node.content, state) + } + ); + }, + html: function(node, output, state) { + return htmlTag("blockquote", output(node.content, state)); + } + }, + list: { + order: currOrder++, + match: function(source, state) { + // We only want to break into a list if we are at the start of a + // line. This is to avoid parsing "hi * there" with "* there" + // becoming a part of a list. + // You might wonder, "but that's inline, so of course it wouldn't + // start a list?". You would be correct! Except that some of our + // lists can be inline, because they might be inside another list, + // in which case we can parse with inline scope, but need to allow + // nested lists inside this inline scope. + var prevCaptureStr = state.prevCapture == null ? "" : state.prevCapture[0]; + var isStartOfLineCapture = LIST_LOOKBEHIND_R.exec(prevCaptureStr); + var isListBlock = state._list || !state.inline; + + if (isStartOfLineCapture && isListBlock) { + source = isStartOfLineCapture[1] + source; + return LIST_R.exec(source); + } else { + return null; + } + }, + parse: function(capture, parse, state) { + var bullet = capture[2]; + var ordered = bullet.length > 1; + var start = ordered ? +bullet : undefined; + var items = /** @type {string[]} */ ( + capture[0] + .replace(LIST_BLOCK_END_R, "\n") + .match(LIST_ITEM_R) + ); + + // We know this will match here, because of how the regexes are + // defined + /*:: items = ((items : any) : Array) */ + + var lastItemWasAParagraph = false; + var itemContent = items.map(function(/** @type {string} */ item, /** @type {number} */ i) { + // We need to see how far indented this item is: + var prefixCapture = LIST_ITEM_PREFIX_R.exec(item); + var space = prefixCapture ? prefixCapture[0].length : 0; + // And then we construct a regex to "unindent" the subsequent + // lines of the items by that amount: + var spaceRegex = new RegExp("^ {1," + space + "}", "gm"); + + // Before processing the item, we need a couple things + var content = item + // remove indents on trailing lines: + .replace(spaceRegex, '') + // remove the bullet: + .replace(LIST_ITEM_PREFIX_R, ''); + + // I'm not sur4 why this is necessary again? + /*:: items = ((items : any) : Array) */ + + // Handling "loose" lists, like: + // + // * this is wrapped in a paragraph + // + // * as is this + // + // * as is this + var isLastItem = (i === items.length - 1); + var containsBlocks = content.indexOf("\n\n") !== -1; + + // Any element in a list is a block if it contains multiple + // newlines. The last element in the list can also be a block + // if the previous item in the list was a block (this is + // because non-last items in the list can end with \n\n, but + // the last item can't, so we just "inherit" this property + // from our previous element). + var thisItemIsAParagraph = containsBlocks || + (isLastItem && lastItemWasAParagraph); + lastItemWasAParagraph = thisItemIsAParagraph; + + // backup our state for restoration afterwards. We're going to + // want to set state._list to true, and state.inline depending + // on our list's looseness. + var oldStateInline = state.inline; + var oldStateList = state._list; + state._list = true; + + // Parse inline if we're in a tight list, or block if we're in + // a loose list. + var adjustedContent; + if (thisItemIsAParagraph) { + state.inline = false; + adjustedContent = content.replace(LIST_ITEM_END_R, "\n\n"); + } else { + state.inline = true; + adjustedContent = content.replace(LIST_ITEM_END_R, ""); + } + + var result = parse(adjustedContent, state); + + // Restore our state before returning + state.inline = oldStateInline; + state._list = oldStateList; + return result; + }); + + return { + ordered: ordered, + start: start, + items: itemContent + }; + }, + react: function(node, output, state) { + var ListWrapper = node.ordered ? "ol" : "ul"; + + return reactElement( + ListWrapper, + state.key, + { + start: node.start, + children: node.items.map(function( + /** @type {SimpleMarkdown.ASTNode} */ item, + /** @type {number} */ i + ) { + return reactElement( + 'li', + '' + i, + { + children: output(item, state) + } + ); + }) + } + ); + }, + html: function(node, output, state) { + var listItems = node.items.map(function(/** @type {SimpleMarkdown.ASTNode} */ item) { + return htmlTag("li", output(item, state)); + }).join(""); + + var listTag = node.ordered ? "ol" : "ul"; + var attributes = { + start: node.start + }; + return htmlTag(listTag, listItems, attributes); + } + }, + def: { + order: currOrder++, + // TODO(aria): This will match without a blank line before the next + // block element, which is inconsistent with most of the rest of + // simple-markdown. + match: blockRegex( + /^ *\[([^\]]+)\]: *]*)>?(?: +["(]([^\n]+)[")])? *\n(?: *\n)*/ + ), + parse: function(capture, parse, state) { + var def = capture[1] + .replace(/\s+/g, ' ') + .toLowerCase(); + var target = capture[2]; + var title = capture[3]; + + // Look for previous links/images using this def + // If any links/images using this def have already been declared, + // they will have added themselves to the state._refs[def] list + // (_ to deconflict with client-defined state). We look through + // that list of reflinks for this def, and modify those AST nodes + // with our newly found information now. + // Sorry :(. + if (state._refs && state._refs[def]) { + // `refNode` can be a link or an image + state._refs[def].forEach(function(/** @type {SimpleMarkdown.RefNode} */ refNode) { + refNode.target = target; + refNode.title = title; + }); + } + + // Add this def to our map of defs for any future links/images + // In case we haven't found any or all of the refs referring to + // this def yet, we add our def to the table of known defs, so + // that future reflinks can modify themselves appropriately with + // this information. + state._defs = state._defs || {}; + state._defs[def] = { + target: target, + title: title, + }; + + // return the relevant parsed information + // for debugging only. + return { + def: def, + target: target, + title: title, + }; + }, + react: function() { return null; }, + html: function() { return ""; } + }, + table: { + order: currOrder++, + match: blockRegex(TABLES.TABLE_REGEX), + parse: TABLES.parseTable, + react: function(node, output, state) { + /** + * @param {number} colIndex + * @returns {{ [attr: string]: SimpleMarkdown.Attr }} + */ + var getStyle = function(colIndex) { + return node.align[colIndex] == null ? {} : { + textAlign: node.align[colIndex] + }; + }; + + var headers = node.header.map(function( + /** @type {SimpleMarkdown.ASTNode} */ content, + /** @type {number} */ i + ) { + return reactElement( + 'th', + '' + i, + { + style: getStyle(i), + scope: 'col', + children: output(content, state) + } + ); + }); + + var rows = node.cells.map(function( + /** @type {SimpleMarkdown.ASTNode[]} */ row, + /** @type {number} */ r + ) { + return reactElement( + 'tr', + '' + r, + { + children: row.map(function( + /** @type {SimpleMarkdown.ASTNode} */ content, + /** @type {number} */ c + ) { + return reactElement( + 'td', + '' + c, + { + style: getStyle(c), + children: output(content, state) + } + ); + }) + } + ); + }); + + return reactElement( + 'table', + state.key, + { + children: [reactElement( + 'thead', + 'thead', + { + children: reactElement( + 'tr', + null, + { + children: headers + } + ) + } + ), reactElement( + 'tbody', + 'tbody', + { + children: rows + } + )] + } + ); + }, + html: function(node, output, state) { + /** + * @param {number} colIndex + * @returns {string} + */ + var getStyle = function(colIndex) { + return node.align[colIndex] == null ? "" : + "text-align:" + node.align[colIndex] + ";"; + }; + + var headers = node.header.map(function( + /** @type {SimpleMarkdown.ASTNode} */ content, + /** @type {number} */ i + ) { + return htmlTag("th", output(content, state), + { style: getStyle(i), scope: "col" }); + }).join(""); + + var rows = node.cells.map(function(/** @type {SimpleMarkdown.ASTNode[]} */ row) { + var cols = row.map(function( + /** @type {SimpleMarkdown.ASTNode} */ content, + /** @type {number} */ c + ) { + return htmlTag("td", output(content, state), + { style: getStyle(c) }); + }).join(""); + + return htmlTag("tr", cols); + }).join(""); + + var thead = htmlTag("thead", htmlTag("tr", headers)); + var tbody = htmlTag("tbody", rows); + + return htmlTag("table", thead + tbody); + } + }, + newline: { + order: currOrder++, + match: blockRegex(/^(?:\n *)*\n/), + parse: ignoreCapture, + react: function(node, output, state) { return "\n"; }, + html: function(node, output, state) { return "\n"; } + }, + paragraph: { + order: currOrder++, + match: blockRegex(/^((?:[^\n]|\n(?! *\n))+)(?:\n *)+\n/), + parse: parseCaptureInline, + react: function(node, output, state) { + return reactElement( + 'div', + state.key, + { + className: 'paragraph', + children: output(node.content, state) + } + ); + }, + html: function(node, output, state) { + var attributes = { + class: 'paragraph' + }; + return htmlTag("div", output(node.content, state), attributes); + } + }, + escape: { + order: currOrder++, + // We don't allow escaping numbers, letters, or spaces here so that + // backslashes used in plain text still get rendered. But allowing + // escaping anything else provides a very flexible escape mechanism, + // regardless of how this grammar is extended. + match: inlineRegex(/^\\([^0-9A-Za-z\s])/), + parse: function(capture, parse, state) { + return { + type: "text", + content: capture[1] + }; + }, + react: null, + html: null + }, + tableSeparator: { + order: currOrder++, + match: function(source, state) { + if (!state.inTable) { + return null; + } + return /^ *\| */.exec(source); + }, + parse: function() { + return { type: 'tableSeparator' }; + }, + // These shouldn't be reached, but in case they are, be reasonable: + react: function() { return ' | '; }, + html: function() { return ' | '; }, + }, + autolink: { + order: currOrder++, + match: inlineRegex(/^<([^: >]+:\/[^ >]+)>/), + parse: function(capture, parse, state) { + return { + type: "link", + content: [{ + type: "text", + content: capture[1] + }], + target: capture[1] + }; + }, + react: null, + html: null + }, + mailto: { + order: currOrder++, + match: inlineRegex(/^<([^ >]+@[^ >]+)>/), + parse: function(capture, parse, state) { + var address = capture[1]; + var target = capture[1]; + + // Check for a `mailto:` already existing in the link: + if (!AUTOLINK_MAILTO_CHECK_R.test(target)) { + target = "mailto:" + target; + } + + return { + type: "link", + content: [{ + type: "text", + content: address + }], + target: target + }; + }, + react: null, + html: null + }, + url: { + order: currOrder++, + match: inlineRegex(/^(https?:\/\/[^\s<]+[^<.,:;"')\]\s])/), + parse: function(capture, parse, state) { + return { + type: "link", + content: [{ + type: "text", + content: capture[1] + }], + target: capture[1], + title: undefined + }; + }, + react: null, + html: null + }, + link: { + order: currOrder++, + match: inlineRegex(new RegExp( + "^\\[(" + LINK_INSIDE + ")\\]\\(" + LINK_HREF_AND_TITLE + "\\)" + )), + parse: function(capture, parse, state) { + var link ={ + content: parse(capture[1], state), + target: unescapeUrl(capture[2]), + title: capture[3] + }; + return link; + }, + react: function(node, output, state) { + return reactElement( + 'a', + state.key, + { + href: sanitizeUrl(node.target), + title: node.title, + children: output(node.content, state) + } + ); + }, + html: function(node, output, state) { + var attributes = { + href: sanitizeUrl(node.target), + title: node.title + }; + + return htmlTag("a", output(node.content, state), attributes); + } + }, + image: { + order: currOrder++, + match: inlineRegex(new RegExp( + "^!\\[(" + LINK_INSIDE + ")\\]\\(" + LINK_HREF_AND_TITLE + "\\)" + )), + parse: function(capture, parse, state) { + var image = { + alt: capture[1], + target: unescapeUrl(capture[2]), + title: capture[3] + }; + return image; + }, + react: function(node, output, state) { + return reactElement( + 'img', + state.key, + { + src: sanitizeUrl(node.target), + alt: node.alt, + title: node.title + } + ); + }, + html: function(node, output, state) { + var attributes = { + src: sanitizeUrl(node.target), + alt: node.alt, + title: node.title + }; + + return htmlTag("img", "", attributes, false); + } + }, + reflink: { + order: currOrder++, + match: inlineRegex(new RegExp( + // The first [part] of the link + "^\\[(" + LINK_INSIDE + ")\\]" + + // The [ref] target of the link + "\\s*\\[([^\\]]*)\\]" + )), + parse: function(capture, parse, state) { + return parseRef(capture, state, { + type: "link", + content: parse(capture[1], state) + }); + }, + react: null, + html: null + }, + refimage: { + order: currOrder++, + match: inlineRegex(new RegExp( + // The first [part] of the link + "^!\\[(" + LINK_INSIDE + ")\\]" + + // The [ref] target of the link + "\\s*\\[([^\\]]*)\\]" + )), + parse: function(capture, parse, state) { + return parseRef(capture, state, { + type: "image", + alt: capture[1] + }); + }, + react: null, + html: null + }, + em: { + order: currOrder /* same as strong/u */, + match: inlineRegex( + new RegExp( + // only match _s surrounding words. + "^\\b_" + + "((?:__|\\\\[\\s\\S]|[^\\\\_])+?)_" + + "\\b" + + // Or match *s: + "|" + + // Only match *s that are followed by a non-space: + "^\\*(?=\\S)(" + + // Match at least one of: + "(?:" + + // - `**`: so that bolds inside italics don't close the + // italics + "\\*\\*|" + + // - escape sequence: so escaped *s don't close us + "\\\\[\\s\\S]|" + + // - whitespace: followed by a non-* (we don't + // want ' *' to close an italics--it might + // start a list) + "\\s+(?:\\\\[\\s\\S]|[^\\s\\*\\\\]|\\*\\*)|" + + // - non-whitespace, non-*, non-backslash characters + "[^\\s\\*\\\\]" + + ")+?" + + // followed by a non-space, non-* then * + ")\\*(?!\\*)" + ) + ), + quality: function(capture) { + // precedence by length, `em` wins ties: + return capture[0].length + 0.2; + }, + parse: function(capture, parse, state) { + return { + content: parse(capture[2] || capture[1], state) + }; + }, + react: function(node, output, state) { + return reactElement( + 'em', + state.key, + { + children: output(node.content, state) + } + ); + }, + html: function(node, output, state) { + return htmlTag("em", output(node.content, state)); + } + }, + strong: { + order: currOrder /* same as em */, + match: inlineRegex(/^\*\*((?:\\[\s\S]|[^\\])+?)\*\*(?!\*)/), + quality: function(capture) { + // precedence by length, wins ties vs `u`: + return capture[0].length + 0.1; + }, + parse: parseCaptureInline, + react: function(node, output, state) { + return reactElement( + 'strong', + state.key, + { + children: output(node.content, state) + } + ); + }, + html: function(node, output, state) { + return htmlTag("strong", output(node.content, state)); + } + }, + u: { + order: currOrder++ /* same as em&strong; increment for next rule */, + match: inlineRegex(/^__((?:\\[\s\S]|[^\\])+?)__(?!_)/), + quality: function(capture) { + // precedence by length, loses all ties + return capture[0].length; + }, + parse: parseCaptureInline, + react: function(node, output, state) { + return reactElement( + 'u', + state.key, + { + children: output(node.content, state) + } + ); + }, + html: function(node, output, state) { + return htmlTag("u", output(node.content, state)); + } + }, + del: { + order: currOrder++, + match: inlineRegex(/^~~(?=\S)((?:\\[\s\S]|~(?!~)|[^\s~]|\s(?!~~))+?)~~/), + parse: parseCaptureInline, + react: function(node, output, state) { + return reactElement( + 'del', + state.key, + { + children: output(node.content, state) + } + ); + }, + html: function(node, output, state) { + return htmlTag("del", output(node.content, state)); + } + }, + inlineCode: { + order: currOrder++, + match: inlineRegex(/^(`+)([\s\S]*?[^`])\1(?!`)/), + parse: function(capture, parse, state) { + return { + content: capture[2].replace(INLINE_CODE_ESCAPE_BACKTICKS_R, "$1") + }; + }, + react: function(node, output, state) { + return reactElement( + 'code', + state.key, + { + children: node.content + } + ); + }, + html: function(node, output, state) { + return htmlTag("code", sanitizeText(node.content)); + } + }, + br: { + order: currOrder++, + match: anyScopeRegex(/^ {2,}\n/), + parse: ignoreCapture, + react: function(node, output, state) { + return reactElement( + 'br', + state.key, + EMPTY_PROPS + ); + }, + html: function(node, output, state) { + return "
"; + } + }, + text: { + order: currOrder++, + // Here we look for anything followed by non-symbols, + // double newlines, or double-space-newlines + // We break on any symbol characters so that this grammar + // is easy to extend without needing to modify this regex + match: anyScopeRegex( + /^[\s\S]+?(?=[^0-9A-Za-z\s\u00c0-\uffff]|\n\n| {2,}\n|\w+:\S|$)/ + ), + parse: function(capture, parse, state) { + return { + content: capture[0] + }; + }, + react: function(node, output, state) { + return node.content; + }, + html: function(node, output, state) { + return sanitizeText(node.content); + } + } +}; + +/** (deprecated) + * @param {any} rules + * @param {any} property + * @returns {any} + */ +var ruleOutput = function/* :: */( + rules /* : OutputRules */, + property /* : $Keys */ +) { + if (!property && typeof console !== "undefined") { + console.warn("simple-markdown ruleOutput should take 'react' or " + + "'html' as the second argument." + ); + } + + /** @type {SimpleMarkdown.NodeOutput} */ + var nestedRuleOutput /* : NodeOutput */ = function( + ast /* : SingleASTNode */, + outputFunc /* : Output */, + state /* : State */ + ) { + return rules[ast.type][property](ast, outputFunc, state); + }; + return nestedRuleOutput; +}; + +/** (deprecated) + * @param {any} outputFunc + * @returns {any} + */ +var reactFor = function(outputFunc /* : ReactNodeOutput */) /* : ReactOutput */ { + /** @type {SimpleMarkdown.ReactOutput} */ + var nestedOutput /* : ReactOutput */ = function(ast, state) { + state = state || {}; + if (Array.isArray(ast)) { + var oldKey = state.key; + var result /* : Array */ = []; + + // map nestedOutput over the ast, except group any text + // nodes together into a single string output. + var lastResult = null; + for (var i = 0; i < ast.length; i++) { + state.key = '' + i; + var nodeOut = nestedOutput(ast[i], state); + if (typeof nodeOut === "string" && typeof lastResult === "string") { + lastResult = lastResult + nodeOut; + result[result.length - 1] = lastResult; + } else { + result.push(nodeOut); + lastResult = nodeOut; + } + } + + state.key = oldKey; + return result; + } else { + return outputFunc(ast, nestedOutput, state); + } + }; + return nestedOutput; +}; + +/** (deprecated) + * @param {any} outputFunc + * @returns {any} + */ +var htmlFor = function(outputFunc /* : HtmlNodeOutput */) /* : HtmlOutput */ { + /** @type {SimpleMarkdown.HtmlOutput} */ + var nestedOutput /* : HtmlOutput */ = function(ast, state) { + state = state || {}; + if (Array.isArray(ast)) { + return ast.map(function(node) { + return nestedOutput(node, state); + }).join(""); + } else { + return outputFunc(ast, nestedOutput, state); + } + }; + return nestedOutput; +}; + +/** + * @type {SimpleMarkdown.OutputFor} + */ +var outputFor = function/* :: */( + rules /* : OutputRules */, + property /* : $Keys */, + defaultState /* : ?State */ +) { + if (!property) { + throw new Error('simple-markdown: outputFor: `property` must be ' + + 'defined. ' + + 'if you just upgraded, you probably need to replace `outputFor` ' + + 'with `reactFor`' + ); + } + + /** @type {SimpleMarkdown.State} */ + var latestState; + /** @type {SimpleMarkdown.ArrayRule} */ + var arrayRule = rules.Array || defaultRules.Array; + + // Tricks to convince tsc that this var is not null: + var arrayRuleCheck = arrayRule[property]; + if (!arrayRuleCheck) { + throw new Error('simple-markdown: outputFor: to join nodes of type `' + + property + '` you must provide an `Array:` joiner rule with that type, ' + + 'Please see the docs for details on specifying an Array rule.' + ); + } + var arrayRuleOutput = arrayRuleCheck; + + /** @type {SimpleMarkdown.Output} */ + var nestedOutput /* : Output */ = function(ast, state) { + state = state || latestState; + latestState = state; + if (Array.isArray(ast)) { + return arrayRuleOutput(ast, nestedOutput, state); + } else { + return rules[ast.type][property](ast, nestedOutput, state); + } + }; + + /** @type {SimpleMarkdown.Output} */ + var outerOutput = function(ast, state) { + latestState = populateInitialState(state, defaultState); + return nestedOutput(ast, latestState); + }; + return outerOutput; +}; + +var defaultRawParse = parserFor(defaultRules); +/** + * @param {string} source + * @param {SimpleMarkdown.OptionalState} [state] + * @returns {Array} + */ +var defaultBlockParse = function(source, state) { + state = state || {}; + state.inline = false; + return defaultRawParse(source, state); +}; +/** + * @param {string} source + * @param {SimpleMarkdown.OptionalState} [state] + * @returns {Array} + */ +var defaultInlineParse = function(source, state) { + state = state || {}; + state.inline = true; + return defaultRawParse(source, state); +}; +/** + * @param {string} source + * @param {SimpleMarkdown.OptionalState} [state] + * @returns {Array} + */ +var defaultImplicitParse = function(source, state) { + var isBlock = BLOCK_END_R.test(source); + state = state || {}; + state.inline = !isBlock; + return defaultRawParse(source, state); +}; + +/** @type {SimpleMarkdown.ReactOutput} */ +var defaultReactOutput /* : ReactOutput */ = outputFor(defaultRules, "react"); +/** @type {SimpleMarkdown.HtmlOutput} */ +var defaultHtmlOutput /* : HtmlOutput */ = outputFor(defaultRules, "html"); + +/** + * @param {string} source + * @param {SimpleMarkdown.OptionalState} [state] + * @returns {SimpleMarkdown.ReactElements} + */ +var markdownToReact = function(source, state) /* : ReactElements */ { + return defaultReactOutput(defaultBlockParse(source, state), state); +}; +/** + * @param {string} source + * @param {SimpleMarkdown.OptionalState} [state] + * @returns {string} + */ +var markdownToHtml = function(source, state) /* : string */ { + return defaultHtmlOutput(defaultBlockParse(source, state), state); +}; + +/** + * @param {SimpleMarkdown.ReactMarkdownProps} props + * @returns {SimpleMarkdown.ReactElement} + */ +var ReactMarkdown = function(props) { + /** @type {Object} */ + var divProps = {}; + + for (var prop in props) { + if (prop !== 'source' && + Object.prototype.hasOwnProperty.call(props, prop) + ) { + divProps[prop] = props[prop]; + } + } + divProps.children = markdownToReact(props.source); + + return reactElement( + 'div', + null, + divProps + ); +}; + + +/*:: // Flow exports: +type Exports = { + +defaultRules: DefaultRules, + +parserFor: (rules: ParserRules, defaultState?: ?State) => Parser, + +outputFor: (rules: OutputRules, param: $Keys, defaultState?: ?State) => Output, + + +ruleOutput: (rules: OutputRules, param: $Keys) => NodeOutput, + +reactFor: (ReactNodeOutput) => ReactOutput, + +htmlFor: (HtmlNodeOutput) => HtmlOutput, + + +inlineRegex: (regex: RegExp) => MatchFunction, + +blockRegex: (regex: RegExp) => MatchFunction, + +anyScopeRegex: (regex: RegExp) => MatchFunction, + +parseInline: (parse: Parser, content: string, state: State) => ASTNode, + +parseBlock: (parse: Parser, content: string, state: State) => ASTNode, + + +markdownToReact: (source: string, state?: ?State) => ReactElements, + +markdownToHtml: (source: string, state?: ?State) => string, + +ReactMarkdown: (props: { source: string, [string]: any }) => ReactElement, + + +defaultRawParse: (source: string, state?: ?State) => Array, + +defaultBlockParse: (source: string, state?: ?State) => Array, + +defaultInlineParse: (source: string, state?: ?State) => Array, + +defaultImplicitParse: (source: string, state?: ?State) => Array, + + +defaultReactOutput: ReactOutput, + +defaultHtmlOutput: HtmlOutput, + + +preprocess: (source: string) => string, + +sanitizeText: (text: Attr) => string, + +sanitizeUrl: (url: ?string) => ?string, + +unescapeUrl: (url: string) => string, + +htmlTag: (tagName: string, content: string, attributes: ?{ [any]: ?Attr }, isClosed: ?boolean) => string, + +reactElement: (type: string, key: string | null, props: { [string]: any }) => ReactElement, +}; + +export type { + // Hopefully you shouldn't have to use these, but they're here if you need! + // Top-level API: + State, + Parser, + Output, + ReactOutput, + HtmlOutput, + + // Most of the following types should be considered experimental and + // subject to change or change names. Again, they shouldn't be necessary, + // but if they are I'd love to hear how so I can better support them! + + // Individual Rule fields: + Capture, + MatchFunction, + ParseFunction, + NodeOutput, + ArrayNodeOutput, + ReactNodeOutput, + + // Single rules: + ParserRule, + ReactOutputRule, + HtmlOutputRule, + + // Sets of rules: + ParserRules, + OutputRules, + Rules, + ReactRules, + HtmlRules, +}; +*/ + +var SimpleMarkdown /* : Exports */ = { + defaultRules: defaultRules, + parserFor: parserFor, + outputFor: outputFor, + + inlineRegex: inlineRegex, + blockRegex: blockRegex, + anyScopeRegex: anyScopeRegex, + parseInline: parseInline, + parseBlock: parseBlock, + + // default wrappers: + markdownToReact: markdownToReact, + markdownToHtml: markdownToHtml, + ReactMarkdown: ReactMarkdown, + + defaultBlockParse: defaultBlockParse, + defaultInlineParse: defaultInlineParse, + defaultImplicitParse: defaultImplicitParse, + + defaultReactOutput: defaultReactOutput, + defaultHtmlOutput: defaultHtmlOutput, + + preprocess: preprocess, + sanitizeText: sanitizeText, + sanitizeUrl: sanitizeUrl, + unescapeUrl: unescapeUrl, + htmlTag: htmlTag, + reactElement: reactElement, + + // deprecated: + defaultRawParse: defaultRawParse, + ruleOutput: ruleOutput, + reactFor: reactFor, + htmlFor: htmlFor, + + defaultParse: function() { + if (typeof console !== 'undefined') { + console.warn('defaultParse is deprecated, please use `defaultImplicitParse`'); + } + return defaultImplicitParse.apply(null, /** @type {any} */ (arguments)); + }, + defaultOutput: function() { + if (typeof console !== 'undefined') { + console.warn('defaultOutput is deprecated, please use `defaultReactOutput`'); + } + return defaultReactOutput.apply(null, /** @type {any} */ (arguments)); + } +}; + +export default SimpleMarkdown; diff --git a/tsconfig.json b/tsconfig.json new file mode 100644 index 0000000..e6e940b --- /dev/null +++ b/tsconfig.json @@ -0,0 +1,71 @@ +{ + "include": [ + "src/**/*", + "__tests__/**/*" + ], + "exclude": [ + "node_modules" + ], + "compilerOptions": { + "target": "es5", /* Specify ECMAScript target version: 'ES3' (default), 'ES5', 'ES2015', 'ES2016', 'ES2017', 'ES2018', 'ES2019' or 'ESNEXT'. */ + "module": "commonjs", /* Specify module code generation: 'none', 'commonjs', 'amd', 'system', 'umd', 'es2015', or 'ESNext'. */ + "allowJs": true, /* Allow javascript files to be compiled. */ + "checkJs": true, /* Report errors in .js files. */ + "strict": true, /* Enable all strict type-checking options. */ + "noEmit": true, /* Do not emit outputs. */ + "esModuleInterop": true, /* Enables emit interoperability between CommonJS and ES Modules via creation of namespace objects for all imports. Implies 'allowSyntheticDefaultImports'. */ + + /* Basic Options */ + // "incremental": true, /* Enable incremental compilation */ + // "jsx": "preserve", /* Specify JSX code generation: 'preserve', 'react-native', or 'react'. */ + // "declaration": true, /* Generates corresponding '.d.ts' file. */ + // "declarationMap": true, /* Generates a sourcemap for each corresponding '.d.ts' file. */ + // "sourceMap": true, /* Generates corresponding '.map' file. */ + // "outFile": "./", /* Concatenate and emit output to single file. */ + // "outDir": "./", /* Redirect output structure to the directory. */ + // "rootDir": "./", /* Specify the root directory of input files. Use to control the output directory structure with --outDir. */ + // "composite": true, /* Enable project compilation */ + // "tsBuildInfoFile": "./", /* Specify file to store incremental compilation information */ + // "removeComments": true, /* Do not emit comments to output. */ + // "importHelpers": true, /* Import emit helpers from 'tslib'. */ + // "downlevelIteration": true, /* Provide full support for iterables in 'for-of', spread, and destructuring when targeting 'ES5' or 'ES3'. */ + // "isolatedModules": true, /* Transpile each file as a separate module (similar to 'ts.transpileModule'). */ + // "lib": ["ES2018"], /* Specify library files to be included in the compilation. */ + // "types": [], /* Type declaration files to be included in compilation. */ + + /* Strict Type-Checking Options */ + // "noImplicitAny": true, /* Raise error on expressions and declarations with an implied 'any' type. */ + // "strictNullChecks": true, /* Enable strict null checks. */ + // "strictFunctionTypes": true, /* Enable strict checking of function types. */ + // "strictBindCallApply": true, /* Enable strict 'bind', 'call', and 'apply' methods on functions. */ + // "noImplicitThis": true, /* Raise error on 'this' expressions with an implied 'any' type. */ + // "alwaysStrict": true, /* Parse in strict mode and emit "use strict" for each source file. */ + // "strictPropertyInitialization": true, /* Enable strict checking of property initialization in classes. */ + + /* Additional Checks */ + // "noUnusedLocals": true, /* Report errors on unused locals. */ + // "noUnusedParameters": true, /* Report errors on unused parameters. */ + // "noImplicitReturns": true, /* Report error when not all code paths in function return a value. */ + // "noFallthroughCasesInSwitch": true, /* Report errors for fallthrough cases in switch statement. */ + + /* Module Resolution Options */ + // "moduleResolution": "node", /* Specify module resolution strategy: 'node' (Node.js) or 'classic' (TypeScript pre-1.6). */ + // "baseUrl": "./", /* Base directory to resolve non-absolute module names. */ + // "paths": {}, /* A series of entries which re-map imports to lookup locations relative to the 'baseUrl'. */ + // "rootDirs": [], /* List of root folders whose combined content represents the structure of the project at runtime. */ + // "typeRoots": [], /* List of folders to include type definitions from. */ + // "allowSyntheticDefaultImports": true, /* Allow default imports from modules with no default export. This does not affect code emit, just typechecking. */ + // "preserveSymlinks": true, /* Do not resolve the real path of symlinks. */ + // "allowUmdGlobalAccess": true, /* Allow accessing UMD globals from modules. */ + + /* Source Map Options */ + // "sourceRoot": "", /* Specify the location where debugger should locate TypeScript files instead of source locations. */ + // "mapRoot": "", /* Specify the location where debugger should locate map files instead of generated locations. */ + // "inlineSourceMap": true, /* Emit a single file with source maps instead of having a separate file. */ + // "inlineSources": true, /* Emit the source alongside the sourcemaps within a single file; requires '--inlineSourceMap' or '--sourceMap' to be set. */ + + /* Experimental Options */ + // "experimentalDecorators": true, /* Enables experimental support for ES7 decorators. */ + // "emitDecoratorMetadata": true, /* Enables experimental support for emitting type metadata for decorators. */ + } +}