diff --git a/.circleci/config.yml b/.circleci/config.yml index 56d463f..e29e513 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -29,14 +29,14 @@ jobs: key: dependency-cache-{{ checksum "yarn.lock" }} paths: - ./node_modules - - run: yarn run test - run: yarn run lint + - run: yarn run coverage - run: yarn run codacy - persist_to_workspace: root: ~/diff2html paths: - docs - - dist + - build build-node_4: <<: *common-build @@ -80,11 +80,6 @@ jobs: steps: - attach_workspace: at: . - - run: - name: Prepare website sources - command: | - rm -f docs/assets - mv dist docs/assets - run: name: Deploy working_directory: ~/diff2html/docs diff --git a/.eslintignore b/.eslintignore index 74776ac..256e583 100644 --- a/.eslintignore +++ b/.eslintignore @@ -1,11 +1,6 @@ -# Skip coverage and build folders +# Skip build results coverage/** -dist/** - -# Ignore symlink to build folder +build/** docs/** - -# Ignore HTML templates generated code -src/** -!src/*.js -!src/ui/js/*.js +node_modules/** +src/diff2html-templates.js diff --git a/.eslintrc.json b/.eslintrc.json index 0096a89..2ab5590 100644 --- a/.eslintrc.json +++ b/.eslintrc.json @@ -1,10 +1,12 @@ { + "parser": "@typescript-eslint/parser", "parserOptions": { - "ecmaVersion": 6, + "ecmaVersion": 2018, + "sourceType": "module", "ecmaFeatures": { + "experimentalObjectRestSpread": true, "jsx": true - }, - "sourceType": "module" + } }, "env": { "es6": true, @@ -19,325 +21,17 @@ "worker": true, "qunit": true }, - "plugins": [ - "standard", - "promise" - ], + "plugins": ["standard", "node", "import", "promise", "@typescript-eslint", "jest"], "globals": { "document": false, "navigator": false, "window": false }, - "rules": { - "accessor-pairs": 2, - "arrow-spacing": [ - 2, - { - "before": true, - "after": true - } - ], - "block-spacing": [ - 2, - "always" - ], - "brace-style": [ - 2, - "1tbs", - { - "allowSingleLine": true - } - ], - "camelcase": [ - 2, - { - "properties": "never" - } - ], - "comma-dangle": [ - 2, - "never" - ], - "comma-spacing": [ - 2, - { - "before": false, - "after": true - } - ], - "comma-style": [ - 2, - "last" - ], - "constructor-super": 2, - "curly": [ - 2, - "multi-line" - ], - "dot-location": [ - 2, - "property" - ], - "eol-last": 2, - "eqeqeq": [ - 2, - "allow-null" - ], - "generator-star-spacing": [ - 2, - { - "before": true, - "after": true - } - ], - "handle-callback-err": [ - 2, - "^(err|error)$" - ], - "indent": [ - 2, - 2, - { - "SwitchCase": 1 - } - ], - "jsx-quotes": [ - 2, - "prefer-single" - ], - "key-spacing": [ - 2, - { - "beforeColon": false, - "afterColon": true - } - ], - "keyword-spacing": [ - 2, - { - "before": true, - "after": true - } - ], - "new-cap": [ - 2, - { - "newIsCap": true, - "capIsNew": false - } - ], - "new-parens": 2, - "no-array-constructor": 2, - "no-caller": 2, - "no-class-assign": 2, - "no-cond-assign": 2, - "no-const-assign": 2, - "no-control-regex": 2, - "no-debugger": 2, - "no-delete-var": 2, - "no-dupe-args": 2, - "no-dupe-class-members": 2, - "no-dupe-keys": 2, - "no-duplicate-case": 2, - "no-duplicate-imports": 2, - "no-empty-character-class": 2, - "no-empty-pattern": 2, - "no-eval": 2, - "no-ex-assign": 2, - "no-extend-native": 2, - "no-extra-bind": 2, - "no-extra-boolean-cast": 2, - "no-extra-parens": [ - 2, - "functions" - ], - "no-fallthrough": 2, - "no-floating-decimal": 2, - "no-func-assign": 2, - "no-implied-eval": 2, - "no-inner-declarations": [ - 2, - "functions" - ], - "no-invalid-regexp": 2, - "no-irregular-whitespace": 2, - "no-iterator": 2, - "no-label-var": 2, - "no-labels": [ - 2, - { - "allowLoop": false, - "allowSwitch": false - } - ], - "no-lone-blocks": 2, - "no-mixed-spaces-and-tabs": 2, - "no-multi-spaces": 2, - "no-multi-str": 2, - "no-multiple-empty-lines": [ - 2, - { - "max": 1 - } - ], - "no-native-reassign": 2, - "no-negated-in-lhs": 2, - "no-new": 2, - "no-new-func": 2, - "no-new-object": 2, - "no-new-require": 2, - "no-new-symbol": 2, - "no-new-wrappers": 2, - "no-obj-calls": 2, - "no-octal": 2, - "no-octal-escape": 2, - "no-path-concat": 2, - "no-proto": 2, - "no-redeclare": 2, - "no-regex-spaces": 2, - "no-return-assign": [ - 2, - "except-parens" - ], - "no-self-assign": 2, - "no-self-compare": 2, - "no-sequences": 2, - "no-shadow-restricted-names": 2, - "no-spaced-func": 2, - "no-sparse-arrays": 2, - "no-this-before-super": 2, - "no-throw-literal": 2, - "no-trailing-spaces": 2, - "no-undef": 2, - "no-undef-init": 2, - "no-unexpected-multiline": 2, - "no-unmodified-loop-condition": 2, - "no-unneeded-ternary": [ - 2, - { - "defaultAssignment": false - } - ], - "no-unreachable": 2, - "no-unsafe-finally": 2, - "no-unused-vars": [ - 2, - { - "vars": "all", - "args": "none" - } - ], - "no-useless-call": 2, - "no-useless-computed-key": 2, - "no-useless-constructor": 2, - "no-useless-escape": 2, - "no-whitespace-before-property": 2, - "no-with": 2, - "one-var": [ - 2, - { - "initialized": "never" - } - ], - "operator-linebreak": [ - 2, - "after", - { - "overrides": { - "?": "before", - ":": "before" - } - } - ], - "padded-blocks": [ - 2, - "never" - ], - "quotes": [ - 2, - "single", - "avoid-escape" - ], - "semi": [ - 2, - "always" - ], - "semi-spacing": [ - 2, - { - "before": false, - "after": true - } - ], - "space-before-blocks": [ - 2, - "always" - ], - "space-before-function-paren": [ - 2, - "never" - ], - "space-in-parens": [ - 2, - "never" - ], - "space-infix-ops": 2, - "space-unary-ops": [ - 2, - { - "words": true, - "nonwords": false - } - ], - "spaced-comment": [ - 2, - "always", - { - "markers": [ - "global", - "globals", - "eslint", - "eslint-disable", - "*package", - "!", - "," - ] - } - ], - "template-curly-spacing": [ - 2, - "never" - ], - "use-isnan": 2, - "valid-typeof": 2, - "wrap-iife": [ - 2, - "any" - ], - "yield-star-spacing": [ - 2, - "both" - ], - "yoda": [ - 2, - "never" - ], - "standard/object-curly-even-spacing": [ - 2, - "either" - ], - "standard/array-bracket-even-spacing": [ - 2, - "either" - ], - "standard/computed-property-even-spacing": [ - 2, - "even" - ], - "promise/param-names": 2, - "linebreak-style": [ - 2, - "unix" - ] - } + "extends": [ + "plugin:@typescript-eslint/recommended", + "plugin:jest/recommended", + "plugin:promise/recommended", + "standard", + "plugin:prettier/recommended" + ] } diff --git a/.gitignore b/.gitignore index bde6b2f..05edf8a 100644 --- a/.gitignore +++ b/.gitignore @@ -28,3 +28,8 @@ bower_components/ # Terraform /terraform/.terraform + +/docs/ +/dist/ +/build/ +/src/diff2html-templates.js diff --git a/dist/diff2html-ui.js b/dist/diff2html-ui.js deleted file mode 100644 index 7885e25..0000000 --- a/dist/diff2html-ui.js +++ /dev/null @@ -1,366 +0,0 @@ -(function(){function r(e,n,t){function o(i,f){if(!n[i]){if(!e[i]){var c="function"==typeof require&&require;if(!f&&c)return c(i,!0);if(u)return u(i,!0);var a=new Error("Cannot find module '"+i+"'");throw a.code="MODULE_NOT_FOUND",a}var p=n[i]={exports:{}};e[i][0].call(p.exports,function(r){var n=e[i][1][r];return o(n||r)},p,p.exports,r,e,n,t)}return n[i].exports}for(var u="function"==typeof require&&require,i=0;i/gm, '>'); - } - - function tag(node) { - return node.nodeName.toLowerCase(); - } - - /* Stream merging */ - - HighlightJS.prototype.nodeStream = function(node) { - var result = []; - (function _nodeStream(node, offset) { - for (var child = node.firstChild; child; child = child.nextSibling) { - if (child.nodeType === 3) { - offset += child.nodeValue.length; - } else if (child.nodeType === 1) { - result.push({ - event: 'start', - offset: offset, - node: child - }); - offset = _nodeStream(child, offset); - // Prevent void elements from having an end tag that would actually - // double them in the output. There are more void elements in HTML - // but we list only those realistically expected in code display. - if (!tag(child).match(/br|hr|img|input/)) { - result.push({ - event: 'stop', - offset: offset, - node: child - }); - } - } - } - return offset; - })(node, 0); - return result; - }; - - HighlightJS.prototype.mergeStreams = function(original, highlighted, value) { - var processed = 0; - var result = ''; - var nodeStack = []; - - function selectStream() { - if (!original.length || !highlighted.length) { - return original.length ? original : highlighted; - } - if (original[0].offset !== highlighted[0].offset) { - return (original[0].offset < highlighted[0].offset) ? original : highlighted; - } - - /* - To avoid starting the stream just before it should stop the order is - ensured that original always starts first and closes last: - if (event1 == 'start' && event2 == 'start') - return original; - if (event1 == 'start' && event2 == 'stop') - return highlighted; - if (event1 == 'stop' && event2 == 'start') - return original; - if (event1 == 'stop' && event2 == 'stop') - return highlighted; - ... which is collapsed to: - */ - return highlighted[0].event === 'start' ? original : highlighted; - } - - function open(node) { - function attr_str(a) { - return ' ' + a.nodeName + '="' + escape(a.value) + '"'; - } - - result += '<' + tag(node) + ArrayProto.map.call(node.attributes, attr_str).join('') + '>'; - } - - function close(node) { - result += ''; - } - - function render(event) { - (event.event === 'start' ? open : close)(event.node); - } - - while (original.length || highlighted.length) { - var stream = selectStream(); - result += escape(value.substring(processed, stream[0].offset)); - processed = stream[0].offset; - if (stream === original) { - /* - On any opening or closing tag of the original markup we first close - the entire highlighted node stack, then render the original tag along - with all the following original tags at the same offset and then - reopen all the tags on the highlighted stack. - */ - nodeStack.reverse().forEach(close); - do { - render(stream.splice(0, 1)[0]); - stream = selectStream(); - } while (stream === original && stream.length && stream[0].offset === processed); - nodeStack.reverse().forEach(open); - } else { - if (stream[0].event === 'start') { - nodeStack.push(stream[0].node); - } else { - nodeStack.pop(); - } - render(stream.splice(0, 1)[0]); - } - } - return result + escape(value.substr(processed)); - }; - - /* **** Highlight.js Private API **** */ - - module.exports.HighlightJS = new HighlightJS(); -})(); - -},{}]},{},[1]); diff --git a/dist/diff2html-ui.min.js b/dist/diff2html-ui.min.js deleted file mode 100644 index 02c14af..0000000 --- a/dist/diff2html-ui.min.js +++ /dev/null @@ -1 +0,0 @@ -!function r(e,n,t){function o(i,f){if(!n[i]){if(!e[i]){var c="function"==typeof require&&require;if(!f&&c)return c(i,!0);if(u)return u(i,!0);var a=new Error("Cannot find module '"+i+"'");throw a.code="MODULE_NOT_FOUND",a}var p=n[i]={exports:{}};e[i][0].call(p.exports,function(r){return o(e[i][1][r]||r)},p,p.exports,r,e,n,t)}return n[i].exports}for(var u="function"==typeof require&&require,i=0;i/gm,">")}function tag(node){return node.nodeName.toLowerCase()}var ArrayProto;ArrayProto=[],HighlightJS.prototype.nodeStream=function(node){var result=[];return function _nodeStream(node,offset){for(var child=node.firstChild;child;child=child.nextSibling)3===child.nodeType?offset+=child.nodeValue.length:1===child.nodeType&&(result.push({event:"start",offset:offset,node:child}),offset=_nodeStream(child,offset),tag(child).match(/br|hr|img|input/)||result.push({event:"stop",offset:offset,node:child}));return offset}(node,0),result},HighlightJS.prototype.mergeStreams=function(original,highlighted,value){var processed=0,result="",nodeStack=[];function selectStream(){return original.length&&highlighted.length?original[0].offset!==highlighted[0].offset?original[0].offset"}function close(node){result+=""}function render(event){("start"===event.event?open:close)(event.node)}for(;original.length||highlighted.length;){var stream=selectStream();if(result+=escape(value.substring(processed,stream[0].offset)),processed=stream[0].offset,stream===original){for(nodeStack.reverse().forEach(close);render(stream.splice(0,1)[0]),(stream=selectStream())===original&&stream.length&&stream[0].offset===processed;);nodeStack.reverse().forEach(open)}else"start"===stream[0].event?nodeStack.push(stream[0].node):nodeStack.pop(),render(stream.splice(0,1)[0])}return result+escape(value.substr(processed))},module.exports.HighlightJS=new HighlightJS},{}]},{},[1]); \ No newline at end of file diff --git a/dist/diff2html.css b/dist/diff2html.css deleted file mode 100644 index 196719a..0000000 --- a/dist/diff2html.css +++ /dev/null @@ -1,367 +0,0 @@ -/* - * - * Diff to HTML (diff2html.css) - * Author: rtfpessoa - * - */ - -.d2h-wrapper { - text-align: left; -} - -.d2h-file-header { - height: 35px; - padding: 5px 10px; - border-bottom: 1px solid #d8d8d8; - background-color: #f7f7f7; -} - -.d2h-file-stats { - display: flex; - margin-left: auto; - font-size: 14px; -} - -.d2h-lines-added { - text-align: right; - border: 1px solid #b4e2b4; - border-radius: 5px 0 0 5px; - color: #399839; - padding: 2px; - vertical-align: middle; -} - -.d2h-lines-deleted { - text-align: left; - border: 1px solid #e9aeae; - border-radius: 0 5px 5px 0; - color: #c33; - padding: 2px; - vertical-align: middle; - margin-left: 1px; -} - -.d2h-file-name-wrapper { - display: flex; - align-items: center; - width: 100%; - font-family: "Source Sans Pro", "Helvetica Neue", Helvetica, Arial, sans-serif; - font-size: 15px; -} - -.d2h-file-name { - white-space: nowrap; - text-overflow: ellipsis; - overflow-x: hidden; -} - -.d2h-file-wrapper { - border: 1px solid #ddd; - border-radius: 3px; - margin-bottom: 1em; -} - -.d2h-diff-table { - width: 100%; - border-collapse: collapse; - font-family: "Menlo", "Consolas", monospace; - font-size: 13px; -} - -.d2h-files-diff { - display: block; - width: 100%; - height: 100%; -} - -.d2h-file-diff { - overflow-y: hidden; -} - -.d2h-file-side-diff { - display: inline-block; - overflow-x: scroll; - overflow-y: hidden; - width: 50%; - margin-right: -4px; - margin-bottom: -8px; -} - -.d2h-code-line { - display: inline-block; - white-space: nowrap; - /* Compensate for the absolute positioning of the line numbers */ - padding: 0 8em; -} - -.d2h-code-side-line { - display: inline-block; - white-space: nowrap; - /* Compensate for the absolute positioning of the line numbers */ - padding: 0 4.5em; -} - -.d2h-code-line del, -.d2h-code-side-line del { - display: inline-block; - margin-top: -1px; - text-decoration: none; - background-color: #ffb6ba; - border-radius: 0.2em; -} - -.d2h-code-line ins, -.d2h-code-side-line ins { - display: inline-block; - margin-top: -1px; - text-decoration: none; - background-color: #97f295; - border-radius: 0.2em; - text-align: left; -} - -.d2h-code-line-prefix { - display: inline; - background: none; - padding: 0; - word-wrap: normal; - white-space: pre; -} - -.d2h-code-line-ctn { - display: inline; - background: none; - padding: 0; - word-wrap: normal; - white-space: pre; -} - -.line-num1 { - box-sizing: border-box; - float: left; - width: 3.5em; - overflow: hidden; - text-overflow: ellipsis; - padding: 0 0.5em 0 0.5em; -} - -.line-num2 { - box-sizing: border-box; - float: right; - width: 3.5em; - overflow: hidden; - text-overflow: ellipsis; - padding: 0 0.5em 0 0.5em; -} - -.d2h-code-linenumber { - box-sizing: border-box; - width: 7.5em; - /* Keep the numbers fixed on line contents scroll */ - position: absolute; - display: inline-block; - background-color: #fff; - color: rgba(0, 0, 0, 0.3); - text-align: right; - border: solid #eeeeee; - border-width: 0 1px 0 1px; - cursor: pointer; -} - -.d2h-code-linenumber:after { - content: '\200b'; -} - -.d2h-code-side-linenumber { - /* Keep the numbers fixed on line contents scroll */ - position: absolute; - display: inline-block; - box-sizing: border-box; - width: 4em; - background-color: #fff; - color: rgba(0, 0, 0, 0.3); - text-align: right; - border: solid #eeeeee; - border-width: 0 1px 0 1px; - cursor: pointer; - overflow: hidden; - text-overflow: ellipsis; -} - -.d2h-code-side-linenumber:after { - content: '\200b'; -} - -.d2h-code-side-emptyplaceholder, -.d2h-emptyplaceholder { - background-color: #f1f1f1; - border-color: #e1e1e1; -} - -/* - * Changes Highlight - */ - -.d2h-del { - background-color: #fee8e9; - border-color: #e9aeae; -} - -.d2h-ins { - background-color: #dfd; - border-color: #b4e2b4; -} - -.d2h-info { - background-color: #f8fafd; - color: rgba(0, 0, 0, 0.3); - border-color: #d5e4f2; -} - -.d2h-file-diff .d2h-del.d2h-change { - background-color: #fdf2d0; -} - -.d2h-file-diff .d2h-ins.d2h-change { - background-color: #ded; -} - -/* - * File Summary List - */ - -.d2h-file-list-wrapper { - margin-bottom: 10px; -} - -.d2h-file-list-wrapper a { - text-decoration: none; - color: #3572b0; -} - -.d2h-file-list-wrapper a:visited { - color: #3572b0; -} - -.d2h-file-list-header { - text-align: left; -} - -.d2h-file-list-title { - font-weight: bold; -} - -.d2h-file-list-line { - display: flex; - text-align: left; -} - -.d2h-file-list { - display: block; - list-style: none; - padding: 0; - margin: 0; -} - -.d2h-file-list > li { - border-bottom: #ddd solid 1px; - padding: 5px 10px; - margin: 0; -} - -.d2h-file-list > li:last-child { - border-bottom: none; -} - -.d2h-file-switch { - display: none; - font-size: 10px; - cursor: pointer; -} - -.d2h-icon { - vertical-align: middle; - margin-right: 10px; - fill: currentColor; -} - -.d2h-deleted { - color: #c33; -} - -.d2h-added { - color: #399839; -} - -.d2h-changed { - color: #d0b44c; -} - -.d2h-moved { - color: #3572b0; -} - -.d2h-tag { - display: flex; - font-size: 10px; - margin-left: 5px; - padding: 0 2px; - background-color: #fff; -} - -.d2h-deleted-tag { - border: #c33 1px solid; -} - -.d2h-added-tag { - border: #399839 1px solid; -} - -.d2h-changed-tag { - border: #d0b44c 1px solid; -} - -.d2h-moved-tag { - border: #3572b0 1px solid; -} - -/* - * Selection util. - */ - -.selecting-left .d2h-code-line, -.selecting-left .d2h-code-line *, -.selecting-right td.d2h-code-linenumber, -.selecting-right td.d2h-code-linenumber *, -.selecting-left .d2h-code-side-line, -.selecting-left .d2h-code-side-line *, -.selecting-right td.d2h-code-side-linenumber, -.selecting-right td.d2h-code-side-linenumber * { - -webkit-touch-callout: none; - -webkit-user-select: none; - -moz-user-select: none; - -ms-user-select: none; - user-select: none; -} - -.selecting-left .d2h-code-line::-moz-selection, -.selecting-left .d2h-code-line *::-moz-selection, -.selecting-right td.d2h-code-linenumber::-moz-selection, -.selecting-left .d2h-code-side-line::-moz-selection, -.selecting-left .d2h-code-side-line *::-moz-selection, -.selecting-right td.d2h-code-side-linenumber::-moz-selection, -.selecting-right td.d2h-code-side-linenumber *::-moz-selection { - background: transparent; -} - -.selecting-left .d2h-code-line::selection, -.selecting-left .d2h-code-line *::selection, -.selecting-right td.d2h-code-linenumber::selection, -.selecting-left .d2h-code-side-line::selection, -.selecting-left .d2h-code-side-line *::selection, -.selecting-right td.d2h-code-side-linenumber::selection, -.selecting-right td.d2h-code-side-linenumber *::selection { - background: transparent; -} - -/*# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uL3NyYy91aS9jc3MvZGlmZjJodG1sLmNzcyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQTs7Ozs7RUFLRTs7QUFFRjtFQUNFLGdCQUFnQjtBQUNsQjs7QUFFQTtFQUNFLFlBQVk7RUFDWixpQkFBaUI7RUFDakIsZ0NBQWdDO0VBQ2hDLHlCQUF5QjtBQUMzQjs7QUFFQTtFQUdFLGFBQWE7RUFDYixpQkFBaUI7RUFDakIsZUFBZTtBQUNqQjs7QUFFQTtFQUNFLGlCQUFpQjtFQUNqQix5QkFBeUI7RUFDekIsMEJBQTBCO0VBQzFCLGNBQWM7RUFDZCxZQUFZO0VBQ1osc0JBQXNCO0FBQ3hCOztBQUVBO0VBQ0UsZ0JBQWdCO0VBQ2hCLHlCQUF5QjtFQUN6QiwwQkFBMEI7RUFDMUIsV0FBVztFQUNYLFlBQVk7RUFDWixzQkFBc0I7RUFDdEIsZ0JBQWdCO0FBQ2xCOztBQUVBO0VBR0UsYUFBYTtFQUdiLG1CQUFtQjtFQUNuQixXQUFXO0VBQ1gsOEVBQThFO0VBQzlFLGVBQWU7QUFDakI7O0FBRUE7RUFDRSxtQkFBbUI7RUFDbkIsdUJBQXVCO0VBQ3ZCLGtCQUFrQjtBQUNwQjs7QUFFQTtFQUNFLHNCQUFzQjtFQUN0QixrQkFBa0I7RUFDbEIsa0JBQWtCO0FBQ3BCOztBQUVBO0VBQ0UsV0FBVztFQUNYLHlCQUF5QjtFQUN6QiwyQ0FBMkM7RUFDM0MsZUFBZTtBQUNqQjs7QUFFQTtFQUNFLGNBQWM7RUFDZCxXQUFXO0VBQ1gsWUFBWTtBQUNkOztBQUVBO0VBQ0Usa0JBQWtCO0FBQ3BCOztBQUVBO0VBQ0UscUJBQXFCO0VBQ3JCLGtCQUFrQjtFQUNsQixrQkFBa0I7RUFDbEIsVUFBVTtFQUNWLGtCQUFrQjtFQUNsQixtQkFBbUI7QUFDckI7O0FBRUE7RUFDRSxxQkFBcUI7RUFDckIsbUJBQW1CO0VBQ25CLGdFQUFnRTtFQUNoRSxjQUFjO0FBQ2hCOztBQUVBO0VBQ0UscUJBQXFCO0VBQ3JCLG1CQUFtQjtFQUNuQixnRUFBZ0U7RUFDaEUsZ0JBQWdCO0FBQ2xCOztBQUVBOztFQUVFLHFCQUFxQjtFQUNyQixnQkFBZ0I7RUFDaEIscUJBQXFCO0VBQ3JCLHlCQUF5QjtFQUN6QixvQkFBb0I7QUFDdEI7O0FBRUE7O0VBRUUscUJBQXFCO0VBQ3JCLGdCQUFnQjtFQUNoQixxQkFBcUI7RUFDckIseUJBQXlCO0VBQ3pCLG9CQUFvQjtFQUNwQixnQkFBZ0I7QUFDbEI7O0FBRUE7RUFDRSxlQUFlO0VBQ2YsZ0JBQWdCO0VBQ2hCLFVBQVU7RUFDVixpQkFBaUI7RUFDakIsZ0JBQWdCO0FBQ2xCOztBQUVBO0VBQ0UsZUFBZTtFQUNmLGdCQUFnQjtFQUNoQixVQUFVO0VBQ1YsaUJBQWlCO0VBQ2pCLGdCQUFnQjtBQUNsQjs7QUFFQTtFQUNFLHNCQUFzQjtFQUN0QixXQUFXO0VBQ1gsWUFBWTtFQUNaLGdCQUFnQjtFQUNoQix1QkFBdUI7RUFDdkIsd0JBQXdCO0FBQzFCOztBQUVBO0VBQ0Usc0JBQXNCO0VBQ3RCLFlBQVk7RUFDWixZQUFZO0VBQ1osZ0JBQWdCO0VBQ2hCLHVCQUF1QjtFQUN2Qix3QkFBd0I7QUFDMUI7O0FBRUE7RUFDRSxzQkFBc0I7RUFDdEIsWUFBWTtFQUNaLG1EQUFtRDtFQUNuRCxrQkFBa0I7RUFDbEIscUJBQXFCO0VBQ3JCLHNCQUFzQjtFQUN0Qix5QkFBeUI7RUFDekIsaUJBQWlCO0VBQ2pCLHFCQUFxQjtFQUNyQix5QkFBeUI7RUFDekIsZUFBZTtBQUNqQjs7QUFFQTtFQUNFLGdCQUFnQjtBQUNsQjs7QUFFQTtFQUNFLG1EQUFtRDtFQUNuRCxrQkFBa0I7RUFDbEIscUJBQXFCO0VBQ3JCLHNCQUFzQjtFQUN0QixVQUFVO0VBQ1Ysc0JBQXNCO0VBQ3RCLHlCQUF5QjtFQUN6QixpQkFBaUI7RUFDakIscUJBQXFCO0VBQ3JCLHlCQUF5QjtFQUN6QixlQUFlO0VBQ2YsZ0JBQWdCO0VBQ2hCLHVCQUF1QjtBQUN6Qjs7QUFFQTtFQUNFLGdCQUFnQjtBQUNsQjs7QUFFQTs7RUFFRSx5QkFBeUI7RUFDekIscUJBQXFCO0FBQ3ZCOztBQUVBOztFQUVFOztBQUVGO0VBQ0UseUJBQXlCO0VBQ3pCLHFCQUFxQjtBQUN2Qjs7QUFFQTtFQUNFLHNCQUFzQjtFQUN0QixxQkFBcUI7QUFDdkI7O0FBRUE7RUFDRSx5QkFBeUI7RUFDekIseUJBQXlCO0VBQ3pCLHFCQUFxQjtBQUN2Qjs7QUFFQTtFQUNFLHlCQUF5QjtBQUMzQjs7QUFFQTtFQUNFLHNCQUFzQjtBQUN4Qjs7QUFFQTs7RUFFRTs7QUFFRjtFQUNFLG1CQUFtQjtBQUNyQjs7QUFFQTtFQUNFLHFCQUFxQjtFQUNyQixjQUFjO0FBQ2hCOztBQUVBO0VBQ0UsY0FBYztBQUNoQjs7QUFFQTtFQUNFLGdCQUFnQjtBQUNsQjs7QUFFQTtFQUNFLGlCQUFpQjtBQUNuQjs7QUFFQTtFQUdFLGFBQWE7RUFDYixnQkFBZ0I7QUFDbEI7O0FBRUE7RUFDRSxjQUFjO0VBQ2QsZ0JBQWdCO0VBQ2hCLFVBQVU7RUFDVixTQUFTO0FBQ1g7O0FBRUE7RUFDRSw2QkFBNkI7RUFDN0IsaUJBQWlCO0VBQ2pCLFNBQVM7QUFDWDs7QUFFQTtFQUNFLG1CQUFtQjtBQUNyQjs7QUFFQTtFQUNFLGFBQWE7RUFDYixlQUFlO0VBQ2YsZUFBZTtBQUNqQjs7QUFFQTtFQUNFLHNCQUFzQjtFQUN0QixrQkFBa0I7RUFDbEIsa0JBQWtCO0FBQ3BCOztBQUVBO0VBQ0UsV0FBVztBQUNiOztBQUVBO0VBQ0UsY0FBYztBQUNoQjs7QUFFQTtFQUNFLGNBQWM7QUFDaEI7O0FBRUE7RUFDRSxjQUFjO0FBQ2hCOztBQUVBO0VBR0UsYUFBYTtFQUNiLGVBQWU7RUFDZixnQkFBZ0I7RUFDaEIsY0FBYztFQUNkLHNCQUFzQjtBQUN4Qjs7QUFFQTtFQUNFLHNCQUFzQjtBQUN4Qjs7QUFFQTtFQUNFLHlCQUF5QjtBQUMzQjs7QUFFQTtFQUNFLHlCQUF5QjtBQUMzQjs7QUFFQTtFQUNFLHlCQUF5QjtBQUMzQjs7QUFFQTs7RUFFRTs7QUFFRjs7Ozs7Ozs7RUFRRSwyQkFBMkI7RUFDM0IseUJBQXlCO0VBQ3pCLHNCQUFzQjtFQUN0QixxQkFBcUI7RUFDckIsaUJBQWlCO0FBQ25COztBQUVBOzs7Ozs7O0VBT0UsdUJBQXVCO0FBQ3pCOztBQUVBOzs7Ozs7O0VBT0UsdUJBQXVCO0FBQ3pCIiwiZmlsZSI6ImRpZmYyaHRtbC5jc3MiLCJzb3VyY2VzQ29udGVudCI6WyIvKlxuICpcbiAqIERpZmYgdG8gSFRNTCAoZGlmZjJodG1sLmNzcylcbiAqIEF1dGhvcjogcnRmcGVzc29hXG4gKlxuICovXG5cbi5kMmgtd3JhcHBlciB7XG4gIHRleHQtYWxpZ246IGxlZnQ7XG59XG5cbi5kMmgtZmlsZS1oZWFkZXIge1xuICBoZWlnaHQ6IDM1cHg7XG4gIHBhZGRpbmc6IDVweCAxMHB4O1xuICBib3JkZXItYm90dG9tOiAxcHggc29saWQgI2Q4ZDhkODtcbiAgYmFja2dyb3VuZC1jb2xvcjogI2Y3ZjdmNztcbn1cblxuLmQyaC1maWxlLXN0YXRzIHtcbiAgZGlzcGxheTogLXdlYmtpdC1ib3g7XG4gIGRpc3BsYXk6IC1tcy1mbGV4Ym94O1xuICBkaXNwbGF5OiBmbGV4O1xuICBtYXJnaW4tbGVmdDogYXV0bztcbiAgZm9udC1zaXplOiAxNHB4O1xufVxuXG4uZDJoLWxpbmVzLWFkZGVkIHtcbiAgdGV4dC1hbGlnbjogcmlnaHQ7XG4gIGJvcmRlcjogMXB4IHNvbGlkICNiNGUyYjQ7XG4gIGJvcmRlci1yYWRpdXM6IDVweCAwIDAgNXB4O1xuICBjb2xvcjogIzM5OTgzOTtcbiAgcGFkZGluZzogMnB4O1xuICB2ZXJ0aWNhbC1hbGlnbjogbWlkZGxlO1xufVxuXG4uZDJoLWxpbmVzLWRlbGV0ZWQge1xuICB0ZXh0LWFsaWduOiBsZWZ0O1xuICBib3JkZXI6IDFweCBzb2xpZCAjZTlhZWFlO1xuICBib3JkZXItcmFkaXVzOiAwIDVweCA1cHggMDtcbiAgY29sb3I6ICNjMzM7XG4gIHBhZGRpbmc6IDJweDtcbiAgdmVydGljYWwtYWxpZ246IG1pZGRsZTtcbiAgbWFyZ2luLWxlZnQ6IDFweDtcbn1cblxuLmQyaC1maWxlLW5hbWUtd3JhcHBlciB7XG4gIGRpc3BsYXk6IC13ZWJraXQtYm94O1xuICBkaXNwbGF5OiAtbXMtZmxleGJveDtcbiAgZGlzcGxheTogZmxleDtcbiAgLXdlYmtpdC1ib3gtYWxpZ246IGNlbnRlcjtcbiAgLW1zLWZsZXgtYWxpZ246IGNlbnRlcjtcbiAgYWxpZ24taXRlbXM6IGNlbnRlcjtcbiAgd2lkdGg6IDEwMCU7XG4gIGZvbnQtZmFtaWx5OiBcIlNvdXJjZSBTYW5zIFByb1wiLCBcIkhlbHZldGljYSBOZXVlXCIsIEhlbHZldGljYSwgQXJpYWwsIHNhbnMtc2VyaWY7XG4gIGZvbnQtc2l6ZTogMTVweDtcbn1cblxuLmQyaC1maWxlLW5hbWUge1xuICB3aGl0ZS1zcGFjZTogbm93cmFwO1xuICB0ZXh0LW92ZXJmbG93OiBlbGxpcHNpcztcbiAgb3ZlcmZsb3cteDogaGlkZGVuO1xufVxuXG4uZDJoLWZpbGUtd3JhcHBlciB7XG4gIGJvcmRlcjogMXB4IHNvbGlkICNkZGQ7XG4gIGJvcmRlci1yYWRpdXM6IDNweDtcbiAgbWFyZ2luLWJvdHRvbTogMWVtO1xufVxuXG4uZDJoLWRpZmYtdGFibGUge1xuICB3aWR0aDogMTAwJTtcbiAgYm9yZGVyLWNvbGxhcHNlOiBjb2xsYXBzZTtcbiAgZm9udC1mYW1pbHk6IFwiTWVubG9cIiwgXCJDb25zb2xhc1wiLCBtb25vc3BhY2U7XG4gIGZvbnQtc2l6ZTogMTNweDtcbn1cblxuLmQyaC1maWxlcy1kaWZmIHtcbiAgZGlzcGxheTogYmxvY2s7XG4gIHdpZHRoOiAxMDAlO1xuICBoZWlnaHQ6IDEwMCU7XG59XG5cbi5kMmgtZmlsZS1kaWZmIHtcbiAgb3ZlcmZsb3cteTogaGlkZGVuO1xufVxuXG4uZDJoLWZpbGUtc2lkZS1kaWZmIHtcbiAgZGlzcGxheTogaW5saW5lLWJsb2NrO1xuICBvdmVyZmxvdy14OiBzY3JvbGw7XG4gIG92ZXJmbG93LXk6IGhpZGRlbjtcbiAgd2lkdGg6IDUwJTtcbiAgbWFyZ2luLXJpZ2h0OiAtNHB4O1xuICBtYXJnaW4tYm90dG9tOiAtOHB4O1xufVxuXG4uZDJoLWNvZGUtbGluZSB7XG4gIGRpc3BsYXk6IGlubGluZS1ibG9jaztcbiAgd2hpdGUtc3BhY2U6IG5vd3JhcDtcbiAgLyogQ29tcGVuc2F0ZSBmb3IgdGhlIGFic29sdXRlIHBvc2l0aW9uaW5nIG9mIHRoZSBsaW5lIG51bWJlcnMgKi9cbiAgcGFkZGluZzogMCA4ZW07XG59XG5cbi5kMmgtY29kZS1zaWRlLWxpbmUge1xuICBkaXNwbGF5OiBpbmxpbmUtYmxvY2s7XG4gIHdoaXRlLXNwYWNlOiBub3dyYXA7XG4gIC8qIENvbXBlbnNhdGUgZm9yIHRoZSBhYnNvbHV0ZSBwb3NpdGlvbmluZyBvZiB0aGUgbGluZSBudW1iZXJzICovXG4gIHBhZGRpbmc6IDAgNC41ZW07XG59XG5cbi5kMmgtY29kZS1saW5lIGRlbCxcbi5kMmgtY29kZS1zaWRlLWxpbmUgZGVsIHtcbiAgZGlzcGxheTogaW5saW5lLWJsb2NrO1xuICBtYXJnaW4tdG9wOiAtMXB4O1xuICB0ZXh0LWRlY29yYXRpb246IG5vbmU7XG4gIGJhY2tncm91bmQtY29sb3I6ICNmZmI2YmE7XG4gIGJvcmRlci1yYWRpdXM6IDAuMmVtO1xufVxuXG4uZDJoLWNvZGUtbGluZSBpbnMsXG4uZDJoLWNvZGUtc2lkZS1saW5lIGlucyB7XG4gIGRpc3BsYXk6IGlubGluZS1ibG9jaztcbiAgbWFyZ2luLXRvcDogLTFweDtcbiAgdGV4dC1kZWNvcmF0aW9uOiBub25lO1xuICBiYWNrZ3JvdW5kLWNvbG9yOiAjOTdmMjk1O1xuICBib3JkZXItcmFkaXVzOiAwLjJlbTtcbiAgdGV4dC1hbGlnbjogbGVmdDtcbn1cblxuLmQyaC1jb2RlLWxpbmUtcHJlZml4IHtcbiAgZGlzcGxheTogaW5saW5lO1xuICBiYWNrZ3JvdW5kOiBub25lO1xuICBwYWRkaW5nOiAwO1xuICB3b3JkLXdyYXA6IG5vcm1hbDtcbiAgd2hpdGUtc3BhY2U6IHByZTtcbn1cblxuLmQyaC1jb2RlLWxpbmUtY3RuIHtcbiAgZGlzcGxheTogaW5saW5lO1xuICBiYWNrZ3JvdW5kOiBub25lO1xuICBwYWRkaW5nOiAwO1xuICB3b3JkLXdyYXA6IG5vcm1hbDtcbiAgd2hpdGUtc3BhY2U6IHByZTtcbn1cblxuLmxpbmUtbnVtMSB7XG4gIGJveC1zaXppbmc6IGJvcmRlci1ib3g7XG4gIGZsb2F0OiBsZWZ0O1xuICB3aWR0aDogMy41ZW07XG4gIG92ZXJmbG93OiBoaWRkZW47XG4gIHRleHQtb3ZlcmZsb3c6IGVsbGlwc2lzO1xuICBwYWRkaW5nOiAwIDAuNWVtIDAgMC41ZW07XG59XG5cbi5saW5lLW51bTIge1xuICBib3gtc2l6aW5nOiBib3JkZXItYm94O1xuICBmbG9hdDogcmlnaHQ7XG4gIHdpZHRoOiAzLjVlbTtcbiAgb3ZlcmZsb3c6IGhpZGRlbjtcbiAgdGV4dC1vdmVyZmxvdzogZWxsaXBzaXM7XG4gIHBhZGRpbmc6IDAgMC41ZW0gMCAwLjVlbTtcbn1cblxuLmQyaC1jb2RlLWxpbmVudW1iZXIge1xuICBib3gtc2l6aW5nOiBib3JkZXItYm94O1xuICB3aWR0aDogNy41ZW07XG4gIC8qIEtlZXAgdGhlIG51bWJlcnMgZml4ZWQgb24gbGluZSBjb250ZW50cyBzY3JvbGwgKi9cbiAgcG9zaXRpb246IGFic29sdXRlO1xuICBkaXNwbGF5OiBpbmxpbmUtYmxvY2s7XG4gIGJhY2tncm91bmQtY29sb3I6ICNmZmY7XG4gIGNvbG9yOiByZ2JhKDAsIDAsIDAsIDAuMyk7XG4gIHRleHQtYWxpZ246IHJpZ2h0O1xuICBib3JkZXI6IHNvbGlkICNlZWVlZWU7XG4gIGJvcmRlci13aWR0aDogMCAxcHggMCAxcHg7XG4gIGN1cnNvcjogcG9pbnRlcjtcbn1cblxuLmQyaC1jb2RlLWxpbmVudW1iZXI6YWZ0ZXIge1xuICBjb250ZW50OiAnXFwyMDBiJztcbn1cblxuLmQyaC1jb2RlLXNpZGUtbGluZW51bWJlciB7XG4gIC8qIEtlZXAgdGhlIG51bWJlcnMgZml4ZWQgb24gbGluZSBjb250ZW50cyBzY3JvbGwgKi9cbiAgcG9zaXRpb246IGFic29sdXRlO1xuICBkaXNwbGF5OiBpbmxpbmUtYmxvY2s7XG4gIGJveC1zaXppbmc6IGJvcmRlci1ib3g7XG4gIHdpZHRoOiA0ZW07XG4gIGJhY2tncm91bmQtY29sb3I6ICNmZmY7XG4gIGNvbG9yOiByZ2JhKDAsIDAsIDAsIDAuMyk7XG4gIHRleHQtYWxpZ246IHJpZ2h0O1xuICBib3JkZXI6IHNvbGlkICNlZWVlZWU7XG4gIGJvcmRlci13aWR0aDogMCAxcHggMCAxcHg7XG4gIGN1cnNvcjogcG9pbnRlcjtcbiAgb3ZlcmZsb3c6IGhpZGRlbjtcbiAgdGV4dC1vdmVyZmxvdzogZWxsaXBzaXM7XG59XG5cbi5kMmgtY29kZS1zaWRlLWxpbmVudW1iZXI6YWZ0ZXIge1xuICBjb250ZW50OiAnXFwyMDBiJztcbn1cblxuLmQyaC1jb2RlLXNpZGUtZW1wdHlwbGFjZWhvbGRlcixcbi5kMmgtZW1wdHlwbGFjZWhvbGRlciB7XG4gIGJhY2tncm91bmQtY29sb3I6ICNmMWYxZjE7XG4gIGJvcmRlci1jb2xvcjogI2UxZTFlMTtcbn1cblxuLypcbiAqIENoYW5nZXMgSGlnaGxpZ2h0XG4gKi9cblxuLmQyaC1kZWwge1xuICBiYWNrZ3JvdW5kLWNvbG9yOiAjZmVlOGU5O1xuICBib3JkZXItY29sb3I6ICNlOWFlYWU7XG59XG5cbi5kMmgtaW5zIHtcbiAgYmFja2dyb3VuZC1jb2xvcjogI2RmZDtcbiAgYm9yZGVyLWNvbG9yOiAjYjRlMmI0O1xufVxuXG4uZDJoLWluZm8ge1xuICBiYWNrZ3JvdW5kLWNvbG9yOiAjZjhmYWZkO1xuICBjb2xvcjogcmdiYSgwLCAwLCAwLCAwLjMpO1xuICBib3JkZXItY29sb3I6ICNkNWU0ZjI7XG59XG5cbi5kMmgtZmlsZS1kaWZmIC5kMmgtZGVsLmQyaC1jaGFuZ2Uge1xuICBiYWNrZ3JvdW5kLWNvbG9yOiAjZmRmMmQwO1xufVxuXG4uZDJoLWZpbGUtZGlmZiAuZDJoLWlucy5kMmgtY2hhbmdlIHtcbiAgYmFja2dyb3VuZC1jb2xvcjogI2RlZDtcbn1cblxuLypcbiAqIEZpbGUgU3VtbWFyeSBMaXN0XG4gKi9cblxuLmQyaC1maWxlLWxpc3Qtd3JhcHBlciB7XG4gIG1hcmdpbi1ib3R0b206IDEwcHg7XG59XG5cbi5kMmgtZmlsZS1saXN0LXdyYXBwZXIgYSB7XG4gIHRleHQtZGVjb3JhdGlvbjogbm9uZTtcbiAgY29sb3I6ICMzNTcyYjA7XG59XG5cbi5kMmgtZmlsZS1saXN0LXdyYXBwZXIgYTp2aXNpdGVkIHtcbiAgY29sb3I6ICMzNTcyYjA7XG59XG5cbi5kMmgtZmlsZS1saXN0LWhlYWRlciB7XG4gIHRleHQtYWxpZ246IGxlZnQ7XG59XG5cbi5kMmgtZmlsZS1saXN0LXRpdGxlIHtcbiAgZm9udC13ZWlnaHQ6IGJvbGQ7XG59XG5cbi5kMmgtZmlsZS1saXN0LWxpbmUge1xuICBkaXNwbGF5OiAtd2Via2l0LWJveDtcbiAgZGlzcGxheTogLW1zLWZsZXhib3g7XG4gIGRpc3BsYXk6IGZsZXg7XG4gIHRleHQtYWxpZ246IGxlZnQ7XG59XG5cbi5kMmgtZmlsZS1saXN0IHtcbiAgZGlzcGxheTogYmxvY2s7XG4gIGxpc3Qtc3R5bGU6IG5vbmU7XG4gIHBhZGRpbmc6IDA7XG4gIG1hcmdpbjogMDtcbn1cblxuLmQyaC1maWxlLWxpc3QgPiBsaSB7XG4gIGJvcmRlci1ib3R0b206ICNkZGQgc29saWQgMXB4O1xuICBwYWRkaW5nOiA1cHggMTBweDtcbiAgbWFyZ2luOiAwO1xufVxuXG4uZDJoLWZpbGUtbGlzdCA+IGxpOmxhc3QtY2hpbGQge1xuICBib3JkZXItYm90dG9tOiBub25lO1xufVxuXG4uZDJoLWZpbGUtc3dpdGNoIHtcbiAgZGlzcGxheTogbm9uZTtcbiAgZm9udC1zaXplOiAxMHB4O1xuICBjdXJzb3I6IHBvaW50ZXI7XG59XG5cbi5kMmgtaWNvbiB7XG4gIHZlcnRpY2FsLWFsaWduOiBtaWRkbGU7XG4gIG1hcmdpbi1yaWdodDogMTBweDtcbiAgZmlsbDogY3VycmVudENvbG9yO1xufVxuXG4uZDJoLWRlbGV0ZWQge1xuICBjb2xvcjogI2MzMztcbn1cblxuLmQyaC1hZGRlZCB7XG4gIGNvbG9yOiAjMzk5ODM5O1xufVxuXG4uZDJoLWNoYW5nZWQge1xuICBjb2xvcjogI2QwYjQ0Yztcbn1cblxuLmQyaC1tb3ZlZCB7XG4gIGNvbG9yOiAjMzU3MmIwO1xufVxuXG4uZDJoLXRhZyB7XG4gIGRpc3BsYXk6IC13ZWJraXQtYm94O1xuICBkaXNwbGF5OiAtbXMtZmxleGJveDtcbiAgZGlzcGxheTogZmxleDtcbiAgZm9udC1zaXplOiAxMHB4O1xuICBtYXJnaW4tbGVmdDogNXB4O1xuICBwYWRkaW5nOiAwIDJweDtcbiAgYmFja2dyb3VuZC1jb2xvcjogI2ZmZjtcbn1cblxuLmQyaC1kZWxldGVkLXRhZyB7XG4gIGJvcmRlcjogI2MzMyAxcHggc29saWQ7XG59XG5cbi5kMmgtYWRkZWQtdGFnIHtcbiAgYm9yZGVyOiAjMzk5ODM5IDFweCBzb2xpZDtcbn1cblxuLmQyaC1jaGFuZ2VkLXRhZyB7XG4gIGJvcmRlcjogI2QwYjQ0YyAxcHggc29saWQ7XG59XG5cbi5kMmgtbW92ZWQtdGFnIHtcbiAgYm9yZGVyOiAjMzU3MmIwIDFweCBzb2xpZDtcbn1cblxuLypcbiAqIFNlbGVjdGlvbiB1dGlsLlxuICovXG5cbi5zZWxlY3RpbmctbGVmdCAuZDJoLWNvZGUtbGluZSxcbi5zZWxlY3RpbmctbGVmdCAuZDJoLWNvZGUtbGluZSAqLFxuLnNlbGVjdGluZy1yaWdodCB0ZC5kMmgtY29kZS1saW5lbnVtYmVyLFxuLnNlbGVjdGluZy1yaWdodCB0ZC5kMmgtY29kZS1saW5lbnVtYmVyICosXG4uc2VsZWN0aW5nLWxlZnQgLmQyaC1jb2RlLXNpZGUtbGluZSxcbi5zZWxlY3RpbmctbGVmdCAuZDJoLWNvZGUtc2lkZS1saW5lICosXG4uc2VsZWN0aW5nLXJpZ2h0IHRkLmQyaC1jb2RlLXNpZGUtbGluZW51bWJlcixcbi5zZWxlY3RpbmctcmlnaHQgdGQuZDJoLWNvZGUtc2lkZS1saW5lbnVtYmVyICoge1xuICAtd2Via2l0LXRvdWNoLWNhbGxvdXQ6IG5vbmU7XG4gIC13ZWJraXQtdXNlci1zZWxlY3Q6IG5vbmU7XG4gIC1tb3otdXNlci1zZWxlY3Q6IG5vbmU7XG4gIC1tcy11c2VyLXNlbGVjdDogbm9uZTtcbiAgdXNlci1zZWxlY3Q6IG5vbmU7XG59XG5cbi5zZWxlY3RpbmctbGVmdCAuZDJoLWNvZGUtbGluZTo6LW1vei1zZWxlY3Rpb24sXG4uc2VsZWN0aW5nLWxlZnQgLmQyaC1jb2RlLWxpbmUgKjo6LW1vei1zZWxlY3Rpb24sXG4uc2VsZWN0aW5nLXJpZ2h0IHRkLmQyaC1jb2RlLWxpbmVudW1iZXI6Oi1tb3otc2VsZWN0aW9uLFxuLnNlbGVjdGluZy1sZWZ0IC5kMmgtY29kZS1zaWRlLWxpbmU6Oi1tb3otc2VsZWN0aW9uLFxuLnNlbGVjdGluZy1sZWZ0IC5kMmgtY29kZS1zaWRlLWxpbmUgKjo6LW1vei1zZWxlY3Rpb24sXG4uc2VsZWN0aW5nLXJpZ2h0IHRkLmQyaC1jb2RlLXNpZGUtbGluZW51bWJlcjo6LW1vei1zZWxlY3Rpb24sXG4uc2VsZWN0aW5nLXJpZ2h0IHRkLmQyaC1jb2RlLXNpZGUtbGluZW51bWJlciAqOjotbW96LXNlbGVjdGlvbiB7XG4gIGJhY2tncm91bmQ6IHRyYW5zcGFyZW50O1xufVxuXG4uc2VsZWN0aW5nLWxlZnQgLmQyaC1jb2RlLWxpbmU6OnNlbGVjdGlvbixcbi5zZWxlY3RpbmctbGVmdCAuZDJoLWNvZGUtbGluZSAqOjpzZWxlY3Rpb24sXG4uc2VsZWN0aW5nLXJpZ2h0IHRkLmQyaC1jb2RlLWxpbmVudW1iZXI6OnNlbGVjdGlvbixcbi5zZWxlY3RpbmctbGVmdCAuZDJoLWNvZGUtc2lkZS1saW5lOjpzZWxlY3Rpb24sXG4uc2VsZWN0aW5nLWxlZnQgLmQyaC1jb2RlLXNpZGUtbGluZSAqOjpzZWxlY3Rpb24sXG4uc2VsZWN0aW5nLXJpZ2h0IHRkLmQyaC1jb2RlLXNpZGUtbGluZW51bWJlcjo6c2VsZWN0aW9uLFxuLnNlbGVjdGluZy1yaWdodCB0ZC5kMmgtY29kZS1zaWRlLWxpbmVudW1iZXIgKjo6c2VsZWN0aW9uIHtcbiAgYmFja2dyb3VuZDogdHJhbnNwYXJlbnQ7XG59XG4iXX0= */ \ No newline at end of file diff --git a/dist/diff2html.d.ts b/dist/diff2html.d.ts deleted file mode 100644 index cea93f6..0000000 --- a/dist/diff2html.d.ts +++ /dev/null @@ -1,71 +0,0 @@ -// Type definitions for diff2html -// Project: https://github.com/rtfpessoa/diff2html -// Definitions by: rtfpessoa -// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped - -declare namespace Diff2Html { - - export interface Options { - inputFormat?: 'diff' | 'json'; - outputFormat?: 'line-by-line' | 'side-by-side'; - showFiles?: boolean; - diffStyle?: 'word' | 'char'; - matching?: 'lines' | 'words' | 'none'; - matchWordsThreshold?: number; - matchingMaxComparisons?: number; - maxLineSizeInBlockForComparison?: number; - maxLineLengthHighlight?: number; - templates?: object; - rawTemplates?: object; - renderNothingWhenEmpty?: boolean; - } - - export interface Line { - content: string; - type: string; - oldNumber: number; - newNumber: number; - } - - export interface Block { - oldStartLine: number; - oldStartLine2?: number; - newStartLine: number; - header: string; - lines: Line[]; - } - - export interface Result { - addedLines: number; - deletedLines: number; - isCombined: boolean; - isGitDiff: boolean; - oldName: string; - newName: string; - language: string; - blocks: Block[]; - oldMode?: string; - newMode?: string; - deletedFileMode?: string; - newFileMode?: string; - isDeleted?: boolean; - isNew?: boolean; - isCopy?: boolean; - isRename?: boolean; - unchangedPercentage?: number; - changedPercentage?: number; - checksumBefore?: string; - checksumAfter?: string; - mode?: string; - } - - export interface Diff2Html { - getJsonFromDiff(input: string, configuration?: Options): Result[]; - getPrettyHtml(input: any, configuration?: Options): string; - } -} - -declare module "diff2html" { - var d2h: { "Diff2Html": Diff2Html.Diff2Html }; - export = d2h; -} diff --git a/dist/diff2html.js b/dist/diff2html.js deleted file mode 100644 index 927cf84..0000000 --- a/dist/diff2html.js +++ /dev/null @@ -1,4782 +0,0 @@ -(function(){function r(e,n,t){function o(i,f){if(!n[i]){if(!e[i]){var c="function"==typeof require&&require;if(!f&&c)return c(i,!0);if(u)return u(i,!0);var a=new Error("Cannot find module '"+i+"'");throw a.code="MODULE_NOT_FOUND",a}var p=n[i]={exports:{}};e[i][0].call(p.exports,function(r){var n=e[i][1][r];return o(n||r)},p,p.exports,r,e,n,t)}return n[i].exports}for(var u="function"==typeof require&&require,i=0;i - -All rights reserved. - -Redistribution and use of this software in source and binary forms, with or without modification, -are permitted provided that the following conditions are met: - -* Redistributions of source code must retain the above - copyright notice, this list of conditions and the - following disclaimer. - -* Redistributions in binary form must reproduce the above - copyright notice, this list of conditions and the - following disclaimer in the documentation and/or other - materials provided with the distribution. - -* Neither the name of Kevin Decker nor the names of its - contributors may be used to endorse or promote products - derived from this software without specific prior - written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR -IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND -FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR -CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER -IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT -OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -@license -*/ -(function (global, factory) { - typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) : - typeof define === 'function' && define.amd ? define(['exports'], factory) : - (global = global || self, factory(global.Diff = {})); -}(this, function (exports) { 'use strict'; - - function Diff() {} - Diff.prototype = { - diff: function diff(oldString, newString) { - var options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {}; - var callback = options.callback; - - if (typeof options === 'function') { - callback = options; - options = {}; - } - - this.options = options; - var self = this; - - function done(value) { - if (callback) { - setTimeout(function () { - callback(undefined, value); - }, 0); - return true; - } else { - return value; - } - } // Allow subclasses to massage the input prior to running - - - oldString = this.castInput(oldString); - newString = this.castInput(newString); - oldString = this.removeEmpty(this.tokenize(oldString)); - newString = this.removeEmpty(this.tokenize(newString)); - var newLen = newString.length, - oldLen = oldString.length; - var editLength = 1; - var maxEditLength = newLen + oldLen; - var bestPath = [{ - newPos: -1, - components: [] - }]; // Seed editLength = 0, i.e. the content starts with the same values - - var oldPos = this.extractCommon(bestPath[0], newString, oldString, 0); - - if (bestPath[0].newPos + 1 >= newLen && oldPos + 1 >= oldLen) { - // Identity per the equality and tokenizer - return done([{ - value: this.join(newString), - count: newString.length - }]); - } // Main worker method. checks all permutations of a given edit length for acceptance. - - - function execEditLength() { - for (var diagonalPath = -1 * editLength; diagonalPath <= editLength; diagonalPath += 2) { - var basePath = void 0; - - var addPath = bestPath[diagonalPath - 1], - removePath = bestPath[diagonalPath + 1], - _oldPos = (removePath ? removePath.newPos : 0) - diagonalPath; - - if (addPath) { - // No one else is going to attempt to use this value, clear it - bestPath[diagonalPath - 1] = undefined; - } - - var canAdd = addPath && addPath.newPos + 1 < newLen, - canRemove = removePath && 0 <= _oldPos && _oldPos < oldLen; - - if (!canAdd && !canRemove) { - // If this path is a terminal then prune - bestPath[diagonalPath] = undefined; - continue; - } // Select the diagonal that we want to branch from. We select the prior - // path whose position in the new string is the farthest from the origin - // and does not pass the bounds of the diff graph - - - if (!canAdd || canRemove && addPath.newPos < removePath.newPos) { - basePath = clonePath(removePath); - self.pushComponent(basePath.components, undefined, true); - } else { - basePath = addPath; // No need to clone, we've pulled it from the list - - basePath.newPos++; - self.pushComponent(basePath.components, true, undefined); - } - - _oldPos = self.extractCommon(basePath, newString, oldString, diagonalPath); // If we have hit the end of both strings, then we are done - - if (basePath.newPos + 1 >= newLen && _oldPos + 1 >= oldLen) { - return done(buildValues(self, basePath.components, newString, oldString, self.useLongestToken)); - } else { - // Otherwise track this path as a potential candidate and continue. - bestPath[diagonalPath] = basePath; - } - } - - editLength++; - } // Performs the length of edit iteration. Is a bit fugly as this has to support the - // sync and async mode which is never fun. Loops over execEditLength until a value - // is produced. - - - if (callback) { - (function exec() { - setTimeout(function () { - // This should not happen, but we want to be safe. - - /* istanbul ignore next */ - if (editLength > maxEditLength) { - return callback(); - } - - if (!execEditLength()) { - exec(); - } - }, 0); - })(); - } else { - while (editLength <= maxEditLength) { - var ret = execEditLength(); - - if (ret) { - return ret; - } - } - } - }, - pushComponent: function pushComponent(components, added, removed) { - var last = components[components.length - 1]; - - if (last && last.added === added && last.removed === removed) { - // We need to clone here as the component clone operation is just - // as shallow array clone - components[components.length - 1] = { - count: last.count + 1, - added: added, - removed: removed - }; - } else { - components.push({ - count: 1, - added: added, - removed: removed - }); - } - }, - extractCommon: function extractCommon(basePath, newString, oldString, diagonalPath) { - var newLen = newString.length, - oldLen = oldString.length, - newPos = basePath.newPos, - oldPos = newPos - diagonalPath, - commonCount = 0; - - while (newPos + 1 < newLen && oldPos + 1 < oldLen && this.equals(newString[newPos + 1], oldString[oldPos + 1])) { - newPos++; - oldPos++; - commonCount++; - } - - if (commonCount) { - basePath.components.push({ - count: commonCount - }); - } - - basePath.newPos = newPos; - return oldPos; - }, - equals: function equals(left, right) { - if (this.options.comparator) { - return this.options.comparator(left, right); - } else { - return left === right || this.options.ignoreCase && left.toLowerCase() === right.toLowerCase(); - } - }, - removeEmpty: function removeEmpty(array) { - var ret = []; - - for (var i = 0; i < array.length; i++) { - if (array[i]) { - ret.push(array[i]); - } - } - - return ret; - }, - castInput: function castInput(value) { - return value; - }, - tokenize: function tokenize(value) { - return value.split(''); - }, - join: function join(chars) { - return chars.join(''); - } - }; - - function buildValues(diff, components, newString, oldString, useLongestToken) { - var componentPos = 0, - componentLen = components.length, - newPos = 0, - oldPos = 0; - - for (; componentPos < componentLen; componentPos++) { - var component = components[componentPos]; - - if (!component.removed) { - if (!component.added && useLongestToken) { - var value = newString.slice(newPos, newPos + component.count); - value = value.map(function (value, i) { - var oldValue = oldString[oldPos + i]; - return oldValue.length > value.length ? oldValue : value; - }); - component.value = diff.join(value); - } else { - component.value = diff.join(newString.slice(newPos, newPos + component.count)); - } - - newPos += component.count; // Common case - - if (!component.added) { - oldPos += component.count; - } - } else { - component.value = diff.join(oldString.slice(oldPos, oldPos + component.count)); - oldPos += component.count; // Reverse add and remove so removes are output first to match common convention - // The diffing algorithm is tied to add then remove output and this is the simplest - // route to get the desired output with minimal overhead. - - if (componentPos && components[componentPos - 1].added) { - var tmp = components[componentPos - 1]; - components[componentPos - 1] = components[componentPos]; - components[componentPos] = tmp; - } - } - } // Special case handle for when one terminal is ignored (i.e. whitespace). - // For this case we merge the terminal into the prior string and drop the change. - // This is only available for string mode. - - - var lastComponent = components[componentLen - 1]; - - if (componentLen > 1 && typeof lastComponent.value === 'string' && (lastComponent.added || lastComponent.removed) && diff.equals('', lastComponent.value)) { - components[componentLen - 2].value += lastComponent.value; - components.pop(); - } - - return components; - } - - function clonePath(path) { - return { - newPos: path.newPos, - components: path.components.slice(0) - }; - } - - var characterDiff = new Diff(); - function diffChars(oldStr, newStr, options) { - return characterDiff.diff(oldStr, newStr, options); - } - - function generateOptions(options, defaults) { - if (typeof options === 'function') { - defaults.callback = options; - } else if (options) { - for (var name in options) { - /* istanbul ignore else */ - if (options.hasOwnProperty(name)) { - defaults[name] = options[name]; - } - } - } - - return defaults; - } - - // - // Ranges and exceptions: - // Latin-1 Supplement, 0080–00FF - // - U+00D7 × Multiplication sign - // - U+00F7 ÷ Division sign - // Latin Extended-A, 0100–017F - // Latin Extended-B, 0180–024F - // IPA Extensions, 0250–02AF - // Spacing Modifier Letters, 02B0–02FF - // - U+02C7 ˇ ˇ Caron - // - U+02D8 ˘ ˘ Breve - // - U+02D9 ˙ ˙ Dot Above - // - U+02DA ˚ ˚ Ring Above - // - U+02DB ˛ ˛ Ogonek - // - U+02DC ˜ ˜ Small Tilde - // - U+02DD ˝ ˝ Double Acute Accent - // Latin Extended Additional, 1E00–1EFF - - var extendedWordChars = /^[A-Za-z\xC0-\u02C6\u02C8-\u02D7\u02DE-\u02FF\u1E00-\u1EFF]+$/; - var reWhitespace = /\S/; - var wordDiff = new Diff(); - - wordDiff.equals = function (left, right) { - if (this.options.ignoreCase) { - left = left.toLowerCase(); - right = right.toLowerCase(); - } - - return left === right || this.options.ignoreWhitespace && !reWhitespace.test(left) && !reWhitespace.test(right); - }; - - wordDiff.tokenize = function (value) { - var tokens = value.split(/(\s+|[()[\]{}'"]|\b)/); // Join the boundary splits that we do not consider to be boundaries. This is primarily the extended Latin character set. - - for (var i = 0; i < tokens.length - 1; i++) { - // If we have an empty string in the next field and we have only word chars before and after, merge - if (!tokens[i + 1] && tokens[i + 2] && extendedWordChars.test(tokens[i]) && extendedWordChars.test(tokens[i + 2])) { - tokens[i] += tokens[i + 2]; - tokens.splice(i + 1, 2); - i--; - } - } - - return tokens; - }; - - function diffWords(oldStr, newStr, options) { - options = generateOptions(options, { - ignoreWhitespace: true - }); - return wordDiff.diff(oldStr, newStr, options); - } - function diffWordsWithSpace(oldStr, newStr, options) { - return wordDiff.diff(oldStr, newStr, options); - } - - var lineDiff = new Diff(); - - lineDiff.tokenize = function (value) { - var retLines = [], - linesAndNewlines = value.split(/(\n|\r\n)/); // Ignore the final empty token that occurs if the string ends with a new line - - if (!linesAndNewlines[linesAndNewlines.length - 1]) { - linesAndNewlines.pop(); - } // Merge the content and line separators into single tokens - - - for (var i = 0; i < linesAndNewlines.length; i++) { - var line = linesAndNewlines[i]; - - if (i % 2 && !this.options.newlineIsToken) { - retLines[retLines.length - 1] += line; - } else { - if (this.options.ignoreWhitespace) { - line = line.trim(); - } - - retLines.push(line); - } - } - - return retLines; - }; - - function diffLines(oldStr, newStr, callback) { - return lineDiff.diff(oldStr, newStr, callback); - } - function diffTrimmedLines(oldStr, newStr, callback) { - var options = generateOptions(callback, { - ignoreWhitespace: true - }); - return lineDiff.diff(oldStr, newStr, options); - } - - var sentenceDiff = new Diff(); - - sentenceDiff.tokenize = function (value) { - return value.split(/(\S.+?[.!?])(?=\s+|$)/); - }; - - function diffSentences(oldStr, newStr, callback) { - return sentenceDiff.diff(oldStr, newStr, callback); - } - - var cssDiff = new Diff(); - - cssDiff.tokenize = function (value) { - return value.split(/([{}:;,]|\s+)/); - }; - - function diffCss(oldStr, newStr, callback) { - return cssDiff.diff(oldStr, newStr, callback); - } - - function _typeof(obj) { - if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { - _typeof = function (obj) { - return typeof obj; - }; - } else { - _typeof = function (obj) { - return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; - }; - } - - return _typeof(obj); - } - - function _toConsumableArray(arr) { - return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _nonIterableSpread(); - } - - function _arrayWithoutHoles(arr) { - if (Array.isArray(arr)) { - for (var i = 0, arr2 = new Array(arr.length); i < arr.length; i++) arr2[i] = arr[i]; - - return arr2; - } - } - - function _iterableToArray(iter) { - if (Symbol.iterator in Object(iter) || Object.prototype.toString.call(iter) === "[object Arguments]") return Array.from(iter); - } - - function _nonIterableSpread() { - throw new TypeError("Invalid attempt to spread non-iterable instance"); - } - - var objectPrototypeToString = Object.prototype.toString; - var jsonDiff = new Diff(); // Discriminate between two lines of pretty-printed, serialized JSON where one of them has a - // dangling comma and the other doesn't. Turns out including the dangling comma yields the nicest output: - - jsonDiff.useLongestToken = true; - jsonDiff.tokenize = lineDiff.tokenize; - - jsonDiff.castInput = function (value) { - var _this$options = this.options, - undefinedReplacement = _this$options.undefinedReplacement, - _this$options$stringi = _this$options.stringifyReplacer, - stringifyReplacer = _this$options$stringi === void 0 ? function (k, v) { - return typeof v === 'undefined' ? undefinedReplacement : v; - } : _this$options$stringi; - return typeof value === 'string' ? value : JSON.stringify(canonicalize(value, null, null, stringifyReplacer), stringifyReplacer, ' '); - }; - - jsonDiff.equals = function (left, right) { - return Diff.prototype.equals.call(jsonDiff, left.replace(/,([\r\n])/g, '$1'), right.replace(/,([\r\n])/g, '$1')); - }; - - function diffJson(oldObj, newObj, options) { - return jsonDiff.diff(oldObj, newObj, options); - } // This function handles the presence of circular references by bailing out when encountering an - // object that is already on the "stack" of items being processed. Accepts an optional replacer - - function canonicalize(obj, stack, replacementStack, replacer, key) { - stack = stack || []; - replacementStack = replacementStack || []; - - if (replacer) { - obj = replacer(key, obj); - } - - var i; - - for (i = 0; i < stack.length; i += 1) { - if (stack[i] === obj) { - return replacementStack[i]; - } - } - - var canonicalizedObj; - - if ('[object Array]' === objectPrototypeToString.call(obj)) { - stack.push(obj); - canonicalizedObj = new Array(obj.length); - replacementStack.push(canonicalizedObj); - - for (i = 0; i < obj.length; i += 1) { - canonicalizedObj[i] = canonicalize(obj[i], stack, replacementStack, replacer, key); - } - - stack.pop(); - replacementStack.pop(); - return canonicalizedObj; - } - - if (obj && obj.toJSON) { - obj = obj.toJSON(); - } - - if (_typeof(obj) === 'object' && obj !== null) { - stack.push(obj); - canonicalizedObj = {}; - replacementStack.push(canonicalizedObj); - - var sortedKeys = [], - _key; - - for (_key in obj) { - /* istanbul ignore else */ - if (obj.hasOwnProperty(_key)) { - sortedKeys.push(_key); - } - } - - sortedKeys.sort(); - - for (i = 0; i < sortedKeys.length; i += 1) { - _key = sortedKeys[i]; - canonicalizedObj[_key] = canonicalize(obj[_key], stack, replacementStack, replacer, _key); - } - - stack.pop(); - replacementStack.pop(); - } else { - canonicalizedObj = obj; - } - - return canonicalizedObj; - } - - var arrayDiff = new Diff(); - - arrayDiff.tokenize = function (value) { - return value.slice(); - }; - - arrayDiff.join = arrayDiff.removeEmpty = function (value) { - return value; - }; - - function diffArrays(oldArr, newArr, callback) { - return arrayDiff.diff(oldArr, newArr, callback); - } - - function parsePatch(uniDiff) { - var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; - var diffstr = uniDiff.split(/\r\n|[\n\v\f\r\x85]/), - delimiters = uniDiff.match(/\r\n|[\n\v\f\r\x85]/g) || [], - list = [], - i = 0; - - function parseIndex() { - var index = {}; - list.push(index); // Parse diff metadata - - while (i < diffstr.length) { - var line = diffstr[i]; // File header found, end parsing diff metadata - - if (/^(\-\-\-|\+\+\+|@@)\s/.test(line)) { - break; - } // Diff index - - - var header = /^(?:Index:|diff(?: -r \w+)+)\s+(.+?)\s*$/.exec(line); - - if (header) { - index.index = header[1]; - } - - i++; - } // Parse file headers if they are defined. Unified diff requires them, but - // there's no technical issues to have an isolated hunk without file header - - - parseFileHeader(index); - parseFileHeader(index); // Parse hunks - - index.hunks = []; - - while (i < diffstr.length) { - var _line = diffstr[i]; - - if (/^(Index:|diff|\-\-\-|\+\+\+)\s/.test(_line)) { - break; - } else if (/^@@/.test(_line)) { - index.hunks.push(parseHunk()); - } else if (_line && options.strict) { - // Ignore unexpected content unless in strict mode - throw new Error('Unknown line ' + (i + 1) + ' ' + JSON.stringify(_line)); - } else { - i++; - } - } - } // Parses the --- and +++ headers, if none are found, no lines - // are consumed. - - - function parseFileHeader(index) { - var fileHeader = /^(---|\+\+\+)\s+(.*)$/.exec(diffstr[i]); - - if (fileHeader) { - var keyPrefix = fileHeader[1] === '---' ? 'old' : 'new'; - var data = fileHeader[2].split('\t', 2); - var fileName = data[0].replace(/\\\\/g, '\\'); - - if (/^".*"$/.test(fileName)) { - fileName = fileName.substr(1, fileName.length - 2); - } - - index[keyPrefix + 'FileName'] = fileName; - index[keyPrefix + 'Header'] = (data[1] || '').trim(); - i++; - } - } // Parses a hunk - // This assumes that we are at the start of a hunk. - - - function parseHunk() { - var chunkHeaderIndex = i, - chunkHeaderLine = diffstr[i++], - chunkHeader = chunkHeaderLine.split(/@@ -(\d+)(?:,(\d+))? \+(\d+)(?:,(\d+))? @@/); - var hunk = { - oldStart: +chunkHeader[1], - oldLines: +chunkHeader[2] || 1, - newStart: +chunkHeader[3], - newLines: +chunkHeader[4] || 1, - lines: [], - linedelimiters: [] - }; - var addCount = 0, - removeCount = 0; - - for (; i < diffstr.length; i++) { - // Lines starting with '---' could be mistaken for the "remove line" operation - // But they could be the header for the next file. Therefore prune such cases out. - if (diffstr[i].indexOf('--- ') === 0 && i + 2 < diffstr.length && diffstr[i + 1].indexOf('+++ ') === 0 && diffstr[i + 2].indexOf('@@') === 0) { - break; - } - - var operation = diffstr[i].length == 0 && i != diffstr.length - 1 ? ' ' : diffstr[i][0]; - - if (operation === '+' || operation === '-' || operation === ' ' || operation === '\\') { - hunk.lines.push(diffstr[i]); - hunk.linedelimiters.push(delimiters[i] || '\n'); - - if (operation === '+') { - addCount++; - } else if (operation === '-') { - removeCount++; - } else if (operation === ' ') { - addCount++; - removeCount++; - } - } else { - break; - } - } // Handle the empty block count case - - - if (!addCount && hunk.newLines === 1) { - hunk.newLines = 0; - } - - if (!removeCount && hunk.oldLines === 1) { - hunk.oldLines = 0; - } // Perform optional sanity checking - - - if (options.strict) { - if (addCount !== hunk.newLines) { - throw new Error('Added line count did not match for hunk at line ' + (chunkHeaderIndex + 1)); - } - - if (removeCount !== hunk.oldLines) { - throw new Error('Removed line count did not match for hunk at line ' + (chunkHeaderIndex + 1)); - } - } - - return hunk; - } - - while (i < diffstr.length) { - parseIndex(); - } - - return list; - } - - // Iterator that traverses in the range of [min, max], stepping - // by distance from a given start position. I.e. for [0, 4], with - // start of 2, this will iterate 2, 3, 1, 4, 0. - function distanceIterator (start, minLine, maxLine) { - var wantForward = true, - backwardExhausted = false, - forwardExhausted = false, - localOffset = 1; - return function iterator() { - if (wantForward && !forwardExhausted) { - if (backwardExhausted) { - localOffset++; - } else { - wantForward = false; - } // Check if trying to fit beyond text length, and if not, check it fits - // after offset location (or desired location on first iteration) - - - if (start + localOffset <= maxLine) { - return localOffset; - } - - forwardExhausted = true; - } - - if (!backwardExhausted) { - if (!forwardExhausted) { - wantForward = true; - } // Check if trying to fit before text beginning, and if not, check it fits - // before offset location - - - if (minLine <= start - localOffset) { - return -localOffset++; - } - - backwardExhausted = true; - return iterator(); - } // We tried to fit hunk before text beginning and beyond text length, then - // hunk can't fit on the text. Return undefined - - }; - } - - function applyPatch(source, uniDiff) { - var options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {}; - - if (typeof uniDiff === 'string') { - uniDiff = parsePatch(uniDiff); - } - - if (Array.isArray(uniDiff)) { - if (uniDiff.length > 1) { - throw new Error('applyPatch only works with a single input.'); - } - - uniDiff = uniDiff[0]; - } // Apply the diff to the input - - - var lines = source.split(/\r\n|[\n\v\f\r\x85]/), - delimiters = source.match(/\r\n|[\n\v\f\r\x85]/g) || [], - hunks = uniDiff.hunks, - compareLine = options.compareLine || function (lineNumber, line, operation, patchContent) { - return line === patchContent; - }, - errorCount = 0, - fuzzFactor = options.fuzzFactor || 0, - minLine = 0, - offset = 0, - removeEOFNL, - addEOFNL; - /** - * Checks if the hunk exactly fits on the provided location - */ - - - function hunkFits(hunk, toPos) { - for (var j = 0; j < hunk.lines.length; j++) { - var line = hunk.lines[j], - operation = line.length > 0 ? line[0] : ' ', - content = line.length > 0 ? line.substr(1) : line; - - if (operation === ' ' || operation === '-') { - // Context sanity check - if (!compareLine(toPos + 1, lines[toPos], operation, content)) { - errorCount++; - - if (errorCount > fuzzFactor) { - return false; - } - } - - toPos++; - } - } - - return true; - } // Search best fit offsets for each hunk based on the previous ones - - - for (var i = 0; i < hunks.length; i++) { - var hunk = hunks[i], - maxLine = lines.length - hunk.oldLines, - localOffset = 0, - toPos = offset + hunk.oldStart - 1; - var iterator = distanceIterator(toPos, minLine, maxLine); - - for (; localOffset !== undefined; localOffset = iterator()) { - if (hunkFits(hunk, toPos + localOffset)) { - hunk.offset = offset += localOffset; - break; - } - } - - if (localOffset === undefined) { - return false; - } // Set lower text limit to end of the current hunk, so next ones don't try - // to fit over already patched text - - - minLine = hunk.offset + hunk.oldStart + hunk.oldLines; - } // Apply patch hunks - - - var diffOffset = 0; - - for (var _i = 0; _i < hunks.length; _i++) { - var _hunk = hunks[_i], - _toPos = _hunk.oldStart + _hunk.offset + diffOffset - 1; - - diffOffset += _hunk.newLines - _hunk.oldLines; - - if (_toPos < 0) { - // Creating a new file - _toPos = 0; - } - - for (var j = 0; j < _hunk.lines.length; j++) { - var line = _hunk.lines[j], - operation = line.length > 0 ? line[0] : ' ', - content = line.length > 0 ? line.substr(1) : line, - delimiter = _hunk.linedelimiters[j]; - - if (operation === ' ') { - _toPos++; - } else if (operation === '-') { - lines.splice(_toPos, 1); - delimiters.splice(_toPos, 1); - /* istanbul ignore else */ - } else if (operation === '+') { - lines.splice(_toPos, 0, content); - delimiters.splice(_toPos, 0, delimiter); - _toPos++; - } else if (operation === '\\') { - var previousOperation = _hunk.lines[j - 1] ? _hunk.lines[j - 1][0] : null; - - if (previousOperation === '+') { - removeEOFNL = true; - } else if (previousOperation === '-') { - addEOFNL = true; - } - } - } - } // Handle EOFNL insertion/removal - - - if (removeEOFNL) { - while (!lines[lines.length - 1]) { - lines.pop(); - delimiters.pop(); - } - } else if (addEOFNL) { - lines.push(''); - delimiters.push('\n'); - } - - for (var _k = 0; _k < lines.length - 1; _k++) { - lines[_k] = lines[_k] + delimiters[_k]; - } - - return lines.join(''); - } // Wrapper that supports multiple file patches via callbacks. - - function applyPatches(uniDiff, options) { - if (typeof uniDiff === 'string') { - uniDiff = parsePatch(uniDiff); - } - - var currentIndex = 0; - - function processIndex() { - var index = uniDiff[currentIndex++]; - - if (!index) { - return options.complete(); - } - - options.loadFile(index, function (err, data) { - if (err) { - return options.complete(err); - } - - var updatedContent = applyPatch(data, index, options); - options.patched(index, updatedContent, function (err) { - if (err) { - return options.complete(err); - } - - processIndex(); - }); - }); - } - - processIndex(); - } - - function structuredPatch(oldFileName, newFileName, oldStr, newStr, oldHeader, newHeader, options) { - if (!options) { - options = {}; - } - - if (typeof options.context === 'undefined') { - options.context = 4; - } - - var diff = diffLines(oldStr, newStr, options); - diff.push({ - value: '', - lines: [] - }); // Append an empty value to make cleanup easier - - function contextLines(lines) { - return lines.map(function (entry) { - return ' ' + entry; - }); - } - - var hunks = []; - var oldRangeStart = 0, - newRangeStart = 0, - curRange = [], - oldLine = 1, - newLine = 1; - - var _loop = function _loop(i) { - var current = diff[i], - lines = current.lines || current.value.replace(/\n$/, '').split('\n'); - current.lines = lines; - - if (current.added || current.removed) { - var _curRange; - - // If we have previous context, start with that - if (!oldRangeStart) { - var prev = diff[i - 1]; - oldRangeStart = oldLine; - newRangeStart = newLine; - - if (prev) { - curRange = options.context > 0 ? contextLines(prev.lines.slice(-options.context)) : []; - oldRangeStart -= curRange.length; - newRangeStart -= curRange.length; - } - } // Output our changes - - - (_curRange = curRange).push.apply(_curRange, _toConsumableArray(lines.map(function (entry) { - return (current.added ? '+' : '-') + entry; - }))); // Track the updated file position - - - if (current.added) { - newLine += lines.length; - } else { - oldLine += lines.length; - } - } else { - // Identical context lines. Track line changes - if (oldRangeStart) { - // Close out any changes that have been output (or join overlapping) - if (lines.length <= options.context * 2 && i < diff.length - 2) { - var _curRange2; - - // Overlapping - (_curRange2 = curRange).push.apply(_curRange2, _toConsumableArray(contextLines(lines))); - } else { - var _curRange3; - - // end the range and output - var contextSize = Math.min(lines.length, options.context); - - (_curRange3 = curRange).push.apply(_curRange3, _toConsumableArray(contextLines(lines.slice(0, contextSize)))); - - var hunk = { - oldStart: oldRangeStart, - oldLines: oldLine - oldRangeStart + contextSize, - newStart: newRangeStart, - newLines: newLine - newRangeStart + contextSize, - lines: curRange - }; - - if (i >= diff.length - 2 && lines.length <= options.context) { - // EOF is inside this hunk - var oldEOFNewline = /\n$/.test(oldStr); - var newEOFNewline = /\n$/.test(newStr); - var noNlBeforeAdds = lines.length == 0 && curRange.length > hunk.oldLines; - - if (!oldEOFNewline && noNlBeforeAdds) { - // special case: old has no eol and no trailing context; no-nl can end up before adds - curRange.splice(hunk.oldLines, 0, '\\ No newline at end of file'); - } - - if (!oldEOFNewline && !noNlBeforeAdds || !newEOFNewline) { - curRange.push('\\ No newline at end of file'); - } - } - - hunks.push(hunk); - oldRangeStart = 0; - newRangeStart = 0; - curRange = []; - } - } - - oldLine += lines.length; - newLine += lines.length; - } - }; - - for (var i = 0; i < diff.length; i++) { - _loop(i); - } - - return { - oldFileName: oldFileName, - newFileName: newFileName, - oldHeader: oldHeader, - newHeader: newHeader, - hunks: hunks - }; - } - function createTwoFilesPatch(oldFileName, newFileName, oldStr, newStr, oldHeader, newHeader, options) { - var diff = structuredPatch(oldFileName, newFileName, oldStr, newStr, oldHeader, newHeader, options); - var ret = []; - - if (oldFileName == newFileName) { - ret.push('Index: ' + oldFileName); - } - - ret.push('==================================================================='); - ret.push('--- ' + diff.oldFileName + (typeof diff.oldHeader === 'undefined' ? '' : '\t' + diff.oldHeader)); - ret.push('+++ ' + diff.newFileName + (typeof diff.newHeader === 'undefined' ? '' : '\t' + diff.newHeader)); - - for (var i = 0; i < diff.hunks.length; i++) { - var hunk = diff.hunks[i]; - ret.push('@@ -' + hunk.oldStart + ',' + hunk.oldLines + ' +' + hunk.newStart + ',' + hunk.newLines + ' @@'); - ret.push.apply(ret, hunk.lines); - } - - return ret.join('\n') + '\n'; - } - function createPatch(fileName, oldStr, newStr, oldHeader, newHeader, options) { - return createTwoFilesPatch(fileName, fileName, oldStr, newStr, oldHeader, newHeader, options); - } - - function arrayEqual(a, b) { - if (a.length !== b.length) { - return false; - } - - return arrayStartsWith(a, b); - } - function arrayStartsWith(array, start) { - if (start.length > array.length) { - return false; - } - - for (var i = 0; i < start.length; i++) { - if (start[i] !== array[i]) { - return false; - } - } - - return true; - } - - function calcLineCount(hunk) { - var _calcOldNewLineCount = calcOldNewLineCount(hunk.lines), - oldLines = _calcOldNewLineCount.oldLines, - newLines = _calcOldNewLineCount.newLines; - - if (oldLines !== undefined) { - hunk.oldLines = oldLines; - } else { - delete hunk.oldLines; - } - - if (newLines !== undefined) { - hunk.newLines = newLines; - } else { - delete hunk.newLines; - } - } - function merge(mine, theirs, base) { - mine = loadPatch(mine, base); - theirs = loadPatch(theirs, base); - var ret = {}; // For index we just let it pass through as it doesn't have any necessary meaning. - // Leaving sanity checks on this to the API consumer that may know more about the - // meaning in their own context. - - if (mine.index || theirs.index) { - ret.index = mine.index || theirs.index; - } - - if (mine.newFileName || theirs.newFileName) { - if (!fileNameChanged(mine)) { - // No header or no change in ours, use theirs (and ours if theirs does not exist) - ret.oldFileName = theirs.oldFileName || mine.oldFileName; - ret.newFileName = theirs.newFileName || mine.newFileName; - ret.oldHeader = theirs.oldHeader || mine.oldHeader; - ret.newHeader = theirs.newHeader || mine.newHeader; - } else if (!fileNameChanged(theirs)) { - // No header or no change in theirs, use ours - ret.oldFileName = mine.oldFileName; - ret.newFileName = mine.newFileName; - ret.oldHeader = mine.oldHeader; - ret.newHeader = mine.newHeader; - } else { - // Both changed... figure it out - ret.oldFileName = selectField(ret, mine.oldFileName, theirs.oldFileName); - ret.newFileName = selectField(ret, mine.newFileName, theirs.newFileName); - ret.oldHeader = selectField(ret, mine.oldHeader, theirs.oldHeader); - ret.newHeader = selectField(ret, mine.newHeader, theirs.newHeader); - } - } - - ret.hunks = []; - var mineIndex = 0, - theirsIndex = 0, - mineOffset = 0, - theirsOffset = 0; - - while (mineIndex < mine.hunks.length || theirsIndex < theirs.hunks.length) { - var mineCurrent = mine.hunks[mineIndex] || { - oldStart: Infinity - }, - theirsCurrent = theirs.hunks[theirsIndex] || { - oldStart: Infinity - }; - - if (hunkBefore(mineCurrent, theirsCurrent)) { - // This patch does not overlap with any of the others, yay. - ret.hunks.push(cloneHunk(mineCurrent, mineOffset)); - mineIndex++; - theirsOffset += mineCurrent.newLines - mineCurrent.oldLines; - } else if (hunkBefore(theirsCurrent, mineCurrent)) { - // This patch does not overlap with any of the others, yay. - ret.hunks.push(cloneHunk(theirsCurrent, theirsOffset)); - theirsIndex++; - mineOffset += theirsCurrent.newLines - theirsCurrent.oldLines; - } else { - // Overlap, merge as best we can - var mergedHunk = { - oldStart: Math.min(mineCurrent.oldStart, theirsCurrent.oldStart), - oldLines: 0, - newStart: Math.min(mineCurrent.newStart + mineOffset, theirsCurrent.oldStart + theirsOffset), - newLines: 0, - lines: [] - }; - mergeLines(mergedHunk, mineCurrent.oldStart, mineCurrent.lines, theirsCurrent.oldStart, theirsCurrent.lines); - theirsIndex++; - mineIndex++; - ret.hunks.push(mergedHunk); - } - } - - return ret; - } - - function loadPatch(param, base) { - if (typeof param === 'string') { - if (/^@@/m.test(param) || /^Index:/m.test(param)) { - return parsePatch(param)[0]; - } - - if (!base) { - throw new Error('Must provide a base reference or pass in a patch'); - } - - return structuredPatch(undefined, undefined, base, param); - } - - return param; - } - - function fileNameChanged(patch) { - return patch.newFileName && patch.newFileName !== patch.oldFileName; - } - - function selectField(index, mine, theirs) { - if (mine === theirs) { - return mine; - } else { - index.conflict = true; - return { - mine: mine, - theirs: theirs - }; - } - } - - function hunkBefore(test, check) { - return test.oldStart < check.oldStart && test.oldStart + test.oldLines < check.oldStart; - } - - function cloneHunk(hunk, offset) { - return { - oldStart: hunk.oldStart, - oldLines: hunk.oldLines, - newStart: hunk.newStart + offset, - newLines: hunk.newLines, - lines: hunk.lines - }; - } - - function mergeLines(hunk, mineOffset, mineLines, theirOffset, theirLines) { - // This will generally result in a conflicted hunk, but there are cases where the context - // is the only overlap where we can successfully merge the content here. - var mine = { - offset: mineOffset, - lines: mineLines, - index: 0 - }, - their = { - offset: theirOffset, - lines: theirLines, - index: 0 - }; // Handle any leading content - - insertLeading(hunk, mine, their); - insertLeading(hunk, their, mine); // Now in the overlap content. Scan through and select the best changes from each. - - while (mine.index < mine.lines.length && their.index < their.lines.length) { - var mineCurrent = mine.lines[mine.index], - theirCurrent = their.lines[their.index]; - - if ((mineCurrent[0] === '-' || mineCurrent[0] === '+') && (theirCurrent[0] === '-' || theirCurrent[0] === '+')) { - // Both modified ... - mutualChange(hunk, mine, their); - } else if (mineCurrent[0] === '+' && theirCurrent[0] === ' ') { - var _hunk$lines; - - // Mine inserted - (_hunk$lines = hunk.lines).push.apply(_hunk$lines, _toConsumableArray(collectChange(mine))); - } else if (theirCurrent[0] === '+' && mineCurrent[0] === ' ') { - var _hunk$lines2; - - // Theirs inserted - (_hunk$lines2 = hunk.lines).push.apply(_hunk$lines2, _toConsumableArray(collectChange(their))); - } else if (mineCurrent[0] === '-' && theirCurrent[0] === ' ') { - // Mine removed or edited - removal(hunk, mine, their); - } else if (theirCurrent[0] === '-' && mineCurrent[0] === ' ') { - // Their removed or edited - removal(hunk, their, mine, true); - } else if (mineCurrent === theirCurrent) { - // Context identity - hunk.lines.push(mineCurrent); - mine.index++; - their.index++; - } else { - // Context mismatch - conflict(hunk, collectChange(mine), collectChange(their)); - } - } // Now push anything that may be remaining - - - insertTrailing(hunk, mine); - insertTrailing(hunk, their); - calcLineCount(hunk); - } - - function mutualChange(hunk, mine, their) { - var myChanges = collectChange(mine), - theirChanges = collectChange(their); - - if (allRemoves(myChanges) && allRemoves(theirChanges)) { - // Special case for remove changes that are supersets of one another - if (arrayStartsWith(myChanges, theirChanges) && skipRemoveSuperset(their, myChanges, myChanges.length - theirChanges.length)) { - var _hunk$lines3; - - (_hunk$lines3 = hunk.lines).push.apply(_hunk$lines3, _toConsumableArray(myChanges)); - - return; - } else if (arrayStartsWith(theirChanges, myChanges) && skipRemoveSuperset(mine, theirChanges, theirChanges.length - myChanges.length)) { - var _hunk$lines4; - - (_hunk$lines4 = hunk.lines).push.apply(_hunk$lines4, _toConsumableArray(theirChanges)); - - return; - } - } else if (arrayEqual(myChanges, theirChanges)) { - var _hunk$lines5; - - (_hunk$lines5 = hunk.lines).push.apply(_hunk$lines5, _toConsumableArray(myChanges)); - - return; - } - - conflict(hunk, myChanges, theirChanges); - } - - function removal(hunk, mine, their, swap) { - var myChanges = collectChange(mine), - theirChanges = collectContext(their, myChanges); - - if (theirChanges.merged) { - var _hunk$lines6; - - (_hunk$lines6 = hunk.lines).push.apply(_hunk$lines6, _toConsumableArray(theirChanges.merged)); - } else { - conflict(hunk, swap ? theirChanges : myChanges, swap ? myChanges : theirChanges); - } - } - - function conflict(hunk, mine, their) { - hunk.conflict = true; - hunk.lines.push({ - conflict: true, - mine: mine, - theirs: their - }); - } - - function insertLeading(hunk, insert, their) { - while (insert.offset < their.offset && insert.index < insert.lines.length) { - var line = insert.lines[insert.index++]; - hunk.lines.push(line); - insert.offset++; - } - } - - function insertTrailing(hunk, insert) { - while (insert.index < insert.lines.length) { - var line = insert.lines[insert.index++]; - hunk.lines.push(line); - } - } - - function collectChange(state) { - var ret = [], - operation = state.lines[state.index][0]; - - while (state.index < state.lines.length) { - var line = state.lines[state.index]; // Group additions that are immediately after subtractions and treat them as one "atomic" modify change. - - if (operation === '-' && line[0] === '+') { - operation = '+'; - } - - if (operation === line[0]) { - ret.push(line); - state.index++; - } else { - break; - } - } - - return ret; - } - - function collectContext(state, matchChanges) { - var changes = [], - merged = [], - matchIndex = 0, - contextChanges = false, - conflicted = false; - - while (matchIndex < matchChanges.length && state.index < state.lines.length) { - var change = state.lines[state.index], - match = matchChanges[matchIndex]; // Once we've hit our add, then we are done - - if (match[0] === '+') { - break; - } - - contextChanges = contextChanges || change[0] !== ' '; - merged.push(match); - matchIndex++; // Consume any additions in the other block as a conflict to attempt - // to pull in the remaining context after this - - if (change[0] === '+') { - conflicted = true; - - while (change[0] === '+') { - changes.push(change); - change = state.lines[++state.index]; - } - } - - if (match.substr(1) === change.substr(1)) { - changes.push(change); - state.index++; - } else { - conflicted = true; - } - } - - if ((matchChanges[matchIndex] || '')[0] === '+' && contextChanges) { - conflicted = true; - } - - if (conflicted) { - return changes; - } - - while (matchIndex < matchChanges.length) { - merged.push(matchChanges[matchIndex++]); - } - - return { - merged: merged, - changes: changes - }; - } - - function allRemoves(changes) { - return changes.reduce(function (prev, change) { - return prev && change[0] === '-'; - }, true); - } - - function skipRemoveSuperset(state, removeChanges, delta) { - for (var i = 0; i < delta; i++) { - var changeContent = removeChanges[removeChanges.length - delta + i].substr(1); - - if (state.lines[state.index + i] !== ' ' + changeContent) { - return false; - } - } - - state.index += delta; - return true; - } - - function calcOldNewLineCount(lines) { - var oldLines = 0; - var newLines = 0; - lines.forEach(function (line) { - if (typeof line !== 'string') { - var myCount = calcOldNewLineCount(line.mine); - var theirCount = calcOldNewLineCount(line.theirs); - - if (oldLines !== undefined) { - if (myCount.oldLines === theirCount.oldLines) { - oldLines += myCount.oldLines; - } else { - oldLines = undefined; - } - } - - if (newLines !== undefined) { - if (myCount.newLines === theirCount.newLines) { - newLines += myCount.newLines; - } else { - newLines = undefined; - } - } - } else { - if (newLines !== undefined && (line[0] === '+' || line[0] === ' ')) { - newLines++; - } - - if (oldLines !== undefined && (line[0] === '-' || line[0] === ' ')) { - oldLines++; - } - } - }); - return { - oldLines: oldLines, - newLines: newLines - }; - } - - // See: http://code.google.com/p/google-diff-match-patch/wiki/API - function convertChangesToDMP(changes) { - var ret = [], - change, - operation; - - for (var i = 0; i < changes.length; i++) { - change = changes[i]; - - if (change.added) { - operation = 1; - } else if (change.removed) { - operation = -1; - } else { - operation = 0; - } - - ret.push([operation, change.value]); - } - - return ret; - } - - function convertChangesToXML(changes) { - var ret = []; - - for (var i = 0; i < changes.length; i++) { - var change = changes[i]; - - if (change.added) { - ret.push(''); - } else if (change.removed) { - ret.push(''); - } - - ret.push(escapeHTML(change.value)); - - if (change.added) { - ret.push(''); - } else if (change.removed) { - ret.push(''); - } - } - - return ret.join(''); - } - - function escapeHTML(s) { - var n = s; - n = n.replace(/&/g, '&'); - n = n.replace(//g, '>'); - n = n.replace(/"/g, '"'); - return n; - } - - /* See LICENSE file for terms of use */ - - exports.Diff = Diff; - exports.diffChars = diffChars; - exports.diffWords = diffWords; - exports.diffWordsWithSpace = diffWordsWithSpace; - exports.diffLines = diffLines; - exports.diffTrimmedLines = diffTrimmedLines; - exports.diffSentences = diffSentences; - exports.diffCss = diffCss; - exports.diffJson = diffJson; - exports.diffArrays = diffArrays; - exports.structuredPatch = structuredPatch; - exports.createTwoFilesPatch = createTwoFilesPatch; - exports.createPatch = createPatch; - exports.applyPatch = applyPatch; - exports.applyPatches = applyPatches; - exports.parsePatch = parsePatch; - exports.merge = merge; - exports.convertChangesToDMP = convertChangesToDMP; - exports.convertChangesToXML = convertChangesToXML; - exports.canonicalize = canonicalize; - - Object.defineProperty(exports, '__esModule', { value: true }); - -})); - -},{}],3:[function(require,module,exports){ -/* - * Copyright 2011 Twitter, Inc. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -(function (Hogan) { - // Setup regex assignments - // remove whitespace according to Mustache spec - var rIsWhitespace = /\S/, - rQuot = /\"/g, - rNewline = /\n/g, - rCr = /\r/g, - rSlash = /\\/g, - rLineSep = /\u2028/, - rParagraphSep = /\u2029/; - - Hogan.tags = { - '#': 1, '^': 2, '<': 3, '$': 4, - '/': 5, '!': 6, '>': 7, '=': 8, '_v': 9, - '{': 10, '&': 11, '_t': 12 - }; - - Hogan.scan = function scan(text, delimiters) { - var len = text.length, - IN_TEXT = 0, - IN_TAG_TYPE = 1, - IN_TAG = 2, - state = IN_TEXT, - tagType = null, - tag = null, - buf = '', - tokens = [], - seenTag = false, - i = 0, - lineStart = 0, - otag = '{{', - ctag = '}}'; - - function addBuf() { - if (buf.length > 0) { - tokens.push({tag: '_t', text: new String(buf)}); - buf = ''; - } - } - - function lineIsWhitespace() { - var isAllWhitespace = true; - for (var j = lineStart; j < tokens.length; j++) { - isAllWhitespace = - (Hogan.tags[tokens[j].tag] < Hogan.tags['_v']) || - (tokens[j].tag == '_t' && tokens[j].text.match(rIsWhitespace) === null); - if (!isAllWhitespace) { - return false; - } - } - - return isAllWhitespace; - } - - function filterLine(haveSeenTag, noNewLine) { - addBuf(); - - if (haveSeenTag && lineIsWhitespace()) { - for (var j = lineStart, next; j < tokens.length; j++) { - if (tokens[j].text) { - if ((next = tokens[j+1]) && next.tag == '>') { - // set indent to token value - next.indent = tokens[j].text.toString() - } - tokens.splice(j, 1); - } - } - } else if (!noNewLine) { - tokens.push({tag:'\n'}); - } - - seenTag = false; - lineStart = tokens.length; - } - - function changeDelimiters(text, index) { - var close = '=' + ctag, - closeIndex = text.indexOf(close, index), - delimiters = trim( - text.substring(text.indexOf('=', index) + 1, closeIndex) - ).split(' '); - - otag = delimiters[0]; - ctag = delimiters[delimiters.length - 1]; - - return closeIndex + close.length - 1; - } - - if (delimiters) { - delimiters = delimiters.split(' '); - otag = delimiters[0]; - ctag = delimiters[1]; - } - - for (i = 0; i < len; i++) { - if (state == IN_TEXT) { - if (tagChange(otag, text, i)) { - --i; - addBuf(); - state = IN_TAG_TYPE; - } else { - if (text.charAt(i) == '\n') { - filterLine(seenTag); - } else { - buf += text.charAt(i); - } - } - } else if (state == IN_TAG_TYPE) { - i += otag.length - 1; - tag = Hogan.tags[text.charAt(i + 1)]; - tagType = tag ? text.charAt(i + 1) : '_v'; - if (tagType == '=') { - i = changeDelimiters(text, i); - state = IN_TEXT; - } else { - if (tag) { - i++; - } - state = IN_TAG; - } - seenTag = i; - } else { - if (tagChange(ctag, text, i)) { - tokens.push({tag: tagType, n: trim(buf), otag: otag, ctag: ctag, - i: (tagType == '/') ? seenTag - otag.length : i + ctag.length}); - buf = ''; - i += ctag.length - 1; - state = IN_TEXT; - if (tagType == '{') { - if (ctag == '}}') { - i++; - } else { - cleanTripleStache(tokens[tokens.length - 1]); - } - } - } else { - buf += text.charAt(i); - } - } - } - - filterLine(seenTag, true); - - return tokens; - } - - function cleanTripleStache(token) { - if (token.n.substr(token.n.length - 1) === '}') { - token.n = token.n.substring(0, token.n.length - 1); - } - } - - function trim(s) { - if (s.trim) { - return s.trim(); - } - - return s.replace(/^\s*|\s*$/g, ''); - } - - function tagChange(tag, text, index) { - if (text.charAt(index) != tag.charAt(0)) { - return false; - } - - for (var i = 1, l = tag.length; i < l; i++) { - if (text.charAt(index + i) != tag.charAt(i)) { - return false; - } - } - - return true; - } - - // the tags allowed inside super templates - var allowedInSuper = {'_t': true, '\n': true, '$': true, '/': true}; - - function buildTree(tokens, kind, stack, customTags) { - var instructions = [], - opener = null, - tail = null, - token = null; - - tail = stack[stack.length - 1]; - - while (tokens.length > 0) { - token = tokens.shift(); - - if (tail && tail.tag == '<' && !(token.tag in allowedInSuper)) { - throw new Error('Illegal content in < super tag.'); - } - - if (Hogan.tags[token.tag] <= Hogan.tags['$'] || isOpener(token, customTags)) { - stack.push(token); - token.nodes = buildTree(tokens, token.tag, stack, customTags); - } else if (token.tag == '/') { - if (stack.length === 0) { - throw new Error('Closing tag without opener: /' + token.n); - } - opener = stack.pop(); - if (token.n != opener.n && !isCloser(token.n, opener.n, customTags)) { - throw new Error('Nesting error: ' + opener.n + ' vs. ' + token.n); - } - opener.end = token.i; - return instructions; - } else if (token.tag == '\n') { - token.last = (tokens.length == 0) || (tokens[0].tag == '\n'); - } - - instructions.push(token); - } - - if (stack.length > 0) { - throw new Error('missing closing tag: ' + stack.pop().n); - } - - return instructions; - } - - function isOpener(token, tags) { - for (var i = 0, l = tags.length; i < l; i++) { - if (tags[i].o == token.n) { - token.tag = '#'; - return true; - } - } - } - - function isCloser(close, open, tags) { - for (var i = 0, l = tags.length; i < l; i++) { - if (tags[i].c == close && tags[i].o == open) { - return true; - } - } - } - - function stringifySubstitutions(obj) { - var items = []; - for (var key in obj) { - items.push('"' + esc(key) + '": function(c,p,t,i) {' + obj[key] + '}'); - } - return "{ " + items.join(",") + " }"; - } - - function stringifyPartials(codeObj) { - var partials = []; - for (var key in codeObj.partials) { - partials.push('"' + esc(key) + '":{name:"' + esc(codeObj.partials[key].name) + '", ' + stringifyPartials(codeObj.partials[key]) + "}"); - } - return "partials: {" + partials.join(",") + "}, subs: " + stringifySubstitutions(codeObj.subs); - } - - Hogan.stringify = function(codeObj, text, options) { - return "{code: function (c,p,i) { " + Hogan.wrapMain(codeObj.code) + " }," + stringifyPartials(codeObj) + "}"; - } - - var serialNo = 0; - Hogan.generate = function(tree, text, options) { - serialNo = 0; - var context = { code: '', subs: {}, partials: {} }; - Hogan.walk(tree, context); - - if (options.asString) { - return this.stringify(context, text, options); - } - - return this.makeTemplate(context, text, options); - } - - Hogan.wrapMain = function(code) { - return 'var t=this;t.b(i=i||"");' + code + 'return t.fl();'; - } - - Hogan.template = Hogan.Template; - - Hogan.makeTemplate = function(codeObj, text, options) { - var template = this.makePartials(codeObj); - template.code = new Function('c', 'p', 'i', this.wrapMain(codeObj.code)); - return new this.template(template, text, this, options); - } - - Hogan.makePartials = function(codeObj) { - var key, template = {subs: {}, partials: codeObj.partials, name: codeObj.name}; - for (key in template.partials) { - template.partials[key] = this.makePartials(template.partials[key]); - } - for (key in codeObj.subs) { - template.subs[key] = new Function('c', 'p', 't', 'i', codeObj.subs[key]); - } - return template; - } - - function esc(s) { - return s.replace(rSlash, '\\\\') - .replace(rQuot, '\\\"') - .replace(rNewline, '\\n') - .replace(rCr, '\\r') - .replace(rLineSep, '\\u2028') - .replace(rParagraphSep, '\\u2029'); - } - - function chooseMethod(s) { - return (~s.indexOf('.')) ? 'd' : 'f'; - } - - function createPartial(node, context) { - var prefix = "<" + (context.prefix || ""); - var sym = prefix + node.n + serialNo++; - context.partials[sym] = {name: node.n, partials: {}}; - context.code += 't.b(t.rp("' + esc(sym) + '",c,p,"' + (node.indent || '') + '"));'; - return sym; - } - - Hogan.codegen = { - '#': function(node, context) { - context.code += 'if(t.s(t.' + chooseMethod(node.n) + '("' + esc(node.n) + '",c,p,1),' + - 'c,p,0,' + node.i + ',' + node.end + ',"' + node.otag + " " + node.ctag + '")){' + - 't.rs(c,p,' + 'function(c,p,t){'; - Hogan.walk(node.nodes, context); - context.code += '});c.pop();}'; - }, - - '^': function(node, context) { - context.code += 'if(!t.s(t.' + chooseMethod(node.n) + '("' + esc(node.n) + '",c,p,1),c,p,1,0,0,"")){'; - Hogan.walk(node.nodes, context); - context.code += '};'; - }, - - '>': createPartial, - '<': function(node, context) { - var ctx = {partials: {}, code: '', subs: {}, inPartial: true}; - Hogan.walk(node.nodes, ctx); - var template = context.partials[createPartial(node, context)]; - template.subs = ctx.subs; - template.partials = ctx.partials; - }, - - '$': function(node, context) { - var ctx = {subs: {}, code: '', partials: context.partials, prefix: node.n}; - Hogan.walk(node.nodes, ctx); - context.subs[node.n] = ctx.code; - if (!context.inPartial) { - context.code += 't.sub("' + esc(node.n) + '",c,p,i);'; - } - }, - - '\n': function(node, context) { - context.code += write('"\\n"' + (node.last ? '' : ' + i')); - }, - - '_v': function(node, context) { - context.code += 't.b(t.v(t.' + chooseMethod(node.n) + '("' + esc(node.n) + '",c,p,0)));'; - }, - - '_t': function(node, context) { - context.code += write('"' + esc(node.text) + '"'); - }, - - '{': tripleStache, - - '&': tripleStache - } - - function tripleStache(node, context) { - context.code += 't.b(t.t(t.' + chooseMethod(node.n) + '("' + esc(node.n) + '",c,p,0)));'; - } - - function write(s) { - return 't.b(' + s + ');'; - } - - Hogan.walk = function(nodelist, context) { - var func; - for (var i = 0, l = nodelist.length; i < l; i++) { - func = Hogan.codegen[nodelist[i].tag]; - func && func(nodelist[i], context); - } - return context; - } - - Hogan.parse = function(tokens, text, options) { - options = options || {}; - return buildTree(tokens, '', [], options.sectionTags || []); - } - - Hogan.cache = {}; - - Hogan.cacheKey = function(text, options) { - return [text, !!options.asString, !!options.disableLambda, options.delimiters, !!options.modelGet].join('||'); - } - - Hogan.compile = function(text, options) { - options = options || {}; - var key = Hogan.cacheKey(text, options); - var template = this.cache[key]; - - if (template) { - var partials = template.partials; - for (var name in partials) { - delete partials[name].instance; - } - return template; - } - - template = this.generate(this.parse(this.scan(text, options.delimiters), text, options), text, options); - return this.cache[key] = template; - } -})(typeof exports !== 'undefined' ? exports : Hogan); - -},{}],4:[function(require,module,exports){ -/* - * Copyright 2011 Twitter, Inc. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -// This file is for use with Node.js. See dist/ for browser files. - -var Hogan = require('./compiler'); -Hogan.Template = require('./template').Template; -Hogan.template = Hogan.Template; -module.exports = Hogan; - -},{"./compiler":3,"./template":5}],5:[function(require,module,exports){ -/* - * Copyright 2011 Twitter, Inc. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -var Hogan = {}; - -(function (Hogan) { - Hogan.Template = function (codeObj, text, compiler, options) { - codeObj = codeObj || {}; - this.r = codeObj.code || this.r; - this.c = compiler; - this.options = options || {}; - this.text = text || ''; - this.partials = codeObj.partials || {}; - this.subs = codeObj.subs || {}; - this.buf = ''; - } - - Hogan.Template.prototype = { - // render: replaced by generated code. - r: function (context, partials, indent) { return ''; }, - - // variable escaping - v: hoganEscape, - - // triple stache - t: coerceToString, - - render: function render(context, partials, indent) { - return this.ri([context], partials || {}, indent); - }, - - // render internal -- a hook for overrides that catches partials too - ri: function (context, partials, indent) { - return this.r(context, partials, indent); - }, - - // ensurePartial - ep: function(symbol, partials) { - var partial = this.partials[symbol]; - - // check to see that if we've instantiated this partial before - var template = partials[partial.name]; - if (partial.instance && partial.base == template) { - return partial.instance; - } - - if (typeof template == 'string') { - if (!this.c) { - throw new Error("No compiler available."); - } - template = this.c.compile(template, this.options); - } - - if (!template) { - return null; - } - - // We use this to check whether the partials dictionary has changed - this.partials[symbol].base = template; - - if (partial.subs) { - // Make sure we consider parent template now - if (!partials.stackText) partials.stackText = {}; - for (key in partial.subs) { - if (!partials.stackText[key]) { - partials.stackText[key] = (this.activeSub !== undefined && partials.stackText[this.activeSub]) ? partials.stackText[this.activeSub] : this.text; - } - } - template = createSpecializedPartial(template, partial.subs, partial.partials, - this.stackSubs, this.stackPartials, partials.stackText); - } - this.partials[symbol].instance = template; - - return template; - }, - - // tries to find a partial in the current scope and render it - rp: function(symbol, context, partials, indent) { - var partial = this.ep(symbol, partials); - if (!partial) { - return ''; - } - - return partial.ri(context, partials, indent); - }, - - // render a section - rs: function(context, partials, section) { - var tail = context[context.length - 1]; - - if (!isArray(tail)) { - section(context, partials, this); - return; - } - - for (var i = 0; i < tail.length; i++) { - context.push(tail[i]); - section(context, partials, this); - context.pop(); - } - }, - - // maybe start a section - s: function(val, ctx, partials, inverted, start, end, tags) { - var pass; - - if (isArray(val) && val.length === 0) { - return false; - } - - if (typeof val == 'function') { - val = this.ms(val, ctx, partials, inverted, start, end, tags); - } - - pass = !!val; - - if (!inverted && pass && ctx) { - ctx.push((typeof val == 'object') ? val : ctx[ctx.length - 1]); - } - - return pass; - }, - - // find values with dotted names - d: function(key, ctx, partials, returnFound) { - var found, - names = key.split('.'), - val = this.f(names[0], ctx, partials, returnFound), - doModelGet = this.options.modelGet, - cx = null; - - if (key === '.' && isArray(ctx[ctx.length - 2])) { - val = ctx[ctx.length - 1]; - } else { - for (var i = 1; i < names.length; i++) { - found = findInScope(names[i], val, doModelGet); - if (found !== undefined) { - cx = val; - val = found; - } else { - val = ''; - } - } - } - - if (returnFound && !val) { - return false; - } - - if (!returnFound && typeof val == 'function') { - ctx.push(cx); - val = this.mv(val, ctx, partials); - ctx.pop(); - } - - return val; - }, - - // find values with normal names - f: function(key, ctx, partials, returnFound) { - var val = false, - v = null, - found = false, - doModelGet = this.options.modelGet; - - for (var i = ctx.length - 1; i >= 0; i--) { - v = ctx[i]; - val = findInScope(key, v, doModelGet); - if (val !== undefined) { - found = true; - break; - } - } - - if (!found) { - return (returnFound) ? false : ""; - } - - if (!returnFound && typeof val == 'function') { - val = this.mv(val, ctx, partials); - } - - return val; - }, - - // higher order templates - ls: function(func, cx, partials, text, tags) { - var oldTags = this.options.delimiters; - - this.options.delimiters = tags; - this.b(this.ct(coerceToString(func.call(cx, text)), cx, partials)); - this.options.delimiters = oldTags; - - return false; - }, - - // compile text - ct: function(text, cx, partials) { - if (this.options.disableLambda) { - throw new Error('Lambda features disabled.'); - } - return this.c.compile(text, this.options).render(cx, partials); - }, - - // template result buffering - b: function(s) { this.buf += s; }, - - fl: function() { var r = this.buf; this.buf = ''; return r; }, - - // method replace section - ms: function(func, ctx, partials, inverted, start, end, tags) { - var textSource, - cx = ctx[ctx.length - 1], - result = func.call(cx); - - if (typeof result == 'function') { - if (inverted) { - return true; - } else { - textSource = (this.activeSub && this.subsText && this.subsText[this.activeSub]) ? this.subsText[this.activeSub] : this.text; - return this.ls(result, cx, partials, textSource.substring(start, end), tags); - } - } - - return result; - }, - - // method replace variable - mv: function(func, ctx, partials) { - var cx = ctx[ctx.length - 1]; - var result = func.call(cx); - - if (typeof result == 'function') { - return this.ct(coerceToString(result.call(cx)), cx, partials); - } - - return result; - }, - - sub: function(name, context, partials, indent) { - var f = this.subs[name]; - if (f) { - this.activeSub = name; - f(context, partials, this, indent); - this.activeSub = false; - } - } - - }; - - //Find a key in an object - function findInScope(key, scope, doModelGet) { - var val; - - if (scope && typeof scope == 'object') { - - if (scope[key] !== undefined) { - val = scope[key]; - - // try lookup with get for backbone or similar model data - } else if (doModelGet && scope.get && typeof scope.get == 'function') { - val = scope.get(key); - } - } - - return val; - } - - function createSpecializedPartial(instance, subs, partials, stackSubs, stackPartials, stackText) { - function PartialTemplate() {}; - PartialTemplate.prototype = instance; - function Substitutions() {}; - Substitutions.prototype = instance.subs; - var key; - var partial = new PartialTemplate(); - partial.subs = new Substitutions(); - partial.subsText = {}; //hehe. substext. - partial.buf = ''; - - stackSubs = stackSubs || {}; - partial.stackSubs = stackSubs; - partial.subsText = stackText; - for (key in subs) { - if (!stackSubs[key]) stackSubs[key] = subs[key]; - } - for (key in stackSubs) { - partial.subs[key] = stackSubs[key]; - } - - stackPartials = stackPartials || {}; - partial.stackPartials = stackPartials; - for (key in partials) { - if (!stackPartials[key]) stackPartials[key] = partials[key]; - } - for (key in stackPartials) { - partial.partials[key] = stackPartials[key]; - } - - return partial; - } - - var rAmp = /&/g, - rLt = //g, - rApos = /\'/g, - rQuot = /\"/g, - hChars = /[&<>\"\']/; - - function coerceToString(val) { - return String((val === null || val === undefined) ? '' : val); - } - - function hoganEscape(str) { - str = coerceToString(str); - return hChars.test(str) ? - str - .replace(rAmp, '&') - .replace(rLt, '<') - .replace(rGt, '>') - .replace(rApos, ''') - .replace(rQuot, '"') : - str; - } - - var isArray = Array.isArray || function(a) { - return Object.prototype.toString.call(a) === '[object Array]'; - }; - -})(typeof exports !== 'undefined' ? exports : Hogan); - -},{}],6:[function(require,module,exports){ -/*! - * @name JavaScript/NodeJS Merge v1.2.1 - * @author yeikos - * @repository https://github.com/yeikos/js.merge - - * Copyright 2014 yeikos - MIT license - * https://raw.github.com/yeikos/js.merge/master/LICENSE - */ - -;(function(isNode) { - - /** - * Merge one or more objects - * @param bool? clone - * @param mixed,... arguments - * @return object - */ - - var Public = function(clone) { - - return merge(clone === true, false, arguments); - - }, publicName = 'merge'; - - /** - * Merge two or more objects recursively - * @param bool? clone - * @param mixed,... arguments - * @return object - */ - - Public.recursive = function(clone) { - - return merge(clone === true, true, arguments); - - }; - - /** - * Clone the input removing any reference - * @param mixed input - * @return mixed - */ - - Public.clone = function(input) { - - var output = input, - type = typeOf(input), - index, size; - - if (type === 'array') { - - output = []; - size = input.length; - - for (index=0;index 0 - var up = 0; - for (var i = parts.length - 1; i >= 0; i--) { - var last = parts[i]; - if (last === '.') { - parts.splice(i, 1); - } else if (last === '..') { - parts.splice(i, 1); - up++; - } else if (up) { - parts.splice(i, 1); - up--; - } - } - - // if the path is allowed to go above the root, restore leading ..s - if (allowAboveRoot) { - for (; up--; up) { - parts.unshift('..'); - } - } - - return parts; -} - -// path.resolve([from ...], to) -// posix version -exports.resolve = function() { - var resolvedPath = '', - resolvedAbsolute = false; - - for (var i = arguments.length - 1; i >= -1 && !resolvedAbsolute; i--) { - var path = (i >= 0) ? arguments[i] : process.cwd(); - - // Skip empty and invalid entries - if (typeof path !== 'string') { - throw new TypeError('Arguments to path.resolve must be strings'); - } else if (!path) { - continue; - } - - resolvedPath = path + '/' + resolvedPath; - resolvedAbsolute = path.charAt(0) === '/'; - } - - // At this point the path should be resolved to a full absolute path, but - // handle relative paths to be safe (might happen when process.cwd() fails) - - // Normalize the path - resolvedPath = normalizeArray(filter(resolvedPath.split('/'), function(p) { - return !!p; - }), !resolvedAbsolute).join('/'); - - return ((resolvedAbsolute ? '/' : '') + resolvedPath) || '.'; -}; - -// path.normalize(path) -// posix version -exports.normalize = function(path) { - var isAbsolute = exports.isAbsolute(path), - trailingSlash = substr(path, -1) === '/'; - - // Normalize the path - path = normalizeArray(filter(path.split('/'), function(p) { - return !!p; - }), !isAbsolute).join('/'); - - if (!path && !isAbsolute) { - path = '.'; - } - if (path && trailingSlash) { - path += '/'; - } - - return (isAbsolute ? '/' : '') + path; -}; - -// posix version -exports.isAbsolute = function(path) { - return path.charAt(0) === '/'; -}; - -// posix version -exports.join = function() { - var paths = Array.prototype.slice.call(arguments, 0); - return exports.normalize(filter(paths, function(p, index) { - if (typeof p !== 'string') { - throw new TypeError('Arguments to path.join must be strings'); - } - return p; - }).join('/')); -}; - - -// path.relative(from, to) -// posix version -exports.relative = function(from, to) { - from = exports.resolve(from).substr(1); - to = exports.resolve(to).substr(1); - - function trim(arr) { - var start = 0; - for (; start < arr.length; start++) { - if (arr[start] !== '') break; - } - - var end = arr.length - 1; - for (; end >= 0; end--) { - if (arr[end] !== '') break; - } - - if (start > end) return []; - return arr.slice(start, end - start + 1); - } - - var fromParts = trim(from.split('/')); - var toParts = trim(to.split('/')); - - var length = Math.min(fromParts.length, toParts.length); - var samePartsLength = length; - for (var i = 0; i < length; i++) { - if (fromParts[i] !== toParts[i]) { - samePartsLength = i; - break; - } - } - - var outputParts = []; - for (var i = samePartsLength; i < fromParts.length; i++) { - outputParts.push('..'); - } - - outputParts = outputParts.concat(toParts.slice(samePartsLength)); - - return outputParts.join('/'); -}; - -exports.sep = '/'; -exports.delimiter = ':'; - -exports.dirname = function (path) { - if (typeof path !== 'string') path = path + ''; - if (path.length === 0) return '.'; - var code = path.charCodeAt(0); - var hasRoot = code === 47 /*/*/; - var end = -1; - var matchedSlash = true; - for (var i = path.length - 1; i >= 1; --i) { - code = path.charCodeAt(i); - if (code === 47 /*/*/) { - if (!matchedSlash) { - end = i; - break; - } - } else { - // We saw the first non-path separator - matchedSlash = false; - } - } - - if (end === -1) return hasRoot ? '/' : '.'; - if (hasRoot && end === 1) { - // return '//'; - // Backwards-compat fix: - return '/'; - } - return path.slice(0, end); -}; - -function basename(path) { - if (typeof path !== 'string') path = path + ''; - - var start = 0; - var end = -1; - var matchedSlash = true; - var i; - - for (i = path.length - 1; i >= 0; --i) { - if (path.charCodeAt(i) === 47 /*/*/) { - // If we reached a path separator that was not part of a set of path - // separators at the end of the string, stop now - if (!matchedSlash) { - start = i + 1; - break; - } - } else if (end === -1) { - // We saw the first non-path separator, mark this as the end of our - // path component - matchedSlash = false; - end = i + 1; - } - } - - if (end === -1) return ''; - return path.slice(start, end); -} - -// Uses a mixed approach for backwards-compatibility, as ext behavior changed -// in new Node.js versions, so only basename() above is backported here -exports.basename = function (path, ext) { - var f = basename(path); - if (ext && f.substr(-1 * ext.length) === ext) { - f = f.substr(0, f.length - ext.length); - } - return f; -}; - -exports.extname = function (path) { - if (typeof path !== 'string') path = path + ''; - var startDot = -1; - var startPart = 0; - var end = -1; - var matchedSlash = true; - // Track the state of characters (if any) we see before our first dot and - // after any path separator we find - var preDotState = 0; - for (var i = path.length - 1; i >= 0; --i) { - var code = path.charCodeAt(i); - if (code === 47 /*/*/) { - // If we reached a path separator that was not part of a set of path - // separators at the end of the string, stop now - if (!matchedSlash) { - startPart = i + 1; - break; - } - continue; - } - if (end === -1) { - // We saw the first non-path separator, mark this as the end of our - // extension - matchedSlash = false; - end = i + 1; - } - if (code === 46 /*.*/) { - // If this is our first dot, mark it as the start of our extension - if (startDot === -1) - startDot = i; - else if (preDotState !== 1) - preDotState = 1; - } else if (startDot !== -1) { - // We saw a non-dot and non-path separator before our dot, so we should - // have a good chance at having a non-empty extension - preDotState = -1; - } - } - - if (startDot === -1 || end === -1 || - // We saw a non-dot character immediately before the dot - preDotState === 0 || - // The (right-most) trimmed path component is exactly '..' - preDotState === 1 && startDot === end - 1 && startDot === startPart + 1) { - return ''; - } - return path.slice(startDot, end); -}; - -function filter (xs, f) { - if (xs.filter) return xs.filter(f); - var res = []; - for (var i = 0; i < xs.length; i++) { - if (f(xs[i], i, xs)) res.push(xs[i]); - } - return res; -} - -// String.prototype.substr - negative index don't work in IE8 -var substr = 'ab'.substr(-1) === 'b' - ? function (str, start, len) { return str.substr(start, len) } - : function (str, start, len) { - if (start < 0) start = str.length + start; - return str.substr(start, len); - } -; - -}).call(this,require('_process')) -},{"_process":8}],8:[function(require,module,exports){ -// shim for using process in browser -var process = module.exports = {}; - -// cached from whatever global is present so that test runners that stub it -// don't break things. But we need to wrap it in a try catch in case it is -// wrapped in strict mode code which doesn't define any globals. It's inside a -// function because try/catches deoptimize in certain engines. - -var cachedSetTimeout; -var cachedClearTimeout; - -function defaultSetTimout() { - throw new Error('setTimeout has not been defined'); -} -function defaultClearTimeout () { - throw new Error('clearTimeout has not been defined'); -} -(function () { - try { - if (typeof setTimeout === 'function') { - cachedSetTimeout = setTimeout; - } else { - cachedSetTimeout = defaultSetTimout; - } - } catch (e) { - cachedSetTimeout = defaultSetTimout; - } - try { - if (typeof clearTimeout === 'function') { - cachedClearTimeout = clearTimeout; - } else { - cachedClearTimeout = defaultClearTimeout; - } - } catch (e) { - cachedClearTimeout = defaultClearTimeout; - } -} ()) -function runTimeout(fun) { - if (cachedSetTimeout === setTimeout) { - //normal enviroments in sane situations - return setTimeout(fun, 0); - } - // if setTimeout wasn't available but was latter defined - if ((cachedSetTimeout === defaultSetTimout || !cachedSetTimeout) && setTimeout) { - cachedSetTimeout = setTimeout; - return setTimeout(fun, 0); - } - try { - // when when somebody has screwed with setTimeout but no I.E. maddness - return cachedSetTimeout(fun, 0); - } catch(e){ - try { - // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally - return cachedSetTimeout.call(null, fun, 0); - } catch(e){ - // same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error - return cachedSetTimeout.call(this, fun, 0); - } - } - - -} -function runClearTimeout(marker) { - if (cachedClearTimeout === clearTimeout) { - //normal enviroments in sane situations - return clearTimeout(marker); - } - // if clearTimeout wasn't available but was latter defined - if ((cachedClearTimeout === defaultClearTimeout || !cachedClearTimeout) && clearTimeout) { - cachedClearTimeout = clearTimeout; - return clearTimeout(marker); - } - try { - // when when somebody has screwed with setTimeout but no I.E. maddness - return cachedClearTimeout(marker); - } catch (e){ - try { - // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally - return cachedClearTimeout.call(null, marker); - } catch (e){ - // same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error. - // Some versions of I.E. have different rules for clearTimeout vs setTimeout - return cachedClearTimeout.call(this, marker); - } - } - - - -} -var queue = []; -var draining = false; -var currentQueue; -var queueIndex = -1; - -function cleanUpNextTick() { - if (!draining || !currentQueue) { - return; - } - draining = false; - if (currentQueue.length) { - queue = currentQueue.concat(queue); - } else { - queueIndex = -1; - } - if (queue.length) { - drainQueue(); - } -} - -function drainQueue() { - if (draining) { - return; - } - var timeout = runTimeout(cleanUpNextTick); - draining = true; - - var len = queue.length; - while(len) { - currentQueue = queue; - queue = []; - while (++queueIndex < len) { - if (currentQueue) { - currentQueue[queueIndex].run(); - } - } - queueIndex = -1; - len = queue.length; - } - currentQueue = null; - draining = false; - runClearTimeout(timeout); -} - -process.nextTick = function (fun) { - var args = new Array(arguments.length - 1); - if (arguments.length > 1) { - for (var i = 1; i < arguments.length; i++) { - args[i - 1] = arguments[i]; - } - } - queue.push(new Item(fun, args)); - if (queue.length === 1 && !draining) { - runTimeout(drainQueue); - } -}; - -// v8 likes predictible objects -function Item(fun, array) { - this.fun = fun; - this.array = array; -} -Item.prototype.run = function () { - this.fun.apply(null, this.array); -}; -process.title = 'browser'; -process.browser = true; -process.env = {}; -process.argv = []; -process.version = ''; // empty string to avoid regexp issues -process.versions = {}; - -function noop() {} - -process.on = noop; -process.addListener = noop; -process.once = noop; -process.off = noop; -process.removeListener = noop; -process.removeAllListeners = noop; -process.emit = noop; -process.prependListener = noop; -process.prependOnceListener = noop; - -process.listeners = function (name) { return [] } - -process.binding = function (name) { - throw new Error('process.binding is not supported'); -}; - -process.cwd = function () { return '/' }; -process.chdir = function (dir) { - throw new Error('process.chdir is not supported'); -}; -process.umask = function() { return 0; }; - -},{}],9:[function(require,module,exports){ -/* - * - * Diff Parser (diff-parser.js) - * Author: rtfpessoa - * - */ - -(function() { - var utils = require('./utils.js').Utils; - - var LINE_TYPE = { - INSERTS: 'd2h-ins', - DELETES: 'd2h-del', - INSERT_CHANGES: 'd2h-ins d2h-change', - DELETE_CHANGES: 'd2h-del d2h-change', - CONTEXT: 'd2h-cntx', - INFO: 'd2h-info' - }; - - function DiffParser() { - } - - DiffParser.prototype.LINE_TYPE = LINE_TYPE; - - DiffParser.prototype.generateDiffJson = function(diffInput, configuration) { - var config = configuration || {}; - - var files = []; - var currentFile = null; - var currentBlock = null; - var oldLine = null; - var oldLine2 = null; // Used for combined diff - var newLine = null; - - var possibleOldName; - var possibleNewName; - - /* Diff Header */ - var oldFileNameHeader = '--- '; - var newFileNameHeader = '+++ '; - var hunkHeaderPrefix = '@@'; - - /* Add previous block(if exists) before start a new file */ - function saveBlock() { - if (currentBlock) { - currentFile.blocks.push(currentBlock); - currentBlock = null; - } - } - - /* - * Add previous file(if exists) before start a new one - * if it has name (to avoid binary files errors) - */ - function saveFile() { - if (currentFile) { - if (!currentFile.oldName) { - currentFile.oldName = possibleOldName; - } - - if (!currentFile.newName) { - currentFile.newName = possibleNewName; - } - - if (currentFile.newName) { - files.push(currentFile); - currentFile = null; - } - } - - possibleOldName = undefined; - possibleNewName = undefined; - } - - /* Create file structure */ - function startFile() { - saveBlock(); - saveFile(); - - currentFile = {}; - currentFile.blocks = []; - currentFile.deletedLines = 0; - currentFile.addedLines = 0; - } - - function startBlock(line) { - saveBlock(); - - var values; - - /** - * From Range: - * -[,] - * - * To Range: - * +[,] - * - * @@ from-file-range to-file-range @@ - * - * @@@ from-file-range from-file-range to-file-range @@@ - * - * number of lines is optional, if omited consider 0 - */ - - if ((values = /^@@ -(\d+)(?:,\d+)? \+(\d+)(?:,\d+)? @@.*/.exec(line))) { - currentFile.isCombined = false; - oldLine = values[1]; - newLine = values[2]; - } else if ((values = /^@@@ -(\d+)(?:,\d+)? -(\d+)(?:,\d+)? \+(\d+)(?:,\d+)? @@@.*/.exec(line))) { - currentFile.isCombined = true; - oldLine = values[1]; - oldLine2 = values[2]; - newLine = values[3]; - } else { - if (utils.startsWith(line, hunkHeaderPrefix)) { - console.error('Failed to parse lines, starting in 0!'); - } - - oldLine = 0; - newLine = 0; - currentFile.isCombined = false; - } - - /* Create block metadata */ - currentBlock = {}; - currentBlock.lines = []; - currentBlock.oldStartLine = oldLine; - currentBlock.oldStartLine2 = oldLine2; - currentBlock.newStartLine = newLine; - currentBlock.header = line; - } - - function createLine(line) { - var currentLine = {}; - currentLine.content = line; - - var newLinePrefixes = !currentFile.isCombined ? ['+'] : ['+', ' +']; - var delLinePrefixes = !currentFile.isCombined ? ['-'] : ['-', ' -']; - - /* Fill the line data */ - if (utils.startsWith(line, newLinePrefixes)) { - currentFile.addedLines++; - - currentLine.type = LINE_TYPE.INSERTS; - currentLine.oldNumber = null; - currentLine.newNumber = newLine++; - - currentBlock.lines.push(currentLine); - } else if (utils.startsWith(line, delLinePrefixes)) { - currentFile.deletedLines++; - - currentLine.type = LINE_TYPE.DELETES; - currentLine.oldNumber = oldLine++; - currentLine.newNumber = null; - - currentBlock.lines.push(currentLine); - } else { - currentLine.type = LINE_TYPE.CONTEXT; - currentLine.oldNumber = oldLine++; - currentLine.newNumber = newLine++; - - currentBlock.lines.push(currentLine); - } - } - - /* - * Checks if there is a hunk header coming before a new file starts - * - * Hunk header is a group of three lines started by ( `--- ` , `+++ ` , `@@` ) - */ - function existHunkHeader(line, lineIdx) { - var idx = lineIdx; - - while (idx < diffLines.length - 3) { - if (utils.startsWith(line, 'diff')) { - return false; - } - - if ( - utils.startsWith(diffLines[idx], oldFileNameHeader) && - utils.startsWith(diffLines[idx + 1], newFileNameHeader) && - utils.startsWith(diffLines[idx + 2], hunkHeaderPrefix) - ) { - return true; - } - - idx++; - } - - return false; - } - - var diffLines = - diffInput.replace(/\\ No newline at end of file/g, '') - .replace(/\r\n?/g, '\n') - .split('\n'); - - /* Diff */ - var oldMode = /^old mode (\d{6})/; - var newMode = /^new mode (\d{6})/; - var deletedFileMode = /^deleted file mode (\d{6})/; - var newFileMode = /^new file mode (\d{6})/; - - var copyFrom = /^copy from "?(.+)"?/; - var copyTo = /^copy to "?(.+)"?/; - - var renameFrom = /^rename from "?(.+)"?/; - var renameTo = /^rename to "?(.+)"?/; - - var similarityIndex = /^similarity index (\d+)%/; - var dissimilarityIndex = /^dissimilarity index (\d+)%/; - var index = /^index ([0-9a-z]+)\.\.([0-9a-z]+)\s*(\d{6})?/; - - var binaryFiles = /^Binary files (.*) and (.*) differ/; - var binaryDiff = /^GIT binary patch/; - - /* Combined Diff */ - var combinedIndex = /^index ([0-9a-z]+),([0-9a-z]+)\.\.([0-9a-z]+)/; - var combinedMode = /^mode (\d{6}),(\d{6})\.\.(\d{6})/; - var combinedNewFile = /^new file mode (\d{6})/; - var combinedDeletedFile = /^deleted file mode (\d{6}),(\d{6})/; - - diffLines.forEach(function(line, lineIndex) { - // Unmerged paths, and possibly other non-diffable files - // https://github.com/scottgonzalez/pretty-diff/issues/11 - // Also, remove some useless lines - if (!line || utils.startsWith(line, '*')) { - return; - } - - // Used to store regex capture groups - var values; - - var prevLine = diffLines[lineIndex - 1]; - var nxtLine = diffLines[lineIndex + 1]; - var afterNxtLine = diffLines[lineIndex + 2]; - - if (utils.startsWith(line, 'diff')) { - startFile(); - - // diff --git a/blocked_delta_results.png b/blocked_delta_results.png - var gitDiffStart = /^diff --git "?(.+)"? "?(.+)"?/; - if ((values = gitDiffStart.exec(line))) { - possibleOldName = _getFilename(null, values[1], config.dstPrefix); - possibleNewName = _getFilename(null, values[2], config.srcPrefix); - } - - currentFile.isGitDiff = true; - return; - } - - if (!currentFile || // If we do not have a file yet, we should crete one - ( - !currentFile.isGitDiff && currentFile && // If we already have some file in progress and - ( - utils.startsWith(line, oldFileNameHeader) && // If we get to an old file path header line - // And is followed by the new file path header line and the hunk header line - utils.startsWith(nxtLine, newFileNameHeader) && utils.startsWith(afterNxtLine, hunkHeaderPrefix) - ) - ) - ) { - startFile(); - } - - /* - * We need to make sure that we have the three lines of the header. - * This avoids cases like the ones described in: - * - https://github.com/rtfpessoa/diff2html/issues/87 - */ - if ( - (utils.startsWith(line, oldFileNameHeader) && - utils.startsWith(nxtLine, newFileNameHeader)) || - - (utils.startsWith(line, newFileNameHeader) && - utils.startsWith(prevLine, oldFileNameHeader)) - ) { - /* - * --- Date Timestamp[FractionalSeconds] TimeZone - * --- 2002-02-21 23:30:39.942229878 -0800 - */ - if (currentFile && !currentFile.oldName && - utils.startsWith(line, '--- ') && (values = getSrcFilename(line, config))) { - currentFile.oldName = values; - currentFile.language = getExtension(currentFile.oldName, currentFile.language); - return; - } - - /* - * +++ Date Timestamp[FractionalSeconds] TimeZone - * +++ 2002-02-21 23:30:39.942229878 -0800 - */ - if (currentFile && !currentFile.newName && - utils.startsWith(line, '+++ ') && (values = getDstFilename(line, config))) { - currentFile.newName = values; - currentFile.language = getExtension(currentFile.newName, currentFile.language); - return; - } - } - - if ( - (currentFile && utils.startsWith(line, hunkHeaderPrefix)) || - (currentFile.isGitDiff && currentFile && currentFile.oldName && currentFile.newName && !currentBlock) - ) { - startBlock(line); - return; - } - - /* - * There are three types of diff lines. These lines are defined by the way they start. - * 1. New line starts with: + - * 2. Old line starts with: - - * 3. Context line starts with: - */ - if (currentBlock && (utils.startsWith(line, '+') || utils.startsWith(line, '-') || utils.startsWith(line, ' '))) { - createLine(line); - return; - } - - var doesNotExistHunkHeader = !existHunkHeader(line, lineIndex); - - /* - * Git diffs provide more information regarding files modes, renames, copies, - * commits between changes and similarity indexes - */ - if ((values = oldMode.exec(line))) { - currentFile.oldMode = values[1]; - } else if ((values = newMode.exec(line))) { - currentFile.newMode = values[1]; - } else if ((values = deletedFileMode.exec(line))) { - currentFile.deletedFileMode = values[1]; - currentFile.isDeleted = true; - } else if ((values = newFileMode.exec(line))) { - currentFile.newFileMode = values[1]; - currentFile.isNew = true; - } else if ((values = copyFrom.exec(line))) { - if (doesNotExistHunkHeader) { - currentFile.oldName = values[1]; - } - currentFile.isCopy = true; - } else if ((values = copyTo.exec(line))) { - if (doesNotExistHunkHeader) { - currentFile.newName = values[1]; - } - currentFile.isCopy = true; - } else if ((values = renameFrom.exec(line))) { - if (doesNotExistHunkHeader) { - currentFile.oldName = values[1]; - } - currentFile.isRename = true; - } else if ((values = renameTo.exec(line))) { - if (doesNotExistHunkHeader) { - currentFile.newName = values[1]; - } - currentFile.isRename = true; - } else if ((values = binaryFiles.exec(line))) { - currentFile.isBinary = true; - currentFile.oldName = _getFilename(null, values[1], config.srcPrefix); - currentFile.newName = _getFilename(null, values[2], config.dstPrefix); - startBlock('Binary file'); - } else if ((values = binaryDiff.exec(line))) { - currentFile.isBinary = true; - startBlock(line); - } else if ((values = similarityIndex.exec(line))) { - currentFile.unchangedPercentage = values[1]; - } else if ((values = dissimilarityIndex.exec(line))) { - currentFile.changedPercentage = values[1]; - } else if ((values = index.exec(line))) { - currentFile.checksumBefore = values[1]; - currentFile.checksumAfter = values[2]; - values[3] && (currentFile.mode = values[3]); - } else if ((values = combinedIndex.exec(line))) { - currentFile.checksumBefore = [values[2], values[3]]; - currentFile.checksumAfter = values[1]; - } else if ((values = combinedMode.exec(line))) { - currentFile.oldMode = [values[2], values[3]]; - currentFile.newMode = values[1]; - } else if ((values = combinedNewFile.exec(line))) { - currentFile.newFileMode = values[1]; - currentFile.isNew = true; - } else if ((values = combinedDeletedFile.exec(line))) { - currentFile.deletedFileMode = values[1]; - currentFile.isDeleted = true; - } - }); - - saveBlock(); - saveFile(); - - return files; - }; - - function getExtension(filename, language) { - var nameSplit = filename.split('.'); - if (nameSplit.length > 1) { - return nameSplit[nameSplit.length - 1]; - } - - return language; - } - - function getSrcFilename(line, cfg) { - return _getFilename('---', line, cfg.srcPrefix); - } - - function getDstFilename(line, cfg) { - return _getFilename('\\+\\+\\+', line, cfg.dstPrefix); - } - - function _getFilename(linePrefix, line, extraPrefix) { - var prefixes = ['a/', 'b/', 'i/', 'w/', 'c/', 'o/']; - if (extraPrefix) { - prefixes.push(extraPrefix); - } - - var FilenameRegExp; - if (linePrefix) { - FilenameRegExp = new RegExp('^' + linePrefix + ' "?(.+?)"?$'); - } else { - FilenameRegExp = new RegExp('^"?(.+?)"?$'); - } - - var filename; - var values = FilenameRegExp.exec(line); - if (values && values[1]) { - filename = values[1]; - var matchingPrefixes = prefixes.filter(function(p) { - return filename.indexOf(p) === 0; - }); - - if (matchingPrefixes[0]) { - // Remove prefix if exists - filename = filename.slice(matchingPrefixes[0].length); - } - - // Cleanup timestamps generated by the unified diff (diff command) as specified in - // https://www.gnu.org/software/diffutils/manual/html_node/Detailed-Unified.html - // Ie: 2016-10-25 11:37:14.000000000 +0200 - filename = filename.replace(/\s+\d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2}(?:\.\d+)? [-+]\d{4}.*$/, ''); - } - - return filename; - } - - module.exports.DiffParser = new DiffParser(); -})(); - -},{"./utils.js":19}],10:[function(require,module,exports){ -(function (global){ -/* - * - * Diff to HTML (diff2html.js) - * Author: rtfpessoa - * - */ - -(function() { - var diffParser = require('./diff-parser.js').DiffParser; - var htmlPrinter = require('./html-printer.js').HtmlPrinter; - var utils = require('./utils.js').Utils; - - function Diff2Html() { - } - - var defaultConfig = { - inputFormat: 'diff', - outputFormat: 'line-by-line', - showFiles: false, - diffStyle: 'word', - matching: 'none', - matchWordsThreshold: 0.25, - matchingMaxComparisons: 2500, - maxLineSizeInBlockForComparison: 200, - maxLineLengthHighlight: 10000, - templates: {}, - rawTemplates: {}, - renderNothingWhenEmpty: false - }; - - /* - * Generates json object from string diff input - */ - Diff2Html.prototype.getJsonFromDiff = function(diffInput, config) { - var cfg = utils.safeConfig(config, defaultConfig); - return diffParser.generateDiffJson(diffInput, cfg); - }; - - /* - * Generates the html diff. The config parameter configures the output/input formats and other options - */ - Diff2Html.prototype.getPrettyHtml = function(diffInput, config) { - var cfg = utils.safeConfig(config, defaultConfig); - - var diffJson = diffInput; - if (!cfg.inputFormat || cfg.inputFormat === 'diff') { - diffJson = diffParser.generateDiffJson(diffInput, cfg); - } - - var fileList = ''; - if (cfg.showFiles === true) { - fileList = htmlPrinter.generateFileListSummary(diffJson, cfg); - } - - var diffOutput = ''; - if (cfg.outputFormat === 'side-by-side') { - diffOutput = htmlPrinter.generateSideBySideJsonHtml(diffJson, cfg); - } else { - diffOutput = htmlPrinter.generateLineByLineJsonHtml(diffJson, cfg); - } - - return fileList + diffOutput; - }; - - /* - * Deprecated methods - The following methods exist only to maintain compatibility with previous versions - */ - - /* - * Generates pretty html from string diff input - */ - Diff2Html.prototype.getPrettyHtmlFromDiff = function(diffInput, config) { - var cfg = utils.safeConfig(config, defaultConfig); - cfg.inputFormat = 'diff'; - cfg.outputFormat = 'line-by-line'; - return this.getPrettyHtml(diffInput, cfg); - }; - - /* - * Generates pretty html from a json object - */ - Diff2Html.prototype.getPrettyHtmlFromJson = function(diffJson, config) { - var cfg = utils.safeConfig(config, defaultConfig); - cfg.inputFormat = 'json'; - cfg.outputFormat = 'line-by-line'; - return this.getPrettyHtml(diffJson, cfg); - }; - - /* - * Generates pretty side by side html from string diff input - */ - Diff2Html.prototype.getPrettySideBySideHtmlFromDiff = function(diffInput, config) { - var cfg = utils.safeConfig(config, defaultConfig); - cfg.inputFormat = 'diff'; - cfg.outputFormat = 'side-by-side'; - return this.getPrettyHtml(diffInput, cfg); - }; - - /* - * Generates pretty side by side html from a json object - */ - Diff2Html.prototype.getPrettySideBySideHtmlFromJson = function(diffJson, config) { - var cfg = utils.safeConfig(config, defaultConfig); - cfg.inputFormat = 'json'; - cfg.outputFormat = 'side-by-side'; - return this.getPrettyHtml(diffJson, cfg); - }; - - var diffObject = new Diff2Html(); - module.exports.Diff2Html = diffObject; - - // Expose diff2html in the browser - global.Diff2Html = diffObject; -})(); - -}).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {}) -},{"./diff-parser.js":9,"./html-printer.js":13,"./utils.js":19}],11:[function(require,module,exports){ -/* - * - * FileListPrinter (file-list-printer.js) - * Author: nmatpt - * - */ - -(function() { - var printerUtils = require('./printer-utils.js').PrinterUtils; - - var hoganUtils; - - var baseTemplatesPath = 'file-summary'; - var iconsBaseTemplatesPath = 'icon'; - - function FileListPrinter(config) { - this.config = config; - - var HoganJsUtils = require('./hoganjs-utils.js').HoganJsUtils; - hoganUtils = new HoganJsUtils(config); - } - - FileListPrinter.prototype.generateFileList = function(diffFiles) { - var lineTemplate = hoganUtils.template(baseTemplatesPath, 'line'); - - var files = diffFiles.map(function(file) { - var fileTypeName = printerUtils.getFileTypeIcon(file); - var iconTemplate = hoganUtils.template(iconsBaseTemplatesPath, fileTypeName); - - return lineTemplate.render({ - fileHtmlId: printerUtils.getHtmlId(file), - oldName: file.oldName, - newName: file.newName, - fileName: printerUtils.getDiffName(file), - deletedLines: '-' + file.deletedLines, - addedLines: '+' + file.addedLines - }, { - fileIcon: iconTemplate - }); - }).join('\n'); - - return hoganUtils.render(baseTemplatesPath, 'wrapper', { - filesNumber: diffFiles.length, - files: files - }); - }; - - module.exports.FileListPrinter = FileListPrinter; -})(); - -},{"./hoganjs-utils.js":12,"./printer-utils.js":15}],12:[function(require,module,exports){ -(function (__dirname){ -/* - * - * Utils (hoganjs-utils.js) - * Author: rtfpessoa - * - */ - -(function() { - var fs = require('fs'); - var path = require('path'); - var hogan = require('hogan.js'); - - var hoganTemplates = require('./templates/diff2html-templates.js'); - - var extraTemplates; - - function HoganJsUtils(configuration) { - this.config = configuration || {}; - extraTemplates = this.config.templates || {}; - - var rawTemplates = this.config.rawTemplates || {}; - for (var templateName in rawTemplates) { - if (rawTemplates.hasOwnProperty(templateName)) { - if (!extraTemplates[templateName]) extraTemplates[templateName] = this.compile(rawTemplates[templateName]); - } - } - } - - HoganJsUtils.prototype.render = function(namespace, view, params) { - var template = this.template(namespace, view); - if (template) { - return template.render(params); - } - - return null; - }; - - HoganJsUtils.prototype.template = function(namespace, view) { - var templateKey = this._templateKey(namespace, view); - - return this._getTemplate(templateKey); - }; - - HoganJsUtils.prototype._getTemplate = function(templateKey) { - var template; - - if (!this.config.noCache) { - template = this._readFromCache(templateKey); - } - - if (!template) { - template = this._loadTemplate(templateKey); - } - - return template; - }; - - HoganJsUtils.prototype._loadTemplate = function(templateKey) { - var template; - - try { - if (fs.readFileSync) { - var templatesPath = path.resolve(__dirname, 'templates'); - var templatePath = path.join(templatesPath, templateKey); - var templateContent = fs.readFileSync(templatePath + '.mustache', 'utf8'); - template = hogan.compile(templateContent); - hoganTemplates[templateKey] = template; - } - } catch (e) { - console.error('Failed to read (template: ' + templateKey + ') from fs: ' + e.message); - } - - return template; - }; - - HoganJsUtils.prototype._readFromCache = function(templateKey) { - return extraTemplates[templateKey] || hoganTemplates[templateKey]; - }; - - HoganJsUtils.prototype._templateKey = function(namespace, view) { - return namespace + '-' + view; - }; - - HoganJsUtils.prototype.compile = function(templateStr) { - return hogan.compile(templateStr); - }; - - module.exports.HoganJsUtils = HoganJsUtils; -})(); - -}).call(this,"/src") -},{"./templates/diff2html-templates.js":18,"fs":1,"hogan.js":4,"path":7}],13:[function(require,module,exports){ -/* - * - * HtmlPrinter (html-printer.js) - * Author: rtfpessoa - * - */ - -(function() { - var LineByLinePrinter = require('./line-by-line-printer.js').LineByLinePrinter; - var SideBySidePrinter = require('./side-by-side-printer.js').SideBySidePrinter; - var FileListPrinter = require('./file-list-printer.js').FileListPrinter; - - function HtmlPrinter() { - } - - HtmlPrinter.prototype.generateLineByLineJsonHtml = function(diffFiles, config) { - var lineByLinePrinter = new LineByLinePrinter(config); - return lineByLinePrinter.generateLineByLineJsonHtml(diffFiles); - }; - - HtmlPrinter.prototype.generateSideBySideJsonHtml = function(diffFiles, config) { - var sideBySidePrinter = new SideBySidePrinter(config); - return sideBySidePrinter.generateSideBySideJsonHtml(diffFiles); - }; - - HtmlPrinter.prototype.generateFileListSummary = function(diffJson, config) { - var fileListPrinter = new FileListPrinter(config); - return fileListPrinter.generateFileList(diffJson); - }; - - module.exports.HtmlPrinter = new HtmlPrinter(); -})(); - -},{"./file-list-printer.js":11,"./line-by-line-printer.js":14,"./side-by-side-printer.js":17}],14:[function(require,module,exports){ -/* - * - * LineByLinePrinter (line-by-line-printer.js) - * Author: rtfpessoa - * - */ - -(function() { - var diffParser = require('./diff-parser.js').DiffParser; - var printerUtils = require('./printer-utils.js').PrinterUtils; - var utils = require('./utils.js').Utils; - var Rematch = require('./rematch.js').Rematch; - - var hoganUtils; - - var genericTemplatesPath = 'generic'; - var baseTemplatesPath = 'line-by-line'; - var iconsBaseTemplatesPath = 'icon'; - var tagsBaseTemplatesPath = 'tag'; - - function LineByLinePrinter(config) { - this.config = config; - - var HoganJsUtils = require('./hoganjs-utils.js').HoganJsUtils; - hoganUtils = new HoganJsUtils(config); - } - - LineByLinePrinter.prototype.makeFileDiffHtml = function(file, diffs) { - if (this.config.renderNothingWhenEmpty && file.blocks && !file.blocks.length) return ''; - - var fileDiffTemplate = hoganUtils.template(baseTemplatesPath, 'file-diff'); - var filePathTemplate = hoganUtils.template(genericTemplatesPath, 'file-path'); - var fileIconTemplate = hoganUtils.template(iconsBaseTemplatesPath, 'file'); - var fileTagTemplate = hoganUtils.template(tagsBaseTemplatesPath, printerUtils.getFileTypeIcon(file)); - - return fileDiffTemplate.render({ - file: file, - fileHtmlId: printerUtils.getHtmlId(file), - diffs: diffs, - filePath: filePathTemplate.render({ - fileDiffName: printerUtils.getDiffName(file) - }, { - fileIcon: fileIconTemplate, - fileTag: fileTagTemplate - }) - }); - }; - - LineByLinePrinter.prototype.makeLineByLineHtmlWrapper = function(content) { - return hoganUtils.render(genericTemplatesPath, 'wrapper', {'content': content}); - }; - - LineByLinePrinter.prototype.generateLineByLineJsonHtml = function(diffFiles) { - var that = this; - var htmlDiffs = diffFiles.map(function(file) { - var diffs; - if (file.blocks.length) { - diffs = that._generateFileHtml(file); - } else { - diffs = that._generateEmptyDiff(); - } - return that.makeFileDiffHtml(file, diffs); - }); - - return this.makeLineByLineHtmlWrapper(htmlDiffs.join('\n')); - }; - - var matcher = Rematch.rematch(function(a, b) { - var amod = a.content.substr(1); - var bmod = b.content.substr(1); - - return Rematch.distance(amod, bmod); - }); - - LineByLinePrinter.prototype.makeColumnLineNumberHtml = function(block) { - return hoganUtils.render(genericTemplatesPath, 'column-line-number', { - diffParser: diffParser, - blockHeader: utils.escape(block.header), - lineClass: 'd2h-code-linenumber', - contentClass: 'd2h-code-line' - }); - }; - - LineByLinePrinter.prototype._generateFileHtml = function(file) { - var that = this; - return file.blocks.map(function(block) { - var lines = that.makeColumnLineNumberHtml(block); - var oldLines = []; - var newLines = []; - - function processChangeBlock() { - var matches; - var insertType; - var deleteType; - - var comparisons = oldLines.length * newLines.length; - - var maxLineSizeInBlock = Math.max.apply(null, - [0].concat((oldLines.concat(newLines)).map( - function(elem) { - return elem.content.length; - } - ))); - - var doMatching = comparisons < that.config.matchingMaxComparisons && - maxLineSizeInBlock < that.config.maxLineSizeInBlockForComparison && - (that.config.matching === 'lines' || that.config.matching === 'words'); - - if (doMatching) { - matches = matcher(oldLines, newLines); - insertType = diffParser.LINE_TYPE.INSERT_CHANGES; - deleteType = diffParser.LINE_TYPE.DELETE_CHANGES; - } else { - matches = [[oldLines, newLines]]; - insertType = diffParser.LINE_TYPE.INSERTS; - deleteType = diffParser.LINE_TYPE.DELETES; - } - - matches.forEach(function(match) { - oldLines = match[0]; - newLines = match[1]; - - var processedOldLines = []; - var processedNewLines = []; - - var common = Math.min(oldLines.length, newLines.length); - - var oldLine, newLine; - for (var j = 0; j < common; j++) { - oldLine = oldLines[j]; - newLine = newLines[j]; - - that.config.isCombined = file.isCombined; - var diff = printerUtils.diffHighlight(oldLine.content, newLine.content, that.config); - - processedOldLines += - that.makeLineHtml(file.isCombined, deleteType, oldLine.oldNumber, oldLine.newNumber, - diff.first.line, diff.first.prefix); - processedNewLines += - that.makeLineHtml(file.isCombined, insertType, newLine.oldNumber, newLine.newNumber, - diff.second.line, diff.second.prefix); - } - - lines += processedOldLines + processedNewLines; - lines += that._processLines(file.isCombined, oldLines.slice(common), newLines.slice(common)); - }); - - oldLines = []; - newLines = []; - } - - for (var i = 0; i < block.lines.length; i++) { - var line = block.lines[i]; - var escapedLine = utils.escape(line.content); - - if (line.type !== diffParser.LINE_TYPE.INSERTS && - (newLines.length > 0 || (line.type !== diffParser.LINE_TYPE.DELETES && oldLines.length > 0))) { - processChangeBlock(); - } - - if (line.type === diffParser.LINE_TYPE.CONTEXT) { - lines += that.makeLineHtml(file.isCombined, line.type, line.oldNumber, line.newNumber, escapedLine); - } else if (line.type === diffParser.LINE_TYPE.INSERTS && !oldLines.length) { - lines += that.makeLineHtml(file.isCombined, line.type, line.oldNumber, line.newNumber, escapedLine); - } else if (line.type === diffParser.LINE_TYPE.DELETES) { - oldLines.push(line); - } else if (line.type === diffParser.LINE_TYPE.INSERTS && Boolean(oldLines.length)) { - newLines.push(line); - } else { - console.error('Unknown state in html line-by-line generator'); - processChangeBlock(); - } - } - - processChangeBlock(); - - return lines; - }).join('\n'); - }; - - LineByLinePrinter.prototype._processLines = function(isCombined, oldLines, newLines) { - var lines = ''; - - for (var i = 0; i < oldLines.length; i++) { - var oldLine = oldLines[i]; - var oldEscapedLine = utils.escape(oldLine.content); - lines += this.makeLineHtml(isCombined, oldLine.type, oldLine.oldNumber, oldLine.newNumber, oldEscapedLine); - } - - for (var j = 0; j < newLines.length; j++) { - var newLine = newLines[j]; - var newEscapedLine = utils.escape(newLine.content); - lines += this.makeLineHtml(isCombined, newLine.type, newLine.oldNumber, newLine.newNumber, newEscapedLine); - } - - return lines; - }; - - LineByLinePrinter.prototype.makeLineHtml = function(isCombined, type, oldNumber, newNumber, content, possiblePrefix) { - var lineNumberTemplate = hoganUtils.render(baseTemplatesPath, 'numbers', { - oldNumber: utils.valueOrEmpty(oldNumber), - newNumber: utils.valueOrEmpty(newNumber) - }); - - var lineWithoutPrefix = content; - var prefix = possiblePrefix; - - if (!prefix) { - var lineWithPrefix = printerUtils.separatePrefix(isCombined, content); - prefix = lineWithPrefix.prefix; - lineWithoutPrefix = lineWithPrefix.line; - } - - if (prefix === ' ') { - prefix = ' '; - } - - return hoganUtils.render(genericTemplatesPath, 'line', - { - type: type, - lineClass: 'd2h-code-linenumber', - contentClass: 'd2h-code-line', - prefix: prefix, - content: lineWithoutPrefix, - lineNumber: lineNumberTemplate - }); - }; - - LineByLinePrinter.prototype._generateEmptyDiff = function() { - return hoganUtils.render(genericTemplatesPath, 'empty-diff', { - contentClass: 'd2h-code-line', - diffParser: diffParser - }); - }; - - module.exports.LineByLinePrinter = LineByLinePrinter; -})(); - -},{"./diff-parser.js":9,"./hoganjs-utils.js":12,"./printer-utils.js":15,"./rematch.js":16,"./utils.js":19}],15:[function(require,module,exports){ -/* - * - * PrinterUtils (printer-utils.js) - * Author: rtfpessoa - * - */ - -(function() { - var jsDiff = require('diff'); - var utils = require('./utils.js').Utils; - var Rematch = require('./rematch.js').Rematch; - - var separator = '/'; - - function PrinterUtils() { - } - - PrinterUtils.prototype.separatePrefix = function(isCombined, line) { - var prefix; - var lineWithoutPrefix; - - if (isCombined) { - prefix = line.substring(0, 2); - lineWithoutPrefix = line.substring(2); - } else { - prefix = line.substring(0, 1); - lineWithoutPrefix = line.substring(1); - } - - return { - 'prefix': prefix, - 'line': lineWithoutPrefix - }; - }; - - PrinterUtils.prototype.getHtmlId = function(file) { - var hashCode = function(text) { - var i, chr, len; - var hash = 0; - - for (i = 0, len = text.length; i < len; i++) { - chr = text.charCodeAt(i); - hash = ((hash << 5) - hash) + chr; - hash |= 0; // Convert to 32bit integer - } - - return hash; - }; - - return 'd2h-' + hashCode(this.getDiffName(file)).toString().slice(-6); - }; - - PrinterUtils.prototype.getDiffName = function(file) { - var oldFilename = unifyPath(file.oldName); - var newFilename = unifyPath(file.newName); - - if (oldFilename && newFilename && oldFilename !== newFilename && !isDevNullName(oldFilename) && !isDevNullName(newFilename)) { - var prefixPaths = []; - var suffixPaths = []; - - var oldFilenameParts = oldFilename.split(separator); - var newFilenameParts = newFilename.split(separator); - - var oldFilenamePartsSize = oldFilenameParts.length; - var newFilenamePartsSize = newFilenameParts.length; - - var i = 0; - var j = oldFilenamePartsSize - 1; - var k = newFilenamePartsSize - 1; - - while (i < j && i < k) { - if (oldFilenameParts[i] === newFilenameParts[i]) { - prefixPaths.push(newFilenameParts[i]); - i += 1; - } else { - break; - } - } - - while (j > i && k > i) { - if (oldFilenameParts[j] === newFilenameParts[k]) { - suffixPaths.unshift(newFilenameParts[k]); - j -= 1; - k -= 1; - } else { - break; - } - } - - var finalPrefix = prefixPaths.join(separator); - var finalSuffix = suffixPaths.join(separator); - - var oldRemainingPath = oldFilenameParts.slice(i, j + 1).join(separator); - var newRemainingPath = newFilenameParts.slice(i, k + 1).join(separator); - - if (finalPrefix.length && finalSuffix.length) { - return finalPrefix + separator + '{' + oldRemainingPath + ' → ' + newRemainingPath + '}' + separator + finalSuffix; - } else if (finalPrefix.length) { - return finalPrefix + separator + '{' + oldRemainingPath + ' → ' + newRemainingPath + '}'; - } else if (finalSuffix.length) { - return '{' + oldRemainingPath + ' → ' + newRemainingPath + '}' + separator + finalSuffix; - } - - return oldFilename + ' → ' + newFilename; - } else if (newFilename && !isDevNullName(newFilename)) { - return newFilename; - } else if (oldFilename) { - return oldFilename; - } - - return 'unknown/file/path'; - }; - - PrinterUtils.prototype.getFileTypeIcon = function(file) { - var templateName = 'file-changed'; - - if (file.isRename) { - templateName = 'file-renamed'; - } else if (file.isCopy) { - templateName = 'file-renamed'; - } else if (file.isNew) { - templateName = 'file-added'; - } else if (file.isDeleted) { - templateName = 'file-deleted'; - } else if (file.newName !== file.oldName) { - // If file is not Added, not Deleted and the names changed it must be a rename :) - templateName = 'file-renamed'; - } - - return templateName; - }; - - PrinterUtils.prototype.diffHighlight = function(diffLine1, diffLine2, config) { - var linePrefix1, linePrefix2, unprefixedLine1, unprefixedLine2; - - var prefixSize = 1; - - if (config.isCombined) { - prefixSize = 2; - } - - linePrefix1 = diffLine1.substr(0, prefixSize); - linePrefix2 = diffLine2.substr(0, prefixSize); - unprefixedLine1 = diffLine1.substr(prefixSize); - unprefixedLine2 = diffLine2.substr(prefixSize); - - if (unprefixedLine1.length > config.maxLineLengthHighlight || - unprefixedLine2.length > config.maxLineLengthHighlight) { - return { - first: { - prefix: linePrefix1, - line: utils.escape(unprefixedLine1) - }, - second: { - prefix: linePrefix2, - line: utils.escape(unprefixedLine2) - } - }; - } - - var diff; - if (config.diffStyle === 'char') { - diff = jsDiff.diffChars(unprefixedLine1, unprefixedLine2); - } else { - diff = jsDiff.diffWordsWithSpace(unprefixedLine1, unprefixedLine2); - } - - var highlightedLine = ''; - - var changedWords = []; - if (config.diffStyle === 'word' && config.matching === 'words') { - var treshold = 0.25; - - if (typeof (config.matchWordsThreshold) !== 'undefined') { - treshold = config.matchWordsThreshold; - } - - var matcher = Rematch.rematch(function(a, b) { - var amod = a.value; - var bmod = b.value; - - return Rematch.distance(amod, bmod); - }); - - var removed = diff.filter(function isRemoved(element) { - return element.removed; - }); - - var added = diff.filter(function isAdded(element) { - return element.added; - }); - - var chunks = matcher(added, removed); - chunks.forEach(function(chunk) { - if (chunk[0].length === 1 && chunk[1].length === 1) { - var dist = Rematch.distance(chunk[0][0].value, chunk[1][0].value); - if (dist < treshold) { - changedWords.push(chunk[0][0]); - changedWords.push(chunk[1][0]); - } - } - }); - } - - diff.forEach(function(part) { - var addClass = changedWords.indexOf(part) > -1 ? ' class="d2h-change"' : ''; - var elemType = part.added ? 'ins' : part.removed ? 'del' : null; - var escapedValue = utils.escape(part.value); - - if (elemType !== null) { - highlightedLine += '<' + elemType + addClass + '>' + escapedValue + ''; - } else { - highlightedLine += escapedValue; - } - }); - - return { - first: { - prefix: linePrefix1, - line: removeIns(highlightedLine) - }, - second: { - prefix: linePrefix2, - line: removeDel(highlightedLine) - } - }; - }; - - function unifyPath(path) { - if (path) { - return path.replace('\\', '/'); - } - - return path; - } - - function isDevNullName(name) { - return name.indexOf('dev/null') !== -1; - } - - function removeIns(line) { - return line.replace(/(]*>((.|\n)*?)<\/ins>)/g, ''); - } - - function removeDel(line) { - return line.replace(/(]*>((.|\n)*?)<\/del>)/g, ''); - } - - module.exports.PrinterUtils = new PrinterUtils(); -})(); - -},{"./rematch.js":16,"./utils.js":19,"diff":2}],16:[function(require,module,exports){ -/* - * - * Rematch (rematch.js) - * Matching two sequences of objects by similarity - * Author: W. Illmeyer, Nexxar GmbH - * - */ - -(function() { - var Rematch = {}; - - /* - Copyright (c) 2011 Andrei Mackenzie - Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated - documentation files (the "Software"), to deal in the Software without restriction, including without limitation - the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, - and to permit persons to whom the Software is furnished to do so, subject to the following conditions: - The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO - THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, - TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - */ - function levenshtein(a, b) { - if (a.length === 0) { - return b.length; - } - if (b.length === 0) { - return a.length; - } - - var matrix = []; - - // Increment along the first column of each row - var i; - for (i = 0; i <= b.length; i++) { - matrix[i] = [i]; - } - - // Increment each column in the first row - var j; - for (j = 0; j <= a.length; j++) { - matrix[0][j] = j; - } - - // Fill in the rest of the matrix - for (i = 1; i <= b.length; i++) { - for (j = 1; j <= a.length; j++) { - if (b.charAt(i - 1) === a.charAt(j - 1)) { - matrix[i][j] = matrix[i - 1][j - 1]; - } else { - matrix[i][j] = Math.min(matrix[i - 1][j - 1] + 1, // Substitution - Math.min(matrix[i][j - 1] + 1, // Insertion - matrix[i - 1][j] + 1)); // Deletion - } - } - } - - return matrix[b.length][a.length]; - } - - Rematch.levenshtein = levenshtein; - - Rematch.distance = function distance(x, y) { - x = x.trim(); - y = y.trim(); - var lev = levenshtein(x, y); - var score = lev / (x.length + y.length); - - return score; - }; - - Rematch.rematch = function rematch(distanceFunction) { - function findBestMatch(a, b, cache) { - var bestMatchDist = Infinity; - var bestMatch; - for (var i = 0; i < a.length; ++i) { - for (var j = 0; j < b.length; ++j) { - var cacheKey = JSON.stringify([a[i], b[j]]); - var md; - if (cache.hasOwnProperty(cacheKey)) { - md = cache[cacheKey]; - } else { - md = distanceFunction(a[i], b[j]); - cache[cacheKey] = md; - } - if (md < bestMatchDist) { - bestMatchDist = md; - bestMatch = {indexA: i, indexB: j, score: bestMatchDist}; - } - } - } - - return bestMatch; - } - - function group(a, b, level, cache) { - if (typeof (cache) === 'undefined') { - cache = {}; - } - - var bm = findBestMatch(a, b, cache); - - if (!level) { - level = 0; - } - - if (!bm || (a.length + b.length < 3)) { - return [[a, b]]; - } - - var a1 = a.slice(0, bm.indexA); - var b1 = b.slice(0, bm.indexB); - var aMatch = [a[bm.indexA]]; - var bMatch = [b[bm.indexB]]; - var tailA = bm.indexA + 1; - var tailB = bm.indexB + 1; - var a2 = a.slice(tailA); - var b2 = b.slice(tailB); - - var group1 = group(a1, b1, level + 1, cache); - var groupMatch = group(aMatch, bMatch, level + 1, cache); - var group2 = group(a2, b2, level + 1, cache); - var result = groupMatch; - - if (bm.indexA > 0 || bm.indexB > 0) { - result = group1.concat(result); - } - - if (a.length > tailA || b.length > tailB) { - result = result.concat(group2); - } - - return result; - } - - return group; - }; - - module.exports.Rematch = Rematch; -})(); - -},{}],17:[function(require,module,exports){ -/* - * - * HtmlPrinter (html-printer.js) - * Author: rtfpessoa - * - */ - -(function() { - var diffParser = require('./diff-parser.js').DiffParser; - var printerUtils = require('./printer-utils.js').PrinterUtils; - var utils = require('./utils.js').Utils; - var Rematch = require('./rematch.js').Rematch; - - var hoganUtils; - - var genericTemplatesPath = 'generic'; - var baseTemplatesPath = 'side-by-side'; - var iconsBaseTemplatesPath = 'icon'; - var tagsBaseTemplatesPath = 'tag'; - - var matcher = Rematch.rematch(function(a, b) { - var amod = a.content.substr(1); - var bmod = b.content.substr(1); - - return Rematch.distance(amod, bmod); - }); - - function SideBySidePrinter(config) { - this.config = config; - - var HoganJsUtils = require('./hoganjs-utils.js').HoganJsUtils; - hoganUtils = new HoganJsUtils(config); - } - - SideBySidePrinter.prototype.makeDiffHtml = function(file, diffs) { - var fileDiffTemplate = hoganUtils.template(baseTemplatesPath, 'file-diff'); - var filePathTemplate = hoganUtils.template(genericTemplatesPath, 'file-path'); - var fileIconTemplate = hoganUtils.template(iconsBaseTemplatesPath, 'file'); - var fileTagTemplate = hoganUtils.template(tagsBaseTemplatesPath, printerUtils.getFileTypeIcon(file)); - - return fileDiffTemplate.render({ - file: file, - fileHtmlId: printerUtils.getHtmlId(file), - diffs: diffs, - filePath: filePathTemplate.render({ - fileDiffName: printerUtils.getDiffName(file) - }, { - fileIcon: fileIconTemplate, - fileTag: fileTagTemplate - }) - }); - }; - - SideBySidePrinter.prototype.generateSideBySideJsonHtml = function(diffFiles) { - var that = this; - - var content = diffFiles.map(function(file) { - var diffs; - if (file.blocks.length) { - diffs = that.generateSideBySideFileHtml(file); - } else { - diffs = that.generateEmptyDiff(); - } - - return that.makeDiffHtml(file, diffs); - }).join('\n'); - - return hoganUtils.render(genericTemplatesPath, 'wrapper', {'content': content}); - }; - - SideBySidePrinter.prototype.makeSideHtml = function(blockHeader) { - return hoganUtils.render(genericTemplatesPath, 'column-line-number', { - diffParser: diffParser, - blockHeader: utils.escape(blockHeader), - lineClass: 'd2h-code-side-linenumber', - contentClass: 'd2h-code-side-line' - }); - }; - - SideBySidePrinter.prototype.generateSideBySideFileHtml = function(file) { - var that = this; - var fileHtml = {}; - fileHtml.left = ''; - fileHtml.right = ''; - - file.blocks.forEach(function(block) { - fileHtml.left += that.makeSideHtml(block.header); - fileHtml.right += that.makeSideHtml(''); - - var oldLines = []; - var newLines = []; - - function processChangeBlock() { - var matches; - var insertType; - var deleteType; - - var comparisons = oldLines.length * newLines.length; - - var maxLineSizeInBlock = Math.max.apply(null, (oldLines.concat(newLines)).map(function(elem) { - return elem.length; - })); - - var doMatching = comparisons < that.config.matchingMaxComparisons && - maxLineSizeInBlock < that.config.maxLineSizeInBlockForComparison && - (that.config.matching === 'lines' || that.config.matching === 'words'); - - if (doMatching) { - matches = matcher(oldLines, newLines); - insertType = diffParser.LINE_TYPE.INSERT_CHANGES; - deleteType = diffParser.LINE_TYPE.DELETE_CHANGES; - } else { - matches = [[oldLines, newLines]]; - insertType = diffParser.LINE_TYPE.INSERTS; - deleteType = diffParser.LINE_TYPE.DELETES; - } - - matches.forEach(function(match) { - oldLines = match[0]; - newLines = match[1]; - - var common = Math.min(oldLines.length, newLines.length); - var max = Math.max(oldLines.length, newLines.length); - - for (var j = 0; j < common; j++) { - var oldLine = oldLines[j]; - var newLine = newLines[j]; - - that.config.isCombined = file.isCombined; - - var diff = printerUtils.diffHighlight(oldLine.content, newLine.content, that.config); - - fileHtml.left += - that.generateSingleLineHtml(file.isCombined, deleteType, oldLine.oldNumber, - diff.first.line, diff.first.prefix); - fileHtml.right += - that.generateSingleLineHtml(file.isCombined, insertType, newLine.newNumber, - diff.second.line, diff.second.prefix); - } - - if (max > common) { - var oldSlice = oldLines.slice(common); - var newSlice = newLines.slice(common); - - var tmpHtml = that.processLines(file.isCombined, oldSlice, newSlice); - fileHtml.left += tmpHtml.left; - fileHtml.right += tmpHtml.right; - } - }); - - oldLines = []; - newLines = []; - } - - for (var i = 0; i < block.lines.length; i++) { - var line = block.lines[i]; - var prefix = line.content[0]; - var escapedLine = utils.escape(line.content.substr(1)); - - if (line.type !== diffParser.LINE_TYPE.INSERTS && - (newLines.length > 0 || (line.type !== diffParser.LINE_TYPE.DELETES && oldLines.length > 0))) { - processChangeBlock(); - } - - if (line.type === diffParser.LINE_TYPE.CONTEXT) { - fileHtml.left += that.generateSingleLineHtml(file.isCombined, line.type, line.oldNumber, escapedLine, prefix); - fileHtml.right += that.generateSingleLineHtml(file.isCombined, line.type, line.newNumber, escapedLine, prefix); - } else if (line.type === diffParser.LINE_TYPE.INSERTS && !oldLines.length) { - fileHtml.left += that.generateSingleLineHtml(file.isCombined, diffParser.LINE_TYPE.CONTEXT, '', '', ''); - fileHtml.right += that.generateSingleLineHtml(file.isCombined, line.type, line.newNumber, escapedLine, prefix); - } else if (line.type === diffParser.LINE_TYPE.DELETES) { - oldLines.push(line); - } else if (line.type === diffParser.LINE_TYPE.INSERTS && Boolean(oldLines.length)) { - newLines.push(line); - } else { - console.error('unknown state in html side-by-side generator'); - processChangeBlock(); - } - } - - processChangeBlock(); - }); - - return fileHtml; - }; - - SideBySidePrinter.prototype.processLines = function(isCombined, oldLines, newLines) { - var that = this; - var fileHtml = {}; - fileHtml.left = ''; - fileHtml.right = ''; - - var maxLinesNumber = Math.max(oldLines.length, newLines.length); - for (var i = 0; i < maxLinesNumber; i++) { - var oldLine = oldLines[i]; - var newLine = newLines[i]; - var oldContent; - var newContent; - var oldPrefix; - var newPrefix; - - if (oldLine) { - oldContent = utils.escape(oldLine.content.substr(1)); - oldPrefix = oldLine.content[0]; - } - - if (newLine) { - newContent = utils.escape(newLine.content.substr(1)); - newPrefix = newLine.content[0]; - } - - if (oldLine && newLine) { - fileHtml.left += that.generateSingleLineHtml(isCombined, oldLine.type, oldLine.oldNumber, oldContent, oldPrefix); - fileHtml.right += that.generateSingleLineHtml(isCombined, newLine.type, newLine.newNumber, newContent, newPrefix); - } else if (oldLine) { - fileHtml.left += that.generateSingleLineHtml(isCombined, oldLine.type, oldLine.oldNumber, oldContent, oldPrefix); - fileHtml.right += that.generateSingleLineHtml(isCombined, diffParser.LINE_TYPE.CONTEXT, '', '', ''); - } else if (newLine) { - fileHtml.left += that.generateSingleLineHtml(isCombined, diffParser.LINE_TYPE.CONTEXT, '', '', ''); - fileHtml.right += that.generateSingleLineHtml(isCombined, newLine.type, newLine.newNumber, newContent, newPrefix); - } else { - console.error('How did it get here?'); - } - } - - return fileHtml; - }; - - SideBySidePrinter.prototype.generateSingleLineHtml = function(isCombined, type, number, content, possiblePrefix) { - var lineWithoutPrefix = content; - var prefix = possiblePrefix; - var lineClass = 'd2h-code-side-linenumber'; - var contentClass = 'd2h-code-side-line'; - - if (!number && !content) { - lineClass += ' d2h-code-side-emptyplaceholder'; - contentClass += ' d2h-code-side-emptyplaceholder'; - type += ' d2h-emptyplaceholder'; - prefix = ' '; - lineWithoutPrefix = ' '; - } else if (!prefix) { - var lineWithPrefix = printerUtils.separatePrefix(isCombined, content); - prefix = lineWithPrefix.prefix; - lineWithoutPrefix = lineWithPrefix.line; - } - - if (prefix === ' ') { - prefix = ' '; - } - - return hoganUtils.render(genericTemplatesPath, 'line', - { - type: type, - lineClass: lineClass, - contentClass: contentClass, - prefix: prefix, - content: lineWithoutPrefix, - lineNumber: number - }); - }; - - SideBySidePrinter.prototype.generateEmptyDiff = function() { - var fileHtml = {}; - fileHtml.right = ''; - - fileHtml.left = hoganUtils.render(genericTemplatesPath, 'empty-diff', { - contentClass: 'd2h-code-side-line', - diffParser: diffParser - }); - - return fileHtml; - }; - - module.exports.SideBySidePrinter = SideBySidePrinter; -})(); - -},{"./diff-parser.js":9,"./hoganjs-utils.js":12,"./printer-utils.js":15,"./rematch.js":16,"./utils.js":19}],18:[function(require,module,exports){ -(function (global){ -(function() { -if (!!!global.browserTemplates) global.browserTemplates = {}; -var Hogan = require("hogan.js");global.browserTemplates["file-summary-line"] = new Hogan.Template({code: function (c,p,i) { var t=this;t.b(i=i||"");t.b("
  • ");t.b("\n" + i);t.b(" ");t.b("\n" + i);t.b(t.rp("");t.b(t.v(t.f("fileName",c,p,0)));t.b("");t.b("\n" + i);t.b(" ");t.b("\n" + i);t.b(" ");t.b(t.v(t.f("addedLines",c,p,0)));t.b("");t.b("\n" + i);t.b(" ");t.b(t.v(t.f("deletedLines",c,p,0)));t.b("");t.b("\n" + i);t.b(" ");t.b("\n" + i);t.b(" ");t.b("\n" + i);t.b("
  • ");return t.fl(); },partials: {"");t.b("\n" + i);t.b("
    ");t.b("\n" + i);t.b(" Files changed (");t.b(t.v(t.f("filesNumber",c,p,0)));t.b(")");t.b("\n" + i);t.b(" hide");t.b("\n" + i);t.b(" show");t.b("\n" + i);t.b("
    ");t.b("\n" + i);t.b("
      ");t.b("\n" + i);t.b(" ");t.b(t.t(t.f("files",c,p,0)));t.b("\n" + i);t.b("
    ");t.b("\n" + i);t.b("");return t.fl(); },partials: {}, subs: { }}); -global.browserTemplates["generic-column-line-number"] = new Hogan.Template({code: function (c,p,i) { var t=this;t.b(i=i||"");t.b("");t.b("\n" + i);t.b(" ");t.b("\n" + i);t.b(" ");t.b("\n" + i);t.b("
    ");t.b(t.t(t.f("blockHeader",c,p,0)));t.b("
    ");t.b("\n" + i);t.b(" ");t.b("\n" + i);t.b("");return t.fl(); },partials: {}, subs: { }}); -global.browserTemplates["generic-empty-diff"] = new Hogan.Template({code: function (c,p,i) { var t=this;t.b(i=i||"");t.b("");t.b("\n" + i);t.b(" ");t.b("\n" + i);t.b("
    ");t.b("\n" + i);t.b(" File without changes");t.b("\n" + i);t.b("
    ");t.b("\n" + i);t.b(" ");t.b("\n" + i);t.b("");return t.fl(); },partials: {}, subs: { }}); -global.browserTemplates["generic-file-path"] = new Hogan.Template({code: function (c,p,i) { var t=this;t.b(i=i||"");t.b("");t.b("\n" + i);t.b(t.rp("");t.b(t.v(t.f("fileDiffName",c,p,0)));t.b("");t.b("\n" + i);t.b(t.rp("");return t.fl(); },partials: {"");t.b("\n" + i);t.b(" ");t.b("\n" + i);t.b(" ");t.b(t.t(t.f("lineNumber",c,p,0)));t.b("\n" + i);t.b(" ");t.b("\n" + i);t.b(" ");t.b("\n" + i);t.b("
    ");t.b("\n" + i);if(t.s(t.f("prefix",c,p,1),c,p,0,171,247,"{{ }}")){t.rs(c,p,function(c,p,t){t.b(" ");t.b(t.t(t.f("prefix",c,p,0)));t.b("");t.b("\n" + i);});c.pop();}if(t.s(t.f("content",c,p,1),c,p,0,279,353,"{{ }}")){t.rs(c,p,function(c,p,t){t.b(" ");t.b(t.t(t.f("content",c,p,0)));t.b("");t.b("\n" + i);});c.pop();}t.b("
    ");t.b("\n" + i);t.b(" ");t.b("\n" + i);t.b("");return t.fl(); },partials: {}, subs: { }}); -global.browserTemplates["generic-wrapper"] = new Hogan.Template({code: function (c,p,i) { var t=this;t.b(i=i||"");t.b("
    ");t.b("\n" + i);t.b(" ");t.b(t.t(t.f("content",c,p,0)));t.b("\n" + i);t.b("
    ");return t.fl(); },partials: {}, subs: { }}); -global.browserTemplates["icon-file-added"] = new Hogan.Template({code: function (c,p,i) { var t=this;t.b(i=i||"");t.b("");t.b("\n" + i);t.b(" ");t.b("\n" + i);t.b("");return t.fl(); },partials: {}, subs: { }}); -global.browserTemplates["icon-file-changed"] = new Hogan.Template({code: function (c,p,i) { var t=this;t.b(i=i||"");t.b("");t.b("\n" + i);t.b(" ");t.b("\n" + i);t.b("");return t.fl(); },partials: {}, subs: { }}); -global.browserTemplates["icon-file-deleted"] = new Hogan.Template({code: function (c,p,i) { var t=this;t.b(i=i||"");t.b("");t.b("\n" + i);t.b(" ");t.b("\n" + i);t.b("");return t.fl(); },partials: {}, subs: { }}); -global.browserTemplates["icon-file-renamed"] = new Hogan.Template({code: function (c,p,i) { var t=this;t.b(i=i||"");t.b("");t.b("\n" + i);t.b(" ");t.b("\n" + i);t.b("");return t.fl(); },partials: {}, subs: { }}); -global.browserTemplates["icon-file"] = new Hogan.Template({code: function (c,p,i) { var t=this;t.b(i=i||"");t.b("");t.b("\n" + i);t.b(" ");t.b("\n" + i);t.b("");return t.fl(); },partials: {}, subs: { }}); -global.browserTemplates["line-by-line-file-diff"] = new Hogan.Template({code: function (c,p,i) { var t=this;t.b(i=i||"");t.b("
    ");t.b("\n" + i);t.b("
    ");t.b("\n" + i);t.b(" ");t.b(t.t(t.f("filePath",c,p,0)));t.b("\n" + i);t.b("
    ");t.b("\n" + i);t.b("
    ");t.b("\n" + i);t.b("
    ");t.b("\n" + i);t.b(" ");t.b("\n" + i);t.b(" ");t.b("\n" + i);t.b(" ");t.b(t.t(t.f("diffs",c,p,0)));t.b("\n" + i);t.b(" ");t.b("\n" + i);t.b("
    ");t.b("\n" + i);t.b("
    ");t.b("\n" + i);t.b("
    ");t.b("\n" + i);t.b("
    ");return t.fl(); },partials: {}, subs: { }}); -global.browserTemplates["line-by-line-numbers"] = new Hogan.Template({code: function (c,p,i) { var t=this;t.b(i=i||"");t.b("
    ");t.b(t.v(t.f("oldNumber",c,p,0)));t.b("
    ");t.b("\n" + i);t.b("
    ");t.b(t.v(t.f("newNumber",c,p,0)));t.b("
    ");return t.fl(); },partials: {}, subs: { }}); -global.browserTemplates["side-by-side-file-diff"] = new Hogan.Template({code: function (c,p,i) { var t=this;t.b(i=i||"");t.b("
    ");t.b("\n" + i);t.b("
    ");t.b("\n" + i);t.b(" ");t.b(t.t(t.f("filePath",c,p,0)));t.b("\n" + i);t.b("
    ");t.b("\n" + i);t.b("
    ");t.b("\n" + i);t.b("
    ");t.b("\n" + i);t.b("
    ");t.b("\n" + i);t.b(" ");t.b("\n" + i);t.b(" ");t.b("\n" + i);t.b(" ");t.b(t.t(t.d("diffs.left",c,p,0)));t.b("\n" + i);t.b(" ");t.b("\n" + i);t.b("
    ");t.b("\n" + i);t.b("
    ");t.b("\n" + i);t.b("
    ");t.b("\n" + i);t.b("
    ");t.b("\n" + i);t.b("
    ");t.b("\n" + i);t.b(" ");t.b("\n" + i);t.b(" ");t.b("\n" + i);t.b(" ");t.b(t.t(t.d("diffs.right",c,p,0)));t.b("\n" + i);t.b(" ");t.b("\n" + i);t.b("
    ");t.b("\n" + i);t.b("
    ");t.b("\n" + i);t.b("
    ");t.b("\n" + i);t.b("
    ");t.b("\n" + i);t.b("
    ");return t.fl(); },partials: {}, subs: { }}); -global.browserTemplates["tag-file-added"] = new Hogan.Template({code: function (c,p,i) { var t=this;t.b(i=i||"");t.b("ADDED");return t.fl(); },partials: {}, subs: { }}); -global.browserTemplates["tag-file-changed"] = new Hogan.Template({code: function (c,p,i) { var t=this;t.b(i=i||"");t.b("CHANGED");return t.fl(); },partials: {}, subs: { }}); -global.browserTemplates["tag-file-deleted"] = new Hogan.Template({code: function (c,p,i) { var t=this;t.b(i=i||"");t.b("DELETED");return t.fl(); },partials: {}, subs: { }}); -global.browserTemplates["tag-file-renamed"] = new Hogan.Template({code: function (c,p,i) { var t=this;t.b(i=i||"");t.b("RENAMED");return t.fl(); },partials: {}, subs: { }}); -module.exports = global.browserTemplates; -})(); - -}).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {}) -},{"hogan.js":4}],19:[function(require,module,exports){ -/* - * - * Utils (utils.js) - * Author: rtfpessoa - * - */ - -(function() { - var merge = require('merge'); - - function Utils() { - } - - Utils.prototype.escape = function(str) { - return str.slice(0) - .replace(/&/g, '&') - .replace(//g, '>') - .replace(/"/g, '"') - .replace(/'/g, ''') - .replace(/\//g, '/'); - }; - - Utils.prototype.startsWith = function(str, start) { - if (typeof start === 'object') { - var result = false; - start.forEach(function(s) { - if (str.indexOf(s) === 0) { - result = true; - } - }); - - return result; - } - - return str && str.indexOf(start) === 0; - }; - - Utils.prototype.valueOrEmpty = function(value) { - return value || ''; - }; - - Utils.prototype.safeConfig = function(cfg, defaultConfig) { - return merge.recursive(true, defaultConfig, cfg); - }; - - module.exports.Utils = new Utils(); -})(); - -},{"merge":6}]},{},[10]); diff --git a/dist/diff2html.min.css b/dist/diff2html.min.css deleted file mode 100644 index 171a77c..0000000 --- a/dist/diff2html.min.css +++ /dev/null @@ -1 +0,0 @@ -.d2h-wrapper{text-align:left}.d2h-file-header{height:35px;padding:5px 10px;border-bottom:1px solid #d8d8d8;background-color:#f7f7f7}.d2h-file-stats{display:flex;margin-left:auto;font-size:14px}.d2h-lines-added{text-align:right;border:1px solid #b4e2b4;border-radius:5px 0 0 5px;color:#399839;padding:2px;vertical-align:middle}.d2h-lines-deleted{text-align:left;border:1px solid #e9aeae;border-radius:0 5px 5px 0;color:#c33;padding:2px;vertical-align:middle;margin-left:1px}.d2h-file-name-wrapper{display:flex;align-items:center;width:100%;font-family:"Source Sans Pro","Helvetica Neue",Helvetica,Arial,sans-serif;font-size:15px}.d2h-file-name{white-space:nowrap;text-overflow:ellipsis;overflow-x:hidden}.d2h-file-wrapper{border:1px solid #ddd;border-radius:3px;margin-bottom:1em}.d2h-diff-table{width:100%;border-collapse:collapse;font-family:Menlo,Consolas,monospace;font-size:13px}.d2h-files-diff{display:block;width:100%;height:100%}.d2h-file-diff{overflow-y:hidden}.d2h-file-side-diff{display:inline-block;overflow-x:scroll;overflow-y:hidden;width:50%;margin-right:-4px;margin-bottom:-8px}.d2h-code-line{display:inline-block;white-space:nowrap;padding:0 8em}.d2h-code-side-line{display:inline-block;white-space:nowrap;padding:0 4.5em}.d2h-code-line del,.d2h-code-side-line del{display:inline-block;margin-top:-1px;text-decoration:none;background-color:#ffb6ba;border-radius:.2em}.d2h-code-line ins,.d2h-code-side-line ins{display:inline-block;margin-top:-1px;text-decoration:none;background-color:#97f295;border-radius:.2em;text-align:left}.d2h-code-line-prefix{display:inline;background:0 0;padding:0;word-wrap:normal;white-space:pre}.d2h-code-line-ctn{display:inline;background:0 0;padding:0;word-wrap:normal;white-space:pre}.line-num1{box-sizing:border-box;float:left;width:3.5em;overflow:hidden;text-overflow:ellipsis;padding:0 .5em 0 .5em}.line-num2{box-sizing:border-box;float:right;width:3.5em;overflow:hidden;text-overflow:ellipsis;padding:0 .5em 0 .5em}.d2h-code-linenumber{box-sizing:border-box;width:7.5em;position:absolute;display:inline-block;background-color:#fff;color:rgba(0,0,0,.3);text-align:right;border:solid #eee;border-width:0 1px 0 1px;cursor:pointer}.d2h-code-linenumber:after{content:'\200b'}.d2h-code-side-linenumber{position:absolute;display:inline-block;box-sizing:border-box;width:4em;background-color:#fff;color:rgba(0,0,0,.3);text-align:right;border:solid #eee;border-width:0 1px 0 1px;cursor:pointer;overflow:hidden;text-overflow:ellipsis}.d2h-code-side-linenumber:after{content:'\200b'}.d2h-code-side-emptyplaceholder,.d2h-emptyplaceholder{background-color:#f1f1f1;border-color:#e1e1e1}.d2h-del{background-color:#fee8e9;border-color:#e9aeae}.d2h-ins{background-color:#dfd;border-color:#b4e2b4}.d2h-info{background-color:#f8fafd;color:rgba(0,0,0,.3);border-color:#d5e4f2}.d2h-file-diff .d2h-del.d2h-change{background-color:#fdf2d0}.d2h-file-diff .d2h-ins.d2h-change{background-color:#ded}.d2h-file-list-wrapper{margin-bottom:10px}.d2h-file-list-wrapper a{text-decoration:none;color:#3572b0}.d2h-file-list-wrapper a:visited{color:#3572b0}.d2h-file-list-header{text-align:left}.d2h-file-list-title{font-weight:700}.d2h-file-list-line{display:flex;text-align:left}.d2h-file-list{display:block;list-style:none;padding:0;margin:0}.d2h-file-list>li{border-bottom:#ddd solid 1px;padding:5px 10px;margin:0}.d2h-file-list>li:last-child{border-bottom:none}.d2h-file-switch{display:none;font-size:10px;cursor:pointer}.d2h-icon{vertical-align:middle;margin-right:10px;fill:currentColor}.d2h-deleted{color:#c33}.d2h-added{color:#399839}.d2h-changed{color:#d0b44c}.d2h-moved{color:#3572b0}.d2h-tag{display:flex;font-size:10px;margin-left:5px;padding:0 2px;background-color:#fff}.d2h-deleted-tag{border:#c33 1px solid}.d2h-added-tag{border:#399839 1px solid}.d2h-changed-tag{border:#d0b44c 1px solid}.d2h-moved-tag{border:#3572b0 1px solid}.selecting-left .d2h-code-line,.selecting-left .d2h-code-line *,.selecting-left .d2h-code-side-line,.selecting-left .d2h-code-side-line *,.selecting-right td.d2h-code-linenumber,.selecting-right td.d2h-code-linenumber *,.selecting-right td.d2h-code-side-linenumber,.selecting-right td.d2h-code-side-linenumber *{-webkit-touch-callout:none;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.selecting-left .d2h-code-line ::-moz-selection,.selecting-left .d2h-code-line::-moz-selection,.selecting-left .d2h-code-side-line ::-moz-selection,.selecting-left .d2h-code-side-line::-moz-selection,.selecting-right td.d2h-code-linenumber::-moz-selection,.selecting-right td.d2h-code-side-linenumber ::-moz-selection,.selecting-right td.d2h-code-side-linenumber::-moz-selection{background:0 0}.selecting-left .d2h-code-line ::selection,.selecting-left .d2h-code-line::selection,.selecting-left .d2h-code-side-line ::selection,.selecting-left .d2h-code-side-line::selection,.selecting-right td.d2h-code-linenumber::selection,.selecting-right td.d2h-code-side-linenumber ::selection,.selecting-right td.d2h-code-side-linenumber::selection{background:0 0} \ No newline at end of file diff --git a/dist/diff2html.min.js b/dist/diff2html.min.js deleted file mode 100644 index ca724b3..0000000 --- a/dist/diff2html.min.js +++ /dev/null @@ -1 +0,0 @@ -!function r(e,n,t){function o(i,f){if(!n[i]){if(!e[i]){var c="function"==typeof require&&require;if(!f&&c)return c(i,!0);if(u)return u(i,!0);var a=new Error("Cannot find module '"+i+"'");throw a.code="MODULE_NOT_FOUND",a}var p=n[i]={exports:{}};e[i][0].call(p.exports,function(r){return o(e[i][1][r]||r)},p,p.exports,r,e,n,t)}return n[i].exports}for(var u="function"==typeof require&&require,i=0;ivalue.length?oldValue:value}),component.value=diff.join(value)}else component.value=diff.join(newString.slice(newPos,newPos+component.count));newPos+=component.count,component.added||(oldPos+=component.count)}}var lastComponent=components[componentLen-1];return 1=newLen&&oldLen<=oldPos+1)return done([{value:this.join(newString),count:newString.length}]);function execEditLength(){for(var diagonalPath=-1*editLength;diagonalPath<=editLength;diagonalPath+=2){var basePath=void 0,addPath=bestPath[diagonalPath-1],removePath=bestPath[diagonalPath+1],_oldPos=(removePath?removePath.newPos:0)-diagonalPath;addPath&&(bestPath[diagonalPath-1]=void 0);var canAdd=addPath&&addPath.newPos+1=newLen&&oldLen<=_oldPos+1)return done(buildValues(self,basePath.components,newString,oldString,self.useLongestToken));bestPath[diagonalPath]=basePath}else bestPath[diagonalPath]=void 0}var path;editLength++}if(callback)!function exec(){setTimeout(function(){if(maxEditLength=diff.length-2&&lines.length<=options.context){var oldEOFNewline=/\n$/.test(oldStr),newEOFNewline=/\n$/.test(newStr),noNlBeforeAdds=0==lines.length&&curRange.length>hunk.oldLines;!oldEOFNewline&&noNlBeforeAdds&&curRange.splice(hunk.oldLines,0,"\\ No newline at end of file"),(oldEOFNewline||noNlBeforeAdds)&&newEOFNewline||curRange.push("\\ No newline at end of file")}hunks.push(hunk),newRangeStart=oldRangeStart=0,curRange=[]}oldLine+=lines.length,newLine+=lines.length}},i=0;iarray.length)return!1;for(var i=0;i/g,">")).replace(/"/g,""")}arrayDiff.tokenize=function(value){return value.slice()},arrayDiff.join=arrayDiff.removeEmpty=function(value){return value},exports.Diff=Diff,exports.diffChars=function(oldStr,newStr,options){return characterDiff.diff(oldStr,newStr,options)},exports.diffWords=function(oldStr,newStr,options){return options=generateOptions(options,{ignoreWhitespace:!0}),wordDiff.diff(oldStr,newStr,options)},exports.diffWordsWithSpace=function(oldStr,newStr,options){return wordDiff.diff(oldStr,newStr,options)},exports.diffLines=diffLines,exports.diffTrimmedLines=function(oldStr,newStr,callback){var options=generateOptions(callback,{ignoreWhitespace:!0});return lineDiff.diff(oldStr,newStr,options)},exports.diffSentences=function(oldStr,newStr,callback){return sentenceDiff.diff(oldStr,newStr,callback)},exports.diffCss=function(oldStr,newStr,callback){return cssDiff.diff(oldStr,newStr,callback)},exports.diffJson=function(oldObj,newObj,options){return jsonDiff.diff(oldObj,newObj,options)},exports.diffArrays=function(oldArr,newArr,callback){return arrayDiff.diff(oldArr,newArr,callback)},exports.structuredPatch=structuredPatch,exports.createTwoFilesPatch=createTwoFilesPatch,exports.createPatch=function(fileName,oldStr,newStr,oldHeader,newHeader,options){return createTwoFilesPatch(fileName,fileName,oldStr,newStr,oldHeader,newHeader,options)},exports.applyPatch=applyPatch,exports.applyPatches=function(uniDiff,options){"string"==typeof uniDiff&&(uniDiff=parsePatch(uniDiff));var currentIndex=0;!function processIndex(){var index=uniDiff[currentIndex++];if(!index)return options.complete();options.loadFile(index,function(err,data){if(err)return options.complete(err);var updatedContent=applyPatch(data,index,options);options.patched(index,updatedContent,function(err){if(err)return options.complete(err);processIndex()})})}()},exports.parsePatch=parsePatch,exports.merge=function(mine,theirs,base){mine=loadPatch(mine,base),theirs=loadPatch(theirs,base);var ret={};(mine.index||theirs.index)&&(ret.index=mine.index||theirs.index),(mine.newFileName||theirs.newFileName)&&(fileNameChanged(mine)?fileNameChanged(theirs)?(ret.oldFileName=selectField(ret,mine.oldFileName,theirs.oldFileName),ret.newFileName=selectField(ret,mine.newFileName,theirs.newFileName),ret.oldHeader=selectField(ret,mine.oldHeader,theirs.oldHeader),ret.newHeader=selectField(ret,mine.newHeader,theirs.newHeader)):(ret.oldFileName=mine.oldFileName,ret.newFileName=mine.newFileName,ret.oldHeader=mine.oldHeader,ret.newHeader=mine.newHeader):(ret.oldFileName=theirs.oldFileName||mine.oldFileName,ret.newFileName=theirs.newFileName||mine.newFileName,ret.oldHeader=theirs.oldHeader||mine.oldHeader,ret.newHeader=theirs.newHeader||mine.newHeader)),ret.hunks=[];for(var mineIndex=0,theirsIndex=0,mineOffset=0,theirsOffset=0;mineIndex"):change.removed&&ret.push(""),ret.push(escapeHTML(change.value)),change.added?ret.push(""):change.removed&&ret.push("")}return ret.join("")},exports.canonicalize=canonicalize,Object.defineProperty(exports,"__esModule",{value:!0})},"object"==typeof exports&&void 0!==module?factory(exports):"function"==typeof define&&define.amd?define(["exports"],factory):factory((global=global||self).Diff={})},{}],3:[function(require,module,exports){!function(Hogan){var rIsWhitespace=/\S/,rQuot=/\"/g,rNewline=/\n/g,rCr=/\r/g,rSlash=/\\/g,rLineSep=/\u2028/,rParagraphSep=/\u2029/;function cleanTripleStache(token){"}"===token.n.substr(token.n.length-1)&&(token.n=token.n.substring(0,token.n.length-1))}function trim(s){return s.trim?s.trim():s.replace(/^\s*|\s*$/g,"")}function tagChange(tag,text,index){if(text.charAt(index)!=tag.charAt(0))return!1;for(var i=1,l=tag.length;i":7,"=":8,_v:9,"{":10,"&":11,_t:12},Hogan.scan=function(text,delimiters){var len=text.length,state=0,tagType=null,tag=null,buf="",tokens=[],seenTag=!1,i=0,lineStart=0,otag="{{",ctag="}}";function addBuf(){0"==next.tag&&(next.indent=tokens[j].text.toString()),tokens.splice(j,1));else noNewLine||tokens.push({tag:"\n"});seenTag=!1,lineStart=tokens.length}function changeDelimiters(text,index){var close="="+ctag,closeIndex=text.indexOf(close,index),delimiters=trim(text.substring(text.indexOf("=",index)+1,closeIndex)).split(" ");return otag=delimiters[0],ctag=delimiters[delimiters.length-1],closeIndex+close.length-1}for(delimiters&&(delimiters=delimiters.split(" "),otag=delimiters[0],ctag=delimiters[1]),i=0;i":createPartial,"<":function(node,context){var ctx={partials:{},code:"",subs:{},inPartial:!0};Hogan.walk(node.nodes,ctx);var template=context.partials[createPartial(node,context)];template.subs=ctx.subs,template.partials=ctx.partials},$:function(node,context){var ctx={subs:{},code:"",partials:context.partials,prefix:node.n};Hogan.walk(node.nodes,ctx),context.subs[node.n]=ctx.code,context.inPartial||(context.code+='t.sub("'+esc(node.n)+'",c,p,i);')},"\n":function(node,context){context.code+=write('"\\n"'+(node.last?"":" + i"))},_v:function(node,context){context.code+="t.b(t.v(t."+chooseMethod(node.n)+'("'+esc(node.n)+'",c,p,0)));'},_t:function(node,context){context.code+=write('"'+esc(node.text)+'"')},"{":tripleStache,"&":tripleStache},Hogan.walk=function(nodelist,context){for(var func,i=0,l=nodelist.length;i/g,rApos=/\'/g,rQuot=/\"/g,hChars=/[&<>\"\']/;function coerceToString(val){return String(null==val?"":val)}var isArray=Array.isArray||function(a){return"[object Array]"===Object.prototype.toString.call(a)}}(void 0!==exports?exports:{})},{}],6:[function(require,module,exports){function merge_recursive(base,extend){if("object"!==typeOf(base))return extend;for(var key in extend)"object"===typeOf(base[key])&&"object"===typeOf(extend[key])?base[key]=merge_recursive(base[key],extend[key]):base[key]=extend[key];return base}function merge(clone,recursive,argv){var result=argv[0],size=argv.length;!clone&&"object"===typeOf(result)||(result={});for(var index=0;indexconfig.maxLineLengthHighlight||unprefixedLine2.length>config.maxLineLengthHighlight)return{first:{prefix:linePrefix1,line:utils.escape(unprefixedLine1)},second:{prefix:linePrefix2,line:utils.escape(unprefixedLine2)}};diff="char"===config.diffStyle?jsDiff.diffChars(unprefixedLine1,unprefixedLine2):jsDiff.diffWordsWithSpace(unprefixedLine1,unprefixedLine2);var highlightedLine="",changedWords=[];if("word"===config.diffStyle&&"words"===config.matching){var treshold=.25;void 0!==config.matchWordsThreshold&&(treshold=config.matchWordsThreshold);var matcher=Rematch.rematch(function(a,b){var amod=a.value,bmod=b.value;return Rematch.distance(amod,bmod)}),removed=diff.filter(function(element){return element.removed});matcher(diff.filter(function(element){return element.added}),removed).forEach(function(chunk){1===chunk[0].length&&1===chunk[1].length&&Rematch.distance(chunk[0][0].value,chunk[1][0].value)"+escapedValue+"":escapedValue}),{first:{prefix:linePrefix1,line:function(line){return line.replace(/(]*>((.|\n)*?)<\/ins>)/g,"")}(highlightedLine)},second:{prefix:linePrefix2,line:function(line){return line.replace(/(]*>((.|\n)*?)<\/del>)/g,"")}(highlightedLine)}}},module.exports.PrinterUtils=new PrinterUtils},{"./rematch.js":16,"./utils.js":19,diff:2}],16:[function(require,module,exports){function levenshtein(a,b){if(0===a.length)return b.length;if(0===b.length)return a.length;var i,j,matrix=[];for(i=0;i<=b.length;i++)matrix[i]=[i];for(j=0;j<=a.length;j++)matrix[0][j]=j;for(i=1;i<=b.length;i++)for(j=1;j<=a.length;j++)b.charAt(i-1)===a.charAt(j-1)?matrix[i][j]=matrix[i-1][j-1]:matrix[i][j]=Math.min(matrix[i-1][j-1]+1,Math.min(matrix[i][j-1]+1,matrix[i-1][j]+1));return matrix[b.length][a.length]}var Rematch;(Rematch={}).levenshtein=levenshtein,Rematch.distance=function(x,y){return levenshtein(x=x.trim(),y=y.trim())/(x.length+y.length)},Rematch.rematch=function(distanceFunction){return function group(a,b,level,cache){void 0===cache&&(cache={});var bm=function(a,b,cache){for(var bestMatch,bestMatchDist=1/0,i=0;itailA||b.length>tailB)&&(result=result.concat(group2)),result}},module.exports.Rematch=Rematch},{}],17:[function(require,module,exports){function SideBySidePrinter(config){this.config=config;var HoganJsUtils=require("./hoganjs-utils.js").HoganJsUtils;hoganUtils=new HoganJsUtils(config)}var hoganUtils,diffParser,printerUtils,utils,Rematch,matcher;diffParser=require("./diff-parser.js").DiffParser,printerUtils=require("./printer-utils.js").PrinterUtils,utils=require("./utils.js").Utils,Rematch=require("./rematch.js").Rematch,matcher=Rematch.rematch(function(a,b){var amod=a.content.substr(1),bmod=b.content.substr(1);return Rematch.distance(amod,bmod)}),SideBySidePrinter.prototype.makeDiffHtml=function(file,diffs){var fileDiffTemplate=hoganUtils.template("side-by-side","file-diff"),filePathTemplate=hoganUtils.template("generic","file-path"),fileIconTemplate=hoganUtils.template("icon","file"),fileTagTemplate=hoganUtils.template("tag",printerUtils.getFileTypeIcon(file));return fileDiffTemplate.render({file:file,fileHtmlId:printerUtils.getHtmlId(file),diffs:diffs,filePath:filePathTemplate.render({fileDiffName:printerUtils.getDiffName(file)},{fileIcon:fileIconTemplate,fileTag:fileTagTemplate})})},SideBySidePrinter.prototype.generateSideBySideJsonHtml=function(diffFiles){var that=this,content=diffFiles.map(function(file){var diffs;return diffs=file.blocks.length?that.generateSideBySideFileHtml(file):that.generateEmptyDiff(),that.makeDiffHtml(file,diffs)}).join("\n");return hoganUtils.render("generic","wrapper",{content:content})},SideBySidePrinter.prototype.makeSideHtml=function(blockHeader){return hoganUtils.render("generic","column-line-number",{diffParser:diffParser,blockHeader:utils.escape(blockHeader),lineClass:"d2h-code-side-linenumber",contentClass:"d2h-code-side-line"})},SideBySidePrinter.prototype.generateSideBySideFileHtml=function(file){var that=this,fileHtml={left:"",right:""};return file.blocks.forEach(function(block){fileHtml.left+=that.makeSideHtml(block.header),fileHtml.right+=that.makeSideHtml("");var oldLines=[],newLines=[];function processChangeBlock(){var matches,insertType,deleteType,comparisons=oldLines.length*newLines.length,maxLineSizeInBlock=Math.max.apply(null,oldLines.concat(newLines).map(function(elem){return elem.length})),doMatching=comparisons'),t.b("\n"+i),t.b(' '),t.b("\n"+i),t.b(t.rp("'),t.b(t.v(t.f("fileName",c,p,0))),t.b(""),t.b("\n"+i),t.b(' '),t.b("\n"+i),t.b(' '),t.b(t.v(t.f("addedLines",c,p,0))),t.b(""),t.b("\n"+i),t.b(' '),t.b(t.v(t.f("deletedLines",c,p,0))),t.b(""),t.b("\n"+i),t.b(" "),t.b("\n"+i),t.b(" "),t.b("\n"+i),t.b(""),t.fl()},partials:{"'),t.b("\n"+i),t.b('
    '),t.b("\n"+i),t.b(' Files changed ('),t.b(t.v(t.f("filesNumber",c,p,0))),t.b(")"),t.b("\n"+i),t.b(' hide'),t.b("\n"+i),t.b(' show'),t.b("\n"+i),t.b("
    "),t.b("\n"+i),t.b('
      '),t.b("\n"+i),t.b(" "),t.b(t.t(t.f("files",c,p,0))),t.b("\n"+i),t.b("
    "),t.b("\n"+i),t.b(""),t.fl()},partials:{},subs:{}}),global.browserTemplates["generic-column-line-number"]=new Hogan.Template({code:function(c,p,i){var t=this;return t.b(i=i||""),t.b(""),t.b("\n"+i),t.b(' '),t.b("\n"+i),t.b(' '),t.b("\n"+i),t.b('
    '),t.b(t.t(t.f("blockHeader",c,p,0))),t.b("
    "),t.b("\n"+i),t.b(" "),t.b("\n"+i),t.b(""),t.fl()},partials:{},subs:{}}),global.browserTemplates["generic-empty-diff"]=new Hogan.Template({code:function(c,p,i){var t=this;return t.b(i=i||""),t.b(""),t.b("\n"+i),t.b(' '),t.b("\n"+i),t.b('
    '),t.b("\n"+i),t.b(" File without changes"),t.b("\n"+i),t.b("
    "),t.b("\n"+i),t.b(" "),t.b("\n"+i),t.b(""),t.fl()},partials:{},subs:{}}),global.browserTemplates["generic-file-path"]=new Hogan.Template({code:function(c,p,i){var t=this;return t.b(i=i||""),t.b(''),t.b("\n"+i),t.b(t.rp("'),t.b(t.v(t.f("fileDiffName",c,p,0))),t.b(""),t.b("\n"+i),t.b(t.rp(""),t.fl()},partials:{""),t.b("\n"+i),t.b(' '),t.b("\n"+i),t.b(" "),t.b(t.t(t.f("lineNumber",c,p,0))),t.b("\n"+i),t.b(" "),t.b("\n"+i),t.b(' '),t.b("\n"+i),t.b('
    '),t.b("\n"+i),t.s(t.f("prefix",c,p,1),c,p,0,171,247,"{{ }}")&&(t.rs(c,p,function(c,p,t){t.b(' '),t.b(t.t(t.f("prefix",c,p,0))),t.b(""),t.b("\n"+i)}),c.pop()),t.s(t.f("content",c,p,1),c,p,0,279,353,"{{ }}")&&(t.rs(c,p,function(c,p,t){t.b(' '),t.b(t.t(t.f("content",c,p,0))),t.b(""),t.b("\n"+i)}),c.pop()),t.b("
    "),t.b("\n"+i),t.b(" "),t.b("\n"+i),t.b(""),t.fl()},partials:{},subs:{}}),global.browserTemplates["generic-wrapper"]=new Hogan.Template({code:function(c,p,i){var t=this;return t.b(i=i||""),t.b('
    '),t.b("\n"+i),t.b(" "),t.b(t.t(t.f("content",c,p,0))),t.b("\n"+i),t.b("
    "),t.fl()},partials:{},subs:{}}),global.browserTemplates["icon-file-added"]=new Hogan.Template({code:function(c,p,i){var t=this;return t.b(i=i||""),t.b('"),t.fl()},partials:{},subs:{}}),global.browserTemplates["icon-file-changed"]=new Hogan.Template({code:function(c,p,i){var t=this;return t.b(i=i||""),t.b('"),t.fl()},partials:{},subs:{}}),global.browserTemplates["icon-file-deleted"]=new Hogan.Template({code:function(c,p,i){var t=this;return t.b(i=i||""),t.b('"),t.fl()},partials:{},subs:{}}),global.browserTemplates["icon-file-renamed"]=new Hogan.Template({code:function(c,p,i){var t=this;return t.b(i=i||""),t.b('"),t.fl()},partials:{},subs:{}}),global.browserTemplates["icon-file"]=new Hogan.Template({code:function(c,p,i){var t=this;return t.b(i=i||""),t.b('"),t.fl()},partials:{},subs:{}}),global.browserTemplates["line-by-line-file-diff"]=new Hogan.Template({code:function(c,p,i){var t=this;return t.b(i=i||""),t.b('
    '),t.b("\n"+i),t.b('
    '),t.b("\n"+i),t.b(" "),t.b(t.t(t.f("filePath",c,p,0))),t.b("\n"+i),t.b("
    "),t.b("\n"+i),t.b('
    '),t.b("\n"+i),t.b('
    '),t.b("\n"+i),t.b(' '),t.b("\n"+i),t.b(' '),t.b("\n"+i),t.b(" "),t.b(t.t(t.f("diffs",c,p,0))),t.b("\n"+i),t.b(" "),t.b("\n"+i),t.b("
    "),t.b("\n"+i),t.b("
    "),t.b("\n"+i),t.b("
    "),t.b("\n"+i),t.b("
    "),t.fl()},partials:{},subs:{}}),global.browserTemplates["line-by-line-numbers"]=new Hogan.Template({code:function(c,p,i){var t=this;return t.b(i=i||""),t.b('
    '),t.b(t.v(t.f("oldNumber",c,p,0))),t.b("
    "),t.b("\n"+i),t.b('
    '),t.b(t.v(t.f("newNumber",c,p,0))),t.b("
    "),t.fl()},partials:{},subs:{}}),global.browserTemplates["side-by-side-file-diff"]=new Hogan.Template({code:function(c,p,i){var t=this;return t.b(i=i||""),t.b('
    '),t.b("\n"+i),t.b('
    '),t.b("\n"+i),t.b(" "),t.b(t.t(t.f("filePath",c,p,0))),t.b("\n"+i),t.b("
    "),t.b("\n"+i),t.b('
    '),t.b("\n"+i),t.b('
    '),t.b("\n"+i),t.b('
    '),t.b("\n"+i),t.b(' '),t.b("\n"+i),t.b(' '),t.b("\n"+i),t.b(" "),t.b(t.t(t.d("diffs.left",c,p,0))),t.b("\n"+i),t.b(" "),t.b("\n"+i),t.b("
    "),t.b("\n"+i),t.b("
    "),t.b("\n"+i),t.b("
    "),t.b("\n"+i),t.b('
    '),t.b("\n"+i),t.b('
    '),t.b("\n"+i),t.b(' '),t.b("\n"+i),t.b(' '),t.b("\n"+i),t.b(" "),t.b(t.t(t.d("diffs.right",c,p,0))),t.b("\n"+i),t.b(" "),t.b("\n"+i),t.b("
    "),t.b("\n"+i),t.b("
    "),t.b("\n"+i),t.b("
    "),t.b("\n"+i),t.b("
    "),t.b("\n"+i),t.b("
    "),t.fl()},partials:{},subs:{}}),global.browserTemplates["tag-file-added"]=new Hogan.Template({code:function(c,p,i){var t=this;return t.b(i=i||""),t.b('ADDED'),t.fl()},partials:{},subs:{}}),global.browserTemplates["tag-file-changed"]=new Hogan.Template({code:function(c,p,i){var t=this;return t.b(i=i||""),t.b('CHANGED'),t.fl()},partials:{},subs:{}}),global.browserTemplates["tag-file-deleted"]=new Hogan.Template({code:function(c,p,i){var t=this;return t.b(i=i||""),t.b('DELETED'),t.fl()},partials:{},subs:{}}),global.browserTemplates["tag-file-renamed"]=new Hogan.Template({code:function(c,p,i){var t=this;return t.b(i=i||""),t.b('RENAMED'),t.fl()},partials:{},subs:{}}),module.exports=global.browserTemplates}()}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"hogan.js":4}],19:[function(require,module,exports){function Utils(){}var merge;merge=require("merge"),Utils.prototype.escape=function(str){return str.slice(0).replace(/&/g,"&").replace(//g,">").replace(/"/g,""").replace(/'/g,"'").replace(/\//g,"/")},Utils.prototype.startsWith=function(str,start){if("object"!=typeof start)return str&&0===str.indexOf(start);var result=!1;return start.forEach(function(s){0===str.indexOf(s)&&(result=!0)}),result},Utils.prototype.valueOrEmpty=function(value){return value||""},Utils.prototype.safeConfig=function(cfg,defaultConfig){return merge.recursive(!0,defaultConfig,cfg)},module.exports.Utils=new Utils},{merge:6}]},{},[10]); \ No newline at end of file diff --git a/docs/CNAME b/docs/CNAME deleted file mode 100644 index 62ff2fd..0000000 --- a/docs/CNAME +++ /dev/null @@ -1 +0,0 @@ -diff2html.xyz \ No newline at end of file diff --git a/docs/assets b/docs/assets deleted file mode 120000 index 85d8c32..0000000 --- a/docs/assets +++ /dev/null @@ -1 +0,0 @@ -../dist \ No newline at end of file diff --git a/docs/demo.html b/docs/demo.html deleted file mode 100644 index 938d8ea..0000000 --- a/docs/demo.html +++ /dev/null @@ -1,255 +0,0 @@ - - - - - - - - - - - - diff2html - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    - -
    - - -

    Diff Prettifier - - -

    -

    GitHub, Bitbucket and GitLab commit and pull request compatible

    -

    Just paste the GitHub, Bitbucket or GitLab commit, pull request or merge request url - or any other git or unified compatible diff and we will render a pretty html representation of it - with code syntax highlight and line similarity matching for better code reviews. -

    -

    Options:

    -
    -
    - -
    -
    - -
    -
    - -
    -
    - -
    -
    - -
    -
    -
    -
    - - Load -
    -
    -
    -
    -
    -

    Help:

    -
      -
    • - Why should I use this instead of GitHub, Bitbucket or GitLab? -

      Code Syntax Highlight

      -

      Line similarity match (similar lines are together)

      -

      Line by Line and Side by Side diffs

      -

      Supports any git and unified compatible diffs

      -

      Easy code selection

      -
    • -
    • - What urls are supported? -

      Any GitHub, Bitbucket or GitLab Commit, Pull Request or Merge Request urls.

      -

      Any Git or Unified Raw Diff or Patch urls.

      -
    • -
    • - Can I send a custom url for a friend, colleague or co-worker? -

      Just add a url parameter called diff to current url using as value your Commit, Pull Request, Merge Request, Diff - or Patch url.

      -

      ex: https://diff2html.xyz/demo.html?diff=https://github.com/rtfpessoa/diff2html/pull/106 -

      -
    • -
    • - Why can't I paste a diff? -

      diffy.org is an amazing tool created by pbu88 - to share your diffs and uses diff2html under the hood.

      -

      Also, diff2html cli can directly publish diffs to diffy.org

      -
    • -
    -
    -

    Thank you

    -

    I want to thank kevinsimper for this great idea, - providing better diff support for existing online services. -

    - - -
    - - - -
    - - - - - - - - - - - - - - - - - - - - diff --git a/docs/demo.js b/docs/demo.js deleted file mode 100644 index a81d602..0000000 --- a/docs/demo.js +++ /dev/null @@ -1,769 +0,0 @@ -(function(){function r(e,n,t){function o(i,f){if(!n[i]){if(!e[i]){var c="function"==typeof require&&require;if(!f&&c)return c(i,!0);if(u)return u(i,!0);var a=new Error("Cannot find module '"+i+"'");throw a.code="MODULE_NOT_FOUND",a}var p=n[i]={exports:{}};e[i][0].call(p.exports,function(r){var n=e[i][1][r];return o(n||r)},p,p.exports,r,e,n,t)}return n[i].exports}for(var u="function"==typeof require&&require,i=0;i -1 - }; - } - - function normalizeName(name) { - if (typeof name !== 'string') { - name = String(name); - } - if (/[^a-z0-9\-#$%&'*+.^_`|~]/i.test(name)) { - throw new TypeError('Invalid character in header field name') - } - return name.toLowerCase() - } - - function normalizeValue(value) { - if (typeof value !== 'string') { - value = String(value); - } - return value - } - - // Build a destructive iterator for the value list - function iteratorFor(items) { - var iterator = { - next: function() { - var value = items.shift(); - return {done: value === undefined, value: value} - } - }; - - if (support.iterable) { - iterator[Symbol.iterator] = function() { - return iterator - }; - } - - return iterator - } - - function Headers(headers) { - this.map = {}; - - if (headers instanceof Headers) { - headers.forEach(function(value, name) { - this.append(name, value); - }, this); - } else if (Array.isArray(headers)) { - headers.forEach(function(header) { - this.append(header[0], header[1]); - }, this); - } else if (headers) { - Object.getOwnPropertyNames(headers).forEach(function(name) { - this.append(name, headers[name]); - }, this); - } - } - - Headers.prototype.append = function(name, value) { - name = normalizeName(name); - value = normalizeValue(value); - var oldValue = this.map[name]; - this.map[name] = oldValue ? oldValue + ', ' + value : value; - }; - - Headers.prototype['delete'] = function(name) { - delete this.map[normalizeName(name)]; - }; - - Headers.prototype.get = function(name) { - name = normalizeName(name); - return this.has(name) ? this.map[name] : null - }; - - Headers.prototype.has = function(name) { - return this.map.hasOwnProperty(normalizeName(name)) - }; - - Headers.prototype.set = function(name, value) { - this.map[normalizeName(name)] = normalizeValue(value); - }; - - Headers.prototype.forEach = function(callback, thisArg) { - for (var name in this.map) { - if (this.map.hasOwnProperty(name)) { - callback.call(thisArg, this.map[name], name, this); - } - } - }; - - Headers.prototype.keys = function() { - var items = []; - this.forEach(function(value, name) { - items.push(name); - }); - return iteratorFor(items) - }; - - Headers.prototype.values = function() { - var items = []; - this.forEach(function(value) { - items.push(value); - }); - return iteratorFor(items) - }; - - Headers.prototype.entries = function() { - var items = []; - this.forEach(function(value, name) { - items.push([name, value]); - }); - return iteratorFor(items) - }; - - if (support.iterable) { - Headers.prototype[Symbol.iterator] = Headers.prototype.entries; - } - - function consumed(body) { - if (body.bodyUsed) { - return Promise.reject(new TypeError('Already read')) - } - body.bodyUsed = true; - } - - function fileReaderReady(reader) { - return new Promise(function(resolve, reject) { - reader.onload = function() { - resolve(reader.result); - }; - reader.onerror = function() { - reject(reader.error); - }; - }) - } - - function readBlobAsArrayBuffer(blob) { - var reader = new FileReader(); - var promise = fileReaderReady(reader); - reader.readAsArrayBuffer(blob); - return promise - } - - function readBlobAsText(blob) { - var reader = new FileReader(); - var promise = fileReaderReady(reader); - reader.readAsText(blob); - return promise - } - - function readArrayBufferAsText(buf) { - var view = new Uint8Array(buf); - var chars = new Array(view.length); - - for (var i = 0; i < view.length; i++) { - chars[i] = String.fromCharCode(view[i]); - } - return chars.join('') - } - - function bufferClone(buf) { - if (buf.slice) { - return buf.slice(0) - } else { - var view = new Uint8Array(buf.byteLength); - view.set(new Uint8Array(buf)); - return view.buffer - } - } - - function Body() { - this.bodyUsed = false; - - this._initBody = function(body) { - this._bodyInit = body; - if (!body) { - this._bodyText = ''; - } else if (typeof body === 'string') { - this._bodyText = body; - } else if (support.blob && Blob.prototype.isPrototypeOf(body)) { - this._bodyBlob = body; - } else if (support.formData && FormData.prototype.isPrototypeOf(body)) { - this._bodyFormData = body; - } else if (support.searchParams && URLSearchParams.prototype.isPrototypeOf(body)) { - this._bodyText = body.toString(); - } else if (support.arrayBuffer && support.blob && isDataView(body)) { - this._bodyArrayBuffer = bufferClone(body.buffer); - // IE 10-11 can't handle a DataView body. - this._bodyInit = new Blob([this._bodyArrayBuffer]); - } else if (support.arrayBuffer && (ArrayBuffer.prototype.isPrototypeOf(body) || isArrayBufferView(body))) { - this._bodyArrayBuffer = bufferClone(body); - } else { - this._bodyText = body = Object.prototype.toString.call(body); - } - - if (!this.headers.get('content-type')) { - if (typeof body === 'string') { - this.headers.set('content-type', 'text/plain;charset=UTF-8'); - } else if (this._bodyBlob && this._bodyBlob.type) { - this.headers.set('content-type', this._bodyBlob.type); - } else if (support.searchParams && URLSearchParams.prototype.isPrototypeOf(body)) { - this.headers.set('content-type', 'application/x-www-form-urlencoded;charset=UTF-8'); - } - } - }; - - if (support.blob) { - this.blob = function() { - var rejected = consumed(this); - if (rejected) { - return rejected - } - - if (this._bodyBlob) { - return Promise.resolve(this._bodyBlob) - } else if (this._bodyArrayBuffer) { - return Promise.resolve(new Blob([this._bodyArrayBuffer])) - } else if (this._bodyFormData) { - throw new Error('could not read FormData body as blob') - } else { - return Promise.resolve(new Blob([this._bodyText])) - } - }; - - this.arrayBuffer = function() { - if (this._bodyArrayBuffer) { - return consumed(this) || Promise.resolve(this._bodyArrayBuffer) - } else { - return this.blob().then(readBlobAsArrayBuffer) - } - }; - } - - this.text = function() { - var rejected = consumed(this); - if (rejected) { - return rejected - } - - if (this._bodyBlob) { - return readBlobAsText(this._bodyBlob) - } else if (this._bodyArrayBuffer) { - return Promise.resolve(readArrayBufferAsText(this._bodyArrayBuffer)) - } else if (this._bodyFormData) { - throw new Error('could not read FormData body as text') - } else { - return Promise.resolve(this._bodyText) - } - }; - - if (support.formData) { - this.formData = function() { - return this.text().then(decode) - }; - } - - this.json = function() { - return this.text().then(JSON.parse) - }; - - return this - } - - // HTTP methods whose capitalization should be normalized - var methods = ['DELETE', 'GET', 'HEAD', 'OPTIONS', 'POST', 'PUT']; - - function normalizeMethod(method) { - var upcased = method.toUpperCase(); - return methods.indexOf(upcased) > -1 ? upcased : method - } - - function Request(input, options) { - options = options || {}; - var body = options.body; - - if (input instanceof Request) { - if (input.bodyUsed) { - throw new TypeError('Already read') - } - this.url = input.url; - this.credentials = input.credentials; - if (!options.headers) { - this.headers = new Headers(input.headers); - } - this.method = input.method; - this.mode = input.mode; - this.signal = input.signal; - if (!body && input._bodyInit != null) { - body = input._bodyInit; - input.bodyUsed = true; - } - } else { - this.url = String(input); - } - - this.credentials = options.credentials || this.credentials || 'same-origin'; - if (options.headers || !this.headers) { - this.headers = new Headers(options.headers); - } - this.method = normalizeMethod(options.method || this.method || 'GET'); - this.mode = options.mode || this.mode || null; - this.signal = options.signal || this.signal; - this.referrer = null; - - if ((this.method === 'GET' || this.method === 'HEAD') && body) { - throw new TypeError('Body not allowed for GET or HEAD requests') - } - this._initBody(body); - } - - Request.prototype.clone = function() { - return new Request(this, {body: this._bodyInit}) - }; - - function decode(body) { - var form = new FormData(); - body - .trim() - .split('&') - .forEach(function(bytes) { - if (bytes) { - var split = bytes.split('='); - var name = split.shift().replace(/\+/g, ' '); - var value = split.join('=').replace(/\+/g, ' '); - form.append(decodeURIComponent(name), decodeURIComponent(value)); - } - }); - return form - } - - function parseHeaders(rawHeaders) { - var headers = new Headers(); - // Replace instances of \r\n and \n followed by at least one space or horizontal tab with a space - // https://tools.ietf.org/html/rfc7230#section-3.2 - var preProcessedHeaders = rawHeaders.replace(/\r?\n[\t ]+/g, ' '); - preProcessedHeaders.split(/\r?\n/).forEach(function(line) { - var parts = line.split(':'); - var key = parts.shift().trim(); - if (key) { - var value = parts.join(':').trim(); - headers.append(key, value); - } - }); - return headers - } - - Body.call(Request.prototype); - - function Response(bodyInit, options) { - if (!options) { - options = {}; - } - - this.type = 'default'; - this.status = options.status === undefined ? 200 : options.status; - this.ok = this.status >= 200 && this.status < 300; - this.statusText = 'statusText' in options ? options.statusText : 'OK'; - this.headers = new Headers(options.headers); - this.url = options.url || ''; - this._initBody(bodyInit); - } - - Body.call(Response.prototype); - - Response.prototype.clone = function() { - return new Response(this._bodyInit, { - status: this.status, - statusText: this.statusText, - headers: new Headers(this.headers), - url: this.url - }) - }; - - Response.error = function() { - var response = new Response(null, {status: 0, statusText: ''}); - response.type = 'error'; - return response - }; - - var redirectStatuses = [301, 302, 303, 307, 308]; - - Response.redirect = function(url, status) { - if (redirectStatuses.indexOf(status) === -1) { - throw new RangeError('Invalid status code') - } - - return new Response(null, {status: status, headers: {location: url}}) - }; - - exports.DOMException = self.DOMException; - try { - new exports.DOMException(); - } catch (err) { - exports.DOMException = function(message, name) { - this.message = message; - this.name = name; - var error = Error(message); - this.stack = error.stack; - }; - exports.DOMException.prototype = Object.create(Error.prototype); - exports.DOMException.prototype.constructor = exports.DOMException; - } - - function fetch(input, init) { - return new Promise(function(resolve, reject) { - var request = new Request(input, init); - - if (request.signal && request.signal.aborted) { - return reject(new exports.DOMException('Aborted', 'AbortError')) - } - - var xhr = new XMLHttpRequest(); - - function abortXhr() { - xhr.abort(); - } - - xhr.onload = function() { - var options = { - status: xhr.status, - statusText: xhr.statusText, - headers: parseHeaders(xhr.getAllResponseHeaders() || '') - }; - options.url = 'responseURL' in xhr ? xhr.responseURL : options.headers.get('X-Request-URL'); - var body = 'response' in xhr ? xhr.response : xhr.responseText; - resolve(new Response(body, options)); - }; - - xhr.onerror = function() { - reject(new TypeError('Network request failed')); - }; - - xhr.ontimeout = function() { - reject(new TypeError('Network request failed')); - }; - - xhr.onabort = function() { - reject(new exports.DOMException('Aborted', 'AbortError')); - }; - - xhr.open(request.method, request.url, true); - - if (request.credentials === 'include') { - xhr.withCredentials = true; - } else if (request.credentials === 'omit') { - xhr.withCredentials = false; - } - - if ('responseType' in xhr && support.blob) { - xhr.responseType = 'blob'; - } - - request.headers.forEach(function(value, name) { - xhr.setRequestHeader(name, value); - }); - - if (request.signal) { - request.signal.addEventListener('abort', abortXhr); - - xhr.onreadystatechange = function() { - // DONE (success or failure) - if (xhr.readyState === 4) { - request.signal.removeEventListener('abort', abortXhr); - } - }; - } - - xhr.send(typeof request._bodyInit === 'undefined' ? null : request._bodyInit); - }) - } - - fetch.polyfill = true; - - if (!self.fetch) { - self.fetch = fetch; - self.Headers = Headers; - self.Request = Request; - self.Response = Response; - } - - exports.Headers = Headers; - exports.Request = Request; - exports.Response = Response; - exports.fetch = fetch; - - Object.defineProperty(exports, '__esModule', { value: true }); - -}))); - -},{}],2:[function(require,module,exports){ -/* global Diff2HtmlUI */ - -/* - * Example URLs: - * - * https://github.com/rtfpessoa/diff2html/commit/7d02e67f3b3386ac5d804f974d025cd7a1165839 - * https://github.com/rtfpessoa/diff2html/pull/106 - * - * https://gitlab.com/gitlab-org/gitlab-ce/commit/4e963fed42ad518caa7353d361a38a1250c99c41 - * https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/6763 - * - * https://bitbucket.org/atlassian/amps/commits/52c38116f12475f75af4a147b7a7685478b83eca - * https://bitbucket.org/atlassian/amps/pull-requests/236 - */ - -$(document).ready(function() { - // Improves browser compatibility - require('whatwg-fetch'); - - var searchParam = 'diff'; - - var $container = $('.container'); - var $url = $('#url'); - var $outputFormat = $('#diff-url-options-output-format'); - var $showFiles = $('#diff-url-options-show-files'); - var $matching = $('#diff-url-options-matching'); - var $wordsThreshold = $('#diff-url-options-match-words-threshold'); - var $matchingMaxComparisons = $('#diff-url-options-matching-max-comparisons'); - - if (window.location.search) { - var url = getUrlFromSearch(window.location.search); - $url.val(url); - smartDraw(url); - } - - bind(); - - $outputFormat - .add($showFiles) - .add($matching) - .add($wordsThreshold) - .add($matchingMaxComparisons) - .change(function(e) { - console.log(''); - console.log(e); - console.log(''); - smartDraw(null, true); - }); - - function getUrlFromSearch(search) { - try { - return search - .split('?')[1] - .split(searchParam + '=')[1] - .split('&')[0]; - } catch (_ignore) { - } - - return null; - } - - function getParamsFromSearch(search) { - var map = {}; - try { - search - .split('?')[1] - .split('&') - .map(function(e) { - var values = e.split('='); - map[values[0]] = values[1]; - }); - } catch (_ignore) { - } - - return map; - } - - function bind() { - $('#url-btn').click(function(e) { - e.preventDefault(); - var url = $url.val(); - smartDraw(url); - }); - - $url.on('paste', function(e) { - var url = e.originalEvent.clipboardData.getData('Text'); - smartDraw(url); - }); - } - - function prepareUrl(url) { - var fetchUrl; - var headers = new Headers(); - - var githubCommitUrl = /^https?:\/\/(?:www\.)?github\.com\/(.*?)\/(.*?)\/commit\/(.*?)(?:\.diff)?(?:\.patch)?(?:\/.*)?$/; - var githubPrUrl = /^https?:\/\/(?:www\.)?github\.com\/(.*?)\/(.*?)\/pull\/(.*?)(?:\.diff)?(?:\.patch)?(?:\/.*)?$/; - - var gitlabCommitUrl = /^https?:\/\/(?:www\.)?gitlab\.com\/(.*?)\/(.*?)\/commit\/(.*?)(?:\.diff)?(?:\.patch)?(?:\/.*)?$/; - var gitlabPrUrl = /^https?:\/\/(?:www\.)?gitlab\.com\/(.*?)\/(.*?)\/merge_requests\/(.*?)(?:\.diff)?(?:\.patch)?(?:\/.*)?$/; - - var bitbucketCommitUrl = /^https?:\/\/(?:www\.)?bitbucket\.org\/(.*?)\/(.*?)\/commits\/(.*?)(?:\/raw)?(?:\/.*)?$/; - var bitbucketPrUrl = /^https?:\/\/(?:www\.)?bitbucket\.org\/(.*?)\/(.*?)\/pull-requests\/(.*?)(?:\/.*)?$/; - - function gitLabUrlGen(userName, projectName, type, value) { - return 'https://crossorigin.me/https://gitlab.com/' + userName + '/' + projectName + '/' + type + '/' + value + '.diff'; - } - - function gitHubUrlGen(userName, projectName, type, value) { - headers.append('Accept', 'application/vnd.github.v3.diff'); - return 'https://api.github.com/repos/' + userName + '/' + projectName + '/' + type + '/' + value; - } - - function bitbucketUrlGen(userName, projectName, type, value) { - var baseUrl = 'https://bitbucket.org/api/2.0/repositories/'; - if (type === 'pullrequests') { - return baseUrl + userName + '/' + projectName + '/pullrequests/' + value + '/diff'; - } - return baseUrl + userName + '/' + projectName + '/diff/' + value; - } - - var values; - if ((values = githubCommitUrl.exec(url))) { - fetchUrl = gitHubUrlGen(values[1], values[2], 'commits', values[3]); - } else if ((values = githubPrUrl.exec(url))) { - fetchUrl = gitHubUrlGen(values[1], values[2], 'pulls', values[3]); - } else if ((values = gitlabCommitUrl.exec(url))) { - fetchUrl = gitLabUrlGen(values[1], values[2], 'commit', values[3]); - } else if ((values = gitlabPrUrl.exec(url))) { - fetchUrl = gitLabUrlGen(values[1], values[2], 'merge_requests', values[3]); - } else if ((values = bitbucketCommitUrl.exec(url))) { - fetchUrl = bitbucketUrlGen(values[1], values[2], 'commit', values[3]); - } else if ((values = bitbucketPrUrl.exec(url))) { - fetchUrl = bitbucketUrlGen(values[1], values[2], 'pullrequests', values[3]); - } else { - console.info('Could not parse url, using the provided url.'); - fetchUrl = 'https://crossorigin.me/' + url; - } - - return { - originalUrl: url, - url: fetchUrl, - headers: headers - }; - } - - function smartDraw(urlOpt, forced) { - var url = urlOpt || $url.val(); - var req = prepareUrl(url); - draw(req, forced); - } - - function draw(req, forced) { - if (!validateUrl(req.url)) { - console.error('Invalid url provided!'); - return; - } - - if (validateUrl(req.originalUrl)) updateUrl(req.originalUrl); - - var outputFormat = $outputFormat.val(); - var showFiles = $showFiles.is(':checked'); - var matching = $matching.val(); - var wordsThreshold = $wordsThreshold.val(); - var matchingMaxComparisons = $matchingMaxComparisons.val(); - - fetch(req.url, { - method: 'GET', - headers: req.headers, - mode: 'cors', - cache: 'default' - }) - .then(function(res) { - return res.text(); - }) - .then(function(data) { - var container = '#url-diff-container'; - var diff2htmlUi = new Diff2HtmlUI({diff: data}); - - if (outputFormat === 'side-by-side') { - $container.css({'width': '100%'}); - } else { - $container.css({'width': ''}); - } - - var params = getParamsFromSearch(window.location.search); - delete params[searchParam]; - - if (forced) { - params['outputFormat'] = outputFormat; - params['showFiles'] = showFiles; - params['matching'] = matching; - params['wordsThreshold'] = wordsThreshold; - params['matchingMaxComparisons'] = matchingMaxComparisons; - } else { - params['outputFormat'] = params['outputFormat'] || outputFormat; - params['showFiles'] = String(params['showFiles']) !== 'false' || (params['showFiles'] === null && showFiles); - params['matching'] = params['matching'] || matching; - params['wordsThreshold'] = params['wordsThreshold'] || wordsThreshold; - params['matchingMaxComparisons'] = params['matchingMaxComparisons'] || matchingMaxComparisons; - - $outputFormat.val(params['outputFormat']); - $showFiles.prop('checked', params['showFiles']); - $matching.val(params['matching']); - $wordsThreshold.val(params['wordsThreshold']); - $matchingMaxComparisons.val(params['matchingMaxComparisons']); - } - - params['synchronisedScroll'] = params['synchronisedScroll'] || true; - - diff2htmlUi.draw(container, params); - diff2htmlUi.fileListCloseable(container, params['fileListCloseable'] || false); - if (params['highlight'] === undefined || params['highlight']) { - diff2htmlUi.highlightCode(container); - } - }); - } - - function validateUrl(url) { - return /^(?:(?:(?:https?|ftp):)?\/\/)(?:\S+(?::\S*)?@)?(?:(?!(?:10|127)(?:\.\d{1,3}){3})(?!(?:169\.254|192\.168)(?:\.\d{1,3}){2})(?!172\.(?:1[6-9]|2\d|3[0-1])(?:\.\d{1,3}){2})(?:[1-9]\d?|1\d\d|2[01]\d|22[0-3])(?:\.(?:1?\d{1,2}|2[0-4]\d|25[0-5])){2}(?:\.(?:[1-9]\d?|1\d\d|2[0-4]\d|25[0-4]))|(?:(?:[a-z\u00a1-\uffff0-9]-*)*[a-z\u00a1-\uffff0-9]+)(?:\.(?:[a-z\u00a1-\uffff0-9]-*)*[a-z\u00a1-\uffff0-9]+)*(?:\.(?:[a-z\u00a1-\uffff]{2,})).?)(?::\d{2,5})?(?:[/?#]\S*)?$/i.test(url); - } - - function updateUrl(url) { - var params = getParamsFromSearch(window.location.search); - - if (params[searchParam] === url) return; - - params[searchParam] = url; - - var paramString = Object.keys(params).map(function(k) { return k + '=' + params[k]; }).join('&'); - - window.location = 'demo.html?' + paramString; - } -}); - -},{"whatwg-fetch":1}]},{},[2]); diff --git a/docs/demo.min.js b/docs/demo.min.js deleted file mode 100644 index 63d41d1..0000000 --- a/docs/demo.min.js +++ /dev/null @@ -1 +0,0 @@ -!function r(e,n,t){function o(i,f){if(!n[i]){if(!e[i]){var c="function"==typeof require&&require;if(!f&&c)return c(i,!0);if(u)return u(i,!0);var a=new Error("Cannot find module '"+i+"'");throw a.code="MODULE_NOT_FOUND",a}var p=n[i]={exports:{}};e[i][0].call(p.exports,function(r){return o(e[i][1][r]||r)},p,p.exports,r,e,n,t)}return n[i].exports}for(var u="function"==typeof require&&require,i=0;i - - - - - - - - - - - diff2html - - - - - - - - - - - - - - - - - - - - - - -
    - -
    - - -
    - - diff2html - -

    Diff parser and pretty html generator

    -

    Better diffs, unmatched reviews.

    -

    Demo

    - -
    - - - - - - - - - -
    -
    - -
    -
    -
    -

    Each diff provides a comprehensive visualization of the code changes, - helping developers identify problems and better understand the changes.

    -
    -
    - -
    -
    - - - -
    Line by Line and Side by Side changes
    -

    Each diff features a line by line and side by side preview of your - changes.

    -
    - -
    - - - -
    Code syntax highlight
    -

    All the code changes are syntax highlighted using highlight.js, - providing more readability.

    -
    - -
    - - - -
    Line similarity matching
    -

    Similar lines are paired, allowing for easier change tracking.

    -
    -
    - -
    -
    -
    -
    -

    Install with Bower

    -

    You can install and manage diff2html's CSS and JS using Bower:

    -
    -

    > $ bower install diff2html

    - Copy -
    -
    -
    -
    -
    -

    Install with npm

    -

    You can also install diff2html using npm:

    -
    -

    > $ npm install diff2html

    - Copy -
    -
    -
    - -
    -
    - -
    -
    -

    With command line integration

    -

    We work hard to make sure you can have your diffs in a simple and flexible - way. Go here full - documentation.

    -
    -
    -
    -

    - > $ npm install -g diff2html-cli
    - diff2html cli installed! -

    -

    - > $ diff2html
    - Previous commit changes on your browser -

    -

    - > $ is that it?
    - Yup, it's that simple.
    -

    -
    -
    -
    - -
    -
    -
    -
    -

    Projects using diff2html

    -
    -
    -
    -
    -
    -
    -
    diff2html-cli
    -

    diff2html from your terminal to the browser.

    - - View GitHub - -
    -
    -
    -
    -
    -
    -
    Codacy
    -

    Check code style, security, duplication, complexity and coverage on every change.

    - - Website - -
    -
    -
    -
    -
    -
    -
    Ungit
    -

    The easiest way to use git. On any platform. Anywhere.

    - - View GitHub - -
    -
    -
    -
    -
    -
    -
    Diffy
    -

    Share your diffs and explain your ideas without committing.

    - - Website - -
    -
    -
    -
    -
    -
    -
    diff-pane
    -

    Atom - Diff two panes.

    - - View GitHub - -
    -
    -
    -
    -
    -
    -
    node-giff
    -

    Display git diff on browser.

    - - View GitHub - -
    -
    -
    -
    -
    -
    -
    edgar-monitor
    -

    A module that processes new Edgar filings and sends out - notifications.

    - - View GitHub - -
    -
    -
    -
    -
    -
    -
    node-git
    -

    Execute Git Command by Node.js.

    - - View GitHub - -
    -
    -
    -
    -
    -
    -
    Jenkins
    -

    Show diffs between builds

    - - Website - -
    -
    -
    -
    -
    -
    -
    Light Review
    -

    Code Reviews with maximum control for the leading developers

    - - Website - -
    -
    -
    -
    -
    -
    -
    Simple Git
    -

    A simple package to be able to drive GIT

    - - View GitHub - -
    -
    -
    -
    -
    -
    - -
    -
    -

    Open Source

    -

    diff2html is open source. - If you'd like to be part of the diff2html community or help us improve, - find us on GitHub and - Gitter. Need any help? -

    - - Read more in the Docs - -
    -
    - -
    - - -
    - - - -
    - - - - - - - - - - - - - diff --git a/docs/main.css b/docs/main.css deleted file mode 100644 index 020636b..0000000 --- a/docs/main.css +++ /dev/null @@ -1,564 +0,0 @@ -/*! - * Copyright Colossal 2015 - * Adapted by @rtfpessoa - */ - -.template-index { - width: 100%; -} - -.template-index-min { - min-width: 700px; -} - -.container { - width: 100%; - padding: 0 8%; -} - -.m-b-md { - margin-bottom: 23px !important -} - -.p-t { - padding-top: 15px !important -} - -@media (min-width: 768px) { - p.m-b { - height: 75px; - overflow-y: hidden; - } -} - -.btn { - display: inline-block; - color: #fff; - background: #26A65B; - font-weight: 400 -} - -.btn:hover { - color: #fff; - background: #5dbe5d; -} - -.btn-clipboard { - position: absolute; - top: 0; - right: 0; - z-index: 10; - display: block; - padding: 5px 8px; - font-size: 12px; - color: #fff; - background-color: #767676; - border-radius: 0 4px 0 4px; - cursor: pointer; -} - -.btn-clipboard:hover { - color: #000; - background-color: #dcdfe4; -} - -.footer { - position: relative; - padding: 40px 0; - text-align: center; - font-size: 14px; - border-top: 1px solid #dcdfe4 -} - -.footer p { - margin-bottom: 5px -} - -.footer a { - color: #26A65B; -} - -.container a { - color: #26A65B; -} - -.container a.btn { - color: #fff; -} - -.footer-list-item { - display: inline-block -} - -.footer-list-item:not(:last-child):after { - content: "\b7" -} - -.footer > ul { - padding: 0; -} - -@media (min-width: 768px) { - .footer { - padding: 60px 0; - } -} - -@media (min-width: 768px) { - .row-centered { - display: flex; - align-items: center; - } -} - -.row-bordered { - position: relative -} - -.row-bordered:before { - content: ''; - display: block; - width: 80%; - position: absolute; - bottom: 0; - left: 50%; - margin-left: -40%; - height: 1px; - background: radial-gradient(ellipse at center, rgba(0, 0, 0, 0.2) 0, rgba(255, 255, 255, 0) 75%) -} - -.hero { - position: relative; - text-align: center; - padding: 80px 0; - border-bottom: 1px solid #dcdfe4 -} - -.hero-booticon { - font-family: Helvetica Neue, Helvetica, Arial, sans-serif; - margin: 0 auto 30px; - width: 100%; - font-size: 8vw; - display: block; - font-weight: 500; - text-align: center; - cursor: default; -} - -.hero-homepage.hero { - padding-top: 0; - padding-bottom: 40px; - overflow: hidden; - border-bottom: 0; - border-bottom: 1px solid #dcdfe4; -} - -.hero-homepage > .btn { - margin-top: 20px -} - -.swag-line:before { - content: ''; - position: fixed; - display: block; - top: 0; - left: 0; - right: 0; - height: 5px; - z-index: 2; - background-color: #26A65B; - background: linear-gradient(45deg, #28a142, #26A65B) -} - -.navbar { - background-color: #fff; - border: 0 #fff; -} - -.navbar-header { - text-align: center -} - -.navbar-brand { - height: auto; - padding: 19px 25px; - font-size: 16px; - display: inline-block; - float: none; - text-align: center; - margin: 5px 0 0 -} - -.navbar-nav { - margin-right: -15px -} - -.navbar-nav > li > a { - font-size: 14px -} - -.navbar-default .navbar-brand, .navbar-default .navbar-brand:focus, .navbar-default .navbar-brand:hover, .navbar-default .navbar-nav > li > a, .navbar-default .navbar-nav > li > a:focus, .navbar-default .navbar-nav > li > a:hover { - background: transparent; - color: #293a46; - font-weight: 300 -} - -.navbar-default .navbar-toggle { - position: absolute; - left: 0; - top: 7px; - border-color: #fff; - color: #293a46; - margin-right: 0 -} - -.navbar-default .navbar-toggle:hover, .navbar-default .navbar-toggle:focus { - background: #f9f9f9; - border-color: #f9f9f9 -} - -@media (min-width: 768px) { - .navbar-full .navbar-brand { - margin-left: -25px - } - - .navbar-tall { - height: 125px - } - - .navbar-tall .navbar-header, .navbar-tall .navbar-nav { - line-height: 125px; - text-align: left - } - - .navbar-brand { - float: none; - display: inline-block; - text-align: left; - margin: 0 - } - - .navbar-nav > li > a { - display: inline-block; - margin-left: 13px - } - - .navbar-nav > li:first-child > a { - margin-left: 0 - } - -} - -.screenshot { - display: block; - overflow: hidden; -} - -.screenshot > img { - width: 100% -} - -.screenshots-fan { - margin-top: 50px -} - -.screenshots-fan .screenshot { - position: relative; - width: auto; - display: inline-block; - text-align: center; -} - -.screenshots-fan .screenshot:last-child, .screenshots-fan .screenshot:first-child { - z-index: 2 -} - -.screenshots-fan .screenshot { - z-index: 3 -} - -@media (min-width: 768px) { - .screenshots-fan { - position: relative; - overflow: hidden; - margin-top: 60px; - height: 200px - } - - .screenshots-fan .screenshot { - height: auto; - top: 10px; - width: 350px - } - - .screenshots-fan .screenshot:first-child, .screenshots-fan .screenshot:last-child { - width: 250px; - position: absolute; - top: 65px - } - - .screenshots-fan .screenshot:first-child { - left: 10px - } - - .screenshots-fan .screenshot:last-child { - left: auto; - right: 10px - } -} - -@media (min-width: 992px) { - .screenshots-fan { - margin-top: 60px; - height: 240px - } - - .screenshots-fan .screenshot { - width: 400px - } - - .screenshots-fan .screenshot:first-child, .screenshots-fan .screenshot:last-child { - width: 300px - } -} - -@media (min-width: 1200px) { - .screenshots-fan { - margin-top: 80px; - height: 380px - } - - .screenshots-fan .screenshot { - width: 550px - } - - .screenshots-fan .screenshot:first-child, .screenshots-fan .screenshot:last-child { - width: 450px - } -} - -body { - font-size: 16px; - font-family: Roboto, sans-serif; - font-weight: 300; - line-height: 1.6 -} - -h1 { - font-size: 26px; - font-weight: 300 -} - -h2 { - font-size: 18px; - font-weight: 300 -} - -h3 { - font-size: 26px; - font-weight: 300 -} - -h4 { - font-size: 16px; - font-weight: 300 -} - -h5 { - font-size: 16px; - font-weight: 400 -} - -h1, h2, h3, h4, h5 { - line-height: 1.4 -} - -h1, h2 { - margin: 10px 0 -} - -h5 { - margin: 6px 0 -} - -@media (min-width: 768px) { - body { - font-size: 16px; - font-family: Roboto, sans-serif; - font-weight: 300; - line-height: 1.6 - } - - h1 { - font-size: 38px; - font-weight: 300 - } - - h2 { - font-size: 26px; - font-weight: 300; - line-height: 1.4 - } - - h3 { - font-size: 26px; - font-weight: 300 - } - - h4 { - font-size: 18px; - font-weight: 300 - } - - h5 { - font-size: 16px; - font-weight: 400 - } -} - -body { - color: #293a46; -} - -a { - text-decoration: none; - color: inherit; -} - -a:hover, a:focus { - text-decoration: underline; -} - -.nav li a { - text-decoration: none; - color: inherit; -} - -.nav li a:hover { - text-decoration: underline; -} - -.text-muted { - color: #697176 -} - -.template-index h3 { - font-size: 21px; - margin-bottom: 12px -} - -.template-index h4 { - color: #697176; - line-height: 1.6 -} - -.template-index h4 a, .template-index p a { - color: #26A65B; -} - -.template-index h5 { - font-size: 17px; - margin-bottom: 8px -} - -.homepage-terminal-example, .homepage-code-example { - position: relative; - font-family: monospace; - background: #272b38; - color: #48d8a0; - border-radius: 8px; - padding: 30px -} - -.homepage-terminal-example .text-muted, -.homepage-code-example .text-muted { - color: #6a7490 -} - -@media (min-width: 768px) { - .homepage-terminal-example { - padding: 50px; - } - - .homepage-code-example { - padding: 10px; - } - - .homepage-code-example > p { - margin: 0; - } -} - -.hero-green { - color: #26A65B; -} - -.hero-black { - color: #353535; -} - -.hero-red { - color: #CB2C37; -} - -.svg-icon-large { - width: 50px; - display: block; - margin: 0 auto; -} - -.svg-icon-large > svg { - width: 100%; - height: auto; -} - -.row-padded-small { - padding: 40px 0; -} - -*.unselectable { - -webkit-touch-callout: none; - -webkit-user-select: none; - -moz-user-select: none; - -ms-user-select: none; - user-select: none; -} - -.url-diff-container { - width: 980px; -} - -.diff-url-wrapper { - display: flex; - width: 100%; -} - -.diff-url-input { - display: inline-block; - margin-right: 10px; - flex-grow: 1; - height: 31px; -} - -.diff-url-btn { - display: inline-block; - float: right; - width: 48px; -} - -.options-label-value { - font-weight: normal; -} - -.diff-url-options-container label select, -.diff-url-options-container label input { - display: block; -} - -/* 15 columns */ - -.col-md- *.col-md-15 { - width: 20%; -} - -/*# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uL3dlYnNpdGUvbWFpbi5jc3MiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUE7OztFQUdFOztBQUVGO0VBQ0UsV0FBVztBQUNiOztBQUVBO0VBQ0UsZ0JBQWdCO0FBQ2xCOztBQUVBO0VBQ0UsV0FBVztFQUNYLGFBQWE7QUFDZjs7QUFFQTtFQUNFO0FBQ0Y7O0FBRUE7RUFDRTtBQUNGOztBQUVBO0VBQ0U7SUFDRSxZQUFZO0lBQ1osa0JBQWtCO0VBQ3BCO0FBQ0Y7O0FBRUE7RUFDRSxxQkFBcUI7RUFDckIsV0FBVztFQUNYLG1CQUFtQjtFQUNuQjtBQUNGOztBQUVBO0VBQ0UsV0FBVztFQUNYLG1CQUFtQjtBQUNyQjs7QUFFQTtFQUNFLGtCQUFrQjtFQUNsQixNQUFNO0VBQ04sUUFBUTtFQUNSLFdBQVc7RUFDWCxjQUFjO0VBQ2QsZ0JBQWdCO0VBQ2hCLGVBQWU7RUFDZixXQUFXO0VBQ1gseUJBQXlCO0VBQ3pCLDBCQUEwQjtFQUMxQixlQUFlO0FBQ2pCOztBQUVBO0VBQ0UsV0FBVztFQUNYLHlCQUF5QjtBQUMzQjs7QUFFQTtFQUNFLGtCQUFrQjtFQUNsQixlQUFlO0VBQ2Ysa0JBQWtCO0VBQ2xCLGVBQWU7RUFDZjtBQUNGOztBQUVBO0VBQ0U7QUFDRjs7QUFFQTtFQUNFLGNBQWM7QUFDaEI7O0FBRUE7RUFDRSxjQUFjO0FBQ2hCOztBQUVBO0VBQ0UsV0FBVztBQUNiOztBQUVBO0VBQ0U7QUFDRjs7QUFFQTtFQUNFO0FBQ0Y7O0FBRUE7RUFDRSxVQUFVO0FBQ1o7O0FBRUE7RUFDRTtJQUNFLGVBQWU7RUFDakI7QUFDRjs7QUFFQTtFQUNFO0lBR0UsYUFBYTtJQUdiLG1CQUFtQjtFQUNyQjtBQUNGOztBQUVBO0VBQ0U7QUFDRjs7QUFFQTtFQUNFLFdBQVc7RUFDWCxjQUFjO0VBQ2QsVUFBVTtFQUNWLGtCQUFrQjtFQUNsQixTQUFTO0VBQ1QsU0FBUztFQUNULGlCQUFpQjtFQUNqQixXQUFXO0VBRVg7QUFDRjs7QUFFQTtFQUNFLGtCQUFrQjtFQUNsQixrQkFBa0I7RUFDbEIsZUFBZTtFQUNmO0FBQ0Y7O0FBRUE7RUFDRSx5REFBeUQ7RUFDekQsbUJBQW1CO0VBQ25CLFdBQVc7RUFDWCxjQUFjO0VBQ2QsY0FBYztFQUNkLGdCQUFnQjtFQUNoQixrQkFBa0I7RUFDbEIsZUFBZTtBQUNqQjs7QUFFQTtFQUNFLGNBQWM7RUFDZCxvQkFBb0I7RUFDcEIsZ0JBQWdCO0VBQ2hCLGdCQUFnQjtFQUNoQixnQ0FBZ0M7QUFDbEM7O0FBRUE7RUFDRTtBQUNGOztBQUVBO0VBQ0UsV0FBVztFQUNYLGVBQWU7RUFDZixjQUFjO0VBQ2QsTUFBTTtFQUNOLE9BQU87RUFDUCxRQUFRO0VBQ1IsV0FBVztFQUNYLFVBQVU7RUFDVix5QkFBeUI7RUFFekI7QUFDRjs7QUFFQTtFQUNFLHNCQUFzQjtFQUN0QixjQUFjO0FBQ2hCOztBQUVBO0VBQ0U7QUFDRjs7QUFFQTtFQUNFLFlBQVk7RUFDWixrQkFBa0I7RUFDbEIsZUFBZTtFQUNmLHFCQUFxQjtFQUNyQixXQUFXO0VBQ1gsa0JBQWtCO0VBQ2xCO0FBQ0Y7O0FBRUE7RUFDRTtBQUNGOztBQUVBO0VBQ0U7QUFDRjs7QUFFQTtFQUNFLHVCQUF1QjtFQUN2QixjQUFjO0VBQ2Q7QUFDRjs7QUFFQTtFQUNFLGtCQUFrQjtFQUNsQixPQUFPO0VBQ1AsUUFBUTtFQUNSLGtCQUFrQjtFQUNsQixjQUFjO0VBQ2Q7QUFDRjs7QUFFQTtFQUNFLG1CQUFtQjtFQUNuQjtBQUNGOztBQUVBO0VBQ0U7SUFDRTtFQUNGOztFQUVBO0lBQ0U7RUFDRjs7RUFFQTtJQUNFLGtCQUFrQjtJQUNsQjtFQUNGOztFQUVBO0lBQ0UsV0FBVztJQUNYLHFCQUFxQjtJQUNyQixnQkFBZ0I7SUFDaEI7RUFDRjs7RUFFQTtJQUNFLHFCQUFxQjtJQUNyQjtFQUNGOztFQUVBO0lBQ0U7RUFDRjs7QUFFRjs7QUFFQTtFQUNFLGNBQWM7RUFDZCxnQkFBZ0I7QUFDbEI7O0FBRUE7RUFDRTtBQUNGOztBQUVBO0VBQ0U7QUFDRjs7QUFFQTtFQUNFLGtCQUFrQjtFQUNsQixXQUFXO0VBQ1gscUJBQXFCO0VBQ3JCLGtCQUFrQjtBQUNwQjs7QUFFQTtFQUNFO0FBQ0Y7O0FBRUE7RUFDRTtBQUNGOztBQUVBO0VBQ0U7SUFDRSxrQkFBa0I7SUFDbEIsZ0JBQWdCO0lBQ2hCLGdCQUFnQjtJQUNoQjtFQUNGOztFQUVBO0lBQ0UsWUFBWTtJQUNaLFNBQVM7SUFDVDtFQUNGOztFQUVBO0lBQ0UsWUFBWTtJQUNaLGtCQUFrQjtJQUNsQjtFQUNGOztFQUVBO0lBQ0U7RUFDRjs7RUFFQTtJQUNFLFVBQVU7SUFDVjtFQUNGO0FBQ0Y7O0FBRUE7RUFDRTtJQUNFLGdCQUFnQjtJQUNoQjtFQUNGOztFQUVBO0lBQ0U7RUFDRjs7RUFFQTtJQUNFO0VBQ0Y7QUFDRjs7QUFFQTtFQUNFO0lBQ0UsZ0JBQWdCO0lBQ2hCO0VBQ0Y7O0VBRUE7SUFDRTtFQUNGOztFQUVBO0lBQ0U7RUFDRjtBQUNGOztBQUVBO0VBQ0UsZUFBZTtFQUNmLCtCQUErQjtFQUMvQixnQkFBZ0I7RUFDaEI7QUFDRjs7QUFFQTtFQUNFLGVBQWU7RUFDZjtBQUNGOztBQUVBO0VBQ0UsZUFBZTtFQUNmO0FBQ0Y7O0FBRUE7RUFDRSxlQUFlO0VBQ2Y7QUFDRjs7QUFFQTtFQUNFLGVBQWU7RUFDZjtBQUNGOztBQUVBO0VBQ0UsZUFBZTtFQUNmO0FBQ0Y7O0FBRUE7RUFDRTtBQUNGOztBQUVBO0VBQ0U7QUFDRjs7QUFFQTtFQUNFO0FBQ0Y7O0FBRUE7RUFDRTtJQUNFLGVBQWU7SUFDZiwrQkFBK0I7SUFDL0IsZ0JBQWdCO0lBQ2hCO0VBQ0Y7O0VBRUE7SUFDRSxlQUFlO0lBQ2Y7RUFDRjs7RUFFQTtJQUNFLGVBQWU7SUFDZixnQkFBZ0I7SUFDaEI7RUFDRjs7RUFFQTtJQUNFLGVBQWU7SUFDZjtFQUNGOztFQUVBO0lBQ0UsZUFBZTtJQUNmO0VBQ0Y7O0VBRUE7SUFDRSxlQUFlO0lBQ2Y7RUFDRjtBQUNGOztBQUVBO0VBQ0UsY0FBYztBQUNoQjs7QUFFQTtFQUNFLHFCQUFxQjtFQUNyQixjQUFjO0FBQ2hCOztBQUVBO0VBQ0UsMEJBQTBCO0FBQzVCOztBQUVBO0VBQ0UscUJBQXFCO0VBQ3JCLGNBQWM7QUFDaEI7O0FBRUE7RUFDRSwwQkFBMEI7QUFDNUI7O0FBRUE7RUFDRTtBQUNGOztBQUVBO0VBQ0UsZUFBZTtFQUNmO0FBQ0Y7O0FBRUE7RUFDRSxjQUFjO0VBQ2Q7QUFDRjs7QUFFQTtFQUNFLGNBQWM7QUFDaEI7O0FBRUE7RUFDRSxlQUFlO0VBQ2Y7QUFDRjs7QUFFQTtFQUNFLGtCQUFrQjtFQUNsQixzQkFBc0I7RUFDdEIsbUJBQW1CO0VBQ25CLGNBQWM7RUFDZCxrQkFBa0I7RUFDbEI7QUFDRjs7QUFFQTs7RUFFRTtBQUNGOztBQUVBO0VBQ0U7SUFDRSxhQUFhO0VBQ2Y7O0VBRUE7SUFDRSxhQUFhO0VBQ2Y7O0VBRUE7SUFDRSxTQUFTO0VBQ1g7QUFDRjs7QUFFQTtFQUNFLGNBQWM7QUFDaEI7O0FBRUE7RUFDRSxjQUFjO0FBQ2hCOztBQUVBO0VBQ0UsY0FBYztBQUNoQjs7QUFFQTtFQUNFLFdBQVc7RUFDWCxjQUFjO0VBQ2QsY0FBYztBQUNoQjs7QUFFQTtFQUNFLFdBQVc7RUFDWCxZQUFZO0FBQ2Q7O0FBRUE7RUFDRSxlQUFlO0FBQ2pCOztBQUVBO0VBQ0UsMkJBQTJCO0VBQzNCLHlCQUF5QjtFQUN6QixzQkFBc0I7RUFDdEIscUJBQXFCO0VBQ3JCLGlCQUFpQjtBQUNuQjs7QUFFQTtFQUNFLFlBQVk7QUFDZDs7QUFFQTtFQUNFLGFBQWE7RUFDYixXQUFXO0FBQ2I7O0FBRUE7RUFDRSxxQkFBcUI7RUFDckIsa0JBQWtCO0VBQ2xCLFlBQVk7RUFDWixZQUFZO0FBQ2Q7O0FBRUE7RUFDRSxxQkFBcUI7RUFDckIsWUFBWTtFQUNaLFdBQVc7QUFDYjs7QUFFQTtFQUNFLG1CQUFtQjtBQUNyQjs7QUFFQTs7RUFFRSxjQUFjO0FBQ2hCOztBQUVBLGVBQWU7O0FBRWY7RUFDRSxVQUFVO0FBQ1oiLCJmaWxlIjoibWFpbi5jc3MiLCJzb3VyY2VzQ29udGVudCI6WyIvKiFcbiAqIENvcHlyaWdodCBDb2xvc3NhbCAyMDE1XG4gKiBBZGFwdGVkIGJ5IEBydGZwZXNzb2FcbiAqL1xuXG4udGVtcGxhdGUtaW5kZXgge1xuICB3aWR0aDogMTAwJTtcbn1cblxuLnRlbXBsYXRlLWluZGV4LW1pbiB7XG4gIG1pbi13aWR0aDogNzAwcHg7XG59XG5cbi5jb250YWluZXIge1xuICB3aWR0aDogMTAwJTtcbiAgcGFkZGluZzogMCA4JTtcbn1cblxuLm0tYi1tZCB7XG4gIG1hcmdpbi1ib3R0b206IDIzcHggIWltcG9ydGFudFxufVxuXG4ucC10IHtcbiAgcGFkZGluZy10b3A6IDE1cHggIWltcG9ydGFudFxufVxuXG5AbWVkaWEgKG1pbi13aWR0aDogNzY4cHgpIHtcbiAgcC5tLWIge1xuICAgIGhlaWdodDogNzVweDtcbiAgICBvdmVyZmxvdy15OiBoaWRkZW47XG4gIH1cbn1cblxuLmJ0biB7XG4gIGRpc3BsYXk6IGlubGluZS1ibG9jaztcbiAgY29sb3I6ICNmZmY7XG4gIGJhY2tncm91bmQ6ICMyNkE2NUI7XG4gIGZvbnQtd2VpZ2h0OiA0MDBcbn1cblxuLmJ0bjpob3ZlciB7XG4gIGNvbG9yOiAjZmZmO1xuICBiYWNrZ3JvdW5kOiAjNWRiZTVkO1xufVxuXG4uYnRuLWNsaXBib2FyZCB7XG4gIHBvc2l0aW9uOiBhYnNvbHV0ZTtcbiAgdG9wOiAwO1xuICByaWdodDogMDtcbiAgei1pbmRleDogMTA7XG4gIGRpc3BsYXk6IGJsb2NrO1xuICBwYWRkaW5nOiA1cHggOHB4O1xuICBmb250LXNpemU6IDEycHg7XG4gIGNvbG9yOiAjZmZmO1xuICBiYWNrZ3JvdW5kLWNvbG9yOiAjNzY3Njc2O1xuICBib3JkZXItcmFkaXVzOiAwIDRweCAwIDRweDtcbiAgY3Vyc29yOiBwb2ludGVyO1xufVxuXG4uYnRuLWNsaXBib2FyZDpob3ZlciB7XG4gIGNvbG9yOiAjMDAwO1xuICBiYWNrZ3JvdW5kLWNvbG9yOiAjZGNkZmU0O1xufVxuXG4uZm9vdGVyIHtcbiAgcG9zaXRpb246IHJlbGF0aXZlO1xuICBwYWRkaW5nOiA0MHB4IDA7XG4gIHRleHQtYWxpZ246IGNlbnRlcjtcbiAgZm9udC1zaXplOiAxNHB4O1xuICBib3JkZXItdG9wOiAxcHggc29saWQgI2RjZGZlNFxufVxuXG4uZm9vdGVyIHAge1xuICBtYXJnaW4tYm90dG9tOiA1cHhcbn1cblxuLmZvb3RlciBhIHtcbiAgY29sb3I6ICMyNkE2NUI7XG59XG5cbi5jb250YWluZXIgYSB7XG4gIGNvbG9yOiAjMjZBNjVCO1xufVxuXG4uY29udGFpbmVyIGEuYnRuIHtcbiAgY29sb3I6ICNmZmY7XG59XG5cbi5mb290ZXItbGlzdC1pdGVtIHtcbiAgZGlzcGxheTogaW5saW5lLWJsb2NrXG59XG5cbi5mb290ZXItbGlzdC1pdGVtOm5vdCg6bGFzdC1jaGlsZCk6YWZ0ZXIge1xuICBjb250ZW50OiBcIlxcYjdcIlxufVxuXG4uZm9vdGVyID4gdWwge1xuICBwYWRkaW5nOiAwO1xufVxuXG5AbWVkaWEgKG1pbi13aWR0aDogNzY4cHgpIHtcbiAgLmZvb3RlciB7XG4gICAgcGFkZGluZzogNjBweCAwO1xuICB9XG59XG5cbkBtZWRpYSAobWluLXdpZHRoOiA3NjhweCkge1xuICAucm93LWNlbnRlcmVkIHtcbiAgICBkaXNwbGF5OiAtd2Via2l0LWJveDtcbiAgICBkaXNwbGF5OiAtbXMtZmxleGJveDtcbiAgICBkaXNwbGF5OiBmbGV4O1xuICAgIC13ZWJraXQtYm94LWFsaWduOiBjZW50ZXI7XG4gICAgLW1zLWZsZXgtYWxpZ246IGNlbnRlcjtcbiAgICBhbGlnbi1pdGVtczogY2VudGVyO1xuICB9XG59XG5cbi5yb3ctYm9yZGVyZWQge1xuICBwb3NpdGlvbjogcmVsYXRpdmVcbn1cblxuLnJvdy1ib3JkZXJlZDpiZWZvcmUge1xuICBjb250ZW50OiAnJztcbiAgZGlzcGxheTogYmxvY2s7XG4gIHdpZHRoOiA4MCU7XG4gIHBvc2l0aW9uOiBhYnNvbHV0ZTtcbiAgYm90dG9tOiAwO1xuICBsZWZ0OiA1MCU7XG4gIG1hcmdpbi1sZWZ0OiAtNDAlO1xuICBoZWlnaHQ6IDFweDtcbiAgYmFja2dyb3VuZDogLXdlYmtpdC1yYWRpYWwtZ3JhZGllbnQoZWxsaXBzZSBhdCBjZW50ZXIsIHJnYmEoMCwgMCwgMCwgMC4yKSAwLCByZ2JhKDI1NSwgMjU1LCAyNTUsIDApIDc1JSk7XG4gIGJhY2tncm91bmQ6IHJhZGlhbC1ncmFkaWVudChlbGxpcHNlIGF0IGNlbnRlciwgcmdiYSgwLCAwLCAwLCAwLjIpIDAsIHJnYmEoMjU1LCAyNTUsIDI1NSwgMCkgNzUlKVxufVxuXG4uaGVybyB7XG4gIHBvc2l0aW9uOiByZWxhdGl2ZTtcbiAgdGV4dC1hbGlnbjogY2VudGVyO1xuICBwYWRkaW5nOiA4MHB4IDA7XG4gIGJvcmRlci1ib3R0b206IDFweCBzb2xpZCAjZGNkZmU0XG59XG5cbi5oZXJvLWJvb3RpY29uIHtcbiAgZm9udC1mYW1pbHk6IEhlbHZldGljYSBOZXVlLCBIZWx2ZXRpY2EsIEFyaWFsLCBzYW5zLXNlcmlmO1xuICBtYXJnaW46IDAgYXV0byAzMHB4O1xuICB3aWR0aDogMTAwJTtcbiAgZm9udC1zaXplOiA4dnc7XG4gIGRpc3BsYXk6IGJsb2NrO1xuICBmb250LXdlaWdodDogNTAwO1xuICB0ZXh0LWFsaWduOiBjZW50ZXI7XG4gIGN1cnNvcjogZGVmYXVsdDtcbn1cblxuLmhlcm8taG9tZXBhZ2UuaGVybyB7XG4gIHBhZGRpbmctdG9wOiAwO1xuICBwYWRkaW5nLWJvdHRvbTogNDBweDtcbiAgb3ZlcmZsb3c6IGhpZGRlbjtcbiAgYm9yZGVyLWJvdHRvbTogMDtcbiAgYm9yZGVyLWJvdHRvbTogMXB4IHNvbGlkICNkY2RmZTQ7XG59XG5cbi5oZXJvLWhvbWVwYWdlID4gLmJ0biB7XG4gIG1hcmdpbi10b3A6IDIwcHhcbn1cblxuLnN3YWctbGluZTpiZWZvcmUge1xuICBjb250ZW50OiAnJztcbiAgcG9zaXRpb246IGZpeGVkO1xuICBkaXNwbGF5OiBibG9jaztcbiAgdG9wOiAwO1xuICBsZWZ0OiAwO1xuICByaWdodDogMDtcbiAgaGVpZ2h0OiA1cHg7XG4gIHotaW5kZXg6IDI7XG4gIGJhY2tncm91bmQtY29sb3I6ICMyNkE2NUI7XG4gIGJhY2tncm91bmQ6IC13ZWJraXQtbGluZWFyLWdyYWRpZW50KDQ1ZGVnLCAjMjhhMTQyLCAjMjZBNjVCKTtcbiAgYmFja2dyb3VuZDogbGluZWFyLWdyYWRpZW50KDQ1ZGVnLCAjMjhhMTQyLCAjMjZBNjVCKVxufVxuXG4ubmF2YmFyIHtcbiAgYmFja2dyb3VuZC1jb2xvcjogI2ZmZjtcbiAgYm9yZGVyOiAwICNmZmY7XG59XG5cbi5uYXZiYXItaGVhZGVyIHtcbiAgdGV4dC1hbGlnbjogY2VudGVyXG59XG5cbi5uYXZiYXItYnJhbmQge1xuICBoZWlnaHQ6IGF1dG87XG4gIHBhZGRpbmc6IDE5cHggMjVweDtcbiAgZm9udC1zaXplOiAxNnB4O1xuICBkaXNwbGF5OiBpbmxpbmUtYmxvY2s7XG4gIGZsb2F0OiBub25lO1xuICB0ZXh0LWFsaWduOiBjZW50ZXI7XG4gIG1hcmdpbjogNXB4IDAgMFxufVxuXG4ubmF2YmFyLW5hdiB7XG4gIG1hcmdpbi1yaWdodDogLTE1cHhcbn1cblxuLm5hdmJhci1uYXYgPiBsaSA+IGEge1xuICBmb250LXNpemU6IDE0cHhcbn1cblxuLm5hdmJhci1kZWZhdWx0IC5uYXZiYXItYnJhbmQsIC5uYXZiYXItZGVmYXVsdCAubmF2YmFyLWJyYW5kOmZvY3VzLCAubmF2YmFyLWRlZmF1bHQgLm5hdmJhci1icmFuZDpob3ZlciwgLm5hdmJhci1kZWZhdWx0IC5uYXZiYXItbmF2ID4gbGkgPiBhLCAubmF2YmFyLWRlZmF1bHQgLm5hdmJhci1uYXYgPiBsaSA+IGE6Zm9jdXMsIC5uYXZiYXItZGVmYXVsdCAubmF2YmFyLW5hdiA+IGxpID4gYTpob3ZlciB7XG4gIGJhY2tncm91bmQ6IHRyYW5zcGFyZW50O1xuICBjb2xvcjogIzI5M2E0NjtcbiAgZm9udC13ZWlnaHQ6IDMwMFxufVxuXG4ubmF2YmFyLWRlZmF1bHQgLm5hdmJhci10b2dnbGUge1xuICBwb3NpdGlvbjogYWJzb2x1dGU7XG4gIGxlZnQ6IDA7XG4gIHRvcDogN3B4O1xuICBib3JkZXItY29sb3I6ICNmZmY7XG4gIGNvbG9yOiAjMjkzYTQ2O1xuICBtYXJnaW4tcmlnaHQ6IDBcbn1cblxuLm5hdmJhci1kZWZhdWx0IC5uYXZiYXItdG9nZ2xlOmhvdmVyLCAubmF2YmFyLWRlZmF1bHQgLm5hdmJhci10b2dnbGU6Zm9jdXMge1xuICBiYWNrZ3JvdW5kOiAjZjlmOWY5O1xuICBib3JkZXItY29sb3I6ICNmOWY5Zjlcbn1cblxuQG1lZGlhIChtaW4td2lkdGg6IDc2OHB4KSB7XG4gIC5uYXZiYXItZnVsbCAubmF2YmFyLWJyYW5kIHtcbiAgICBtYXJnaW4tbGVmdDogLTI1cHhcbiAgfVxuXG4gIC5uYXZiYXItdGFsbCB7XG4gICAgaGVpZ2h0OiAxMjVweFxuICB9XG5cbiAgLm5hdmJhci10YWxsIC5uYXZiYXItaGVhZGVyLCAubmF2YmFyLXRhbGwgLm5hdmJhci1uYXYge1xuICAgIGxpbmUtaGVpZ2h0OiAxMjVweDtcbiAgICB0ZXh0LWFsaWduOiBsZWZ0XG4gIH1cblxuICAubmF2YmFyLWJyYW5kIHtcbiAgICBmbG9hdDogbm9uZTtcbiAgICBkaXNwbGF5OiBpbmxpbmUtYmxvY2s7XG4gICAgdGV4dC1hbGlnbjogbGVmdDtcbiAgICBtYXJnaW46IDBcbiAgfVxuXG4gIC5uYXZiYXItbmF2ID4gbGkgPiBhIHtcbiAgICBkaXNwbGF5OiBpbmxpbmUtYmxvY2s7XG4gICAgbWFyZ2luLWxlZnQ6IDEzcHhcbiAgfVxuXG4gIC5uYXZiYXItbmF2ID4gbGk6Zmlyc3QtY2hpbGQgPiBhIHtcbiAgICBtYXJnaW4tbGVmdDogMFxuICB9XG5cbn1cblxuLnNjcmVlbnNob3Qge1xuICBkaXNwbGF5OiBibG9jaztcbiAgb3ZlcmZsb3c6IGhpZGRlbjtcbn1cblxuLnNjcmVlbnNob3QgPiBpbWcge1xuICB3aWR0aDogMTAwJVxufVxuXG4uc2NyZWVuc2hvdHMtZmFuIHtcbiAgbWFyZ2luLXRvcDogNTBweFxufVxuXG4uc2NyZWVuc2hvdHMtZmFuIC5zY3JlZW5zaG90IHtcbiAgcG9zaXRpb246IHJlbGF0aXZlO1xuICB3aWR0aDogYXV0bztcbiAgZGlzcGxheTogaW5saW5lLWJsb2NrO1xuICB0ZXh0LWFsaWduOiBjZW50ZXI7XG59XG5cbi5zY3JlZW5zaG90cy1mYW4gLnNjcmVlbnNob3Q6bGFzdC1jaGlsZCwgLnNjcmVlbnNob3RzLWZhbiAuc2NyZWVuc2hvdDpmaXJzdC1jaGlsZCB7XG4gIHotaW5kZXg6IDJcbn1cblxuLnNjcmVlbnNob3RzLWZhbiAuc2NyZWVuc2hvdCB7XG4gIHotaW5kZXg6IDNcbn1cblxuQG1lZGlhIChtaW4td2lkdGg6IDc2OHB4KSB7XG4gIC5zY3JlZW5zaG90cy1mYW4ge1xuICAgIHBvc2l0aW9uOiByZWxhdGl2ZTtcbiAgICBvdmVyZmxvdzogaGlkZGVuO1xuICAgIG1hcmdpbi10b3A6IDYwcHg7XG4gICAgaGVpZ2h0OiAyMDBweFxuICB9XG5cbiAgLnNjcmVlbnNob3RzLWZhbiAuc2NyZWVuc2hvdCB7XG4gICAgaGVpZ2h0OiBhdXRvO1xuICAgIHRvcDogMTBweDtcbiAgICB3aWR0aDogMzUwcHhcbiAgfVxuXG4gIC5zY3JlZW5zaG90cy1mYW4gLnNjcmVlbnNob3Q6Zmlyc3QtY2hpbGQsIC5zY3JlZW5zaG90cy1mYW4gLnNjcmVlbnNob3Q6bGFzdC1jaGlsZCB7XG4gICAgd2lkdGg6IDI1MHB4O1xuICAgIHBvc2l0aW9uOiBhYnNvbHV0ZTtcbiAgICB0b3A6IDY1cHhcbiAgfVxuXG4gIC5zY3JlZW5zaG90cy1mYW4gLnNjcmVlbnNob3Q6Zmlyc3QtY2hpbGQge1xuICAgIGxlZnQ6IDEwcHhcbiAgfVxuXG4gIC5zY3JlZW5zaG90cy1mYW4gLnNjcmVlbnNob3Q6bGFzdC1jaGlsZCB7XG4gICAgbGVmdDogYXV0bztcbiAgICByaWdodDogMTBweFxuICB9XG59XG5cbkBtZWRpYSAobWluLXdpZHRoOiA5OTJweCkge1xuICAuc2NyZWVuc2hvdHMtZmFuIHtcbiAgICBtYXJnaW4tdG9wOiA2MHB4O1xuICAgIGhlaWdodDogMjQwcHhcbiAgfVxuXG4gIC5zY3JlZW5zaG90cy1mYW4gLnNjcmVlbnNob3Qge1xuICAgIHdpZHRoOiA0MDBweFxuICB9XG5cbiAgLnNjcmVlbnNob3RzLWZhbiAuc2NyZWVuc2hvdDpmaXJzdC1jaGlsZCwgLnNjcmVlbnNob3RzLWZhbiAuc2NyZWVuc2hvdDpsYXN0LWNoaWxkIHtcbiAgICB3aWR0aDogMzAwcHhcbiAgfVxufVxuXG5AbWVkaWEgKG1pbi13aWR0aDogMTIwMHB4KSB7XG4gIC5zY3JlZW5zaG90cy1mYW4ge1xuICAgIG1hcmdpbi10b3A6IDgwcHg7XG4gICAgaGVpZ2h0OiAzODBweFxuICB9XG5cbiAgLnNjcmVlbnNob3RzLWZhbiAuc2NyZWVuc2hvdCB7XG4gICAgd2lkdGg6IDU1MHB4XG4gIH1cblxuICAuc2NyZWVuc2hvdHMtZmFuIC5zY3JlZW5zaG90OmZpcnN0LWNoaWxkLCAuc2NyZWVuc2hvdHMtZmFuIC5zY3JlZW5zaG90Omxhc3QtY2hpbGQge1xuICAgIHdpZHRoOiA0NTBweFxuICB9XG59XG5cbmJvZHkge1xuICBmb250LXNpemU6IDE2cHg7XG4gIGZvbnQtZmFtaWx5OiBSb2JvdG8sIHNhbnMtc2VyaWY7XG4gIGZvbnQtd2VpZ2h0OiAzMDA7XG4gIGxpbmUtaGVpZ2h0OiAxLjZcbn1cblxuaDEge1xuICBmb250LXNpemU6IDI2cHg7XG4gIGZvbnQtd2VpZ2h0OiAzMDBcbn1cblxuaDIge1xuICBmb250LXNpemU6IDE4cHg7XG4gIGZvbnQtd2VpZ2h0OiAzMDBcbn1cblxuaDMge1xuICBmb250LXNpemU6IDI2cHg7XG4gIGZvbnQtd2VpZ2h0OiAzMDBcbn1cblxuaDQge1xuICBmb250LXNpemU6IDE2cHg7XG4gIGZvbnQtd2VpZ2h0OiAzMDBcbn1cblxuaDUge1xuICBmb250LXNpemU6IDE2cHg7XG4gIGZvbnQtd2VpZ2h0OiA0MDBcbn1cblxuaDEsIGgyLCBoMywgaDQsIGg1IHtcbiAgbGluZS1oZWlnaHQ6IDEuNFxufVxuXG5oMSwgaDIge1xuICBtYXJnaW46IDEwcHggMFxufVxuXG5oNSB7XG4gIG1hcmdpbjogNnB4IDBcbn1cblxuQG1lZGlhIChtaW4td2lkdGg6IDc2OHB4KSB7XG4gIGJvZHkge1xuICAgIGZvbnQtc2l6ZTogMTZweDtcbiAgICBmb250LWZhbWlseTogUm9ib3RvLCBzYW5zLXNlcmlmO1xuICAgIGZvbnQtd2VpZ2h0OiAzMDA7XG4gICAgbGluZS1oZWlnaHQ6IDEuNlxuICB9XG5cbiAgaDEge1xuICAgIGZvbnQtc2l6ZTogMzhweDtcbiAgICBmb250LXdlaWdodDogMzAwXG4gIH1cblxuICBoMiB7XG4gICAgZm9udC1zaXplOiAyNnB4O1xuICAgIGZvbnQtd2VpZ2h0OiAzMDA7XG4gICAgbGluZS1oZWlnaHQ6IDEuNFxuICB9XG5cbiAgaDMge1xuICAgIGZvbnQtc2l6ZTogMjZweDtcbiAgICBmb250LXdlaWdodDogMzAwXG4gIH1cblxuICBoNCB7XG4gICAgZm9udC1zaXplOiAxOHB4O1xuICAgIGZvbnQtd2VpZ2h0OiAzMDBcbiAgfVxuXG4gIGg1IHtcbiAgICBmb250LXNpemU6IDE2cHg7XG4gICAgZm9udC13ZWlnaHQ6IDQwMFxuICB9XG59XG5cbmJvZHkge1xuICBjb2xvcjogIzI5M2E0Njtcbn1cblxuYSB7XG4gIHRleHQtZGVjb3JhdGlvbjogbm9uZTtcbiAgY29sb3I6IGluaGVyaXQ7XG59XG5cbmE6aG92ZXIsIGE6Zm9jdXMge1xuICB0ZXh0LWRlY29yYXRpb246IHVuZGVybGluZTtcbn1cblxuLm5hdiBsaSBhIHtcbiAgdGV4dC1kZWNvcmF0aW9uOiBub25lO1xuICBjb2xvcjogaW5oZXJpdDtcbn1cblxuLm5hdiBsaSBhOmhvdmVyIHtcbiAgdGV4dC1kZWNvcmF0aW9uOiB1bmRlcmxpbmU7XG59XG5cbi50ZXh0LW11dGVkIHtcbiAgY29sb3I6ICM2OTcxNzZcbn1cblxuLnRlbXBsYXRlLWluZGV4IGgzIHtcbiAgZm9udC1zaXplOiAyMXB4O1xuICBtYXJnaW4tYm90dG9tOiAxMnB4XG59XG5cbi50ZW1wbGF0ZS1pbmRleCBoNCB7XG4gIGNvbG9yOiAjNjk3MTc2O1xuICBsaW5lLWhlaWdodDogMS42XG59XG5cbi50ZW1wbGF0ZS1pbmRleCBoNCBhLCAudGVtcGxhdGUtaW5kZXggcCBhIHtcbiAgY29sb3I6ICMyNkE2NUI7XG59XG5cbi50ZW1wbGF0ZS1pbmRleCBoNSB7XG4gIGZvbnQtc2l6ZTogMTdweDtcbiAgbWFyZ2luLWJvdHRvbTogOHB4XG59XG5cbi5ob21lcGFnZS10ZXJtaW5hbC1leGFtcGxlLCAuaG9tZXBhZ2UtY29kZS1leGFtcGxlIHtcbiAgcG9zaXRpb246IHJlbGF0aXZlO1xuICBmb250LWZhbWlseTogbW9ub3NwYWNlO1xuICBiYWNrZ3JvdW5kOiAjMjcyYjM4O1xuICBjb2xvcjogIzQ4ZDhhMDtcbiAgYm9yZGVyLXJhZGl1czogOHB4O1xuICBwYWRkaW5nOiAzMHB4XG59XG5cbi5ob21lcGFnZS10ZXJtaW5hbC1leGFtcGxlIC50ZXh0LW11dGVkLFxuLmhvbWVwYWdlLWNvZGUtZXhhbXBsZSAudGV4dC1tdXRlZCB7XG4gIGNvbG9yOiAjNmE3NDkwXG59XG5cbkBtZWRpYSAobWluLXdpZHRoOiA3NjhweCkge1xuICAuaG9tZXBhZ2UtdGVybWluYWwtZXhhbXBsZSB7XG4gICAgcGFkZGluZzogNTBweDtcbiAgfVxuXG4gIC5ob21lcGFnZS1jb2RlLWV4YW1wbGUge1xuICAgIHBhZGRpbmc6IDEwcHg7XG4gIH1cblxuICAuaG9tZXBhZ2UtY29kZS1leGFtcGxlID4gcCB7XG4gICAgbWFyZ2luOiAwO1xuICB9XG59XG5cbi5oZXJvLWdyZWVuIHtcbiAgY29sb3I6ICMyNkE2NUI7XG59XG5cbi5oZXJvLWJsYWNrIHtcbiAgY29sb3I6ICMzNTM1MzU7XG59XG5cbi5oZXJvLXJlZCB7XG4gIGNvbG9yOiAjQ0IyQzM3O1xufVxuXG4uc3ZnLWljb24tbGFyZ2Uge1xuICB3aWR0aDogNTBweDtcbiAgZGlzcGxheTogYmxvY2s7XG4gIG1hcmdpbjogMCBhdXRvO1xufVxuXG4uc3ZnLWljb24tbGFyZ2UgPiBzdmcge1xuICB3aWR0aDogMTAwJTtcbiAgaGVpZ2h0OiBhdXRvO1xufVxuXG4ucm93LXBhZGRlZC1zbWFsbCB7XG4gIHBhZGRpbmc6IDQwcHggMDtcbn1cblxuKi51bnNlbGVjdGFibGUge1xuICAtd2Via2l0LXRvdWNoLWNhbGxvdXQ6IG5vbmU7XG4gIC13ZWJraXQtdXNlci1zZWxlY3Q6IG5vbmU7XG4gIC1tb3otdXNlci1zZWxlY3Q6IG5vbmU7XG4gIC1tcy11c2VyLXNlbGVjdDogbm9uZTtcbiAgdXNlci1zZWxlY3Q6IG5vbmU7XG59XG5cbi51cmwtZGlmZi1jb250YWluZXIge1xuICB3aWR0aDogOTgwcHg7XG59XG5cbi5kaWZmLXVybC13cmFwcGVyIHtcbiAgZGlzcGxheTogZmxleDtcbiAgd2lkdGg6IDEwMCU7XG59XG5cbi5kaWZmLXVybC1pbnB1dCB7XG4gIGRpc3BsYXk6IGlubGluZS1ibG9jaztcbiAgbWFyZ2luLXJpZ2h0OiAxMHB4O1xuICBmbGV4LWdyb3c6IDE7XG4gIGhlaWdodDogMzFweDtcbn1cblxuLmRpZmYtdXJsLWJ0biB7XG4gIGRpc3BsYXk6IGlubGluZS1ibG9jaztcbiAgZmxvYXQ6IHJpZ2h0O1xuICB3aWR0aDogNDhweDtcbn1cblxuLm9wdGlvbnMtbGFiZWwtdmFsdWUge1xuICBmb250LXdlaWdodDogbm9ybWFsO1xufVxuXG4uZGlmZi11cmwtb3B0aW9ucy1jb250YWluZXIgbGFiZWwgc2VsZWN0LFxuLmRpZmYtdXJsLW9wdGlvbnMtY29udGFpbmVyIGxhYmVsIGlucHV0IHtcbiAgZGlzcGxheTogYmxvY2s7XG59XG5cbi8qIDE1IGNvbHVtbnMgKi9cblxuLmNvbC1tZC0gKi5jb2wtbWQtMTUge1xuICB3aWR0aDogMjAlO1xufVxuIl19 */ \ No newline at end of file diff --git a/docs/main.min.css b/docs/main.min.css deleted file mode 100644 index 7e1fd93..0000000 --- a/docs/main.min.css +++ /dev/null @@ -1,4 +0,0 @@ -/*! - * Copyright Colossal 2015 - * Adapted by @rtfpessoa - */.template-index{width:100%}.template-index-min{min-width:700px}.container{width:100%;padding:0 8%}.m-b-md{margin-bottom:23px!important}.p-t{padding-top:15px!important}@media (min-width:768px){p.m-b{height:75px;overflow-y:hidden}}.btn{display:inline-block;color:#fff;background:#26a65b;font-weight:400}.btn:hover{color:#fff;background:#5dbe5d}.btn-clipboard{position:absolute;top:0;right:0;z-index:10;display:block;padding:5px 8px;font-size:12px;color:#fff;background-color:#767676;border-radius:0 4px 0 4px;cursor:pointer}.btn-clipboard:hover{color:#000;background-color:#dcdfe4}.footer{position:relative;padding:40px 0;text-align:center;font-size:14px;border-top:1px solid #dcdfe4}.footer p{margin-bottom:5px}.footer a{color:#26a65b}.container a{color:#26a65b}.container a.btn{color:#fff}.footer-list-item{display:inline-block}.footer-list-item:not(:last-child):after{content:"\b7"}.footer>ul{padding:0}@media (min-width:768px){.footer{padding:60px 0}}@media (min-width:768px){.row-centered{display:flex;align-items:center}}.row-bordered{position:relative}.row-bordered:before{content:'';display:block;width:80%;position:absolute;bottom:0;left:50%;margin-left:-40%;height:1px;background:radial-gradient(ellipse at center,rgba(0,0,0,.2) 0,rgba(255,255,255,0) 75%)}.hero{position:relative;text-align:center;padding:80px 0;border-bottom:1px solid #dcdfe4}.hero-booticon{font-family:Helvetica Neue,Helvetica,Arial,sans-serif;margin:0 auto 30px;width:100%;font-size:8vw;display:block;font-weight:500;text-align:center;cursor:default}.hero-homepage.hero{padding-top:0;padding-bottom:40px;overflow:hidden;border-bottom:0;border-bottom:1px solid #dcdfe4}.hero-homepage>.btn{margin-top:20px}.swag-line:before{content:'';position:fixed;display:block;top:0;left:0;right:0;height:5px;z-index:2;background-color:#26a65b;background:linear-gradient(45deg,#28a142,#26a65b)}.navbar{background-color:#fff;border:0 #fff}.navbar-header{text-align:center}.navbar-brand{height:auto;padding:19px 25px;font-size:16px;display:inline-block;float:none;text-align:center;margin:5px 0 0}.navbar-nav{margin-right:-15px}.navbar-nav>li>a{font-size:14px}.navbar-default .navbar-brand,.navbar-default .navbar-brand:focus,.navbar-default .navbar-brand:hover,.navbar-default .navbar-nav>li>a,.navbar-default .navbar-nav>li>a:focus,.navbar-default .navbar-nav>li>a:hover{background:0 0;color:#293a46;font-weight:300}.navbar-default .navbar-toggle{position:absolute;left:0;top:7px;border-color:#fff;color:#293a46;margin-right:0}.navbar-default .navbar-toggle:focus,.navbar-default .navbar-toggle:hover{background:#f9f9f9;border-color:#f9f9f9}@media (min-width:768px){.navbar-full .navbar-brand{margin-left:-25px}.navbar-tall{height:125px}.navbar-tall .navbar-header,.navbar-tall .navbar-nav{line-height:125px;text-align:left}.navbar-brand{float:none;display:inline-block;text-align:left;margin:0}.navbar-nav>li>a{display:inline-block;margin-left:13px}.navbar-nav>li:first-child>a{margin-left:0}}.screenshot{display:block;overflow:hidden}.screenshot>img{width:100%}.screenshots-fan{margin-top:50px}.screenshots-fan .screenshot{position:relative;width:auto;display:inline-block;text-align:center}.screenshots-fan .screenshot:first-child,.screenshots-fan .screenshot:last-child{z-index:2}.screenshots-fan .screenshot{z-index:3}@media (min-width:768px){.screenshots-fan{position:relative;overflow:hidden;margin-top:60px;height:200px}.screenshots-fan .screenshot{height:auto;top:10px;width:350px}.screenshots-fan .screenshot:first-child,.screenshots-fan .screenshot:last-child{width:250px;position:absolute;top:65px}.screenshots-fan .screenshot:first-child{left:10px}.screenshots-fan .screenshot:last-child{left:auto;right:10px}}@media (min-width:992px){.screenshots-fan{margin-top:60px;height:240px}.screenshots-fan .screenshot{width:400px}.screenshots-fan .screenshot:first-child,.screenshots-fan .screenshot:last-child{width:300px}}@media (min-width:1200px){.screenshots-fan{margin-top:80px;height:380px}.screenshots-fan .screenshot{width:550px}.screenshots-fan .screenshot:first-child,.screenshots-fan .screenshot:last-child{width:450px}}body{font-size:16px;font-family:Roboto,sans-serif;font-weight:300;line-height:1.6}h1{font-size:26px;font-weight:300}h2{font-size:18px;font-weight:300}h3{font-size:26px;font-weight:300}h4{font-size:16px;font-weight:300}h5{font-size:16px;font-weight:400}h1,h2,h3,h4,h5{line-height:1.4}h1,h2{margin:10px 0}h5{margin:6px 0}@media (min-width:768px){body{font-size:16px;font-family:Roboto,sans-serif;font-weight:300;line-height:1.6}h1{font-size:38px;font-weight:300}h2{font-size:26px;font-weight:300;line-height:1.4}h3{font-size:26px;font-weight:300}h4{font-size:18px;font-weight:300}h5{font-size:16px;font-weight:400}}body{color:#293a46}a{text-decoration:none;color:inherit}a:focus,a:hover{text-decoration:underline}.nav li a{text-decoration:none;color:inherit}.nav li a:hover{text-decoration:underline}.text-muted{color:#697176}.template-index h3{font-size:21px;margin-bottom:12px}.template-index h4{color:#697176;line-height:1.6}.template-index h4 a,.template-index p a{color:#26a65b}.template-index h5{font-size:17px;margin-bottom:8px}.homepage-code-example,.homepage-terminal-example{position:relative;font-family:monospace;background:#272b38;color:#48d8a0;border-radius:8px;padding:30px}.homepage-code-example .text-muted,.homepage-terminal-example .text-muted{color:#6a7490}@media (min-width:768px){.homepage-terminal-example{padding:50px}.homepage-code-example{padding:10px}.homepage-code-example>p{margin:0}}.hero-green{color:#26a65b}.hero-black{color:#353535}.hero-red{color:#cb2c37}.svg-icon-large{width:50px;display:block;margin:0 auto}.svg-icon-large>svg{width:100%;height:auto}.row-padded-small{padding:40px 0}.unselectable{-webkit-touch-callout:none;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.url-diff-container{width:980px}.diff-url-wrapper{display:flex;width:100%}.diff-url-input{display:inline-block;margin-right:10px;flex-grow:1;height:31px}.diff-url-btn{display:inline-block;float:right;width:48px}.options-label-value{font-weight:400}.diff-url-options-container label input,.diff-url-options-container label select{display:block}.col-md- .col-md-15{width:20%} \ No newline at end of file diff --git a/docs/robots.txt b/docs/robots.txt deleted file mode 100644 index 4f9540b..0000000 --- a/docs/robots.txt +++ /dev/null @@ -1 +0,0 @@ -User-agent: * \ No newline at end of file diff --git a/docs/sitemap.xml b/docs/sitemap.xml deleted file mode 100644 index 3f5fd62..0000000 --- a/docs/sitemap.xml +++ /dev/null @@ -1,16 +0,0 @@ - - - - https://diff2html.xyz/ - - - https://diff2html.xyz/index.html - - - https://diff2html.xyz/demo.html - - diff --git a/jest.config.js b/jest.config.js new file mode 100644 index 0000000..d311713 --- /dev/null +++ b/jest.config.js @@ -0,0 +1,15 @@ +module.exports = { + verbose: true, + preset: "ts-jest", + testEnvironment: "node", + coverageDirectory: "./coverage", + coverageReporters: ["lcov", "text", "html"], + coverageThreshold: { + global: { + statements: 90, + branches: 85, + functions: 90, + lines: 90 + } + } +}; diff --git a/package.json b/package.json index e7cb771..57afd00 100644 --- a/package.json +++ b/package.json @@ -34,22 +34,25 @@ "engines": { "node": ">=4" }, - "preferGlobal": true, "scripts": { - "release": "./scripts/release.sh", - "release-website": "./scripts/release-website.sh", - "templates": "./scripts/hulk.js --wrapper node --variable 'browserTemplates' ./src/templates/*.mustache > ./src/templates/diff2html-templates.js", + "build": "tsc", + "lint": "eslint '*/**/*.{js,jsx,ts,tsx}'", "style": "yarn run lint", - "lint": "eslint .", - "coverage": "istanbul cover _mocha -- -u exports -R spec ./test/**/*", - "check-coverage": "istanbul check-coverage --statements 90 --functions 90 --branches 85 --lines 90 ./coverage/coverage.json", - "test": "yarn run coverage && yarn run check-coverage", + "test": "jest", + "coverage": "jest --collectCoverage", + "coverage-html": "yarn run coverage && open ./coverage/index.html", "codacy": "cat ./coverage/lcov.info | codacy-coverage", - "preversion": "yarn run release && yarn run release-website && yarn run lint && yarn test", - "version": "git add -A src dist docs package.json", + "release": "yarn run release-css && yarn run release-templates && yarn run release-ts && yarn run release-browser-bundle && yarn run release-website", + "release-css": "./scripts/release-css.sh", + "release-templates": "./scripts/release-templates.sh", + "release-ts": "yarn run build", + "release-browser-bundle": "./scripts/release-browser-bundle.sh", + "release-website": "./scripts/release-website.sh", + "preversion": "yarn run release && yarn run lint && yarn test", + "version": "git add -A package.json", "postversion": "git push && git push --tags" }, - "main": "./src/diff2html.js", + "main": "./build/commonjs-node/diff2html.js", "browser": { "fs": false }, @@ -60,28 +63,38 @@ "whatwg-fetch": "^3.0.0" }, "devDependencies": { + "@types/jest": "24.0.18", + "@types/node": "^12.7.2", + "@typescript-eslint/eslint-plugin": "2.0.0", + "@typescript-eslint/parser": "2.0.0", "autoprefixer": "^9.6.0", - "browserify": "^16.2.3", + "browserify": "^16.5.0", "clean-css-cli": "^4.3.0", "codacy-coverage": "^3.4.0", - "eslint": "^5.16.0", - "eslint-plugin-promise": "^4.1.1", - "eslint-plugin-standard": "^4.0.0", + "eslint": "6.2.2", + "eslint-config-prettier": "6.1.0", + "eslint-config-standard": "14.0.1", + "eslint-plugin-import": "2.18.2", + "eslint-plugin-jest": "22.15.2", + "eslint-plugin-node": "9.1.0", + "eslint-plugin-prettier": "3.1.0", + "eslint-plugin-promise": "^4.2.1", + "eslint-plugin-standard": "^4.0.1", "fast-html-parser": "^1.0.1", - "istanbul": "^0.4.5", + "jest": "24.9.0", "mkdirp": "^0.5.1", - "mocha": "5.2.0", "nopt": "^4.0.1", - "postcss-cli": "^6.1.2", - "uglify-js": "^3.6.0" + "postcss-cli": "^6.1.3", + "prettier": "1.18.2", + "ts-jest": "24.0.2", + "typescript": "^3.6.3", + "terser": "^4.3.8" }, "resolutions": { - "lodash": "4.17.14" + "lodash": "4.17.15" }, "license": "MIT", "files": [ - "src", - "dist", - "typescript" + "build" ] } diff --git a/scripts/hulk.js b/scripts/hulk.js index a4b1a4d..d718a66 100755 --- a/scripts/hulk.js +++ b/scripts/hulk.js @@ -16,61 +16,66 @@ */ // dependencies -var hogan = require('hogan.js'); -var path = require('path'); -var nopt = require('nopt'); -var mkderp = require('mkdirp'); -var fs = require('fs'); +const path = require("path"); +const fs = require("fs"); +const hogan = require("hogan.js"); +const nopt = require("nopt"); +const mkderp = require("mkdirp"); // locals -var specials = ['/', '.', '*', '+', '?', '|', '(', ')', '[', ']', '{', '}', '\\']; -var specialsRegExp = new RegExp('(\\' + specials.join('|\\') + ')', 'g'); -var options = { - 'namespace': String, - 'outputdir': path, - 'variable': String, - 'wrapper': String, - 'version': true, - 'help': true +const specials = ["/", ".", "*", "+", "?", "|", "(", ")", "[", "]", "{", "}", "\\"]; +const specialsRegExp = new RegExp("(\\" + specials.join("|\\") + ")", "g"); +let options = { + namespace: String, + outputdir: path, + variable: String, + wrapper: String, + version: true, + help: true }; -var shortHand = { - 'n': ['--namespace'], - 'o': ['--outputdir'], - 'vn': ['--variable'], - 'w': ['--wrapper'], - 'h': ['--help'], - 'v': ['--version'] +const shortHand = { + n: ["--namespace"], + o: ["--outputdir"], + vn: ["--variable"], + w: ["--wrapper"], + h: ["--help"], + v: ["--version"] }; -var templates; +let templates; // options options = nopt(options, shortHand); // escape special regexp characters function esc(text) { - return text.replace(specialsRegExp, '\\$1'); + return text.replace(specialsRegExp, "\\$1"); } // cyan function for rob function cyan(text) { - return '\x1B[36m' + text + '\x1B[39m'; + return "\x1B[36m" + text + "\x1B[39m"; } // check for dirs and correct ext (<3 for windows) function extractFiles(args) { - var usage = '\n' + - cyan('USAGE:') + ' hulk [--wrapper wrapper] [--outputdir outputdir] ' + - '[--namespace namespace] [--variable variable] FILES\n\n' + - cyan('OPTIONS:') + ' [-w, --wrapper] :: wraps the template (i.e. amd)\n' + - ' [-o, --outputdir] :: outputs the templates as individual files to a directory\n\n' + - ' [-n, --namespace] :: prepend string to template names\n\n' + - ' [-vn, --variable] :: variable name for non-amd wrapper\n\n' + - cyan('EXAMPLE:') + ' hulk --wrapper amd ./templates/*.mustache\n\n' + - cyan('NOTE:') + ' hulk supports the "*" wildcard and allows you to target specific extensions too\n'; - var files = []; + const usage = + "\n" + + cyan("USAGE:") + + " hulk [--wrapper wrapper] [--outputdir outputdir] " + + "[--namespace namespace] [--variable variable] FILES\n\n" + + cyan("OPTIONS:") + + " [-w, --wrapper] :: wraps the template (i.e. amd)\n" + + " [-o, --outputdir] :: outputs the templates as individual files to a directory\n\n" + + " [-n, --namespace] :: prepend string to template names\n\n" + + " [-vn, --variable] :: variable name for non-amd wrapper\n\n" + + cyan("EXAMPLE:") + + " hulk --wrapper amd ./templates/*.mustache\n\n" + + cyan("NOTE:") + + ' hulk supports the "*" wildcard and allows you to target specific extensions too\n'; + let files = []; if (options.version) { - console.log(require('../package.json').version); + console.log(require("../package.json").version); process.exit(0); } @@ -81,12 +86,13 @@ function extractFiles(args) { args.forEach(function(arg) { if (/\*/.test(arg)) { - arg = arg.split('*'); + arg = arg.split("*"); files = files.concat( - fs.readdirSync(arg[0] || '.') + fs + .readdirSync(arg[0] || ".") .map(function(f) { - var file = path.join(arg[0], f); - return new RegExp(esc(arg[1]) + '$').test(f) && fs.statSync(file).isFile() && file; + const file = path.join(arg[0], f); + return new RegExp(esc(arg[1]) + "$").test(f) && fs.statSync(file).isFile() && file; }) .filter(function(f) { return f; @@ -112,51 +118,65 @@ function removeByteOrderMark(text) { // wrap templates function wrap(file, name, openedFile) { switch (options.wrapper) { - case 'amd': - return 'define(' + (!options.outputdir ? '"' + path.join(path.dirname(file), name) + '", ' : '') + + case "amd": + return ( + "define(" + + (!options.outputdir ? '"' + path.join(path.dirname(file), name) + '", ' : "") + '[ "hogan.js" ], function(Hogan){ return new Hogan.Template(' + - hogan.compile(openedFile, {asString: 1}) + - ');});'; - case 'node': - var globalObj = 'global.' + (options.variable || 'templates') + '["' + name + '"]'; - var globalStmt = globalObj + ' = new Hogan.Template(' + hogan.compile(openedFile, {asString: 1}) + ');'; + hogan.compile(openedFile, { asString: 1 }) + + ");});" + ); + case "node": + var globalObj = "global." + (options.variable || "templates") + '["' + name + '"]'; + var globalStmt = globalObj + " = new Hogan.Template(" + hogan.compile(openedFile, { asString: 1 }) + ");"; var nodeOutput = globalStmt; // if we have a template per file the export will expose the template directly if (options.outputdir) { - nodeOutput = nodeOutput + '\n' + 'module.exports = ' + globalObj + ';'; + nodeOutput = nodeOutput + "\n" + "module.exports = " + globalObj + ";"; } return nodeOutput; default: - return (options.variable || 'templates') + - '["' + name + '"] = new Hogan.Template(' + - hogan.compile(openedFile, {asString: 1}) + - ');'; + return ( + (options.variable || "templates") + + '["' + + name + + '"] = new Hogan.Template(' + + hogan.compile(openedFile, { asString: 1 }) + + ");" + ); } } function prepareOutput(content) { - var variableName = options.variable || 'templates'; + const variableName = options.variable || "templates"; switch (options.wrapper) { - case 'amd': + case "amd": return content; - case 'node': - var nodeExport = ''; + case "node": + var nodeExport = ""; // if we have aggregated templates the export will expose the template map if (!options.outputdir) { - nodeExport = 'module.exports = global.' + variableName + ';\n'; + nodeExport = "module.exports = global." + variableName + ";\n"; } - return '(function() {\n' + - 'if (!!!global.' + variableName + ') global.' + variableName + ' = {};\n' + + return ( + "(function() {\n" + + "if (!!!global." + + variableName + + ") global." + + variableName + + " = {};\n" + 'var Hogan = require("hogan.js");' + - content + '\n' + + content + + "\n" + nodeExport + - '})();'; + "})();" + ); default: - return 'if (!!!' + variableName + ') var ' + variableName + ' = {};\n' + content; + return "if (!!!" + variableName + ") var " + variableName + " = {};\n" + content; } } @@ -167,21 +187,20 @@ if (options.outputdir) { // Prepend namespace to template name function namespace(name) { - return (options.namespace || '') + name; + return (options.namespace || "") + name; } // write a template foreach file that matches template extension templates = extractFiles(options.argv.remain) .map(function(file) { - var openedFile = fs.readFileSync(file, 'utf-8').trim(); - var name; + let openedFile = fs.readFileSync(file, "utf-8").trim(); + let name; if (!openedFile) return; - name = namespace(path.basename(file).replace(/\..*$/, '')); + name = namespace(path.basename(file).replace(/\..*$/, "")); openedFile = removeByteOrderMark(openedFile); openedFile = wrap(file, name, openedFile); if (!options.outputdir) return openedFile; - fs.writeFileSync(path.join(options.outputdir, name + '.js') - , prepareOutput(openedFile)); + fs.writeFileSync(path.join(options.outputdir, name + ".js"), prepareOutput(openedFile)); }) .filter(function(t) { return t; @@ -190,4 +209,4 @@ templates = extractFiles(options.argv.remain) // output templates if (!templates.length || options.outputdir) process.exit(0); -console.log(prepareOutput(templates.join('\n'))); +console.log(prepareOutput(templates.join("\n"))); diff --git a/scripts/release-browser-bundle.sh b/scripts/release-browser-bundle.sh new file mode 100755 index 0000000..6eb2cc3 --- /dev/null +++ b/scripts/release-browser-bundle.sh @@ -0,0 +1,36 @@ +#!/usr/bin/env bash + +set -e + +SCRIPT_DIRECTORY="$( cd "$( dirname "$0" )" && pwd )" + +INPUT_DIR=${SCRIPT_DIRECTORY}/../build/commonjs-node +INPUT_UI_DIR=${INPUT_DIR}/ui +INPUT_JS_FILE=${INPUT_DIR}/diff2html.js +INPUT_JS_UI_FILE=${INPUT_UI_DIR}/js/diff2html-ui.js + +OUTPUT_DIR=${SCRIPT_DIRECTORY}/../build/browser +OUTPUT_JS_FILE=${OUTPUT_DIR}/diff2html.js +OUTPUT_MIN_JS_FILE=${OUTPUT_DIR}/diff2html.min.js +OUTPUT_JS_UI_FILE=${OUTPUT_DIR}/diff2html-ui.js +OUTPUT_MIN_JS_UI_FILE=${OUTPUT_DIR}/diff2html-ui.min.js + +echo "Creating diff2html browser bundle ..." + +echo "Cleaning previous versions ..." +rm -rf ${OUTPUT_DIR} +mkdir -p ${OUTPUT_DIR} + +echo "Generating js aggregation file in ${OUTPUT_JS_FILE}" +browserify -e ${INPUT_JS_FILE} -o ${OUTPUT_JS_FILE} + +echo "Minifying ${OUTPUT_JS_FILE} to ${OUTPUT_MIN_JS_FILE}" +terser ${OUTPUT_JS_FILE} -c -o ${OUTPUT_MIN_JS_FILE} + +echo "Generating js ui aggregation file in ${OUTPUT_JS_UI_FILE}" +browserify -e ${INPUT_JS_UI_FILE} -o ${OUTPUT_JS_UI_FILE} + +echo "Minifying ${OUTPUT_JS_UI_FILE} to ${OUTPUT_MIN_JS_UI_FILE}" +terser ${OUTPUT_JS_UI_FILE} -c -o ${OUTPUT_MIN_JS_UI_FILE} + +echo "diff2html browser bundle created successfully!" diff --git a/scripts/release-css.sh b/scripts/release-css.sh new file mode 100755 index 0000000..e1e55ef --- /dev/null +++ b/scripts/release-css.sh @@ -0,0 +1,25 @@ +#!/usr/bin/env bash + +set -e + +SCRIPT_DIRECTORY="$( cd "$( dirname "$0" )" && pwd )" + +INPUT_DIR=${SCRIPT_DIRECTORY}/../src +INPUT_UI_DIR=${INPUT_DIR}/ui +INPUT_CSS_FILE=${INPUT_UI_DIR}/css/diff2html.css + +OUTPUT_DIR=${SCRIPT_DIRECTORY}/../build/css +OUTPUT_CSS_FILE=${OUTPUT_DIR}/diff2html.css +OUTPUT_MIN_CSS_FILE=${OUTPUT_DIR}/diff2html.min.css + +echo "Creating diff2html css ..." + +echo "Cleaning previous versions ..." +rm -rf ${OUTPUT_DIR} +mkdir -p ${OUTPUT_DIR} + +echo "Minifying ${OUTPUT_CSS_FILE} to ${OUTPUT_MIN_CSS_FILE}" +postcss --use autoprefixer -o ${OUTPUT_CSS_FILE} ${INPUT_CSS_FILE} +cleancss --advanced --compatibility=ie8 -o ${OUTPUT_MIN_CSS_FILE} ${OUTPUT_CSS_FILE} + +echo "diff2html css created successfully!" diff --git a/scripts/release-templates.sh b/scripts/release-templates.sh new file mode 100755 index 0000000..061b105 --- /dev/null +++ b/scripts/release-templates.sh @@ -0,0 +1,10 @@ +#!/usr/bin/env bash + +set -e + +SCRIPT_DIRECTORY="$( cd "$( dirname "$0" )" && pwd )" + +node ${SCRIPT_DIRECTORY}/hulk.js \ + --wrapper node \ + --variable 'browserTemplates' \ + ${SCRIPT_DIRECTORY}/../src/templates/*.mustache > ${SCRIPT_DIRECTORY}/../src/diff2html-templates.js diff --git a/scripts/release-website.js b/scripts/release-website.js index 5e51132..8c5ff0f 100644 --- a/scripts/release-website.js +++ b/scripts/release-website.js @@ -1,34 +1,38 @@ -var fs = require('fs'); +#!/usr/bin/env node -var hogan = require('hogan.js'); +const fs = require("fs"); -var root = 'website/templates'; -var pagesRoot = root + '/pages'; +const hogan = require("hogan.js"); -var websitePages = fs.readdirSync(root + '/pages'); +const root = "website/templates"; +const pagesRoot = root + "/pages"; -var template = hogan.compile(readFile(root + '/template.mustache')); +const websitePages = fs.readdirSync(root + "/pages"); -var options = { - 'all': { - 'demoUrl': 'demo.html?diff=https://github.com/rtfpessoa/diff2html/pull/106' +const template = hogan.compile(readFile(root + "/template.mustache")); + +const options = { + all: { + demoUrl: "demo.html?diff=https://github.com/rtfpessoa/diff2html/pull/106" }, - 'demo': { - 'extraClass': 'template-index-min' + demo: { + extraClass: "template-index-min" } }; websitePages.map(function(page) { - var pagePartialTemplate = hogan.compile(readFile(pagesRoot + '/' + page + '/' + page + '.partial.mustache')); - var pageAssetsTemplate = hogan.compile(readFile(pagesRoot + '/' + page + '/' + page + '-assets.partial.mustache')); - var pageScriptsTemplate = hogan.compile(readFile(pagesRoot + '/' + page + '/' + page + '-scripts.partial.mustache')); + const pagePartialTemplate = hogan.compile(readFile(pagesRoot + "/" + page + "/" + page + ".partial.mustache")); + const pageAssetsTemplate = hogan.compile(readFile(pagesRoot + "/" + page + "/" + page + "-assets.partial.mustache")); + const pageScriptsTemplate = hogan.compile( + readFile(pagesRoot + "/" + page + "/" + page + "-scripts.partial.mustache") + ); - var templateOptions = {}; + const templateOptions = {}; - var key; + let key; // Allow the pages to share common options - var genericOptions = options['all'] || {}; + const genericOptions = options.all || {}; for (key in genericOptions) { if (genericOptions.hasOwnProperty(key)) { templateOptions[key] = genericOptions[key]; @@ -36,32 +40,31 @@ websitePages.map(function(page) { } // Allow each page to have custom options - var pageOptions = options[page] || {}; + const pageOptions = options[page] || {}; for (key in pageOptions) { if (pageOptions.hasOwnProperty(key)) { templateOptions[key] = pageOptions[key]; } } - var pagePartial = pagePartialTemplate.render(templateOptions); - var pageAssets = pageAssetsTemplate.render(templateOptions); - var pageScripts = pageScriptsTemplate.render(templateOptions); + const pagePartial = pagePartialTemplate.render(templateOptions); + const pageAssets = pageAssetsTemplate.render(templateOptions); + const pageScripts = pageScriptsTemplate.render(templateOptions); templateOptions.assets = pageAssets; templateOptions.scripts = pageScripts; templateOptions.content = pagePartial; - var pageHtml = template.render(templateOptions); - writeFile('docs/' + page + '.html', pageHtml); + const pageHtml = template.render(templateOptions); + writeFile("docs/" + page + ".html", pageHtml); }); function readFile(filePath) { try { - return fs.readFileSync(filePath, 'utf8'); - } catch (_ignore) { - } + return fs.readFileSync(filePath, "utf8"); + } catch (_ignore) {} - return ''; + return ""; } function writeFile(filePath, content) { diff --git a/scripts/release-website.sh b/scripts/release-website.sh index 841732a..82573ef 100755 --- a/scripts/release-website.sh +++ b/scripts/release-website.sh @@ -1,17 +1,14 @@ #!/bin/bash -# -# diff2html website release script -# by rtfpessoa -# - set -e -INPUT_DIR=website +SCRIPT_DIRECTORY="$( cd "$( dirname "$0" )" && pwd )" + +INPUT_DIR=${SCRIPT_DIRECTORY}/../website INPUT_DEMO_JS=${INPUT_DIR}/templates/pages/demo/demo.js INPUT_CSS_FILE=${INPUT_DIR}/main.css -OUTPUT_DIR=docs +OUTPUT_DIR=${SCRIPT_DIRECTORY}/../docs OUTPUT_DEMO_JS=${OUTPUT_DIR}/demo.js OUTPUT_DEMO_MIN_JS=${OUTPUT_DIR}/demo.min.js OUTPUT_CSS_FILE=${OUTPUT_DIR}/main.css @@ -21,7 +18,7 @@ echo "Creating diff2html website release ..." echo "Cleaning previous versions ..." rm -rf ${OUTPUT_DIR} -mkdir -p ${OUTPUT_DIR} +mkdir -p ${OUTPUT_DIR}/assets echo "Minifying ${OUTPUT_CSS_FILE} to ${OUTPUT_MIN_CSS_FILE}" postcss --use autoprefixer -o ${OUTPUT_CSS_FILE} ${INPUT_CSS_FILE} @@ -31,10 +28,10 @@ echo "Generating website js aggregation file in ${OUTPUT_DEMO_JS}" browserify -e ${INPUT_DEMO_JS} -o ${OUTPUT_DEMO_JS} echo "Minifying ${OUTPUT_DEMO_JS} to ${OUTPUT_DEMO_MIN_JS}" -uglifyjs ${OUTPUT_DEMO_JS} -c -o ${OUTPUT_DEMO_MIN_JS} +terser ${OUTPUT_DEMO_JS} -c -o ${OUTPUT_DEMO_MIN_JS} echo "Generating HTMLs from templates ..." -node ./scripts/release-website.js +node ${SCRIPT_DIRECTORY}/release-website.js echo "Copying static files ..." cp -rf ${INPUT_DIR}/img ${OUTPUT_DIR}/ @@ -43,7 +40,9 @@ cp -f ${INPUT_DIR}/favicon.ico ${OUTPUT_DIR}/ cp -f ${INPUT_DIR}/robots.txt ${OUTPUT_DIR}/ cp -f ${INPUT_DIR}/sitemap.xml ${OUTPUT_DIR}/ -echo "Creating diff2html assets symlink ..." -ln -s ../dist docs/assets +echo "Copying diff2html resources ..." +cp ${SCRIPT_DIRECTORY}/../build/browser/diff2html.min.js ${SCRIPT_DIRECTORY}/../docs/assets/ +cp ${SCRIPT_DIRECTORY}/../build/browser/diff2html-ui.min.js ${SCRIPT_DIRECTORY}/../docs/assets/ +cp ${SCRIPT_DIRECTORY}/../build/css/diff2html.min.css ${SCRIPT_DIRECTORY}/../docs/assets/ echo "diff2html website release created successfully!" diff --git a/scripts/release.sh b/scripts/release.sh deleted file mode 100755 index 0d891fb..0000000 --- a/scripts/release.sh +++ /dev/null @@ -1,57 +0,0 @@ -#!/bin/bash - -# -# diff2html release script -# by rtfpessoa -# - -set -e - -INPUT_DIR=src -INTPUT_TEMPLATES_DIR=${INPUT_DIR}/templates -INPUT_UI_DIR=${INPUT_DIR}/ui -INPUT_JS_FILE=${INPUT_DIR}/diff2html.js -INPUT_JS_UI_FILE=${INPUT_UI_DIR}/js/diff2html-ui.js -INPUT_CSS_FILE=${INPUT_UI_DIR}/css/diff2html.css -INPUT_TYPINGS_D_TS_FILE=${INPUT_DIR}/diff2html.d.ts - -GENERATED_TEMPLATES_FILE=${INTPUT_TEMPLATES_DIR}/diff2html-templates.js - -OUTPUT_DIR=dist -OUTPUT_JS_FILE=${OUTPUT_DIR}/diff2html.js -OUTPUT_MIN_JS_FILE=${OUTPUT_DIR}/diff2html.min.js -OUTPUT_JS_UI_FILE=${OUTPUT_DIR}/diff2html-ui.js -OUTPUT_MIN_JS_UI_FILE=${OUTPUT_DIR}/diff2html-ui.min.js -OUTPUT_CSS_FILE=${OUTPUT_DIR}/diff2html.css -OUTPUT_MIN_CSS_FILE=${OUTPUT_DIR}/diff2html.min.css -OUTPUT_TYPINGS_D_TS_FILE=${OUTPUT_DIR}/diff2html.d.ts - -echo "Creating diff2html release ..." - -echo "Cleaning previous versions ..." -rm -rf ${OUTPUT_DIR} -mkdir -p ${OUTPUT_DIR} - -echo "Minifying ${OUTPUT_CSS_FILE} to ${OUTPUT_MIN_CSS_FILE}" -postcss --use autoprefixer -o ${OUTPUT_CSS_FILE} ${INPUT_CSS_FILE} -cleancss --advanced --compatibility=ie8 -o ${OUTPUT_MIN_CSS_FILE} ${OUTPUT_CSS_FILE} - -echo "Pre-compile hogan.js templates" -yarn run templates - -echo "Generating js aggregation file in ${OUTPUT_JS_FILE}" -browserify -e ${INPUT_JS_FILE} -o ${OUTPUT_JS_FILE} - -echo "Minifying ${OUTPUT_JS_FILE} to ${OUTPUT_MIN_JS_FILE}" -uglifyjs ${OUTPUT_JS_FILE} -c -o ${OUTPUT_MIN_JS_FILE} - -echo "Generating js ui aggregation file in ${OUTPUT_JS_UI_FILE}" -browserify -e ${INPUT_JS_UI_FILE} -o ${OUTPUT_JS_UI_FILE} - -echo "Minifying ${OUTPUT_JS_UI_FILE} to ${OUTPUT_MIN_JS_UI_FILE}" -uglifyjs ${OUTPUT_JS_UI_FILE} -c -o ${OUTPUT_MIN_JS_UI_FILE} - -echo "Copying types ${INPUT_TYPINGS_D_TS_FILE} to ${OUTPUT_TYPINGS_D_TS_FILE}" -cp -f ${INPUT_TYPINGS_D_TS_FILE} ${OUTPUT_TYPINGS_D_TS_FILE} - -echo "diff2html release created successfully!" diff --git a/src/__tests__/diff-parser-tests.js b/src/__tests__/diff-parser-tests.js new file mode 100644 index 0000000..c0de992 --- /dev/null +++ b/src/__tests__/diff-parser-tests.js @@ -0,0 +1,728 @@ +const DiffParser = require("../diff-parser.js").DiffParser; + +function checkDiffSample(diff) { + const result = DiffParser.generateDiffJson(diff); + const file1 = result[0]; + expect(1).toEqual(result.length); + expect(1).toEqual(file1.addedLines); + expect(1).toEqual(file1.deletedLines); + expect("sample").toEqual(file1.oldName); + expect("sample").toEqual(file1.newName); + expect(1).toEqual(file1.blocks.length); +} + +describe("DiffParser", function() { + describe("generateDiffJson", function() { + it("should parse unix with \n diff", function() { + const diff = + "diff --git a/sample b/sample\n" + + "index 0000001..0ddf2ba\n" + + "--- a/sample\n" + + "+++ b/sample\n" + + "@@ -1 +1 @@\n" + + "-test\n" + + "+test1r\n"; + checkDiffSample(diff); + }); + + it("should parse windows with \r\n diff", function() { + const diff = + "diff --git a/sample b/sample\r\n" + + "index 0000001..0ddf2ba\r\n" + + "--- a/sample\r\n" + + "+++ b/sample\r\n" + + "@@ -1 +1 @@\r\n" + + "-test\r\n" + + "+test1r\r\n"; + checkDiffSample(diff); + }); + + it("should parse old os x with \r diff", function() { + const diff = + "diff --git a/sample b/sample\r" + + "index 0000001..0ddf2ba\r" + + "--- a/sample\r" + + "+++ b/sample\r" + + "@@ -1 +1 @@\r" + + "-test\r" + + "+test1r\r"; + checkDiffSample(diff); + }); + + it("should parse mixed eols diff", function() { + const diff = + "diff --git a/sample b/sample\n" + + "index 0000001..0ddf2ba\r\n" + + "--- a/sample\r" + + "+++ b/sample\r\n" + + "@@ -1 +1 @@\n" + + "-test\r" + + "+test1r\n"; + checkDiffSample(diff); + }); + + it("should parse diff with special characters", function() { + const diff = + 'diff --git "a/bla with \ttab.scala" "b/bla with \ttab.scala"\n' + + "index 4c679d7..e9bd385 100644\n" + + '--- "a/bla with \ttab.scala"\n' + + '+++ "b/bla with \ttab.scala"\n' + + "@@ -1 +1,2 @@\n" + + "-cenas\n" + + "+cenas com ananas\n" + + "+bananas"; + + const result = DiffParser.generateDiffJson(diff); + const file1 = result[0]; + expect(1).toEqual(result.length); + expect(2).toEqual(file1.addedLines); + expect(1).toEqual(file1.deletedLines); + expect("bla with \ttab.scala").toEqual(file1.oldName); + expect("bla with \ttab.scala").toEqual(file1.newName); + expect(1).toEqual(file1.blocks.length); + }); + + it("should parse diff with prefix", function() { + const diff = + 'diff --git "\tbla with \ttab.scala" "\tbla with \ttab.scala"\n' + + "index 4c679d7..e9bd385 100644\n" + + '--- "\tbla with \ttab.scala"\n' + + '+++ "\tbla with \ttab.scala"\n' + + "@@ -1 +1,2 @@\n" + + "-cenas\n" + + "+cenas com ananas\n" + + "+bananas"; + + const result = DiffParser.generateDiffJson(diff, { srcPrefix: "\t", dstPrefix: "\t" }); + const file1 = result[0]; + expect(1).toEqual(result.length); + expect(2).toEqual(file1.addedLines); + expect(1).toEqual(file1.deletedLines); + expect("bla with \ttab.scala").toEqual(file1.oldName); + expect("bla with \ttab.scala").toEqual(file1.newName); + expect(1).toEqual(file1.blocks.length); + }); + + it("should parse diff with deleted file", function() { + const diff = + "diff --git a/src/var/strundefined.js b/src/var/strundefined.js\n" + + "deleted file mode 100644\n" + + "index 04e16b0..0000000\n" + + "--- a/src/var/strundefined.js\n" + + "+++ /dev/null\n" + + "@@ -1,3 +0,0 @@\n" + + "-define(function() {\n" + + "- return typeof undefined;\n" + + "-});\n"; + + const result = DiffParser.generateDiffJson(diff); + expect(1).toEqual(result.length); + + const file1 = result[0]; + expect(false).toEqual(file1.isCombined); + expect(0).toEqual(file1.addedLines); + expect(3).toEqual(file1.deletedLines); + expect("src/var/strundefined.js").toEqual(file1.oldName); + expect("/dev/null").toEqual(file1.newName); + expect(1).toEqual(file1.blocks.length); + expect(true).toEqual(file1.isDeleted); + expect("04e16b0").toEqual(file1.checksumBefore); + expect("0000000").toEqual(file1.checksumAfter); + }); + + it("should parse diff with new file", function() { + const diff = + "diff --git a/test.js b/test.js\n" + + "new file mode 100644\n" + + "index 0000000..e1e22ec\n" + + "--- /dev/null\n" + + "+++ b/test.js\n" + + "@@ -0,0 +1,5 @@\n" + + "+var parser = require('./source/git-parser');\n" + + "+\n" + + "+var patchLineList = [ false, false, false, false ];\n" + + "+\n" + + "+console.log(parser.parsePatchDiffResult(text, patchLineList));\n"; + + const result = DiffParser.generateDiffJson(diff); + expect(1).toEqual(result.length); + + const file1 = result[0]; + expect(false).toEqual(file1.isCombined); + expect(5).toEqual(file1.addedLines); + expect(0).toEqual(file1.deletedLines); + expect("/dev/null").toEqual(file1.oldName); + expect("test.js").toEqual(file1.newName); + expect(1).toEqual(file1.blocks.length); + expect(true).toEqual(file1.isNew); + expect("100644").toEqual(file1.newFileMode); + expect("0000000").toEqual(file1.checksumBefore); + expect("e1e22ec").toEqual(file1.checksumAfter); + }); + + it("should parse diff with nested diff", function() { + const diff = + "diff --git a/src/offset.js b/src/offset.js\n" + + "index cc6ffb4..fa51f18 100644\n" + + "--- a/src/offset.js\n" + + "+++ b/src/offset.js\n" + + "@@ -1,6 +1,5 @@\n" + + "+var parser = require('./source/git-parser');\n" + + "+\n" + + "+var text = 'diff --git a/components/app/app.html b/components/app/app.html\\nindex ecb7a95..027bd9b 100644\\n--- a/components/app/app.html\\n+++ b/components/app/app.html\\n@@ -52,0 +53,3 @@\\n+\\n+\\n+\\n@@ -56,0 +60,3 @@\\n+\\n+\\n+\\n'\n" + + "+var patchLineList = [ false, false, false, false ];\n" + + "+\n" + + "+console.log(parser.parsePatchDiffResult(text, patchLineList));\n"; + + const result = DiffParser.generateDiffJson(diff); + expect(1).toEqual(result.length); + + const file1 = result[0]; + expect(false).toEqual(file1.isCombined); + expect(6).toEqual(file1.addedLines); + expect(0).toEqual(file1.deletedLines); + expect("src/offset.js").toEqual(file1.oldName); + expect("src/offset.js").toEqual(file1.newName); + expect(1).toEqual(file1.blocks.length); + expect(6).toEqual(file1.blocks[0].lines.length); + expect("cc6ffb4").toEqual(file1.checksumBefore); + expect("fa51f18").toEqual(file1.checksumAfter); + }); + + it("should parse diff with multiple blocks", function() { + const diff = + "diff --git a/src/attributes/classes.js b/src/attributes/classes.js\n" + + "index c617824..c8d1393 100644\n" + + "--- a/src/attributes/classes.js\n" + + "+++ b/src/attributes/classes.js\n" + + "@@ -1,10 +1,9 @@\n" + + " define([\n" + + ' "../core",\n' + + ' "../var/rnotwhite",\n' + + '- "../var/strundefined",\n' + + ' "../data/var/dataPriv",\n' + + ' "../core/init"\n' + + "-], function( jQuery, rnotwhite, strundefined, dataPriv ) {\n" + + "+], function( jQuery, rnotwhite, dataPriv ) {\n" + + " \n" + + " var rclass = /[\\t\\r\\n\\f]/g;\n" + + " \n" + + "@@ -128,7 +127,7 @@ jQuery.fn.extend({\n" + + " }\n" + + " \n" + + " // Toggle whole class name\n" + + '- } else if ( type === strundefined || type === "boolean" ) {\n' + + '+ } else if ( value === undefined || type === "boolean" ) {\n' + + " if ( this.className ) {\n" + + " // store className if set\n" + + ' dataPriv.set( this, "__className__", this.className );\n'; + + const result = DiffParser.generateDiffJson(diff); + expect(1).toEqual(result.length); + + const file1 = result[0]; + expect(false).toEqual(file1.isCombined); + expect(2).toEqual(file1.addedLines); + expect(3).toEqual(file1.deletedLines); + expect("src/attributes/classes.js").toEqual(file1.oldName); + expect("src/attributes/classes.js").toEqual(file1.newName); + expect(2).toEqual(file1.blocks.length); + expect(11).toEqual(file1.blocks[0].lines.length); + expect(8).toEqual(file1.blocks[1].lines.length); + expect("c617824").toEqual(file1.checksumBefore); + expect("c8d1393").toEqual(file1.checksumAfter); + }); + + it("should parse diff with multiple files", function() { + const diff = + "diff --git a/src/core/init.js b/src/core/init.js\n" + + "index e49196a..50f310c 100644\n" + + "--- a/src/core/init.js\n" + + "+++ b/src/core/init.js\n" + + "@@ -101,7 +101,7 @@ var rootjQuery,\n" + + " // HANDLE: $(function)\n" + + " // Shortcut for document ready\n" + + " } else if ( jQuery.isFunction( selector ) ) {\n" + + '- return typeof rootjQuery.ready !== "undefined" ?\n' + + "+ return rootjQuery.ready !== undefined ?\n" + + " rootjQuery.ready( selector ) :\n" + + " // Execute immediately if ready is not present\n" + + " selector( jQuery );\n" + + "diff --git a/src/event.js b/src/event.js\n" + + "index 7336f4d..6183f70 100644\n" + + "--- a/src/event.js\n" + + "+++ b/src/event.js\n" + + "@@ -1,6 +1,5 @@\n" + + " define([\n" + + ' "./core",\n' + + '- "./var/strundefined",\n' + + ' "./var/rnotwhite",\n' + + ' "./var/hasOwn",\n' + + ' "./var/slice",\n'; + + const result = DiffParser.generateDiffJson(diff); + expect(2).toEqual(result.length); + + const file1 = result[0]; + expect(false).toEqual(file1.isCombined); + expect(1).toEqual(file1.addedLines); + expect(1).toEqual(file1.deletedLines); + expect("src/core/init.js").toEqual(file1.oldName); + expect("src/core/init.js").toEqual(file1.newName); + expect(1).toEqual(file1.blocks.length); + expect(8).toEqual(file1.blocks[0].lines.length); + expect("e49196a").toEqual(file1.checksumBefore); + expect("50f310c").toEqual(file1.checksumAfter); + + const file2 = result[1]; + expect(false).toEqual(file2.isCombined); + expect(0).toEqual(file2.addedLines); + expect(1).toEqual(file2.deletedLines); + expect("src/event.js").toEqual(file2.oldName); + expect("src/event.js").toEqual(file2.newName); + expect(1).toEqual(file2.blocks.length); + expect(6).toEqual(file2.blocks[0].lines.length); + expect("7336f4d").toEqual(file2.checksumBefore); + expect("6183f70").toEqual(file2.checksumAfter); + }); + + it("should parse combined diff", function() { + const diff = + "diff --combined describe.c\n" + + "index fabadb8,cc95eb0..4866510\n" + + "--- a/describe.c\n" + + "+++ b/describe.c\n" + + "@@@ -98,20 -98,12 +98,20 @@@\n" + + " return (a_date > b_date) ? -1 : (a_date == b_date) ? 0 : 1;\n" + + " }\n" + + " \n" + + "- static void describe(char *arg)\n" + + " -static void describe(struct commit *cmit, int last_one)\n" + + "++static void describe(char *arg, int last_one)\n" + + " {\n" + + " + unsigned char sha1[20];\n" + + " + struct commit *cmit;\n" + + " struct commit_list *list;\n" + + " static int initialized = 0;\n" + + " struct commit_name *n;\n" + + " \n" + + " + if (get_sha1(arg, sha1) < 0)\n" + + " + usage(describe_usage);\n" + + " + cmit = lookup_commit_reference(sha1);\n" + + " + if (!cmit)\n" + + " + usage(describe_usage);\n" + + " +\n" + + " if (!initialized) {\n" + + " initialized = 1;\n" + + " for_each_ref(get_name);\n"; + + const result = DiffParser.generateDiffJson(diff); + expect(1).toEqual(result.length); + + const file1 = result[0]; + expect(true).toEqual(file1.isCombined); + expect(9).toEqual(file1.addedLines); + expect(2).toEqual(file1.deletedLines); + expect("describe.c").toEqual(file1.oldName); + expect("describe.c").toEqual(file1.newName); + expect(1).toEqual(file1.blocks.length); + expect(22).toEqual(file1.blocks[0].lines.length); + expect(["4866510", "cc95eb0"].sort()).toEqual(file1.checksumBefore.sort()); + expect("fabadb8").toEqual(file1.checksumAfter); + }); + + it("should parse diffs with copied files", function() { + const diff = + "diff --git a/index.js b/more-index.js\n" + + "dissimilarity index 5%\n" + + "copy from index.js\n" + + "copy to more-index.js\n"; + + const result = DiffParser.generateDiffJson(diff); + expect(1).toEqual(result.length); + + const file1 = result[0]; + expect(0).toEqual(file1.addedLines); + expect(0).toEqual(file1.deletedLines); + expect("index.js").toEqual(file1.oldName); + expect("more-index.js").toEqual(file1.newName); + expect(0).toEqual(file1.blocks.length); + expect(true).toEqual(file1.isCopy); + expect("5").toEqual(file1.changedPercentage); + }); + + it("should parse diffs with moved files", function() { + const diff = + "diff --git a/more-index.js b/other-index.js\n" + + "similarity index 86%\n" + + "rename from more-index.js\n" + + "rename to other-index.js\n"; + + const result = DiffParser.generateDiffJson(diff); + expect(1).toEqual(result.length); + + const file1 = result[0]; + expect(0).toEqual(file1.addedLines); + expect(0).toEqual(file1.deletedLines); + expect("more-index.js").toEqual(file1.oldName); + expect("other-index.js").toEqual(file1.newName); + expect(0).toEqual(file1.blocks.length); + expect(true).toEqual(file1.isRename); + expect("86").toEqual(file1.unchangedPercentage); + }); + + it("should parse diffs correct line numbers", function() { + const diff = + "diff --git a/sample b/sample\n" + + "index 0000001..0ddf2ba\n" + + "--- a/sample\n" + + "+++ b/sample\n" + + "@@ -1 +1,2 @@\n" + + "-test\n" + + "+test1r\n"; + + const result = DiffParser.generateDiffJson(diff); + expect(1).toEqual(result.length); + + const file1 = result[0]; + expect(1).toEqual(file1.addedLines); + expect(1).toEqual(file1.deletedLines); + expect("sample").toEqual(file1.oldName); + expect("sample").toEqual(file1.newName); + expect(1).toEqual(file1.blocks.length); + expect(2).toEqual(file1.blocks[0].lines.length); + expect(1).toEqual(file1.blocks[0].lines[0].oldNumber); + expect(null).toEqual(file1.blocks[0].lines[0].newNumber); + expect(null).toEqual(file1.blocks[0].lines[1].oldNumber); + expect(1).toEqual(file1.blocks[0].lines[1].newNumber); + }); + + it("should parse unified non git diff and strip timestamps off the headers", function() { + const diffs = [ + // 2 hours ahead of GMT + "--- a/sample.js 2016-10-25 11:37:14.000000000 +0200\n" + + "+++ b/sample.js 2016-10-25 11:37:14.000000000 +0200\n" + + "@@ -1 +1,2 @@\n" + + "-test\n" + + "+test1r\n" + + "+test2r\n", + // 2 hours behind GMT + "--- a/sample.js 2016-10-25 11:37:14.000000000 -0200\n" + + "+++ b/sample.js 2016-10-25 11:37:14.000000000 -0200\n" + + "@@ -1 +1,2 @@\n" + + "-test\n" + + "+test1r\n" + + "+test2r\n" + ]; + + diffs.forEach(function(diff) { + const result = DiffParser.generateDiffJson(diff); + const file1 = result[0]; + expect(1).toEqual(result.length); + expect(2).toEqual(file1.addedLines); + expect(1).toEqual(file1.deletedLines); + expect("sample.js").toEqual(file1.oldName); + expect("sample.js").toEqual(file1.newName); + expect(1).toEqual(file1.blocks.length); + + const linesContent = file1.blocks[0].lines.map(function(line) { + return line.content; + }); + expect(linesContent).toEqual(["-test", "+test1r", "+test2r"]); + }); + }); + + it("should parse unified non git diff", function() { + const diff = + "--- a/sample.js\n" + "+++ b/sample.js\n" + "@@ -1 +1,2 @@\n" + "-test\n" + "+test1r\n" + "+test2r\n"; + + const result = DiffParser.generateDiffJson(diff); + const file1 = result[0]; + expect(1).toEqual(result.length); + expect(2).toEqual(file1.addedLines); + expect(1).toEqual(file1.deletedLines); + expect("sample.js").toEqual(file1.oldName); + expect("sample.js").toEqual(file1.newName); + expect(1).toEqual(file1.blocks.length); + + const linesContent = file1.blocks[0].lines.map(function(line) { + return line.content; + }); + expect(linesContent).toEqual(["-test", "+test1r", "+test2r"]); + }); + + it("should parse unified diff with multiple hunks and files", function() { + const diff = + "--- sample.js\n" + + "+++ sample.js\n" + + "@@ -1 +1,2 @@\n" + + "-test\n" + + "@@ -10 +20,2 @@\n" + + "+test\n" + + "--- sample1.js\n" + + "+++ sample1.js\n" + + "@@ -1 +1,2 @@\n" + + "+test1"; + + const result = DiffParser.generateDiffJson(diff); + expect(2).toEqual(result.length); + + const file1 = result[0]; + expect(1).toEqual(file1.addedLines); + expect(1).toEqual(file1.deletedLines); + expect("sample.js").toEqual(file1.oldName); + expect("sample.js").toEqual(file1.newName); + expect(2).toEqual(file1.blocks.length); + + const linesContent1 = file1.blocks[0].lines.map(function(line) { + return line.content; + }); + expect(linesContent1).toEqual(["-test"]); + + const linesContent2 = file1.blocks[1].lines.map(function(line) { + return line.content; + }); + expect(linesContent2).toEqual(["+test"]); + + const file2 = result[1]; + expect(1).toEqual(file2.addedLines); + expect(0).toEqual(file2.deletedLines); + expect("sample1.js").toEqual(file2.oldName); + expect("sample1.js").toEqual(file2.newName); + expect(1).toEqual(file2.blocks.length); + + const linesContent = file2.blocks[0].lines.map(function(line) { + return line.content; + }); + expect(linesContent).toEqual(["+test1"]); + }); + + it("should parse diff with --- and +++ in the context lines", function() { + const diff = + "--- sample.js\n" + + "+++ sample.js\n" + + "@@ -1,8 +1,8 @@\n" + + " test\n" + + " \n" + + "-- 1\n" + + "--- 1\n" + + "---- 1\n" + + " \n" + + "++ 2\n" + + "+++ 2\n" + + "++++ 2"; + + const result = DiffParser.generateDiffJson(diff); + const file1 = result[0]; + expect(1).toEqual(result.length); + expect(3).toEqual(file1.addedLines); + expect(3).toEqual(file1.deletedLines); + expect("sample.js").toEqual(file1.oldName); + expect("sample.js").toEqual(file1.newName); + expect(1).toEqual(file1.blocks.length); + + const linesContent = file1.blocks[0].lines.map(function(line) { + return line.content; + }); + expect(linesContent).toEqual([" test", " ", "-- 1", "--- 1", "---- 1", " ", "++ 2", "+++ 2", "++++ 2"]); + }); + + it("should parse diff without proper hunk headers", function() { + const diff = "--- sample.js\n" + "+++ sample.js\n" + "@@ @@\n" + " test"; + + const result = DiffParser.generateDiffJson(diff); + const file1 = result[0]; + expect(1).toEqual(result.length); + expect(0).toEqual(file1.addedLines); + expect(0).toEqual(file1.deletedLines); + expect("sample.js").toEqual(file1.oldName); + expect("sample.js").toEqual(file1.newName); + expect(1).toEqual(file1.blocks.length); + + const linesContent = file1.blocks[0].lines.map(function(line) { + return line.content; + }); + expect(linesContent).toEqual([" test"]); + }); + + it("should parse binary file diff", function() { + const diff = + "diff --git a/last-changes-config.png b/last-changes-config.png\n" + + "index 322248b..56fc1f2 100644\n" + + "--- a/last-changes-config.png\n" + + "+++ b/last-changes-config.png\n" + + "Binary files differ"; + + const result = DiffParser.generateDiffJson(diff); + const file1 = result[0]; + expect(1).toEqual(result.length); + expect(0).toEqual(file1.addedLines); + expect(0).toEqual(file1.deletedLines); + expect("last-changes-config.png").toEqual(file1.oldName); + expect("last-changes-config.png").toEqual(file1.newName); + expect(1).toEqual(file1.blocks.length); + expect(0).toEqual(file1.blocks[0].lines.length); + expect("Binary files differ").toEqual(file1.blocks[0].header); + }); + + it("should parse diff with --find-renames", function() { + const diff = + "diff --git a/src/test-bar.js b/src/test-baz.js\n" + + "similarity index 98%\n" + + "rename from src/test-bar.js\n" + + "rename to src/test-baz.js\n" + + "index e01513b..f14a870 100644\n" + + "--- a/src/test-bar.js\n" + + "+++ b/src/test-baz.js\n" + + "@@ -1,4 +1,32 @@\n" + + " function foo() {\n" + + '-var bar = "Whoops!";\n' + + '+var baz = "Whoops!";\n' + + " }\n" + + " "; + + const result = DiffParser.generateDiffJson(diff); + const file1 = result[0]; + expect(1).toEqual(result.length); + expect(1).toEqual(file1.addedLines); + expect(1).toEqual(file1.deletedLines); + expect("src/test-bar.js").toEqual(file1.oldName); + expect("src/test-baz.js").toEqual(file1.newName); + expect(1).toEqual(file1.blocks.length); + expect(5).toEqual(file1.blocks[0].lines.length); + const linesContent = file1.blocks[0].lines.map(function(line) { + return line.content; + }); + expect(linesContent).toEqual([" function foo() {", '-var bar = "Whoops!";', '+var baz = "Whoops!";', " }", " "]); + }); + + it("should parse diff with prefix 2", function() { + const diff = + 'diff --git "\tTest.scala" "\tScalaTest.scala"\n' + + "similarity index 88%\n" + + "rename from Test.scala\n" + + "rename to ScalaTest.scala\n" + + "index 7d1f9bf..8b13271 100644\n" + + '--- "\tTest.scala"\n' + + '+++ "\tScalaTest.scala"\n' + + "@@ -1,6 +1,8 @@\n" + + " class Test {\n" + + " \n" + + " def method1 = ???\n" + + "+\n" + + "+ def method2 = ???\n" + + " \n" + + " def myMethod = ???\n" + + " \n" + + "@@ -10,7 +12,6 @@ class Test {\n" + + " \n" + + " def + = ???\n" + + " \n" + + "- def |> = ???\n" + + " \n" + + " }\n" + + " \n" + + 'diff --git "\ttardis.png" "\ttardis.png"\n' + + "new file mode 100644\n" + + "index 0000000..d503a29\n" + + 'Binary files /dev/null and "\ttardis.png" differ\n' + + "diff --git a/src/test-bar.js b/src/test-baz.js\n" + + "similarity index 98%\n" + + "rename from src/test-bar.js\n" + + "rename to src/test-baz.js\n" + + "index e01513b..f14a870 100644\n" + + "--- a/src/test-bar.js\n" + + "+++ b/src/test-baz.js\n" + + "@@ -1,4 +1,32 @@\n" + + " function foo() {\n" + + '-var bar = "Whoops!";\n' + + '+var baz = "Whoops!";\n' + + " }\n" + + " "; + + const result = DiffParser.generateDiffJson(diff, { srcPrefix: "\t", dstPrefix: "\t" }); + expect(3).toEqual(result.length); + + const file1 = result[0]; + expect(2).toEqual(file1.addedLines); + expect(1).toEqual(file1.deletedLines); + expect("Test.scala").toEqual(file1.oldName); + expect("ScalaTest.scala").toEqual(file1.newName); + expect(2).toEqual(file1.blocks.length); + expect(8).toEqual(file1.blocks[0].lines.length); + expect(7).toEqual(file1.blocks[1].lines.length); + + const file2 = result[1]; + expect("/dev/null").toEqual(file2.oldName); + expect("tardis.png").toEqual(file2.newName); + + const file3 = result[2]; + expect(1).toEqual(file3.addedLines); + expect(1).toEqual(file3.deletedLines); + expect("src/test-bar.js").toEqual(file3.oldName); + expect("src/test-baz.js").toEqual(file3.newName); + expect(1).toEqual(file3.blocks.length); + expect(5).toEqual(file3.blocks[0].lines.length); + const linesContent = file3.blocks[0].lines.map(function(line) { + return line.content; + }); + expect(linesContent).toEqual([" function foo() {", '-var bar = "Whoops!";', '+var baz = "Whoops!";', " }", " "]); + }); + + it("should parse binary with content", function() { + const diff = + "diff --git a/favicon.png b/favicon.png\n" + + "deleted file mode 100644\n" + + "index 2a9d516a5647205d7be510dd0dff93a3663eff6f..0000000000000000000000000000000000000000\n" + + "GIT binary patch\n" + + "literal 0\n" + + "HcmV?d00001\n" + + "\n" + + "literal 471\n" + + "zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61|;P_|4#%`EX7WqAsj$Z!;#Vf4nJ\n" + + "za0`JjqPVOAS4ANVKzqmCp=Cty@U^(7zk!jHsvT~YI{F^=Ex6g|gox78w\n" + + "z+Sn2Du3GS9U7qU`1*NYYlJi3u-!-_B#8k9H0\n" + + "zGl{FnZs<2$wz5^=Q2h-1XI^s{LQL1#T4epqNPC%Orl(tD_@!*EY++~^Lt2<2&!&%=\n" + + "z`m>(TYj6uS7jDdt=eH>iOyQg(QMR<-Fw8)Dk^ZG)XQTuzEgl{`GpS?Cfq9818R9~=\n" + + "z{&h9@9n8F^?|qusoPy{k#%tVHzu7H$t26CR`BJZk*Ixf&u36WuS=?6m2^ho-p00i_\n" + + "I>zopr0Nz-&lmGw#\n" + + "diff --git a/src/test-bar.js b/src/test-baz.js\n" + + "similarity index 98%\n" + + "rename from src/test-bar.js\n" + + "rename to src/test-baz.js\n" + + "index e01513b..f14a870 100644\n" + + "--- a/src/test-bar.js\n" + + "+++ b/src/test-baz.js\n" + + "@@ -1,4 +1,32 @@\n" + + " function foo() {\n" + + '-var bar = "Whoops!";\n' + + '+var baz = "Whoops!";\n' + + " }\n" + + " "; + + const result = DiffParser.generateDiffJson(diff); + expect(2).toEqual(result.length); + + const file1 = result[0]; + expect("favicon.png").toEqual(file1.oldName); + expect("favicon.png").toEqual(file1.newName); + expect(1).toEqual(file1.blocks.length); + expect(0).toEqual(file1.blocks[0].lines.length); + + const file2 = result[1]; + expect(1).toEqual(file2.addedLines); + expect(1).toEqual(file2.deletedLines); + expect("src/test-bar.js").toEqual(file2.oldName); + expect("src/test-baz.js").toEqual(file2.newName); + expect(1).toEqual(file2.blocks.length); + expect(5).toEqual(file2.blocks[0].lines.length); + const linesContent = file2.blocks[0].lines.map(function(line) { + return line.content; + }); + expect(linesContent).toEqual([" function foo() {", '-var bar = "Whoops!";', '+var baz = "Whoops!";', " }", " "]); + }); + }); +}); diff --git a/test/diff2html-tests.js b/src/__tests__/diff2html-tests.js similarity index 60% rename from test/diff2html-tests.js rename to src/__tests__/diff2html-tests.js index af9914c..04810e7 100644 --- a/test/diff2html-tests.js +++ b/src/__tests__/diff2html-tests.js @@ -1,59 +1,56 @@ -var assert = require('assert'); +const Diff2Html = require("../diff2html.js").Diff2Html; -var Diff2Html = require('../src/diff2html.js').Diff2Html; +const diffExample1 = + "diff --git a/sample b/sample\n" + + "index 0000001..0ddf2ba\n" + + "--- a/sample\n" + + "+++ b/sample\n" + + "@@ -1 +1 @@\n" + + "-test\n" + + "+test1\n"; -var diffExample1 = - 'diff --git a/sample b/sample\n' + - 'index 0000001..0ddf2ba\n' + - '--- a/sample\n' + - '+++ b/sample\n' + - '@@ -1 +1 @@\n' + - '-test\n' + - '+test1\n'; +const jsonExample1 = [ + { + blocks: [ + { + lines: [ + { + content: "-test", + type: "d2h-del", + oldNumber: 1, + newNumber: null + }, + { + content: "+test1", + type: "d2h-ins", + oldNumber: null, + newNumber: 1 + } + ], + oldStartLine: "1", + oldStartLine2: null, + newStartLine: "1", + header: "@@ -1 +1 @@" + } + ], + deletedLines: 1, + addedLines: 1, + checksumBefore: "0000001", + checksumAfter: "0ddf2ba", + oldName: "sample", + language: undefined, + newName: "sample", + isCombined: false + } +]; -var jsonExample1 = - [ - { - blocks: [ - { - lines: [ - { - content: '-test', - type: 'd2h-del', - oldNumber: 1, - newNumber: null - }, - { - content: '+test1', - type: 'd2h-ins', - oldNumber: null, - newNumber: 1 - } - ], - oldStartLine: '1', - oldStartLine2: null, - newStartLine: '1', - header: '@@ -1 +1 @@' - } - ], - deletedLines: 1, - addedLines: 1, - checksumBefore: '0000001', - checksumAfter: '0ddf2ba', - oldName: 'sample', - language: undefined, - newName: 'sample', - isCombined: false - } - ]; - -var filesExample1 = +const filesExample1 = '
    \n' + '
    \n' + ' Files changed (1)\n' + ' hide\n' + ' show\n' + - '
    \n' + + "
    \n" + '
      \n' + '
    1. \n' + ' \n' + @@ -64,13 +61,13 @@ var filesExample1 = ' \n' + ' +1\n' + ' -1\n' + - ' \n' + - ' \n' + - '
    2. \n' + - '
    \n' + - ''; + " \n" + + " \n" + + "\n" + + " \n" + + ""; -var htmlLineExample1 = +const htmlLineExample1 = '
    \n' + '
    \n' + '
    \n' + @@ -79,49 +76,49 @@ var htmlLineExample1 = ' \n' + ' sample\n' + ' CHANGED\n' + - '
    \n' + + "
    \n" + '
    \n' + '
    \n' + ' \n' + ' \n' + - ' \n' + + " \n" + ' \n' + ' \n' + - '\n' + + " \n" + + "\n" + ' \n' + + " \n" + ' \n' + - '\n' + + " \n" + + " \n" + + "\n" + ' \n' + + " \n" + ' \n' + - '\n' + - ' \n' + - '
    \n' + '
    @@ -1 +1 @@
    \n' + - '
    \n' + '
    1
    \n' + '
    \n' + - '
    \n' + '
    \n' + ' -\n' + ' test\n' + - '
    \n' + - '
    \n' + '
    \n' + '
    1
    \n' + - '
    \n' + '
    \n' + ' +\n' + ' test1\n' + - '
    \n' + - '
    \n' + - '
    \n' + - '
    \n' + - '
    \n' + - ''; + " \n" + + " \n" + + "\n" + + " \n" + + " \n" + + " \n" + + " \n" + + "\n" + + ""; -var htmlLineExample1WithFilesSummary = filesExample1 + htmlLineExample1; +const htmlLineExample1WithFilesSummary = filesExample1 + htmlLineExample1; -var htmlSideExample1 = +const htmlSideExample1 = '
    \n' + '
    \n' + '
    \n' + @@ -130,187 +127,189 @@ var htmlSideExample1 = ' \n' + ' sample\n' + ' CHANGED\n' + - '
    \n' + + "
    \n" + '
    \n' + '
    \n' + '
    \n' + ' \n' + ' \n' + - ' \n' + + " \n" + ' \n' + ' \n' + - '\n' + + " \n" + + "\n" + ' \n' + + " 1\n" + + " \n" + ' \n' + - '\n' + - ' \n' + - '
    \n' + '
    @@ -1 +1 @@
    \n' + - '
    \n' + - ' 1\n' + - ' \n' + '
    \n' + ' -\n' + ' test\n' + - '
    \n' + - '
    \n' + - '
    \n' + - '
    \n' + + "
    \n" + + " \n" + + "\n" + + " \n" + + " \n" + + "
    \n" + + " \n" + '
    \n' + '
    \n' + ' \n' + ' \n' + - ' \n' + + " \n" + ' \n' + ' \n' + - '\n' + + " \n" + + "\n" + ' \n' + + " 1\n" + + " \n" + ' \n' + - '\n' + - ' \n' + - '
    \n' + '
    \n' + - '
    \n' + - ' 1\n' + - ' \n' + '
    \n' + ' +\n' + ' test1\n' + - '
    \n' + - '
    \n' + - '
    \n' + - '
    \n' + - ' \n' + - '\n' + - ''; + " \n" + + " \n" + + "\n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + "\n" + + ""; -var htmlSideExample1WithFilesSummary = filesExample1 + htmlSideExample1; +const htmlSideExample1WithFilesSummary = filesExample1 + htmlSideExample1; -describe('Diff2Html', function() { - describe('getJsonFromDiff', function() { - it('should parse simple diff to json', function() { - var diff = - 'diff --git a/sample b/sample\n' + - 'index 0000001..0ddf2ba\n' + - '--- a/sample\n' + - '+++ b/sample\n' + - '@@ -1 +1 @@\n' + - '-test\n' + - '+test1\n'; - var result = Diff2Html.getJsonFromDiff(diff); +describe("Diff2Html", function() { + describe("getJsonFromDiff", function() { + it("should parse simple diff to json", function() { + const diff = + "diff --git a/sample b/sample\n" + + "index 0000001..0ddf2ba\n" + + "--- a/sample\n" + + "+++ b/sample\n" + + "@@ -1 +1 @@\n" + + "-test\n" + + "+test1\n"; + const result = Diff2Html.getJsonFromDiff(diff); - var file1 = result[0]; - assert.equal(1, result.length); - assert.equal(1, file1.addedLines); - assert.equal(1, file1.deletedLines); - assert.equal('sample', file1.oldName); - assert.equal('sample', file1.newName); - assert.equal(1, file1.blocks.length); + const file1 = result[0]; + expect(1).toEqual(result.length); + expect(1).toEqual(file1.addedLines); + expect(1).toEqual(file1.deletedLines); + expect("sample").toEqual(file1.oldName); + expect("sample").toEqual(file1.newName); + expect(1).toEqual(file1.blocks.length); }); // Test case for issue #49 - it('should parse diff with added EOF', function() { - var diff = - 'diff --git a/sample.scala b/sample.scala\n' + - 'index b583263..8b2fc3e 100644\n' + - '--- a/b583263..8b2fc3e\n' + - '+++ b/8b2fc3e\n' + - '@@ -50,5 +50,7 @@ case class Response[+A](value: Option[A],\n' + - ' object ResponseErrorCode extends JsonEnumeration {\n' + - ' val NoError, ServiceError, JsonError,\n' + - ' InvalidPermissions, MissingPermissions, GenericError,\n' + - '- TokenRevoked, MissingToken = Value\n' + - '-}\n' + - '\\ No newline at end of file\n' + - '+ TokenRevoked, MissingToken,\n' + - '+ IndexLock, RepositoryError, NotValidRepo, PullRequestNotMergeable, BranchError,\n' + - '+ PluginError, CodeParserError, EngineError = Value\n' + - '+}\n'; - var result = Diff2Html.getJsonFromDiff(diff); + it("should parse diff with added EOF", function() { + const diff = + "diff --git a/sample.scala b/sample.scala\n" + + "index b583263..8b2fc3e 100644\n" + + "--- a/b583263..8b2fc3e\n" + + "+++ b/8b2fc3e\n" + + "@@ -50,5 +50,7 @@ case class Response[+A](value: Option[A],\n" + + " object ResponseErrorCode extends JsonEnumeration {\n" + + " val NoError, ServiceError, JsonError,\n" + + " InvalidPermissions, MissingPermissions, GenericError,\n" + + "- TokenRevoked, MissingToken = Value\n" + + "-}\n" + + "\\ No newline at end of file\n" + + "+ TokenRevoked, MissingToken,\n" + + "+ IndexLock, RepositoryError, NotValidRepo, PullRequestNotMergeable, BranchError,\n" + + "+ PluginError, CodeParserError, EngineError = Value\n" + + "+}\n"; + const result = Diff2Html.getJsonFromDiff(diff); - assert.equal(50, result[0].blocks[0].lines[0].oldNumber); - assert.equal(50, result[0].blocks[0].lines[0].newNumber); + expect(50).toEqual(result[0].blocks[0].lines[0].oldNumber); + expect(50).toEqual(result[0].blocks[0].lines[0].newNumber); - assert.equal(51, result[0].blocks[0].lines[1].oldNumber); - assert.equal(51, result[0].blocks[0].lines[1].newNumber); + expect(51).toEqual(result[0].blocks[0].lines[1].oldNumber); + expect(51).toEqual(result[0].blocks[0].lines[1].newNumber); - assert.equal(52, result[0].blocks[0].lines[2].oldNumber); - assert.equal(52, result[0].blocks[0].lines[2].newNumber); + expect(52).toEqual(result[0].blocks[0].lines[2].oldNumber); + expect(52).toEqual(result[0].blocks[0].lines[2].newNumber); - assert.equal(53, result[0].blocks[0].lines[3].oldNumber); - assert.equal(null, result[0].blocks[0].lines[3].newNumber); + expect(53).toEqual(result[0].blocks[0].lines[3].oldNumber); + expect(null).toEqual(result[0].blocks[0].lines[3].newNumber); - assert.equal(54, result[0].blocks[0].lines[4].oldNumber); - assert.equal(null, result[0].blocks[0].lines[4].newNumber); + expect(54).toEqual(result[0].blocks[0].lines[4].oldNumber); + expect(null).toEqual(result[0].blocks[0].lines[4].newNumber); - assert.equal(null, result[0].blocks[0].lines[5].oldNumber); - assert.equal(53, result[0].blocks[0].lines[5].newNumber); + expect(null).toEqual(result[0].blocks[0].lines[5].oldNumber); + expect(53).toEqual(result[0].blocks[0].lines[5].newNumber); - assert.equal(null, result[0].blocks[0].lines[6].oldNumber); - assert.equal(54, result[0].blocks[0].lines[6].newNumber); + expect(null).toEqual(result[0].blocks[0].lines[6].oldNumber); + expect(54).toEqual(result[0].blocks[0].lines[6].newNumber); - assert.equal(null, result[0].blocks[0].lines[7].oldNumber); - assert.equal(55, result[0].blocks[0].lines[7].newNumber); + expect(null).toEqual(result[0].blocks[0].lines[7].oldNumber); + expect(55).toEqual(result[0].blocks[0].lines[7].newNumber); - assert.equal(null, result[0].blocks[0].lines[8].oldNumber); - assert.equal(56, result[0].blocks[0].lines[8].newNumber); + expect(null).toEqual(result[0].blocks[0].lines[8].oldNumber); + expect(56).toEqual(result[0].blocks[0].lines[8].newNumber); }); - it('should generate pretty line by line html from diff', function() { - var result = Diff2Html.getPrettyHtmlFromDiff(diffExample1); - assert.equal(htmlLineExample1, result); + it("should generate pretty line by line html from diff", function() { + const result = Diff2Html.getPrettyHtmlFromDiff(diffExample1); + expect(htmlLineExample1).toEqual(result); }); - it('should generate pretty line by line html from json', function() { - var result = Diff2Html.getPrettyHtmlFromJson(jsonExample1); - assert.equal(htmlLineExample1, result); + it("should generate pretty line by line html from json", function() { + const result = Diff2Html.getPrettyHtmlFromJson(jsonExample1); + expect(htmlLineExample1).toEqual(result); }); - it('should generate pretty diff with files summary', function() { - var result = Diff2Html.getPrettyHtmlFromDiff(diffExample1, {showFiles: true}); - assert.equal(htmlLineExample1WithFilesSummary, result); + it("should generate pretty diff with files summary", function() { + const result = Diff2Html.getPrettyHtmlFromDiff(diffExample1, { showFiles: true }); + expect(htmlLineExample1WithFilesSummary).toEqual(result); }); - it('should generate pretty side by side html from diff', function() { - var result = Diff2Html.getPrettySideBySideHtmlFromDiff(diffExample1); - assert.equal(htmlSideExample1, result); + it("should generate pretty side by side html from diff", function() { + const result = Diff2Html.getPrettySideBySideHtmlFromDiff(diffExample1); + expect(htmlSideExample1).toEqual(result); }); - it('should generate pretty side by side html from json', function() { - var result = Diff2Html.getPrettySideBySideHtmlFromJson(jsonExample1); - assert.equal(htmlSideExample1, result); + it("should generate pretty side by side html from json", function() { + const result = Diff2Html.getPrettySideBySideHtmlFromJson(jsonExample1); + expect(htmlSideExample1).toEqual(result); }); - it('should generate pretty side by side html from diff', function() { - var result = Diff2Html.getPrettySideBySideHtmlFromDiff(diffExample1, {showFiles: true}); - assert.equal(htmlSideExample1WithFilesSummary, result); + it("should generate pretty side by side html from diff 2", function() { + const result = Diff2Html.getPrettySideBySideHtmlFromDiff(diffExample1, { showFiles: true }); + expect(htmlSideExample1WithFilesSummary).toEqual(result); }); - it('should generate pretty side by side html from diff with html on headers', function() { - var diffExample2 = 'diff --git a/CHANGELOG.md b/CHANGELOG.md\n' + - 'index fc3e3f4..b486d10 100644\n' + - '--- a/CHANGELOG.md\n' + - '+++ b/CHANGELOG.md\n' + - '@@ -1,7 +1,6 @@\n' + - ' # Change Log\n' + - ' All notable changes to this project will be documented in this file.\n' + - ' This project adheres to [Semantic Versioning](http://semver.org/).\n' + + it("should generate pretty side by side html from diff with html on headers", function() { + const diffExample2 = + "diff --git a/CHANGELOG.md b/CHANGELOG.md\n" + + "index fc3e3f4..b486d10 100644\n" + + "--- a/CHANGELOG.md\n" + + "+++ b/CHANGELOG.md\n" + + "@@ -1,7 +1,6 @@\n" + + " # Change Log\n" + + " All notable changes to this project will be documented in this file.\n" + + " This project adheres to [Semantic Versioning](http://semver.org/).\n" + '-$a="\n" + + "
    Use the following format for additions: ` - VERSION: [feature/patch (if applicable)] Short description of change. Links to relevant issues/PRs.`\n' + ' $a="\n" + + "
    \n' + " $a=\"\n" + + ' \n" + + ""; + + it("should render view", function() { + const result = HoganJsUtils.render("generic", "empty-diff", { + contentClass: "d2h-code-line", + diffParser: diffParser + }); + expect(emptyDiffHtml).toEqual(result); + }); + + it("should render view without cache", function() { + const result = HoganJsUtils.render( + "generic", + "empty-diff", + { + contentClass: "d2h-code-line", + diffParser: diffParser + }, + { noCache: true } + ); + expect(emptyDiffHtml).toEqual(result); + }); + + it("should return null if template is missing", function() { + const hoganUtils = new (require("../hoganjs-utils.js")).HoganJsUtils({ noCache: true }); + const result = hoganUtils.render("generic", "missing-template", {}); + expect(null).toEqual(result); + }); + + it("should allow templates to be overridden with compiled templates", function() { + const emptyDiffTemplate = HoganJsUtils.compile("

    {{myName}}

    "); + + const config = { templates: { "generic-empty-diff": emptyDiffTemplate } }; + const hoganUtils = new (require("../hoganjs-utils.js")).HoganJsUtils(config); + const result = hoganUtils.render("generic", "empty-diff", { myName: "Rodrigo Fernandes" }); + expect("

    Rodrigo Fernandes

    ").toEqual(result); + }); + + it("should allow templates to be overridden with uncompiled templates", function() { + const emptyDiffTemplate = "

    {{myName}}

    "; + + const config = { rawTemplates: { "generic-empty-diff": emptyDiffTemplate } }; + const hoganUtils = new (require("../hoganjs-utils.js")).HoganJsUtils(config); + const result = hoganUtils.render("generic", "empty-diff", { myName: "Rodrigo Fernandes" }); + expect("

    Rodrigo Fernandes

    ").toEqual(result); + }); + + it("should allow templates to be overridden giving priority to compiled templates", function() { + const emptyDiffTemplate = HoganJsUtils.compile("

    {{myName}}

    "); + const emptyDiffTemplateUncompiled = "

    Not used!

    "; + + const config = { + templates: { "generic-empty-diff": emptyDiffTemplate }, + rawTemplates: { "generic-empty-diff": emptyDiffTemplateUncompiled } + }; + const hoganUtils = new (require("../hoganjs-utils.js")).HoganJsUtils(config); + const result = hoganUtils.render("generic", "empty-diff", { myName: "Rodrigo Fernandes" }); + expect("

    Rodrigo Fernandes

    ").toEqual(result); + }); + }); +}); diff --git a/test/line-by-line-tests.js b/src/__tests__/line-by-line-tests.js similarity index 54% rename from test/line-by-line-tests.js rename to src/__tests__/line-by-line-tests.js index 72d3711..60b5836 100644 --- a/test/line-by-line-tests.js +++ b/src/__tests__/line-by-line-tests.js @@ -1,153 +1,152 @@ -var assert = require('assert'); +const LineByLinePrinter = require("../line-by-line-printer.js").LineByLinePrinter; -var LineByLinePrinter = require('../src/line-by-line-printer.js').LineByLinePrinter; - -describe('LineByLinePrinter', function() { - describe('_generateEmptyDiff', function() { - it('should return an empty diff', function() { - var lineByLinePrinter = new LineByLinePrinter({}); - var fileHtml = lineByLinePrinter._generateEmptyDiff(); - var expected = '\n' + +describe("LineByLinePrinter", function() { + describe("_generateEmptyDiff", function() { + it("should return an empty diff", function() { + const lineByLinePrinter = new LineByLinePrinter({}); + const fileHtml = lineByLinePrinter._generateEmptyDiff(); + const expected = + "\n" + ' \n' + - ''; + " File without changes\n" + + " \n" + + " \n" + + ""; - assert.equal(expected, fileHtml); + expect(expected).toEqual(fileHtml); }); }); - describe('makeLineHtml', function() { - it('should work for insertions', function() { - var diffParser = require('../src/diff-parser.js').DiffParser; - var lineByLinePrinter = new LineByLinePrinter({}); - var fileHtml = lineByLinePrinter.makeLineHtml(false, - diffParser.LINE_TYPE.INSERTS, '', 30, 'test', '+'); - fileHtml = fileHtml.replace(/\n\n+/g, '\n'); - var expected = '\n' + + describe("makeLineHtml", function() { + it("should work for insertions", function() { + const diffParser = require("../diff-parser.js").DiffParser; + const lineByLinePrinter = new LineByLinePrinter({}); + let fileHtml = lineByLinePrinter.makeLineHtml(false, diffParser.LINE_TYPE.INSERTS, "", 30, "test", "+"); + fileHtml = fileHtml.replace(/\n\n+/g, "\n"); + const expected = + "\n" + ' \n' + + " \n" + ' \n' + - ''; + " \n" + + " \n" + + ""; - assert.equal(expected, fileHtml); + expect(expected).toEqual(fileHtml); }); - it('should work for deletions', function() { - var diffParser = require('../src/diff-parser.js').DiffParser; - var lineByLinePrinter = new LineByLinePrinter({}); - var fileHtml = lineByLinePrinter.makeLineHtml(false, - diffParser.LINE_TYPE.DELETES, 30, '', 'test', '-'); - fileHtml = fileHtml.replace(/\n\n+/g, '\n'); - var expected = '\n' + + it("should work for deletions", function() { + const diffParser = require("../diff-parser.js").DiffParser; + const lineByLinePrinter = new LineByLinePrinter({}); + let fileHtml = lineByLinePrinter.makeLineHtml(false, diffParser.LINE_TYPE.DELETES, 30, "", "test", "-"); + fileHtml = fileHtml.replace(/\n\n+/g, "\n"); + const expected = + "\n" + ' \n' + + " \n" + ' \n' + - ''; + " \n" + + " \n" + + ""; - assert.equal(expected, fileHtml); + expect(expected).toEqual(fileHtml); }); - it('should convert indents into non breakin spaces (2 white spaces)', function() { - var diffParser = require('../src/diff-parser.js').DiffParser; - var lineByLinePrinter = new LineByLinePrinter({}); - var fileHtml = lineByLinePrinter.makeLineHtml(false, - diffParser.LINE_TYPE.INSERTS, '', 30, ' test', '+'); - fileHtml = fileHtml.replace(/\n\n+/g, '\n'); - var expected = '\n' + + it("should convert indents into non breakin spaces (2 white spaces)", function() { + const diffParser = require("../diff-parser.js").DiffParser; + const lineByLinePrinter = new LineByLinePrinter({}); + let fileHtml = lineByLinePrinter.makeLineHtml(false, diffParser.LINE_TYPE.INSERTS, "", 30, " test", "+"); + fileHtml = fileHtml.replace(/\n\n+/g, "\n"); + const expected = + "\n" + ' \n' + + " \n" + ' \n' + - ''; + " \n" + + " \n" + + ""; - assert.equal(expected, fileHtml); + expect(expected).toEqual(fileHtml); }); - it('should convert indents into non breakin spaces (4 white spaces)', function() { - var diffParser = require('../src/diff-parser.js').DiffParser; - var lineByLinePrinter = new LineByLinePrinter({}); - var fileHtml = lineByLinePrinter.makeLineHtml(false, - diffParser.LINE_TYPE.INSERTS, '', 30, ' test', '+'); - fileHtml = fileHtml.replace(/\n\n+/g, '\n'); - var expected = '\n' + + it("should convert indents into non breakin spaces (4 white spaces)", function() { + const diffParser = require("../diff-parser.js").DiffParser; + const lineByLinePrinter = new LineByLinePrinter({}); + let fileHtml = lineByLinePrinter.makeLineHtml(false, diffParser.LINE_TYPE.INSERTS, "", 30, " test", "+"); + fileHtml = fileHtml.replace(/\n\n+/g, "\n"); + const expected = + "\n" + ' \n' + + " \n" + ' \n' + - ''; + " \n" + + " \n" + + ""; - assert.equal(expected, fileHtml); + expect(expected).toEqual(fileHtml); }); - it('should preserve tabs', function() { - var diffParser = require('../src/diff-parser.js').DiffParser; - var lineByLinePrinter = new LineByLinePrinter({}); - var fileHtml = lineByLinePrinter.makeLineHtml(false, - diffParser.LINE_TYPE.INSERTS, '', 30, '\ttest', '+'); - fileHtml = fileHtml.replace(/\n\n+/g, '\n'); - var expected = '\n' + + it("should preserve tabs", function() { + const diffParser = require("../diff-parser.js").DiffParser; + const lineByLinePrinter = new LineByLinePrinter({}); + let fileHtml = lineByLinePrinter.makeLineHtml(false, diffParser.LINE_TYPE.INSERTS, "", 30, "\ttest", "+"); + fileHtml = fileHtml.replace(/\n\n+/g, "\n"); + const expected = + "\n" + ' \n' + + " \n" + ' \n' + - ''; + " \n" + + " \n" + + ""; - assert.equal(expected, fileHtml); + expect(expected).toEqual(fileHtml); }); }); - describe('makeFileDiffHtml', function() { - it('should work for simple file', function() { - var lineByLinePrinter = new LineByLinePrinter({}); + describe("makeFileDiffHtml", function() { + it("should work for simple file", function() { + const lineByLinePrinter = new LineByLinePrinter({}); - var file = { + const file = { addedLines: 12, deletedLines: 41, - language: 'js', - oldName: 'my/file/name.js', - newName: 'my/file/name.js' + language: "js", + oldName: "my/file/name.js", + newName: "my/file/name.js" }; - var diffs = 'Random Html'; + const diffs = "Random Html"; - var fileHtml = lineByLinePrinter.makeFileDiffHtml(file, diffs); + const fileHtml = lineByLinePrinter.makeFileDiffHtml(file, diffs); - var expected = + const expected = '
    \n' + '
    \n' + ' \n' + @@ -155,36 +154,36 @@ describe('LineByLinePrinter', function() { ' \n' + ' my/file/name.js\n' + ' CHANGED\n' + - '
    \n' + + "
    \n" + '
    \n' + '
    \n' + '
    - 1.1.9: Fix around ubuntu's inability to cache promises. [#877](https://github.com/FredrikNoren/ungit/pull/878)\n" + - ' - 1.1.8:\n' + + " - 1.1.8:\n" + "@@ -11,7 +10,7 @@ $a=\"\n" + + "\n" + + " \n" + + "
    - 1.1.9: Fix around ubuntu's inability to cache promises. [#8\n" + - ' - 1.1.7:\n' + - ' - Fix diff flickering issue and optimization [#865](https://github.com/FredrikNoren/ungit/pull/865)\n' + - ' - Fix credential dialog issue [#864](https://github.com/FredrikNoren/ungit/pull/864)\n' + - '- - Fix HEAD branch order when redraw [#858](https://github.com/FredrikNoren/ungit/issues/858)\n' + - '+4 - Fix HEAD branch order when redraw [#858](https://github.com/FredrikNoren/ungit/issues/858)\n' + - ' - 1.1.6: Fix path auto complete [#861](https://github.com/FredrikNoren/ungit/issues/861)\n' + + " - 1.1.7:\n" + + " - Fix diff flickering issue and optimization [#865](https://github.com/FredrikNoren/ungit/pull/865)\n" + + " - Fix credential dialog issue [#864](https://github.com/FredrikNoren/ungit/pull/864)\n" + + "- - Fix HEAD branch order when redraw [#858](https://github.com/FredrikNoren/ungit/issues/858)\n" + + "+4 - Fix HEAD branch order when redraw [#858](https://github.com/FredrikNoren/ungit/issues/858)\n" + + " - 1.1.6: Fix path auto complete [#861](https://github.com/FredrikNoren/ungit/issues/861)\n" + ' - 1.1.5: Update "Toggle all" button after commit or changing selected files [#859](https://github.com/FredrikNoren/ungit/issues/859)\n' + - ' - 1.1.4: [patch] Promise refactoring\n' + - ' \n'; + " - 1.1.4: [patch] Promise refactoring\n" + + " \n"; - var htmlExample2 = '
    \n' + + const htmlExample2 = + '
    \n' + '
    \n' + '
    \n' + ' \n' + @@ -318,207 +317,207 @@ describe('Diff2Html', function() { ' \n' + ' CHANGELOG.md\n' + ' CHANGED\n' + - '
    \n' + + "
    \n" + '
    \n' + '
    \n' + ' \n' + ' \n' + - ' \n' + + " \n" + ' \n' + ' \n' + - '\n' + + " \n" + + "\n" + ' \n' + + " \n" + ' \n' + - '\n' + + " \n" + + " \n" + + "\n" + ' \n' + + " \n" + ' \n' + - '\n' + + " \n" + + " \n" + + "\n" + ' \n' + + " \n" + ' \n' + - '\n' + + " \n" + + " \n" + + "\n" + ' \n' + + " \n" + ' \n' + - '\n' + + " \n" + + " \n" + + "\n" + ' \n' + + " \n" + ' \n' + - '\n' + + " \n" + + " \n" + + "\n" + ' \n' + + " \n" + ' \n' + - '\n' + + " \n" + + " \n" + + "\n" + ' \n' + + " \n" + ' \n' + - '\n' + - '\n' + + " \n" + + " \n" + + "\n" + + "\n" + ' \n' + ' \n' + - '\n' + + " \n" + + "\n" + ' \n' + + " \n" + ' \n' + - '\n' + + " \n" + + " \n" + + "\n" + ' \n' + + " \n" + ' \n' + - '\n' + + " \n" + + " \n" + + "\n" + ' \n' + + " \n" + ' \n' + - '\n' + + " \n" + + " \n" + + "\n" + ' \n' + + " \n" + ' \n' + - '\n' + + " \n" + + " \n" + + "\n" + ' \n' + + " \n" + ' \n' + - '\n' + + " \n" + + " \n" + + "\n" + ' \n' + + " \n" + ' \n' + - '\n' + + " \n" + + " \n" + + "\n" + ' \n' + + " \n" + ' \n' + - '\n' + + " \n" + + " \n" + + "\n" + ' \n' + + " \n" + ' \n' + - '\n' + + " \n" + + " \n" + + "\n" + ' \n' + + " \n" + ' \n' + - '\n' + - ' \n' + - '
    \n' + '
    @@ -1,7 +1,6 @@
    \n' + - '
    \n' + '
    1
    \n' + '
    1
    \n' + - '
    \n' + '
    \n' + '  \n' + ' # Change Log\n' + - '
    \n' + - '
    \n' + '
    2
    \n' + '
    2
    \n' + - '
    \n' + '
    \n' + '  \n' + ' All notable changes to this project will be documented in this file.\n' + - '
    \n' + - '
    \n' + '
    3
    \n' + '
    3
    \n' + - '
    \n' + '
    \n' + '  \n' + ' This project adheres to [Semantic Versioning](http://semver.org/).\n' + - '
    \n' + - '
    \n' + '
    4
    \n' + '
    \n' + - '
    \n' + '
    \n' + ' -\n' + ' $a="<table><tr><td>Use the following format for additions: ` - VERSION: [feature/patch (if applicable)] Short description of change. Links to relevant issues/PRs.`\n' + - '
    \n' + - '
    \n' + '
    5
    \n' + '
    4
    \n' + - '
    \n' + '
    \n' + '  \n' + ' $a="<table><tr><td>\n' + - '
    \n' + - '
    \n' + '
    6
    \n' + '
    5
    \n' + - '
    \n' + '
    \n' + '  \n' + ' $a="<table><tr><td>- 1.1.9: Fix around ubuntu's inability to cache promises. [#877](https://github.com/FredrikNoren/ungit/pull/878)\n' + - '
    \n' + - '
    \n' + '
    7
    \n' + '
    6
    \n' + - '
    \n' + '
    \n' + '  \n' + ' - 1.1.8:\n' + - '
    \n' + - '
    \n' + '
    @@ -11,7 +10,7 @@ $a="<table><tr><td>- 1.1.9: Fix around ubuntu's inability to cache promises. [#8
    \n' + - '
    \n' + '
    11
    \n' + '
    10
    \n' + - '
    \n' + '
    \n' + '  \n' + ' - 1.1.7:\n' + - '
    \n' + - '
    \n' + '
    12
    \n' + '
    11
    \n' + - '
    \n' + '
    \n' + '  \n' + ' - Fix diff flickering issue and optimization [#865](https://github.com/FredrikNoren/ungit/pull/865)\n' + - '
    \n' + - '
    \n' + '
    13
    \n' + '
    12
    \n' + - '
    \n' + '
    \n' + '  \n' + ' - Fix credential dialog issue [#864](https://github.com/FredrikNoren/ungit/pull/864)\n' + - '
    \n' + - '
    \n' + '
    14
    \n' + '
    \n' + - '
    \n' + '
    \n' + ' -\n' + ' - Fix HEAD branch order when redraw [#858](https://github.com/FredrikNoren/ungit/issues/858)\n' + - '
    \n' + - '
    \n' + '
    \n' + '
    13
    \n' + - '
    \n' + '
    \n' + ' +\n' + ' 4 - Fix HEAD branch order when redraw [#858](https://github.com/FredrikNoren/ungit/issues/858)\n' + - '
    \n' + - '
    \n' + '
    15
    \n' + '
    14
    \n' + - '
    \n' + '
    \n' + '  \n' + ' - 1.1.6: Fix path auto complete [#861](https://github.com/FredrikNoren/ungit/issues/861)\n' + - '
    \n' + - '
    \n' + '
    16
    \n' + '
    15
    \n' + - '
    \n' + '
    \n' + '  \n' + ' - 1.1.5: Update "Toggle all" button after commit or changing selected files [#859](https://github.com/FredrikNoren/ungit/issues/859)\n' + - '
    \n' + - '
    \n' + '
    17
    \n' + '
    16
    \n' + - '
    \n' + '
    \n' + '  \n' + ' - 1.1.4: [patch] Promise refactoring\n' + - '
    \n' + - '
    \n' + '
    18
    \n' + '
    17
    \n' + - '
    \n' + '
    \n' + '  \n' + - '
    \n' + - '
    \n' + - '
    \n' + - '
    \n' + - '
    \n' + - '
    '; + " \n" + + "
    \n" + + " \n" + + " \n" + + "\n" + + ""; - var result = Diff2Html.getPrettyHtmlFromDiff(diffExample2); - assert.equal(result, htmlExample2); + const result = Diff2Html.getPrettyHtmlFromDiff(diffExample2); + expect(result).toEqual(htmlExample2); }); }); }); diff --git a/test/file-list-printer-tests.js b/src/__tests__/file-list-printer-tests.js similarity index 53% rename from test/file-list-printer-tests.js rename to src/__tests__/file-list-printer-tests.js index 55c6cfe..9361474 100644 --- a/test/file-list-printer-tests.js +++ b/src/__tests__/file-list-printer-tests.js @@ -1,92 +1,102 @@ -var assert = require('assert'); -var FileListPrinter = require('../src/file-list-printer.js').FileListPrinter; +const FileListPrinter = require("../file-list-printer.js").FileListPrinter; -describe('FileListPrinter', function() { - describe('generateFileList', function() { - it('should expose old and new files to templates', function() { - var files = [{ - addedlines: 12, - deletedlines: 41, - language: 'js', - oldName: 'my/file/name.js', - newName: 'my/file/name.js' - }, { - addedLines: 12, - deletedLines: 41, - language: 'js', - oldName: 'my/file/name1.js', - newName: 'my/file/name2.js' - }, { - addedLines: 12, - deletedLines: 0, - language: 'js', - oldName: 'dev/null', - newName: 'my/file/name.js', - isNew: true - }, { - addedLines: 0, - deletedLines: 41, - language: 'js', - oldName: 'my/file/name.js', - newName: 'dev/null', - isDeleted: true - }]; +describe("FileListPrinter", function() { + describe("generateFileList", function() { + it("should expose old and new files to templates", function() { + const files = [ + { + addedlines: 12, + deletedlines: 41, + language: "js", + oldName: "my/file/name.js", + newName: "my/file/name.js" + }, + { + addedLines: 12, + deletedLines: 41, + language: "js", + oldName: "my/file/name1.js", + newName: "my/file/name2.js" + }, + { + addedLines: 12, + deletedLines: 0, + language: "js", + oldName: "dev/null", + newName: "my/file/name.js", + isNew: true + }, + { + addedLines: 0, + deletedLines: 41, + language: "js", + oldName: "my/file/name.js", + newName: "dev/null", + isDeleted: true + } + ]; - var fileListPrinter = new FileListPrinter({ + const fileListPrinter = new FileListPrinter({ rawTemplates: { - 'file-summary-wrapper': '{{{files}}}', - 'file-summary-line': '{{oldName}}, {{newName}}, {{fileName}}' + "file-summary-wrapper": "{{{files}}}", + "file-summary-line": "{{oldName}}, {{newName}}, {{fileName}}" } }); - var fileHtml = fileListPrinter.generateFileList(files); - var expected = 'my/file/name.js, my/file/name.js, my/file/name.js\n' + - 'my/file/name1.js, my/file/name2.js, my/file/{name1.js → name2.js}\n' + - 'dev/null, my/file/name.js, my/file/name.js\n' + - 'my/file/name.js, dev/null, my/file/name.js'; + const fileHtml = fileListPrinter.generateFileList(files); + const expected = + "my/file/name.js, my/file/name.js, my/file/name.js\n" + + "my/file/name1.js, my/file/name2.js, my/file/{name1.js → name2.js}\n" + + "dev/null, my/file/name.js, my/file/name.js\n" + + "my/file/name.js, dev/null, my/file/name.js"; - assert.equal(expected, fileHtml); + expect(expected).toEqual(fileHtml); }); - it('should work for all kinds of files', function() { - var files = [{ - addedLines: 12, - deletedLines: 41, - language: 'js', - oldName: 'my/file/name.js', - newName: 'my/file/name.js' - }, { - addedLines: 12, - deletedLines: 41, - language: 'js', - oldName: 'my/file/name1.js', - newName: 'my/file/name2.js' - }, { - addedLines: 12, - deletedLines: 0, - language: 'js', - oldName: 'dev/null', - newName: 'my/file/name.js', - isNew: true - }, { - addedLines: 0, - deletedLines: 41, - language: 'js', - oldName: 'my/file/name.js', - newName: 'dev/null', - isDeleted: true - }]; + it("should work for all kinds of files", function() { + const files = [ + { + addedLines: 12, + deletedLines: 41, + language: "js", + oldName: "my/file/name.js", + newName: "my/file/name.js" + }, + { + addedLines: 12, + deletedLines: 41, + language: "js", + oldName: "my/file/name1.js", + newName: "my/file/name2.js" + }, + { + addedLines: 12, + deletedLines: 0, + language: "js", + oldName: "dev/null", + newName: "my/file/name.js", + isNew: true + }, + { + addedLines: 0, + deletedLines: 41, + language: "js", + oldName: "my/file/name.js", + newName: "dev/null", + isDeleted: true + } + ]; - var fileListPrinter = new FileListPrinter(); - var fileHtml = fileListPrinter.generateFileList(files); + const fileListPrinter = new FileListPrinter(); + const fileHtml = fileListPrinter.generateFileList(files); - var expected = + const expected = '
    \n' + '
    \n' + ' Files changed (4)\n' + ' hide\n' + ' show\n' + - '
    \n' + + "
    \n" + '
      \n' + '
    1. \n' + ' \n' + @@ -97,9 +107,9 @@ describe('FileListPrinter', function() { ' \n' + ' +12\n' + ' -41\n' + - ' \n' + - ' \n' + - '
    2. \n' + + " \n" + + " \n" + + "\n" + '
    3. \n' + ' \n' + ' +12\n' + ' -41\n' + - ' \n' + - ' \n' + - '
    4. \n' + + " \n" + + " \n" + + "\n" + '
    5. \n' + ' \n' + ' +12\n' + ' -0\n' + - ' \n' + - ' \n' + - '
    6. \n' + + " \n" + + " \n" + + "\n" + '
    7. \n' + ' \n' + ' +0\n' + ' -41\n' + - ' \n' + - ' \n' + - '
    8. \n' + - '
    \n' + - ''; + " \n" + + " \n" + + "\n" + + " \n" + + ""; - assert.equal(expected, fileHtml); + expect(expected).toEqual(fileHtml); }); }); }); diff --git a/src/__tests__/hogan-cache-tests.js b/src/__tests__/hogan-cache-tests.js new file mode 100644 index 0000000..f1b40fe --- /dev/null +++ b/src/__tests__/hogan-cache-tests.js @@ -0,0 +1,73 @@ +const HoganJsUtils = new (require("../hoganjs-utils.js")).HoganJsUtils(); +const diffParser = require("../diff-parser.js").DiffParser; + +describe("HoganJsUtils", function() { + describe("render", function() { + const emptyDiffHtml = + "
    \n' + + '
    \n' + + " File without changes\n" + + "
    \n" + + "
    \n' + '
    \n' + - ' File without changes\n' + - '
    \n' + - '
    \n' + '
    \n' + '
    30
    \n' + - '
    \n' + '
    \n' + ' +\n' + ' test\n' + - '
    \n' + - '
    \n' + '
    30
    \n' + '
    \n' + - '
    \n' + '
    \n' + ' -\n' + ' test\n' + - '
    \n' + - '
    \n' + '
    \n' + '
    30
    \n' + - '
    \n' + '
    \n' + ' +\n' + ' test\n' + - '
    \n' + - '
    \n' + '
    \n' + '
    30
    \n' + - '
    \n' + '
    \n' + ' +\n' + ' test\n' + - '
    \n' + - '
    \n' + '
    \n' + - '' + + "" + '
    30
    \n' + - '
    \n' + '
    \n' + ' +\n' + ' \ttest\n' + - '
    \n' + - '
    \n' + ' \n' + - ' Random Html\n' + - ' \n' + - '
    \n' + - ' \n' + - ' \n' + - ''; + " Random Html\n" + + "
    \n" + + " \n" + + " \n" + + ""; - assert.equal(expected, fileHtml); + expect(expected).toEqual(fileHtml); }); - it('should work for simple added file', function() { - var lineByLinePrinter = new LineByLinePrinter({}); + it("should work for simple added file", function() { + const lineByLinePrinter = new LineByLinePrinter({}); - var file = { + const file = { addedLines: 12, deletedLines: 0, - language: 'js', - oldName: 'dev/null', - newName: 'my/file/name.js', + language: "js", + oldName: "dev/null", + newName: "my/file/name.js", isNew: true }; - var diffs = 'Random Html'; + const diffs = "Random Html"; - var fileHtml = lineByLinePrinter.makeFileDiffHtml(file, diffs); + const fileHtml = lineByLinePrinter.makeFileDiffHtml(file, diffs); - var expected = + const expected = '
    \n' + '
    \n' + ' \n' + @@ -192,36 +191,36 @@ describe('LineByLinePrinter', function() { ' \n' + ' my/file/name.js\n' + ' ADDED\n' + - '
    \n' + + "
    \n" + '
    \n' + '
    \n' + ' \n' + ' \n' + - ' Random Html\n' + - ' \n' + - '
    \n' + - '
    \n' + - '
    \n' + - ''; + " Random Html\n" + + "
    \n" + + " \n" + + " \n" + + ""; - assert.equal(expected, fileHtml); + expect(expected).toEqual(fileHtml); }); - it('should work for simple deleted file', function() { - var lineByLinePrinter = new LineByLinePrinter({}); + it("should work for simple deleted file", function() { + const lineByLinePrinter = new LineByLinePrinter({}); - var file = { + const file = { addedLines: 0, deletedLines: 41, - language: 'js', - oldName: 'my/file/name.js', - newName: 'dev/null', + language: "js", + oldName: "my/file/name.js", + newName: "dev/null", isDeleted: true }; - var diffs = 'Random Html'; + const diffs = "Random Html"; - var fileHtml = lineByLinePrinter.makeFileDiffHtml(file, diffs); + const fileHtml = lineByLinePrinter.makeFileDiffHtml(file, diffs); - var expected = + const expected = '
    \n' + '
    \n' + ' \n' + @@ -229,36 +228,36 @@ describe('LineByLinePrinter', function() { ' \n' + ' my/file/name.js\n' + ' DELETED\n' + - '
    \n' + + "
    \n" + '
    \n' + '
    \n' + ' \n' + ' \n' + - ' Random Html\n' + - ' \n' + - '
    \n' + - '
    \n' + - '
    \n' + - ''; + " Random Html\n" + + " \n" + + " \n" + + " \n" + + " \n" + + ""; - assert.equal(expected, fileHtml); + expect(expected).toEqual(fileHtml); }); - it('should work for simple renamed file', function() { - var lineByLinePrinter = new LineByLinePrinter({}); + it("should work for simple renamed file", function() { + const lineByLinePrinter = new LineByLinePrinter({}); - var file = { + const file = { addedLines: 12, deletedLines: 41, - language: 'js', - oldName: 'my/file/name1.js', - newName: 'my/file/name2.js', + language: "js", + oldName: "my/file/name1.js", + newName: "my/file/name2.js", isRename: true }; - var diffs = 'Random Html'; + const diffs = "Random Html"; - var fileHtml = lineByLinePrinter.makeFileDiffHtml(file, diffs); + const fileHtml = lineByLinePrinter.makeFileDiffHtml(file, diffs); - var expected = + const expected = '
    \n' + '
    \n' + ' \n' + @@ -266,93 +265,90 @@ describe('LineByLinePrinter', function() { ' \n' + ' my/file/{name1.js → name2.js}\n' + ' RENAMED\n' + - '
    \n' + + "
    \n" + '
    \n' + '
    \n' + ' \n' + ' \n' + - ' Random Html\n' + - ' \n' + - '
    \n' + - '
    \n' + - '
    \n' + - ''; + " Random Html\n" + + " \n" + + " \n" + + " \n" + + " \n" + + ""; - assert.equal(expected, fileHtml); + expect(expected).toEqual(fileHtml); }); - it('should return empty when option renderNothingWhenEmpty is true and file blocks not present', function() { - var lineByLinePrinter = new LineByLinePrinter({ + it("should return empty when option renderNothingWhenEmpty is true and file blocks not present", function() { + const lineByLinePrinter = new LineByLinePrinter({ renderNothingWhenEmpty: true }); - var file = { + const file = { blocks: [] }; - var diffs = 'Random Html'; + const diffs = "Random Html"; - var fileHtml = lineByLinePrinter.makeFileDiffHtml(file, diffs); + const fileHtml = lineByLinePrinter.makeFileDiffHtml(file, diffs); - var expected = ''; + const expected = ""; - assert.equal(expected, fileHtml); + expect(expected).toEqual(fileHtml); }); }); - describe('makeLineByLineHtmlWrapper', function() { - it('should work for simple content', function() { - var lineByLinePrinter = new LineByLinePrinter({}); - var fileHtml = lineByLinePrinter.makeLineByLineHtmlWrapper('Random Html'); + describe("makeLineByLineHtmlWrapper", function() { + it("should work for simple content", function() { + const lineByLinePrinter = new LineByLinePrinter({}); + const fileHtml = lineByLinePrinter.makeLineByLineHtmlWrapper("Random Html"); - var expected = - '
    \n' + - ' Random Html\n' + - '
    '; + const expected = '
    \n' + " Random Html\n" + "
    "; - assert.equal(expected, fileHtml); + expect(expected).toEqual(fileHtml); }); }); - describe('generateLineByLineJsonHtml', function() { - it('should work for list of files', function() { - var exampleJson = [ + describe("generateLineByLineJsonHtml", function() { + it("should work for list of files", function() { + const exampleJson = [ { blocks: [ { lines: [ { - content: '-test', - type: 'd2h-del', + content: "-test", + type: "d2h-del", oldNumber: 1, newNumber: null }, { - content: '+test1r', - type: 'd2h-ins', + content: "+test1r", + type: "d2h-ins", oldNumber: null, newNumber: 1 } ], - oldStartLine: '1', + oldStartLine: "1", oldStartLine2: null, - newStartLine: '1', - header: '@@ -1 +1 @@' + newStartLine: "1", + header: "@@ -1 +1 @@" } ], deletedLines: 1, addedLines: 1, - checksumBefore: '0000001', - checksumAfter: '0ddf2ba', - oldName: 'sample', + checksumBefore: "0000001", + checksumAfter: "0ddf2ba", + oldName: "sample", language: undefined, - newName: 'sample', + newName: "sample", isCombined: false } ]; - var lineByLinePrinter = new LineByLinePrinter({matching: 'lines'}); - var html = lineByLinePrinter.generateLineByLineJsonHtml(exampleJson); - var expected = + const lineByLinePrinter = new LineByLinePrinter({ matching: "lines" }); + const html = lineByLinePrinter.generateLineByLineJsonHtml(exampleJson); + const expected = '
    \n' + '
    \n' + '
    \n' + @@ -361,63 +357,65 @@ describe('LineByLinePrinter', function() { ' \n' + ' sample\n' + ' CHANGED\n' + - '
    \n' + + "
    \n" + '
    \n' + '
    \n' + ' \n' + ' \n' + - ' \n' + + " \n" + ' \n' + ' \n' + - '\n' + + " \n" + + "\n" + ' \n' + + " \n" + ' \n' + - '\n' + + " \n" + + " \n" + + "\n" + ' \n' + + " \n" + ' \n' + - '\n' + - ' \n' + - '
    \n' + '
    @@ -1 +1 @@
    \n' + - '
    \n' + '
    1
    \n' + '
    \n' + - '
    \n' + '
    \n' + ' -\n' + ' test\n' + - '
    \n' + - '
    \n' + '
    \n' + '
    1
    \n' + - '
    \n' + '
    \n' + ' +\n' + ' test1r\n' + - '
    \n' + - '
    \n' + - '
    \n' + - '
    \n' + - '
    \n' + - ''; + " \n" + + " \n" + + "\n" + + " \n" + + " \n" + + " \n" + + " \n" + + "\n" + + ""; - assert.equal(expected, html); + expect(expected).toEqual(html); }); - it('should work for empty blocks', function() { - var exampleJson = [{ - blocks: [], - deletedLines: 0, - addedLines: 0, - oldName: 'sample', - language: 'js', - newName: 'sample', - isCombined: false - }]; + it("should work for empty blocks", function() { + const exampleJson = [ + { + blocks: [], + deletedLines: 0, + addedLines: 0, + oldName: "sample", + language: "js", + newName: "sample", + isCombined: false + } + ]; - var lineByLinePrinter = new LineByLinePrinter({ renderNothingWhenEmpty: false }); - var html = lineByLinePrinter.generateLineByLineJsonHtml(exampleJson); - var expected = + const lineByLinePrinter = new LineByLinePrinter({ renderNothingWhenEmpty: false }); + const html = lineByLinePrinter.generateLineByLineJsonHtml(exampleJson); + const expected = '
    \n' + '
    \n' + '
    \n' + @@ -426,179 +424,183 @@ describe('LineByLinePrinter', function() { ' \n' + ' sample\n' + ' CHANGED\n' + - '
    \n' + + "
    \n" + '
    \n' + '
    \n' + ' \n' + ' \n' + - ' \n' + + " \n" + ' \n' + - '\n' + - ' \n' + - '
    \n' + '
    \n' + - ' File without changes\n' + - '
    \n' + - '
    \n' + - '
    \n' + - '
    \n' + - '
    \n' + - ''; + " File without changes\n" + + " \n" + + " \n" + + "\n" + + " \n" + + " \n" + + " \n" + + " \n" + + "\n" + + ""; - assert.equal(expected, html); + expect(expected).toEqual(html); }); }); - describe('_processLines', function() { - it('should work for simple block header', function() { - var lineByLinePrinter = new LineByLinePrinter({}); - var oldLines = [{ - content: '-test', - type: 'd2h-del', - oldNumber: 1, - newNumber: null - }]; - var newLines = [{ - content: '+test1r', - type: 'd2h-ins', - oldNumber: null, - newNumber: 1 - }]; + describe("_processLines", function() { + it("should work for simple block header", function() { + const lineByLinePrinter = new LineByLinePrinter({}); + const oldLines = [ + { + content: "-test", + type: "d2h-del", + oldNumber: 1, + newNumber: null + } + ]; + const newLines = [ + { + content: "+test1r", + type: "d2h-ins", + oldNumber: null, + newNumber: 1 + } + ]; - var html = lineByLinePrinter._processLines(false, oldLines, newLines); + const html = lineByLinePrinter._processLines(false, oldLines, newLines); - var expected = - '\n' + + const expected = + "\n" + ' \n' + '
    1
    \n' + '
    \n' + - ' \n' + + " \n" + ' \n' + '
    \n' + ' -\n' + ' test\n' + - '
    \n' + - ' \n' + - '\n' + + " \n" + + " \n" + + "\n" + ' \n' + '
    \n' + '
    1
    \n' + - ' \n' + + " \n" + ' \n' + '
    \n' + ' +\n' + ' test1r\n' + - '
    \n' + - ' \n' + - ''; + " \n" + + " \n" + + ""; - assert.equal(expected, html); + expect(expected).toEqual(html); }); }); - describe('_generateFileHtml', function() { - it('should work for simple file', function() { - var lineByLinePrinter = new LineByLinePrinter({}); - var file = { + describe("_generateFileHtml", function() { + it("should work for simple file", function() { + const lineByLinePrinter = new LineByLinePrinter({}); + const file = { blocks: [ { lines: [ { - content: ' one context line', - type: 'd2h-cntx', + content: " one context line", + type: "d2h-cntx", oldNumber: 1, newNumber: 1 }, { - content: '-test', - type: 'd2h-del', + content: "-test", + type: "d2h-del", oldNumber: 2, newNumber: null }, { - content: '+test1r', - type: 'd2h-ins', + content: "+test1r", + type: "d2h-ins", oldNumber: null, newNumber: 2 }, { - content: '+test2r', - type: 'd2h-ins', + content: "+test2r", + type: "d2h-ins", oldNumber: null, newNumber: 3 } ], - oldStartLine: '1', + oldStartLine: "1", oldStartLine2: null, - newStartLine: '1', - header: '@@ -1 +1 @@' + newStartLine: "1", + header: "@@ -1 +1 @@" } ], deletedLines: 1, addedLines: 1, - checksumBefore: '0000001', - checksumAfter: '0ddf2ba', - oldName: 'sample', + checksumBefore: "0000001", + checksumAfter: "0ddf2ba", + oldName: "sample", language: undefined, - newName: 'sample', + newName: "sample", isCombined: false }; - var html = lineByLinePrinter._generateFileHtml(file); + const html = lineByLinePrinter._generateFileHtml(file); - var expected = - '\n' + + const expected = + "\n" + ' \n' + ' \n' + '
    @@ -1 +1 @@
    \n' + - ' \n' + - '\n' + + " \n" + + "\n" + ' \n' + '
    1
    \n' + '
    1
    \n' + - ' \n' + + " \n" + ' \n' + '
    \n' + '  \n' + ' one context line\n' + - '
    \n' + - ' \n' + - '\n' + + " \n" + + " \n" + + "\n" + ' \n' + '
    2
    \n' + '
    \n' + - ' \n' + + " \n" + ' \n' + '
    \n' + ' -\n' + ' test\n' + - '
    \n' + - ' \n' + - '\n' + + " \n" + + " \n" + + "\n" + ' \n' + '
    \n' + '
    2
    \n' + - ' \n' + + " \n" + ' \n' + '
    \n' + ' +\n' + ' test1r\n' + - '
    \n' + - ' \n' + - '\n' + + " \n" + + " \n" + + "\n" + ' \n' + '
    \n' + '
    3
    \n' + - ' \n' + + " \n" + ' \n' + '
    \n' + ' +\n' + ' test2r\n' + - '
    \n' + - ' \n' + - ''; + " \n" + + " \n" + + ""; - assert.equal(expected, html); + expect(expected).toEqual(html); }); }); }); diff --git a/src/__tests__/printer-utils-tests.js b/src/__tests__/printer-utils-tests.js new file mode 100644 index 0000000..5e92a6b --- /dev/null +++ b/src/__tests__/printer-utils-tests.js @@ -0,0 +1,126 @@ +const PrinterUtils = require("../printer-utils.js").PrinterUtils; + +describe("Utils", function() { + describe("getHtmlId", function() { + it("should generate file unique id", function() { + const result = PrinterUtils.getHtmlId({ + oldName: "sample.js", + newName: "sample.js" + }); + expect("d2h-960013").toEqual(result); + }); + it("should generate file unique id for empty hashes", function() { + const result = PrinterUtils.getHtmlId({ + oldName: "sample.js", + newName: "sample.js" + }); + expect("d2h-960013").toEqual(result); + }); + }); + + describe("getDiffName", function() { + it("should generate the file name for a changed file", function() { + const result = PrinterUtils.getDiffName({ + oldName: "sample.js", + newName: "sample.js" + }); + expect("sample.js").toEqual(result); + }); + it("should generate the file name for a changed file and full rename", function() { + const result = PrinterUtils.getDiffName({ + oldName: "sample1.js", + newName: "sample2.js" + }); + expect("sample1.js → sample2.js").toEqual(result); + }); + it("should generate the file name for a changed file and prefix rename", function() { + const result = PrinterUtils.getDiffName({ + oldName: "src/path/sample.js", + newName: "source/path/sample.js" + }); + expect("{src → source}/path/sample.js").toEqual(result); + }); + it("should generate the file name for a changed file and suffix rename", function() { + const result = PrinterUtils.getDiffName({ + oldName: "src/path/sample1.js", + newName: "src/path/sample2.js" + }); + expect("src/path/{sample1.js → sample2.js}").toEqual(result); + }); + it("should generate the file name for a changed file and middle rename", function() { + const result = PrinterUtils.getDiffName({ + oldName: "src/really/big/path/sample.js", + newName: "src/small/path/sample.js" + }); + expect("src/{really/big → small}/path/sample.js").toEqual(result); + }); + it("should generate the file name for a deleted file", function() { + const result = PrinterUtils.getDiffName({ + oldName: "src/my/file.js", + newName: "/dev/null" + }); + expect("src/my/file.js").toEqual(result); + }); + it("should generate the file name for a new file", function() { + const result = PrinterUtils.getDiffName({ + oldName: "/dev/null", + newName: "src/my/file.js" + }); + expect("src/my/file.js").toEqual(result); + }); + it("should generate handle undefined filename", function() { + const result = PrinterUtils.getDiffName({}); + expect("unknown/file/path").toEqual(result); + }); + }); + + describe("diffHighlight", function() { + it("should highlight two lines", function() { + const result = PrinterUtils.diffHighlight("-var myVar = 2;", "+var myVariable = 3;", { matching: "words" }); + + expect({ + first: { + prefix: "-", + line: "var myVar = 2;" + }, + second: { + prefix: "+", + line: "var myVariable = 3;" + } + }).toEqual(result); + }); + it("should highlight two lines char by char", function() { + const result = PrinterUtils.diffHighlight("-var myVar = 2;", "+var myVariable = 3;", { diffStyle: "char" }); + + expect({ + first: { + prefix: "-", + line: "var myVar = 2;" + }, + second: { + prefix: "+", + line: "var myVariable = 3;" + } + }).toEqual(result); + }); + it("should highlight combined diff lines", function() { + const result = PrinterUtils.diffHighlight(" -var myVar = 2;", " +var myVariable = 3;", { + diffStyle: "word", + isCombined: true, + matching: "words", + matchWordsThreshold: 1.0 + }); + + expect({ + first: { + prefix: " -", + line: 'var myVar = 2;' + }, + second: { + prefix: " +", + line: 'var myVariable = 3;' + } + }).toEqual(result); + }); + }); +}); diff --git a/test/side-by-side-printer-tests.js b/src/__tests__/side-by-side-printer-tests.js similarity index 52% rename from test/side-by-side-printer-tests.js rename to src/__tests__/side-by-side-printer-tests.js index ee10c39..fb2b007 100644 --- a/test/side-by-side-printer-tests.js +++ b/src/__tests__/side-by-side-printer-tests.js @@ -1,240 +1,239 @@ -var assert = require('assert'); +const SideBySidePrinter = require("../side-by-side-printer.js").SideBySidePrinter; -var SideBySidePrinter = require('../src/side-by-side-printer.js').SideBySidePrinter; - -describe('SideBySidePrinter', function() { - describe('generateEmptyDiff', function() { - it('should return an empty diff', function() { - var sideBySidePrinter = new SideBySidePrinter({}); - var fileHtml = sideBySidePrinter.generateEmptyDiff(); - var expectedRight = ''; - var expectedLeft = '\n' + +describe("SideBySidePrinter", function() { + describe("generateEmptyDiff", function() { + it("should return an empty diff", function() { + const sideBySidePrinter = new SideBySidePrinter({}); + const fileHtml = sideBySidePrinter.generateEmptyDiff(); + const expectedRight = ""; + const expectedLeft = + "\n" + ' \n' + '
    \n' + - ' File without changes\n' + - '
    \n' + - ' \n' + - ''; + " File without changes\n" + + " \n" + + " \n" + + ""; - assert.equal(expectedRight, fileHtml.right); - assert.equal(expectedLeft, fileHtml.left); + expect(expectedRight).toEqual(fileHtml.right); + expect(expectedLeft).toEqual(fileHtml.left); }); }); - describe('generateSideBySideFileHtml', function() { - it('should generate lines with the right prefixes', function() { - var sideBySidePrinter = new SideBySidePrinter({}); + describe("generateSideBySideFileHtml", function() { + it("should generate lines with the right prefixes", function() { + const sideBySidePrinter = new SideBySidePrinter({}); - var file = { - 'blocks': [ + const file = { + blocks: [ { - 'lines': [ + lines: [ { - 'content': ' context', - 'type': 'd2h-cntx', - 'oldNumber': 19, - 'newNumber': 19 + content: " context", + type: "d2h-cntx", + oldNumber: 19, + newNumber: 19 }, { - 'content': '-removed', - 'type': 'd2h-del', - 'oldNumber': 20, - 'newNumber': null + content: "-removed", + type: "d2h-del", + oldNumber: 20, + newNumber: null }, { - 'content': '+added', - 'type': 'd2h-ins', - 'oldNumber': null, - 'newNumber': 20 + content: "+added", + type: "d2h-ins", + oldNumber: null, + newNumber: 20 }, { - 'content': '+another added', - 'type': 'd2h-ins', - 'oldNumber': null, - 'newNumber': 21 + content: "+another added", + type: "d2h-ins", + oldNumber: null, + newNumber: 21 } ], - 'oldStartLine': '19', - 'newStartLine': '19', - 'header': '@@ -19,7 +19,7 @@' + oldStartLine: "19", + newStartLine: "19", + header: "@@ -19,7 +19,7 @@" } ], - 'deletedLines': 1, - 'addedLines': 1, - 'checksumBefore': 'fc56817', - 'checksumAfter': 'e8e7e49', - 'mode': '100644', - 'oldName': 'coverage.init', - 'language': 'init', - 'newName': 'coverage.init', - 'isCombined': false + deletedLines: 1, + addedLines: 1, + checksumBefore: "fc56817", + checksumAfter: "e8e7e49", + mode: "100644", + oldName: "coverage.init", + language: "init", + newName: "coverage.init", + isCombined: false }; - var fileHtml = sideBySidePrinter.generateSideBySideFileHtml(file); + const fileHtml = sideBySidePrinter.generateSideBySideFileHtml(file); - var expectedLeft = - '\n' + + const expectedLeft = + "\n" + ' \n' + ' \n' + '
    @@ -19,7 +19,7 @@
    \n' + - ' \n' + - '\n' + + " \n" + + "\n" + ' \n' + - ' 19\n' + - ' \n' + + " 19\n" + + " \n" + ' \n' + '
    \n' + '  \n' + ' context\n' + - '
    \n' + - ' \n' + - '\n' + + " \n" + + " \n" + + "\n" + ' \n' + - ' 20\n' + - ' \n' + + " 20\n" + + " \n" + ' \n' + '
    \n' + ' -\n' + ' removed\n' + - '
    \n' + - ' \n' + - '\n' + + " \n" + + " \n" + + "\n" + ' \n' + - ' ' + - '\n' + - ' \n' + + " " + + "\n" + + " \n" + ' \n' + '
    \n' + '  \n' + '  \n' + - '
    \n' + - ' \n' + - ''; + " \n" + + " \n" + + ""; - var expectedRight = - '\n' + + const expectedRight = + "\n" + ' \n' + ' \n' + '
    \n' + - ' \n' + - '\n' + + " \n" + + "\n" + ' \n' + - ' 19\n' + - ' \n' + + " 19\n" + + " \n" + ' \n' + '
    \n' + '  \n' + ' context\n' + - '
    \n' + - ' \n' + - '\n' + + " \n" + + " \n" + + "\n" + ' \n' + - ' 20\n' + - ' \n' + + " 20\n" + + " \n" + ' \n' + '
    \n' + ' +\n' + ' added\n' + - '
    \n' + - ' \n' + - '\n' + + " \n" + + " \n" + + "\n" + ' \n' + - ' 21\n' + - ' \n' + + " 21\n" + + " \n" + ' \n' + '
    \n' + ' +\n' + ' another added\n' + - '
    \n' + - ' \n' + - ''; + " \n" + + " \n" + + ""; - assert.equal(expectedLeft, fileHtml.left); - assert.equal(expectedRight, fileHtml.right); + expect(expectedLeft).toEqual(fileHtml.left); + expect(expectedRight).toEqual(fileHtml.right); }); }); - describe('generateSingleLineHtml', function() { - it('should work for insertions', function() { - var diffParser = require('../src/diff-parser.js').DiffParser; - var sideBySidePrinter = new SideBySidePrinter({}); - var fileHtml = sideBySidePrinter.generateSingleLineHtml(false, - diffParser.LINE_TYPE.INSERTS, 30, 'test', '+'); - var expected = '\n' + + describe("generateSingleLineHtml", function() { + it("should work for insertions", function() { + const diffParser = require("../diff-parser.js").DiffParser; + const sideBySidePrinter = new SideBySidePrinter({}); + const fileHtml = sideBySidePrinter.generateSingleLineHtml(false, diffParser.LINE_TYPE.INSERTS, 30, "test", "+"); + const expected = + "\n" + ' \n' + - ' 30\n' + - ' \n' + + " 30\n" + + " \n" + ' \n' + '
    \n' + ' +\n' + ' test\n' + - '
    \n' + - ' \n' + - ''; + " \n" + + " \n" + + ""; - assert.equal(expected, fileHtml); + expect(expected).toEqual(fileHtml); }); - it('should work for deletions', function() { - var diffParser = require('../src/diff-parser.js').DiffParser; - var sideBySidePrinter = new SideBySidePrinter({}); - var fileHtml = sideBySidePrinter.generateSingleLineHtml(false, - diffParser.LINE_TYPE.DELETES, 30, 'test', '-'); - var expected = '\n' + + it("should work for deletions", function() { + const diffParser = require("../diff-parser.js").DiffParser; + const sideBySidePrinter = new SideBySidePrinter({}); + const fileHtml = sideBySidePrinter.generateSingleLineHtml(false, diffParser.LINE_TYPE.DELETES, 30, "test", "-"); + const expected = + "\n" + ' \n' + - ' 30\n' + - ' \n' + + " 30\n" + + " \n" + ' \n' + '
    \n' + ' -\n' + ' test\n' + - '
    \n' + - ' \n' + - ''; + " \n" + + " \n" + + ""; - assert.equal(expected, fileHtml); + expect(expected).toEqual(fileHtml); }); }); - describe('generateSideBySideJsonHtml', function() { - it('should work for list of files', function() { - var exampleJson = [ + describe("generateSideBySideJsonHtml", function() { + it("should work for list of files", function() { + const exampleJson = [ { blocks: [ { lines: [ { - content: '-test', - type: 'd2h-del', + content: "-test", + type: "d2h-del", oldNumber: 1, newNumber: null }, { - content: '+test1r', - type: 'd2h-ins', + content: "+test1r", + type: "d2h-ins", oldNumber: null, newNumber: 1 } ], - oldStartLine: '1', + oldStartLine: "1", oldStartLine2: null, - newStartLine: '1', - header: '@@ -1 +1 @@' + newStartLine: "1", + header: "@@ -1 +1 @@" } ], deletedLines: 1, addedLines: 1, - checksumBefore: '0000001', - checksumAfter: '0ddf2ba', - oldName: 'sample', + checksumBefore: "0000001", + checksumAfter: "0ddf2ba", + oldName: "sample", language: undefined, - newName: 'sample', + newName: "sample", isCombined: false } ]; - var sideBySidePrinter = new SideBySidePrinter({matching: 'lines'}); - var html = sideBySidePrinter.generateSideBySideJsonHtml(exampleJson); - var expected = + const sideBySidePrinter = new SideBySidePrinter({ matching: "lines" }); + const html = sideBySidePrinter.generateSideBySideJsonHtml(exampleJson); + const expected = '
    \n' + '
    \n' + '
    \n' + @@ -243,74 +242,76 @@ describe('SideBySidePrinter', function() { ' \n' + ' sample\n' + ' CHANGED\n' + - '
    \n' + + "
    \n" + '
    \n' + '
    \n' + '
    \n' + ' \n' + ' \n' + - ' \n' + + " \n" + ' \n' + ' \n' + - '\n' + + " \n" + + "\n" + ' \n' + + " 1\n" + + " \n" + ' \n' + - '\n' + - ' \n' + - '
    \n' + '
    @@ -1 +1 @@
    \n' + - '
    \n' + - ' 1\n' + - ' \n' + '
    \n' + ' -\n' + ' test\n' + - '
    \n' + - '
    \n' + - '
    \n' + - '
    \n' + + "
    \n" + + " \n" + + "\n" + + " \n" + + " \n" + + "
    \n" + + " \n" + '
    \n' + '
    \n' + ' \n' + ' \n' + - ' \n' + + " \n" + ' \n' + ' \n' + - '\n' + + " \n" + + "\n" + ' \n' + + " 1\n" + + " \n" + ' \n' + - '\n' + - ' \n' + - '
    \n' + '
    \n' + - '
    \n' + - ' 1\n' + - ' \n' + '
    \n' + ' +\n' + ' test1r\n' + - '
    \n' + - '
    \n' + - '
    \n' + - '
    \n' + - ' \n' + - '\n' + - ''; + " \n" + + " \n" + + "\n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + "\n" + + ""; - assert.equal(expected, html); + expect(expected).toEqual(html); }); - it('should work for files without blocks', function() { - var exampleJson = [{ - blocks: [], - oldName: 'sample', - language: 'js', - newName: 'sample', - isCombined: false - }]; + it("should work for files without blocks", function() { + const exampleJson = [ + { + blocks: [], + oldName: "sample", + language: "js", + newName: "sample", + isCombined: false + } + ]; - var sideBySidePrinter = new SideBySidePrinter(); - var html = sideBySidePrinter.generateSideBySideJsonHtml(exampleJson); - var expected = + const sideBySidePrinter = new SideBySidePrinter(); + const html = sideBySidePrinter.generateSideBySideJsonHtml(exampleJson); + const expected = '
    \n' + '
    \n' + '
    \n' + @@ -319,86 +320,90 @@ describe('SideBySidePrinter', function() { ' \n' + ' sample\n' + ' CHANGED\n' + - '
    \n' + + "
    \n" + '
    \n' + '
    \n' + '
    \n' + ' \n' + ' \n' + - ' \n' + + " \n" + ' \n' + - '\n' + - ' \n' + - '
    \n' + '
    \n' + - ' File without changes\n' + - '
    \n' + - '
    \n' + - '
    \n' + - '
    \n' + + " File without changes\n" + + "
    \n" + + " \n" + + "\n" + + " \n" + + " \n" + + "
    \n" + + " \n" + '
    \n' + '
    \n' + ' \n' + ' \n' + - ' \n' + - ' \n' + - '
    \n' + - '
    \n' + - '
    \n' + - ' \n' + - '\n' + - ''; + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + "\n" + + ""; - assert.equal(expected, html); + expect(expected).toEqual(html); }); }); - describe('processLines', function() { - it('should process file lines', function() { - var oldLines = [{ - content: '-test', - type: 'd2h-del', - oldNumber: 1, - newNumber: null - }]; + describe("processLines", function() { + it("should process file lines", function() { + const oldLines = [ + { + content: "-test", + type: "d2h-del", + oldNumber: 1, + newNumber: null + } + ]; - var newLines = [{ - content: '+test1r', - type: 'd2h-ins', - oldNumber: null, - newNumber: 1 - }]; + const newLines = [ + { + content: "+test1r", + type: "d2h-ins", + oldNumber: null, + newNumber: 1 + } + ]; - var sideBySidePrinter = new SideBySidePrinter({matching: 'lines'}); - var html = sideBySidePrinter.processLines(false, oldLines, newLines); - var expectedLeft = - '\n' + + const sideBySidePrinter = new SideBySidePrinter({ matching: "lines" }); + const html = sideBySidePrinter.processLines(false, oldLines, newLines); + const expectedLeft = + "\n" + ' \n' + - ' 1\n' + - ' \n' + + " 1\n" + + " \n" + ' \n' + '
    \n' + ' -\n' + ' test\n' + - '
    \n' + - ' \n' + - ''; + " \n" + + " \n" + + ""; - var expectedRight = - '\n' + + const expectedRight = + "\n" + ' \n' + - ' 1\n' + - ' \n' + + " 1\n" + + " \n" + ' \n' + '
    \n' + ' +\n' + ' test1r\n' + - '
    \n' + - ' \n' + - ''; + " \n" + + " \n" + + ""; - assert.equal(expectedLeft, html.left); - assert.equal(expectedRight, html.right); + expect(expectedLeft).toEqual(html.left); + expect(expectedRight).toEqual(html.right); }); }); }); diff --git a/src/__tests__/utils-tests.js b/src/__tests__/utils-tests.js new file mode 100644 index 0000000..295b098 --- /dev/null +++ b/src/__tests__/utils-tests.js @@ -0,0 +1,23 @@ +const Utils = require("../utils.js").Utils; + +describe("Utils", function() { + describe("escape", function() { + it("should escape & with &", function() { + const result = Utils.escape("&"); + expect("&").toEqual(result); + }); + it("should escape < with <", function() { + const result = Utils.escape("<"); + expect("<").toEqual(result); + }); + it("should escape > with >", function() { + const result = Utils.escape(">"); + expect(">").toEqual(result); + }); + it("should escape a string with multiple problematic characters", function() { + const result = Utils.escape('\tlink text'); + const expected = "<a href="#">\tlink text</a>"; + expect(expected).toEqual(result); + }); + }); +}); diff --git a/src/diff-parser.js b/src/diff-parser.js index 57892cb..faaa4ef 100644 --- a/src/diff-parser.js +++ b/src/diff-parser.js @@ -6,39 +6,38 @@ */ (function() { - var utils = require('./utils.js').Utils; + const utils = require("./utils.js").Utils; - var LINE_TYPE = { - INSERTS: 'd2h-ins', - DELETES: 'd2h-del', - INSERT_CHANGES: 'd2h-ins d2h-change', - DELETE_CHANGES: 'd2h-del d2h-change', - CONTEXT: 'd2h-cntx', - INFO: 'd2h-info' + const LINE_TYPE = { + INSERTS: "d2h-ins", + DELETES: "d2h-del", + INSERT_CHANGES: "d2h-ins d2h-change", + DELETE_CHANGES: "d2h-del d2h-change", + CONTEXT: "d2h-cntx", + INFO: "d2h-info" }; - function DiffParser() { - } + function DiffParser() {} DiffParser.prototype.LINE_TYPE = LINE_TYPE; DiffParser.prototype.generateDiffJson = function(diffInput, configuration) { - var config = configuration || {}; + const config = configuration || {}; - var files = []; - var currentFile = null; - var currentBlock = null; - var oldLine = null; - var oldLine2 = null; // Used for combined diff - var newLine = null; + const files = []; + let currentFile = null; + let currentBlock = null; + let oldLine = null; + let oldLine2 = null; // Used for combined diff + let newLine = null; - var possibleOldName; - var possibleNewName; + let possibleOldName; + let possibleNewName; /* Diff Header */ - var oldFileNameHeader = '--- '; - var newFileNameHeader = '+++ '; - var hunkHeaderPrefix = '@@'; + const oldFileNameHeader = "--- "; + const newFileNameHeader = "+++ "; + const hunkHeaderPrefix = "@@"; /* Add previous block(if exists) before start a new file */ function saveBlock() { @@ -86,7 +85,7 @@ function startBlock(line) { saveBlock(); - var values; + let values; /** * From Range: @@ -113,7 +112,7 @@ newLine = values[3]; } else { if (utils.startsWith(line, hunkHeaderPrefix)) { - console.error('Failed to parse lines, starting in 0!'); + console.error("Failed to parse lines, starting in 0!"); } oldLine = 0; @@ -131,11 +130,11 @@ } function createLine(line) { - var currentLine = {}; + const currentLine = {}; currentLine.content = line; - var newLinePrefixes = !currentFile.isCombined ? ['+'] : ['+', ' +']; - var delLinePrefixes = !currentFile.isCombined ? ['-'] : ['-', ' -']; + const newLinePrefixes = !currentFile.isCombined ? ["+"] : ["+", " +"]; + const delLinePrefixes = !currentFile.isCombined ? ["-"] : ["-", " -"]; /* Fill the line data */ if (utils.startsWith(line, newLinePrefixes)) { @@ -169,10 +168,10 @@ * Hunk header is a group of three lines started by ( `--- ` , `+++ ` , `@@` ) */ function existHunkHeader(line, lineIdx) { - var idx = lineIdx; + let idx = lineIdx; while (idx < diffLines.length - 3) { - if (utils.startsWith(line, 'diff')) { + if (utils.startsWith(line, "diff")) { return false; } @@ -190,56 +189,56 @@ return false; } - var diffLines = - diffInput.replace(/\\ No newline at end of file/g, '') - .replace(/\r\n?/g, '\n') - .split('\n'); + var diffLines = diffInput + .replace(/\\ No newline at end of file/g, "") + .replace(/\r\n?/g, "\n") + .split("\n"); /* Diff */ - var oldMode = /^old mode (\d{6})/; - var newMode = /^new mode (\d{6})/; - var deletedFileMode = /^deleted file mode (\d{6})/; - var newFileMode = /^new file mode (\d{6})/; + const oldMode = /^old mode (\d{6})/; + const newMode = /^new mode (\d{6})/; + const deletedFileMode = /^deleted file mode (\d{6})/; + const newFileMode = /^new file mode (\d{6})/; - var copyFrom = /^copy from "?(.+)"?/; - var copyTo = /^copy to "?(.+)"?/; + const copyFrom = /^copy from "?(.+)"?/; + const copyTo = /^copy to "?(.+)"?/; - var renameFrom = /^rename from "?(.+)"?/; - var renameTo = /^rename to "?(.+)"?/; + const renameFrom = /^rename from "?(.+)"?/; + const renameTo = /^rename to "?(.+)"?/; - var similarityIndex = /^similarity index (\d+)%/; - var dissimilarityIndex = /^dissimilarity index (\d+)%/; - var index = /^index ([0-9a-z]+)\.\.([0-9a-z]+)\s*(\d{6})?/; + const similarityIndex = /^similarity index (\d+)%/; + const dissimilarityIndex = /^dissimilarity index (\d+)%/; + const index = /^index ([0-9a-z]+)\.\.([0-9a-z]+)\s*(\d{6})?/; - var binaryFiles = /^Binary files (.*) and (.*) differ/; - var binaryDiff = /^GIT binary patch/; + const binaryFiles = /^Binary files (.*) and (.*) differ/; + const binaryDiff = /^GIT binary patch/; /* Combined Diff */ - var combinedIndex = /^index ([0-9a-z]+),([0-9a-z]+)\.\.([0-9a-z]+)/; - var combinedMode = /^mode (\d{6}),(\d{6})\.\.(\d{6})/; - var combinedNewFile = /^new file mode (\d{6})/; - var combinedDeletedFile = /^deleted file mode (\d{6}),(\d{6})/; + const combinedIndex = /^index ([0-9a-z]+),([0-9a-z]+)\.\.([0-9a-z]+)/; + const combinedMode = /^mode (\d{6}),(\d{6})\.\.(\d{6})/; + const combinedNewFile = /^new file mode (\d{6})/; + const combinedDeletedFile = /^deleted file mode (\d{6}),(\d{6})/; diffLines.forEach(function(line, lineIndex) { // Unmerged paths, and possibly other non-diffable files // https://github.com/scottgonzalez/pretty-diff/issues/11 // Also, remove some useless lines - if (!line || utils.startsWith(line, '*')) { + if (!line || utils.startsWith(line, "*")) { return; } // Used to store regex capture groups - var values; + let values; - var prevLine = diffLines[lineIndex - 1]; - var nxtLine = diffLines[lineIndex + 1]; - var afterNxtLine = diffLines[lineIndex + 2]; + const prevLine = diffLines[lineIndex - 1]; + const nxtLine = diffLines[lineIndex + 1]; + const afterNxtLine = diffLines[lineIndex + 2]; - if (utils.startsWith(line, 'diff')) { + if (utils.startsWith(line, "diff")) { startFile(); // diff --git a/blocked_delta_results.png b/blocked_delta_results.png - var gitDiffStart = /^diff --git "?(.+)"? "?(.+)"?/; + const gitDiffStart = /^diff --git "?(.+)"? "?(.+)"?/; if ((values = gitDiffStart.exec(line))) { possibleOldName = _getFilename(null, values[1], config.dstPrefix); possibleNewName = _getFilename(null, values[2], config.srcPrefix); @@ -249,15 +248,14 @@ return; } - if (!currentFile || // If we do not have a file yet, we should crete one - ( - !currentFile.isGitDiff && currentFile && // If we already have some file in progress and - ( - utils.startsWith(line, oldFileNameHeader) && // If we get to an old file path header line + if ( + !currentFile || // If we do not have a file yet, we should crete one + (!currentFile.isGitDiff && + currentFile && // If we already have some file in progress and + (utils.startsWith(line, oldFileNameHeader) && // If we get to an old file path header line // And is followed by the new file path header line and the hunk header line - utils.startsWith(nxtLine, newFileNameHeader) && utils.startsWith(afterNxtLine, hunkHeaderPrefix) - ) - ) + utils.startsWith(nxtLine, newFileNameHeader) && + utils.startsWith(afterNxtLine, hunkHeaderPrefix))) ) { startFile(); } @@ -268,18 +266,19 @@ * - https://github.com/rtfpessoa/diff2html/issues/87 */ if ( - (utils.startsWith(line, oldFileNameHeader) && - utils.startsWith(nxtLine, newFileNameHeader)) || - - (utils.startsWith(line, newFileNameHeader) && - utils.startsWith(prevLine, oldFileNameHeader)) + (utils.startsWith(line, oldFileNameHeader) && utils.startsWith(nxtLine, newFileNameHeader)) || + (utils.startsWith(line, newFileNameHeader) && utils.startsWith(prevLine, oldFileNameHeader)) ) { /* * --- Date Timestamp[FractionalSeconds] TimeZone * --- 2002-02-21 23:30:39.942229878 -0800 */ - if (currentFile && !currentFile.oldName && - utils.startsWith(line, '--- ') && (values = getSrcFilename(line, config))) { + if ( + currentFile && + !currentFile.oldName && + utils.startsWith(line, "--- ") && + (values = getSrcFilename(line, config)) + ) { currentFile.oldName = values; currentFile.language = getExtension(currentFile.oldName, currentFile.language); return; @@ -289,8 +288,12 @@ * +++ Date Timestamp[FractionalSeconds] TimeZone * +++ 2002-02-21 23:30:39.942229878 -0800 */ - if (currentFile && !currentFile.newName && - utils.startsWith(line, '+++ ') && (values = getDstFilename(line, config))) { + if ( + currentFile && + !currentFile.newName && + utils.startsWith(line, "+++ ") && + (values = getDstFilename(line, config)) + ) { currentFile.newName = values; currentFile.language = getExtension(currentFile.newName, currentFile.language); return; @@ -311,12 +314,12 @@ * 2. Old line starts with: - * 3. Context line starts with: */ - if (currentBlock && (utils.startsWith(line, '+') || utils.startsWith(line, '-') || utils.startsWith(line, ' '))) { + if (currentBlock && (utils.startsWith(line, "+") || utils.startsWith(line, "-") || utils.startsWith(line, " "))) { createLine(line); return; } - var doesNotExistHunkHeader = !existHunkHeader(line, lineIndex); + const doesNotExistHunkHeader = !existHunkHeader(line, lineIndex); /* * Git diffs provide more information regarding files modes, renames, copies, @@ -356,7 +359,7 @@ currentFile.isBinary = true; currentFile.oldName = _getFilename(null, values[1], config.srcPrefix); currentFile.newName = _getFilename(null, values[2], config.dstPrefix); - startBlock('Binary file'); + startBlock("Binary file"); } else if ((values = binaryDiff.exec(line))) { currentFile.isBinary = true; startBlock(line); @@ -390,7 +393,7 @@ }; function getExtension(filename, language) { - var nameSplit = filename.split('.'); + const nameSplit = filename.split("."); if (nameSplit.length > 1) { return nameSplit[nameSplit.length - 1]; } @@ -399,31 +402,31 @@ } function getSrcFilename(line, cfg) { - return _getFilename('---', line, cfg.srcPrefix); + return _getFilename("---", line, cfg.srcPrefix); } function getDstFilename(line, cfg) { - return _getFilename('\\+\\+\\+', line, cfg.dstPrefix); + return _getFilename("\\+\\+\\+", line, cfg.dstPrefix); } function _getFilename(linePrefix, line, extraPrefix) { - var prefixes = ['a/', 'b/', 'i/', 'w/', 'c/', 'o/']; + const prefixes = ["a/", "b/", "i/", "w/", "c/", "o/"]; if (extraPrefix) { prefixes.push(extraPrefix); } - var FilenameRegExp; + let FilenameRegExp; if (linePrefix) { - FilenameRegExp = new RegExp('^' + linePrefix + ' "?(.+?)"?$'); + FilenameRegExp = new RegExp("^" + linePrefix + ' "?(.+?)"?$'); } else { FilenameRegExp = new RegExp('^"?(.+?)"?$'); } - var filename; - var values = FilenameRegExp.exec(line); + let filename; + const values = FilenameRegExp.exec(line); if (values && values[1]) { filename = values[1]; - var matchingPrefixes = prefixes.filter(function(p) { + const matchingPrefixes = prefixes.filter(function(p) { return filename.indexOf(p) === 0; }); @@ -435,7 +438,7 @@ // Cleanup timestamps generated by the unified diff (diff command) as specified in // https://www.gnu.org/software/diffutils/manual/html_node/Detailed-Unified.html // Ie: 2016-10-25 11:37:14.000000000 +0200 - filename = filename.replace(/\s+\d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2}(?:\.\d+)? [-+]\d{4}.*$/, ''); + filename = filename.replace(/\s+\d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2}(?:\.\d+)? [-+]\d{4}.*$/, ""); } return filename; diff --git a/src/diff2html.d.ts b/src/diff2html.d.ts index cea93f6..de77dbf 100644 --- a/src/diff2html.d.ts +++ b/src/diff2html.d.ts @@ -4,13 +4,12 @@ // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped declare namespace Diff2Html { - export interface Options { - inputFormat?: 'diff' | 'json'; - outputFormat?: 'line-by-line' | 'side-by-side'; + inputFormat?: "diff" | "json"; + outputFormat?: "line-by-line" | "side-by-side"; showFiles?: boolean; - diffStyle?: 'word' | 'char'; - matching?: 'lines' | 'words' | 'none'; + diffStyle?: "word" | "char"; + matching?: "lines" | "words" | "none"; matchWordsThreshold?: number; matchingMaxComparisons?: number; maxLineSizeInBlockForComparison?: number; @@ -66,6 +65,6 @@ declare namespace Diff2Html { } declare module "diff2html" { - var d2h: { "Diff2Html": Diff2Html.Diff2Html }; + var d2h: { Diff2Html: Diff2Html.Diff2Html }; export = d2h; } diff --git a/src/diff2html.js b/src/diff2html.js index 4d4155d..2b89372 100644 --- a/src/diff2html.js +++ b/src/diff2html.js @@ -6,19 +6,18 @@ */ (function() { - var diffParser = require('./diff-parser.js').DiffParser; - var htmlPrinter = require('./html-printer.js').HtmlPrinter; - var utils = require('./utils.js').Utils; + const diffParser = require("./diff-parser.js").DiffParser; + const htmlPrinter = require("./html-printer.js").HtmlPrinter; + const utils = require("./utils.js").Utils; - function Diff2Html() { - } + function Diff2Html() {} - var defaultConfig = { - inputFormat: 'diff', - outputFormat: 'line-by-line', + const defaultConfig = { + inputFormat: "diff", + outputFormat: "line-by-line", showFiles: false, - diffStyle: 'word', - matching: 'none', + diffStyle: "word", + matching: "none", matchWordsThreshold: 0.25, matchingMaxComparisons: 2500, maxLineSizeInBlockForComparison: 200, @@ -32,7 +31,7 @@ * Generates json object from string diff input */ Diff2Html.prototype.getJsonFromDiff = function(diffInput, config) { - var cfg = utils.safeConfig(config, defaultConfig); + const cfg = utils.safeConfig(config, defaultConfig); return diffParser.generateDiffJson(diffInput, cfg); }; @@ -40,20 +39,20 @@ * Generates the html diff. The config parameter configures the output/input formats and other options */ Diff2Html.prototype.getPrettyHtml = function(diffInput, config) { - var cfg = utils.safeConfig(config, defaultConfig); + const cfg = utils.safeConfig(config, defaultConfig); - var diffJson = diffInput; - if (!cfg.inputFormat || cfg.inputFormat === 'diff') { + let diffJson = diffInput; + if (!cfg.inputFormat || cfg.inputFormat === "diff") { diffJson = diffParser.generateDiffJson(diffInput, cfg); } - var fileList = ''; + let fileList = ""; if (cfg.showFiles === true) { fileList = htmlPrinter.generateFileListSummary(diffJson, cfg); } - var diffOutput = ''; - if (cfg.outputFormat === 'side-by-side') { + let diffOutput = ""; + if (cfg.outputFormat === "side-by-side") { diffOutput = htmlPrinter.generateSideBySideJsonHtml(diffJson, cfg); } else { diffOutput = htmlPrinter.generateLineByLineJsonHtml(diffJson, cfg); @@ -70,9 +69,9 @@ * Generates pretty html from string diff input */ Diff2Html.prototype.getPrettyHtmlFromDiff = function(diffInput, config) { - var cfg = utils.safeConfig(config, defaultConfig); - cfg.inputFormat = 'diff'; - cfg.outputFormat = 'line-by-line'; + const cfg = utils.safeConfig(config, defaultConfig); + cfg.inputFormat = "diff"; + cfg.outputFormat = "line-by-line"; return this.getPrettyHtml(diffInput, cfg); }; @@ -80,9 +79,9 @@ * Generates pretty html from a json object */ Diff2Html.prototype.getPrettyHtmlFromJson = function(diffJson, config) { - var cfg = utils.safeConfig(config, defaultConfig); - cfg.inputFormat = 'json'; - cfg.outputFormat = 'line-by-line'; + const cfg = utils.safeConfig(config, defaultConfig); + cfg.inputFormat = "json"; + cfg.outputFormat = "line-by-line"; return this.getPrettyHtml(diffJson, cfg); }; @@ -90,9 +89,9 @@ * Generates pretty side by side html from string diff input */ Diff2Html.prototype.getPrettySideBySideHtmlFromDiff = function(diffInput, config) { - var cfg = utils.safeConfig(config, defaultConfig); - cfg.inputFormat = 'diff'; - cfg.outputFormat = 'side-by-side'; + const cfg = utils.safeConfig(config, defaultConfig); + cfg.inputFormat = "diff"; + cfg.outputFormat = "side-by-side"; return this.getPrettyHtml(diffInput, cfg); }; @@ -100,13 +99,13 @@ * Generates pretty side by side html from a json object */ Diff2Html.prototype.getPrettySideBySideHtmlFromJson = function(diffJson, config) { - var cfg = utils.safeConfig(config, defaultConfig); - cfg.inputFormat = 'json'; - cfg.outputFormat = 'side-by-side'; + const cfg = utils.safeConfig(config, defaultConfig); + cfg.inputFormat = "json"; + cfg.outputFormat = "side-by-side"; return this.getPrettyHtml(diffJson, cfg); }; - var diffObject = new Diff2Html(); + const diffObject = new Diff2Html(); module.exports.Diff2Html = diffObject; // Expose diff2html in the browser diff --git a/src/file-list-printer.js b/src/file-list-printer.js index da371c9..97e31b7 100644 --- a/src/file-list-printer.js +++ b/src/file-list-printer.js @@ -6,40 +6,45 @@ */ (function() { - var printerUtils = require('./printer-utils.js').PrinterUtils; + const printerUtils = require("./printer-utils.js").PrinterUtils; - var hoganUtils; + let hoganUtils; - var baseTemplatesPath = 'file-summary'; - var iconsBaseTemplatesPath = 'icon'; + const baseTemplatesPath = "file-summary"; + const iconsBaseTemplatesPath = "icon"; function FileListPrinter(config) { this.config = config; - var HoganJsUtils = require('./hoganjs-utils.js').HoganJsUtils; + const HoganJsUtils = require("./hoganjs-utils.js").HoganJsUtils; hoganUtils = new HoganJsUtils(config); } FileListPrinter.prototype.generateFileList = function(diffFiles) { - var lineTemplate = hoganUtils.template(baseTemplatesPath, 'line'); + const lineTemplate = hoganUtils.template(baseTemplatesPath, "line"); - var files = diffFiles.map(function(file) { - var fileTypeName = printerUtils.getFileTypeIcon(file); - var iconTemplate = hoganUtils.template(iconsBaseTemplatesPath, fileTypeName); + const files = diffFiles + .map(function(file) { + const fileTypeName = printerUtils.getFileTypeIcon(file); + const iconTemplate = hoganUtils.template(iconsBaseTemplatesPath, fileTypeName); - return lineTemplate.render({ - fileHtmlId: printerUtils.getHtmlId(file), - oldName: file.oldName, - newName: file.newName, - fileName: printerUtils.getDiffName(file), - deletedLines: '-' + file.deletedLines, - addedLines: '+' + file.addedLines - }, { - fileIcon: iconTemplate - }); - }).join('\n'); + return lineTemplate.render( + { + fileHtmlId: printerUtils.getHtmlId(file), + oldName: file.oldName, + newName: file.newName, + fileName: printerUtils.getDiffName(file), + deletedLines: "-" + file.deletedLines, + addedLines: "+" + file.addedLines + }, + { + fileIcon: iconTemplate + } + ); + }) + .join("\n"); - return hoganUtils.render(baseTemplatesPath, 'wrapper', { + return hoganUtils.render(baseTemplatesPath, "wrapper", { filesNumber: diffFiles.length, files: files }); diff --git a/src/hoganjs-utils.js b/src/hoganjs-utils.js index b2e9c27..9727557 100644 --- a/src/hoganjs-utils.js +++ b/src/hoganjs-utils.js @@ -6,20 +6,20 @@ */ (function() { - var fs = require('fs'); - var path = require('path'); - var hogan = require('hogan.js'); + const fs = require("fs"); + const path = require("path"); + const hogan = require("hogan.js"); - var hoganTemplates = require('./templates/diff2html-templates.js'); + const hoganTemplates = require("./diff2html-templates.js"); - var extraTemplates; + let extraTemplates; function HoganJsUtils(configuration) { this.config = configuration || {}; extraTemplates = this.config.templates || {}; - var rawTemplates = this.config.rawTemplates || {}; - for (var templateName in rawTemplates) { + const rawTemplates = this.config.rawTemplates || {}; + for (const templateName in rawTemplates) { if (rawTemplates.hasOwnProperty(templateName)) { if (!extraTemplates[templateName]) extraTemplates[templateName] = this.compile(rawTemplates[templateName]); } @@ -27,7 +27,7 @@ } HoganJsUtils.prototype.render = function(namespace, view, params) { - var template = this.template(namespace, view); + const template = this.template(namespace, view); if (template) { return template.render(params); } @@ -36,13 +36,13 @@ }; HoganJsUtils.prototype.template = function(namespace, view) { - var templateKey = this._templateKey(namespace, view); + const templateKey = this._templateKey(namespace, view); return this._getTemplate(templateKey); }; HoganJsUtils.prototype._getTemplate = function(templateKey) { - var template; + let template; if (!this.config.noCache) { template = this._readFromCache(templateKey); @@ -56,18 +56,18 @@ }; HoganJsUtils.prototype._loadTemplate = function(templateKey) { - var template; + let template; try { if (fs.readFileSync) { - var templatesPath = path.resolve(__dirname, 'templates'); - var templatePath = path.join(templatesPath, templateKey); - var templateContent = fs.readFileSync(templatePath + '.mustache', 'utf8'); + const templatesPath = path.resolve(__dirname, "templates"); + const templatePath = path.join(templatesPath, templateKey); + const templateContent = fs.readFileSync(templatePath + ".mustache", "utf8"); template = hogan.compile(templateContent); hoganTemplates[templateKey] = template; } } catch (e) { - console.error('Failed to read (template: ' + templateKey + ') from fs: ' + e.message); + console.error("Failed to read (template: " + templateKey + ") from fs: " + e.message); } return template; @@ -78,7 +78,7 @@ }; HoganJsUtils.prototype._templateKey = function(namespace, view) { - return namespace + '-' + view; + return namespace + "-" + view; }; HoganJsUtils.prototype.compile = function(templateStr) { diff --git a/src/html-printer.js b/src/html-printer.js index 13f8304..2c76d83 100644 --- a/src/html-printer.js +++ b/src/html-printer.js @@ -6,25 +6,24 @@ */ (function() { - var LineByLinePrinter = require('./line-by-line-printer.js').LineByLinePrinter; - var SideBySidePrinter = require('./side-by-side-printer.js').SideBySidePrinter; - var FileListPrinter = require('./file-list-printer.js').FileListPrinter; + const LineByLinePrinter = require("./line-by-line-printer.js").LineByLinePrinter; + const SideBySidePrinter = require("./side-by-side-printer.js").SideBySidePrinter; + const FileListPrinter = require("./file-list-printer.js").FileListPrinter; - function HtmlPrinter() { - } + function HtmlPrinter() {} HtmlPrinter.prototype.generateLineByLineJsonHtml = function(diffFiles, config) { - var lineByLinePrinter = new LineByLinePrinter(config); + const lineByLinePrinter = new LineByLinePrinter(config); return lineByLinePrinter.generateLineByLineJsonHtml(diffFiles); }; HtmlPrinter.prototype.generateSideBySideJsonHtml = function(diffFiles, config) { - var sideBySidePrinter = new SideBySidePrinter(config); + const sideBySidePrinter = new SideBySidePrinter(config); return sideBySidePrinter.generateSideBySideJsonHtml(diffFiles); }; HtmlPrinter.prototype.generateFileListSummary = function(diffJson, config) { - var fileListPrinter = new FileListPrinter(config); + const fileListPrinter = new FileListPrinter(config); return fileListPrinter.generateFileList(diffJson); }; diff --git a/src/line-by-line-printer.js b/src/line-by-line-printer.js index 49f183f..8a0f5ac 100644 --- a/src/line-by-line-printer.js +++ b/src/line-by-line-printer.js @@ -6,54 +6,57 @@ */ (function() { - var diffParser = require('./diff-parser.js').DiffParser; - var printerUtils = require('./printer-utils.js').PrinterUtils; - var utils = require('./utils.js').Utils; - var Rematch = require('./rematch.js').Rematch; + const diffParser = require("./diff-parser.js").DiffParser; + const printerUtils = require("./printer-utils.js").PrinterUtils; + const utils = require("./utils.js").Utils; + const Rematch = require("./rematch.js").Rematch; - var hoganUtils; + let hoganUtils; - var genericTemplatesPath = 'generic'; - var baseTemplatesPath = 'line-by-line'; - var iconsBaseTemplatesPath = 'icon'; - var tagsBaseTemplatesPath = 'tag'; + const genericTemplatesPath = "generic"; + const baseTemplatesPath = "line-by-line"; + const iconsBaseTemplatesPath = "icon"; + const tagsBaseTemplatesPath = "tag"; function LineByLinePrinter(config) { this.config = config; - var HoganJsUtils = require('./hoganjs-utils.js').HoganJsUtils; + const HoganJsUtils = require("./hoganjs-utils.js").HoganJsUtils; hoganUtils = new HoganJsUtils(config); } LineByLinePrinter.prototype.makeFileDiffHtml = function(file, diffs) { - if (this.config.renderNothingWhenEmpty && file.blocks && !file.blocks.length) return ''; + if (this.config.renderNothingWhenEmpty && file.blocks && !file.blocks.length) return ""; - var fileDiffTemplate = hoganUtils.template(baseTemplatesPath, 'file-diff'); - var filePathTemplate = hoganUtils.template(genericTemplatesPath, 'file-path'); - var fileIconTemplate = hoganUtils.template(iconsBaseTemplatesPath, 'file'); - var fileTagTemplate = hoganUtils.template(tagsBaseTemplatesPath, printerUtils.getFileTypeIcon(file)); + const fileDiffTemplate = hoganUtils.template(baseTemplatesPath, "file-diff"); + const filePathTemplate = hoganUtils.template(genericTemplatesPath, "file-path"); + const fileIconTemplate = hoganUtils.template(iconsBaseTemplatesPath, "file"); + const fileTagTemplate = hoganUtils.template(tagsBaseTemplatesPath, printerUtils.getFileTypeIcon(file)); return fileDiffTemplate.render({ file: file, fileHtmlId: printerUtils.getHtmlId(file), diffs: diffs, - filePath: filePathTemplate.render({ - fileDiffName: printerUtils.getDiffName(file) - }, { - fileIcon: fileIconTemplate, - fileTag: fileTagTemplate - }) + filePath: filePathTemplate.render( + { + fileDiffName: printerUtils.getDiffName(file) + }, + { + fileIcon: fileIconTemplate, + fileTag: fileTagTemplate + } + ) }); }; LineByLinePrinter.prototype.makeLineByLineHtmlWrapper = function(content) { - return hoganUtils.render(genericTemplatesPath, 'wrapper', {'content': content}); + return hoganUtils.render(genericTemplatesPath, "wrapper", { content: content }); }; LineByLinePrinter.prototype.generateLineByLineJsonHtml = function(diffFiles) { - var that = this; - var htmlDiffs = diffFiles.map(function(file) { - var diffs; + const that = this; + const htmlDiffs = diffFiles.map(function(file) { + let diffs; if (file.blocks.length) { diffs = that._generateFileHtml(file); } else { @@ -62,134 +65,151 @@ return that.makeFileDiffHtml(file, diffs); }); - return this.makeLineByLineHtmlWrapper(htmlDiffs.join('\n')); + return this.makeLineByLineHtmlWrapper(htmlDiffs.join("\n")); }; - var matcher = Rematch.rematch(function(a, b) { - var amod = a.content.substr(1); - var bmod = b.content.substr(1); + const matcher = Rematch.rematch(function(a, b) { + const amod = a.content.substr(1); + const bmod = b.content.substr(1); return Rematch.distance(amod, bmod); }); LineByLinePrinter.prototype.makeColumnLineNumberHtml = function(block) { - return hoganUtils.render(genericTemplatesPath, 'column-line-number', { + return hoganUtils.render(genericTemplatesPath, "column-line-number", { diffParser: diffParser, blockHeader: utils.escape(block.header), - lineClass: 'd2h-code-linenumber', - contentClass: 'd2h-code-line' + lineClass: "d2h-code-linenumber", + contentClass: "d2h-code-line" }); }; LineByLinePrinter.prototype._generateFileHtml = function(file) { - var that = this; - return file.blocks.map(function(block) { - var lines = that.makeColumnLineNumberHtml(block); - var oldLines = []; - var newLines = []; + const that = this; + return file.blocks + .map(function(block) { + let lines = that.makeColumnLineNumberHtml(block); + let oldLines = []; + let newLines = []; - function processChangeBlock() { - var matches; - var insertType; - var deleteType; + function processChangeBlock() { + let matches; + let insertType; + let deleteType; - var comparisons = oldLines.length * newLines.length; + const comparisons = oldLines.length * newLines.length; - var maxLineSizeInBlock = Math.max.apply(null, - [0].concat((oldLines.concat(newLines)).map( - function(elem) { - return elem.content.length; - } - ))); + const maxLineSizeInBlock = Math.max.apply( + null, + [0].concat( + oldLines.concat(newLines).map(function(elem) { + return elem.content.length; + }) + ) + ); - var doMatching = comparisons < that.config.matchingMaxComparisons && - maxLineSizeInBlock < that.config.maxLineSizeInBlockForComparison && - (that.config.matching === 'lines' || that.config.matching === 'words'); + const doMatching = + comparisons < that.config.matchingMaxComparisons && + maxLineSizeInBlock < that.config.maxLineSizeInBlockForComparison && + (that.config.matching === "lines" || that.config.matching === "words"); - if (doMatching) { - matches = matcher(oldLines, newLines); - insertType = diffParser.LINE_TYPE.INSERT_CHANGES; - deleteType = diffParser.LINE_TYPE.DELETE_CHANGES; - } else { - matches = [[oldLines, newLines]]; - insertType = diffParser.LINE_TYPE.INSERTS; - deleteType = diffParser.LINE_TYPE.DELETES; - } - - matches.forEach(function(match) { - oldLines = match[0]; - newLines = match[1]; - - var processedOldLines = []; - var processedNewLines = []; - - var common = Math.min(oldLines.length, newLines.length); - - var oldLine, newLine; - for (var j = 0; j < common; j++) { - oldLine = oldLines[j]; - newLine = newLines[j]; - - that.config.isCombined = file.isCombined; - var diff = printerUtils.diffHighlight(oldLine.content, newLine.content, that.config); - - processedOldLines += - that.makeLineHtml(file.isCombined, deleteType, oldLine.oldNumber, oldLine.newNumber, - diff.first.line, diff.first.prefix); - processedNewLines += - that.makeLineHtml(file.isCombined, insertType, newLine.oldNumber, newLine.newNumber, - diff.second.line, diff.second.prefix); + if (doMatching) { + matches = matcher(oldLines, newLines); + insertType = diffParser.LINE_TYPE.INSERT_CHANGES; + deleteType = diffParser.LINE_TYPE.DELETE_CHANGES; + } else { + matches = [[oldLines, newLines]]; + insertType = diffParser.LINE_TYPE.INSERTS; + deleteType = diffParser.LINE_TYPE.DELETES; } - lines += processedOldLines + processedNewLines; - lines += that._processLines(file.isCombined, oldLines.slice(common), newLines.slice(common)); - }); + matches.forEach(function(match) { + oldLines = match[0]; + newLines = match[1]; - oldLines = []; - newLines = []; - } + let processedOldLines = []; + let processedNewLines = []; - for (var i = 0; i < block.lines.length; i++) { - var line = block.lines[i]; - var escapedLine = utils.escape(line.content); + const common = Math.min(oldLines.length, newLines.length); - if (line.type !== diffParser.LINE_TYPE.INSERTS && - (newLines.length > 0 || (line.type !== diffParser.LINE_TYPE.DELETES && oldLines.length > 0))) { - processChangeBlock(); + let oldLine, newLine; + for (let j = 0; j < common; j++) { + oldLine = oldLines[j]; + newLine = newLines[j]; + + that.config.isCombined = file.isCombined; + const diff = printerUtils.diffHighlight(oldLine.content, newLine.content, that.config); + + processedOldLines += that.makeLineHtml( + file.isCombined, + deleteType, + oldLine.oldNumber, + oldLine.newNumber, + diff.first.line, + diff.first.prefix + ); + processedNewLines += that.makeLineHtml( + file.isCombined, + insertType, + newLine.oldNumber, + newLine.newNumber, + diff.second.line, + diff.second.prefix + ); + } + + lines += processedOldLines + processedNewLines; + lines += that._processLines(file.isCombined, oldLines.slice(common), newLines.slice(common)); + }); + + oldLines = []; + newLines = []; } - if (line.type === diffParser.LINE_TYPE.CONTEXT) { - lines += that.makeLineHtml(file.isCombined, line.type, line.oldNumber, line.newNumber, escapedLine); - } else if (line.type === diffParser.LINE_TYPE.INSERTS && !oldLines.length) { - lines += that.makeLineHtml(file.isCombined, line.type, line.oldNumber, line.newNumber, escapedLine); - } else if (line.type === diffParser.LINE_TYPE.DELETES) { - oldLines.push(line); - } else if (line.type === diffParser.LINE_TYPE.INSERTS && Boolean(oldLines.length)) { - newLines.push(line); - } else { - console.error('Unknown state in html line-by-line generator'); - processChangeBlock(); + for (let i = 0; i < block.lines.length; i++) { + const line = block.lines[i]; + const escapedLine = utils.escape(line.content); + + if ( + line.type !== diffParser.LINE_TYPE.INSERTS && + (newLines.length > 0 || (line.type !== diffParser.LINE_TYPE.DELETES && oldLines.length > 0)) + ) { + processChangeBlock(); + } + + if (line.type === diffParser.LINE_TYPE.CONTEXT) { + lines += that.makeLineHtml(file.isCombined, line.type, line.oldNumber, line.newNumber, escapedLine); + } else if (line.type === diffParser.LINE_TYPE.INSERTS && !oldLines.length) { + lines += that.makeLineHtml(file.isCombined, line.type, line.oldNumber, line.newNumber, escapedLine); + } else if (line.type === diffParser.LINE_TYPE.DELETES) { + oldLines.push(line); + } else if (line.type === diffParser.LINE_TYPE.INSERTS && Boolean(oldLines.length)) { + newLines.push(line); + } else { + console.error("Unknown state in html line-by-line generator"); + processChangeBlock(); + } } - } - processChangeBlock(); + processChangeBlock(); - return lines; - }).join('\n'); + return lines; + }) + .join("\n"); }; LineByLinePrinter.prototype._processLines = function(isCombined, oldLines, newLines) { - var lines = ''; + let lines = ""; - for (var i = 0; i < oldLines.length; i++) { - var oldLine = oldLines[i]; - var oldEscapedLine = utils.escape(oldLine.content); + for (let i = 0; i < oldLines.length; i++) { + const oldLine = oldLines[i]; + const oldEscapedLine = utils.escape(oldLine.content); lines += this.makeLineHtml(isCombined, oldLine.type, oldLine.oldNumber, oldLine.newNumber, oldEscapedLine); } - for (var j = 0; j < newLines.length; j++) { - var newLine = newLines[j]; - var newEscapedLine = utils.escape(newLine.content); + for (let j = 0; j < newLines.length; j++) { + const newLine = newLines[j]; + const newEscapedLine = utils.escape(newLine.content); lines += this.makeLineHtml(isCombined, newLine.type, newLine.oldNumber, newLine.newNumber, newEscapedLine); } @@ -197,38 +217,37 @@ }; LineByLinePrinter.prototype.makeLineHtml = function(isCombined, type, oldNumber, newNumber, content, possiblePrefix) { - var lineNumberTemplate = hoganUtils.render(baseTemplatesPath, 'numbers', { + const lineNumberTemplate = hoganUtils.render(baseTemplatesPath, "numbers", { oldNumber: utils.valueOrEmpty(oldNumber), newNumber: utils.valueOrEmpty(newNumber) }); - var lineWithoutPrefix = content; - var prefix = possiblePrefix; + let lineWithoutPrefix = content; + let prefix = possiblePrefix; if (!prefix) { - var lineWithPrefix = printerUtils.separatePrefix(isCombined, content); + const lineWithPrefix = printerUtils.separatePrefix(isCombined, content); prefix = lineWithPrefix.prefix; lineWithoutPrefix = lineWithPrefix.line; } - if (prefix === ' ') { - prefix = ' '; + if (prefix === " ") { + prefix = " "; } - return hoganUtils.render(genericTemplatesPath, 'line', - { - type: type, - lineClass: 'd2h-code-linenumber', - contentClass: 'd2h-code-line', - prefix: prefix, - content: lineWithoutPrefix, - lineNumber: lineNumberTemplate - }); + return hoganUtils.render(genericTemplatesPath, "line", { + type: type, + lineClass: "d2h-code-linenumber", + contentClass: "d2h-code-line", + prefix: prefix, + content: lineWithoutPrefix, + lineNumber: lineNumberTemplate + }); }; LineByLinePrinter.prototype._generateEmptyDiff = function() { - return hoganUtils.render(genericTemplatesPath, 'empty-diff', { - contentClass: 'd2h-code-line', + return hoganUtils.render(genericTemplatesPath, "empty-diff", { + contentClass: "d2h-code-line", diffParser: diffParser }); }; diff --git a/src/printer-utils.js b/src/printer-utils.js index d4a61be..9e2ee49 100644 --- a/src/printer-utils.js +++ b/src/printer-utils.js @@ -6,18 +6,17 @@ */ (function() { - var jsDiff = require('diff'); - var utils = require('./utils.js').Utils; - var Rematch = require('./rematch.js').Rematch; + const jsDiff = require("diff"); + const utils = require("./utils.js").Utils; + const Rematch = require("./rematch.js").Rematch; - var separator = '/'; + const separator = "/"; - function PrinterUtils() { - } + function PrinterUtils() {} PrinterUtils.prototype.separatePrefix = function(isCombined, line) { - var prefix; - var lineWithoutPrefix; + let prefix; + let lineWithoutPrefix; if (isCombined) { prefix = line.substring(0, 2); @@ -28,45 +27,56 @@ } return { - 'prefix': prefix, - 'line': lineWithoutPrefix + prefix: prefix, + line: lineWithoutPrefix }; }; PrinterUtils.prototype.getHtmlId = function(file) { - var hashCode = function(text) { - var i, chr, len; - var hash = 0; + const hashCode = function(text) { + let i, chr, len; + let hash = 0; for (i = 0, len = text.length; i < len; i++) { chr = text.charCodeAt(i); - hash = ((hash << 5) - hash) + chr; + hash = (hash << 5) - hash + chr; hash |= 0; // Convert to 32bit integer } return hash; }; - return 'd2h-' + hashCode(this.getDiffName(file)).toString().slice(-6); + return ( + "d2h-" + + hashCode(this.getDiffName(file)) + .toString() + .slice(-6) + ); }; PrinterUtils.prototype.getDiffName = function(file) { - var oldFilename = unifyPath(file.oldName); - var newFilename = unifyPath(file.newName); + const oldFilename = unifyPath(file.oldName); + const newFilename = unifyPath(file.newName); - if (oldFilename && newFilename && oldFilename !== newFilename && !isDevNullName(oldFilename) && !isDevNullName(newFilename)) { - var prefixPaths = []; - var suffixPaths = []; + if ( + oldFilename && + newFilename && + oldFilename !== newFilename && + !isDevNullName(oldFilename) && + !isDevNullName(newFilename) + ) { + const prefixPaths = []; + const suffixPaths = []; - var oldFilenameParts = oldFilename.split(separator); - var newFilenameParts = newFilename.split(separator); + const oldFilenameParts = oldFilename.split(separator); + const newFilenameParts = newFilename.split(separator); - var oldFilenamePartsSize = oldFilenameParts.length; - var newFilenamePartsSize = newFilenameParts.length; + const oldFilenamePartsSize = oldFilenameParts.length; + const newFilenamePartsSize = newFilenameParts.length; - var i = 0; - var j = oldFilenamePartsSize - 1; - var k = newFilenamePartsSize - 1; + let i = 0; + let j = oldFilenamePartsSize - 1; + let k = newFilenamePartsSize - 1; while (i < j && i < k) { if (oldFilenameParts[i] === newFilenameParts[i]) { @@ -87,53 +97,55 @@ } } - var finalPrefix = prefixPaths.join(separator); - var finalSuffix = suffixPaths.join(separator); + const finalPrefix = prefixPaths.join(separator); + const finalSuffix = suffixPaths.join(separator); - var oldRemainingPath = oldFilenameParts.slice(i, j + 1).join(separator); - var newRemainingPath = newFilenameParts.slice(i, k + 1).join(separator); + const oldRemainingPath = oldFilenameParts.slice(i, j + 1).join(separator); + const newRemainingPath = newFilenameParts.slice(i, k + 1).join(separator); if (finalPrefix.length && finalSuffix.length) { - return finalPrefix + separator + '{' + oldRemainingPath + ' → ' + newRemainingPath + '}' + separator + finalSuffix; + return ( + finalPrefix + separator + "{" + oldRemainingPath + " → " + newRemainingPath + "}" + separator + finalSuffix + ); } else if (finalPrefix.length) { - return finalPrefix + separator + '{' + oldRemainingPath + ' → ' + newRemainingPath + '}'; + return finalPrefix + separator + "{" + oldRemainingPath + " → " + newRemainingPath + "}"; } else if (finalSuffix.length) { - return '{' + oldRemainingPath + ' → ' + newRemainingPath + '}' + separator + finalSuffix; + return "{" + oldRemainingPath + " → " + newRemainingPath + "}" + separator + finalSuffix; } - return oldFilename + ' → ' + newFilename; + return oldFilename + " → " + newFilename; } else if (newFilename && !isDevNullName(newFilename)) { return newFilename; } else if (oldFilename) { return oldFilename; } - return 'unknown/file/path'; + return "unknown/file/path"; }; PrinterUtils.prototype.getFileTypeIcon = function(file) { - var templateName = 'file-changed'; + let templateName = "file-changed"; if (file.isRename) { - templateName = 'file-renamed'; + templateName = "file-renamed"; } else if (file.isCopy) { - templateName = 'file-renamed'; + templateName = "file-renamed"; } else if (file.isNew) { - templateName = 'file-added'; + templateName = "file-added"; } else if (file.isDeleted) { - templateName = 'file-deleted'; + templateName = "file-deleted"; } else if (file.newName !== file.oldName) { // If file is not Added, not Deleted and the names changed it must be a rename :) - templateName = 'file-renamed'; + templateName = "file-renamed"; } return templateName; }; PrinterUtils.prototype.diffHighlight = function(diffLine1, diffLine2, config) { - var linePrefix1, linePrefix2, unprefixedLine1, unprefixedLine2; + let linePrefix1, linePrefix2, unprefixedLine1, unprefixedLine2; - var prefixSize = 1; + let prefixSize = 1; if (config.isCombined) { prefixSize = 2; @@ -144,8 +156,10 @@ unprefixedLine1 = diffLine1.substr(prefixSize); unprefixedLine2 = diffLine2.substr(prefixSize); - if (unprefixedLine1.length > config.maxLineLengthHighlight || - unprefixedLine2.length > config.maxLineLengthHighlight) { + if ( + unprefixedLine1.length > config.maxLineLengthHighlight || + unprefixedLine2.length > config.maxLineLengthHighlight + ) { return { first: { prefix: linePrefix1, @@ -158,42 +172,42 @@ }; } - var diff; - if (config.diffStyle === 'char') { + let diff; + if (config.diffStyle === "char") { diff = jsDiff.diffChars(unprefixedLine1, unprefixedLine2); } else { diff = jsDiff.diffWordsWithSpace(unprefixedLine1, unprefixedLine2); } - var highlightedLine = ''; + let highlightedLine = ""; - var changedWords = []; - if (config.diffStyle === 'word' && config.matching === 'words') { - var treshold = 0.25; + const changedWords = []; + if (config.diffStyle === "word" && config.matching === "words") { + let treshold = 0.25; - if (typeof (config.matchWordsThreshold) !== 'undefined') { + if (typeof config.matchWordsThreshold !== "undefined") { treshold = config.matchWordsThreshold; } - var matcher = Rematch.rematch(function(a, b) { - var amod = a.value; - var bmod = b.value; + const matcher = Rematch.rematch(function(a, b) { + const amod = a.value; + const bmod = b.value; return Rematch.distance(amod, bmod); }); - var removed = diff.filter(function isRemoved(element) { + const removed = diff.filter(function isRemoved(element) { return element.removed; }); - var added = diff.filter(function isAdded(element) { + const added = diff.filter(function isAdded(element) { return element.added; }); - var chunks = matcher(added, removed); + const chunks = matcher(added, removed); chunks.forEach(function(chunk) { if (chunk[0].length === 1 && chunk[1].length === 1) { - var dist = Rematch.distance(chunk[0][0].value, chunk[1][0].value); + const dist = Rematch.distance(chunk[0][0].value, chunk[1][0].value); if (dist < treshold) { changedWords.push(chunk[0][0]); changedWords.push(chunk[1][0]); @@ -203,12 +217,12 @@ } diff.forEach(function(part) { - var addClass = changedWords.indexOf(part) > -1 ? ' class="d2h-change"' : ''; - var elemType = part.added ? 'ins' : part.removed ? 'del' : null; - var escapedValue = utils.escape(part.value); + const addClass = changedWords.indexOf(part) > -1 ? ' class="d2h-change"' : ""; + const elemType = part.added ? "ins" : part.removed ? "del" : null; + const escapedValue = utils.escape(part.value); if (elemType !== null) { - highlightedLine += '<' + elemType + addClass + '>' + escapedValue + ''; + highlightedLine += "<" + elemType + addClass + ">" + escapedValue + ""; } else { highlightedLine += escapedValue; } @@ -228,22 +242,22 @@ function unifyPath(path) { if (path) { - return path.replace('\\', '/'); + return path.replace("\\", "/"); } return path; } function isDevNullName(name) { - return name.indexOf('dev/null') !== -1; + return name.indexOf("dev/null") !== -1; } function removeIns(line) { - return line.replace(/(]*>((.|\n)*?)<\/ins>)/g, ''); + return line.replace(/(]*>((.|\n)*?)<\/ins>)/g, ""); } function removeDel(line) { - return line.replace(/(]*>((.|\n)*?)<\/del>)/g, ''); + return line.replace(/(]*>((.|\n)*?)<\/del>)/g, ""); } module.exports.PrinterUtils = new PrinterUtils(); diff --git a/src/rematch.js b/src/rematch.js index bad5665..b8b26a5 100644 --- a/src/rematch.js +++ b/src/rematch.js @@ -7,7 +7,7 @@ */ (function() { - var Rematch = {}; + const Rematch = {}; /* Copyright (c) 2011 Andrei Mackenzie @@ -29,16 +29,16 @@ return a.length; } - var matrix = []; + const matrix = []; // Increment along the first column of each row - var i; + let i; for (i = 0; i <= b.length; i++) { matrix[i] = [i]; } // Increment each column in the first row - var j; + let j; for (j = 0; j <= a.length; j++) { matrix[0][j] = j; } @@ -49,9 +49,13 @@ if (b.charAt(i - 1) === a.charAt(j - 1)) { matrix[i][j] = matrix[i - 1][j - 1]; } else { - matrix[i][j] = Math.min(matrix[i - 1][j - 1] + 1, // Substitution - Math.min(matrix[i][j - 1] + 1, // Insertion - matrix[i - 1][j] + 1)); // Deletion + matrix[i][j] = Math.min( + matrix[i - 1][j - 1] + 1, // Substitution + Math.min( + matrix[i][j - 1] + 1, // Insertion + matrix[i - 1][j] + 1 + ) + ); // Deletion } } } @@ -64,19 +68,19 @@ Rematch.distance = function distance(x, y) { x = x.trim(); y = y.trim(); - var lev = levenshtein(x, y); - var score = lev / (x.length + y.length); + const lev = levenshtein(x, y); + const score = lev / (x.length + y.length); return score; }; Rematch.rematch = function rematch(distanceFunction) { function findBestMatch(a, b, cache) { - var bestMatchDist = Infinity; - var bestMatch; - for (var i = 0; i < a.length; ++i) { - for (var j = 0; j < b.length; ++j) { - var cacheKey = JSON.stringify([a[i], b[j]]); + let bestMatchDist = Infinity; + let bestMatch; + for (let i = 0; i < a.length; ++i) { + for (let j = 0; j < b.length; ++j) { + const cacheKey = JSON.stringify([a[i], b[j]]); var md; if (cache.hasOwnProperty(cacheKey)) { md = cache[cacheKey]; @@ -86,7 +90,7 @@ } if (md < bestMatchDist) { bestMatchDist = md; - bestMatch = {indexA: i, indexB: j, score: bestMatchDist}; + bestMatch = { indexA: i, indexB: j, score: bestMatchDist }; } } } @@ -95,33 +99,33 @@ } function group(a, b, level, cache) { - if (typeof (cache) === 'undefined') { + if (typeof cache === "undefined") { cache = {}; } - var bm = findBestMatch(a, b, cache); + const bm = findBestMatch(a, b, cache); if (!level) { level = 0; } - if (!bm || (a.length + b.length < 3)) { + if (!bm || a.length + b.length < 3) { return [[a, b]]; } - var a1 = a.slice(0, bm.indexA); - var b1 = b.slice(0, bm.indexB); - var aMatch = [a[bm.indexA]]; - var bMatch = [b[bm.indexB]]; - var tailA = bm.indexA + 1; - var tailB = bm.indexB + 1; - var a2 = a.slice(tailA); - var b2 = b.slice(tailB); + const a1 = a.slice(0, bm.indexA); + const b1 = b.slice(0, bm.indexB); + const aMatch = [a[bm.indexA]]; + const bMatch = [b[bm.indexB]]; + const tailA = bm.indexA + 1; + const tailB = bm.indexB + 1; + const a2 = a.slice(tailA); + const b2 = b.slice(tailB); - var group1 = group(a1, b1, level + 1, cache); - var groupMatch = group(aMatch, bMatch, level + 1, cache); - var group2 = group(a2, b2, level + 1, cache); - var result = groupMatch; + const group1 = group(a1, b1, level + 1, cache); + const groupMatch = group(aMatch, bMatch, level + 1, cache); + const group2 = group(a2, b2, level + 1, cache); + let result = groupMatch; if (bm.indexA > 0 || bm.indexB > 0) { result = group1.concat(result); diff --git a/src/side-by-side-printer.js b/src/side-by-side-printer.js index 91fb84b..7655081 100644 --- a/src/side-by-side-printer.js +++ b/src/side-by-side-printer.js @@ -6,21 +6,21 @@ */ (function() { - var diffParser = require('./diff-parser.js').DiffParser; - var printerUtils = require('./printer-utils.js').PrinterUtils; - var utils = require('./utils.js').Utils; - var Rematch = require('./rematch.js').Rematch; + const diffParser = require("./diff-parser.js").DiffParser; + const printerUtils = require("./printer-utils.js").PrinterUtils; + const utils = require("./utils.js").Utils; + const Rematch = require("./rematch.js").Rematch; - var hoganUtils; + let hoganUtils; - var genericTemplatesPath = 'generic'; - var baseTemplatesPath = 'side-by-side'; - var iconsBaseTemplatesPath = 'icon'; - var tagsBaseTemplatesPath = 'tag'; + const genericTemplatesPath = "generic"; + const baseTemplatesPath = "side-by-side"; + const iconsBaseTemplatesPath = "icon"; + const tagsBaseTemplatesPath = "tag"; - var matcher = Rematch.rematch(function(a, b) { - var amod = a.content.substr(1); - var bmod = b.content.substr(1); + const matcher = Rematch.rematch(function(a, b) { + const amod = a.content.substr(1); + const bmod = b.content.substr(1); return Rematch.distance(amod, bmod); }); @@ -28,82 +28,91 @@ function SideBySidePrinter(config) { this.config = config; - var HoganJsUtils = require('./hoganjs-utils.js').HoganJsUtils; + const HoganJsUtils = require("./hoganjs-utils.js").HoganJsUtils; hoganUtils = new HoganJsUtils(config); } SideBySidePrinter.prototype.makeDiffHtml = function(file, diffs) { - var fileDiffTemplate = hoganUtils.template(baseTemplatesPath, 'file-diff'); - var filePathTemplate = hoganUtils.template(genericTemplatesPath, 'file-path'); - var fileIconTemplate = hoganUtils.template(iconsBaseTemplatesPath, 'file'); - var fileTagTemplate = hoganUtils.template(tagsBaseTemplatesPath, printerUtils.getFileTypeIcon(file)); + const fileDiffTemplate = hoganUtils.template(baseTemplatesPath, "file-diff"); + const filePathTemplate = hoganUtils.template(genericTemplatesPath, "file-path"); + const fileIconTemplate = hoganUtils.template(iconsBaseTemplatesPath, "file"); + const fileTagTemplate = hoganUtils.template(tagsBaseTemplatesPath, printerUtils.getFileTypeIcon(file)); return fileDiffTemplate.render({ file: file, fileHtmlId: printerUtils.getHtmlId(file), diffs: diffs, - filePath: filePathTemplate.render({ - fileDiffName: printerUtils.getDiffName(file) - }, { - fileIcon: fileIconTemplate, - fileTag: fileTagTemplate - }) + filePath: filePathTemplate.render( + { + fileDiffName: printerUtils.getDiffName(file) + }, + { + fileIcon: fileIconTemplate, + fileTag: fileTagTemplate + } + ) }); }; SideBySidePrinter.prototype.generateSideBySideJsonHtml = function(diffFiles) { - var that = this; + const that = this; - var content = diffFiles.map(function(file) { - var diffs; - if (file.blocks.length) { - diffs = that.generateSideBySideFileHtml(file); - } else { - diffs = that.generateEmptyDiff(); - } + const content = diffFiles + .map(function(file) { + let diffs; + if (file.blocks.length) { + diffs = that.generateSideBySideFileHtml(file); + } else { + diffs = that.generateEmptyDiff(); + } - return that.makeDiffHtml(file, diffs); - }).join('\n'); + return that.makeDiffHtml(file, diffs); + }) + .join("\n"); - return hoganUtils.render(genericTemplatesPath, 'wrapper', {'content': content}); + return hoganUtils.render(genericTemplatesPath, "wrapper", { content: content }); }; SideBySidePrinter.prototype.makeSideHtml = function(blockHeader) { - return hoganUtils.render(genericTemplatesPath, 'column-line-number', { + return hoganUtils.render(genericTemplatesPath, "column-line-number", { diffParser: diffParser, blockHeader: utils.escape(blockHeader), - lineClass: 'd2h-code-side-linenumber', - contentClass: 'd2h-code-side-line' + lineClass: "d2h-code-side-linenumber", + contentClass: "d2h-code-side-line" }); }; SideBySidePrinter.prototype.generateSideBySideFileHtml = function(file) { - var that = this; - var fileHtml = {}; - fileHtml.left = ''; - fileHtml.right = ''; + const that = this; + const fileHtml = {}; + fileHtml.left = ""; + fileHtml.right = ""; file.blocks.forEach(function(block) { fileHtml.left += that.makeSideHtml(block.header); - fileHtml.right += that.makeSideHtml(''); + fileHtml.right += that.makeSideHtml(""); - var oldLines = []; - var newLines = []; + let oldLines = []; + let newLines = []; function processChangeBlock() { - var matches; - var insertType; - var deleteType; + let matches; + let insertType; + let deleteType; - var comparisons = oldLines.length * newLines.length; + const comparisons = oldLines.length * newLines.length; - var maxLineSizeInBlock = Math.max.apply(null, (oldLines.concat(newLines)).map(function(elem) { - return elem.length; - })); + const maxLineSizeInBlock = Math.max.apply( + null, + oldLines.concat(newLines).map(function(elem) { + return elem.length; + }) + ); - var doMatching = comparisons < that.config.matchingMaxComparisons && + const doMatching = + comparisons < that.config.matchingMaxComparisons && maxLineSizeInBlock < that.config.maxLineSizeInBlockForComparison && - (that.config.matching === 'lines' || that.config.matching === 'words'); + (that.config.matching === "lines" || that.config.matching === "words"); if (doMatching) { matches = matcher(oldLines, newLines); @@ -119,30 +128,38 @@ oldLines = match[0]; newLines = match[1]; - var common = Math.min(oldLines.length, newLines.length); - var max = Math.max(oldLines.length, newLines.length); + const common = Math.min(oldLines.length, newLines.length); + const max = Math.max(oldLines.length, newLines.length); - for (var j = 0; j < common; j++) { - var oldLine = oldLines[j]; - var newLine = newLines[j]; + for (let j = 0; j < common; j++) { + const oldLine = oldLines[j]; + const newLine = newLines[j]; that.config.isCombined = file.isCombined; - var diff = printerUtils.diffHighlight(oldLine.content, newLine.content, that.config); + const diff = printerUtils.diffHighlight(oldLine.content, newLine.content, that.config); - fileHtml.left += - that.generateSingleLineHtml(file.isCombined, deleteType, oldLine.oldNumber, - diff.first.line, diff.first.prefix); - fileHtml.right += - that.generateSingleLineHtml(file.isCombined, insertType, newLine.newNumber, - diff.second.line, diff.second.prefix); + fileHtml.left += that.generateSingleLineHtml( + file.isCombined, + deleteType, + oldLine.oldNumber, + diff.first.line, + diff.first.prefix + ); + fileHtml.right += that.generateSingleLineHtml( + file.isCombined, + insertType, + newLine.newNumber, + diff.second.line, + diff.second.prefix + ); } if (max > common) { - var oldSlice = oldLines.slice(common); - var newSlice = newLines.slice(common); + const oldSlice = oldLines.slice(common); + const newSlice = newLines.slice(common); - var tmpHtml = that.processLines(file.isCombined, oldSlice, newSlice); + const tmpHtml = that.processLines(file.isCombined, oldSlice, newSlice); fileHtml.left += tmpHtml.left; fileHtml.right += tmpHtml.right; } @@ -152,28 +169,42 @@ newLines = []; } - for (var i = 0; i < block.lines.length; i++) { - var line = block.lines[i]; - var prefix = line.content[0]; - var escapedLine = utils.escape(line.content.substr(1)); + for (let i = 0; i < block.lines.length; i++) { + const line = block.lines[i]; + const prefix = line.content[0]; + const escapedLine = utils.escape(line.content.substr(1)); - if (line.type !== diffParser.LINE_TYPE.INSERTS && - (newLines.length > 0 || (line.type !== diffParser.LINE_TYPE.DELETES && oldLines.length > 0))) { + if ( + line.type !== diffParser.LINE_TYPE.INSERTS && + (newLines.length > 0 || (line.type !== diffParser.LINE_TYPE.DELETES && oldLines.length > 0)) + ) { processChangeBlock(); } if (line.type === diffParser.LINE_TYPE.CONTEXT) { fileHtml.left += that.generateSingleLineHtml(file.isCombined, line.type, line.oldNumber, escapedLine, prefix); - fileHtml.right += that.generateSingleLineHtml(file.isCombined, line.type, line.newNumber, escapedLine, prefix); + fileHtml.right += that.generateSingleLineHtml( + file.isCombined, + line.type, + line.newNumber, + escapedLine, + prefix + ); } else if (line.type === diffParser.LINE_TYPE.INSERTS && !oldLines.length) { - fileHtml.left += that.generateSingleLineHtml(file.isCombined, diffParser.LINE_TYPE.CONTEXT, '', '', ''); - fileHtml.right += that.generateSingleLineHtml(file.isCombined, line.type, line.newNumber, escapedLine, prefix); + fileHtml.left += that.generateSingleLineHtml(file.isCombined, diffParser.LINE_TYPE.CONTEXT, "", "", ""); + fileHtml.right += that.generateSingleLineHtml( + file.isCombined, + line.type, + line.newNumber, + escapedLine, + prefix + ); } else if (line.type === diffParser.LINE_TYPE.DELETES) { oldLines.push(line); } else if (line.type === diffParser.LINE_TYPE.INSERTS && Boolean(oldLines.length)) { newLines.push(line); } else { - console.error('unknown state in html side-by-side generator'); + console.error("unknown state in html side-by-side generator"); processChangeBlock(); } } @@ -185,15 +216,15 @@ }; SideBySidePrinter.prototype.processLines = function(isCombined, oldLines, newLines) { - var that = this; - var fileHtml = {}; - fileHtml.left = ''; - fileHtml.right = ''; + const that = this; + const fileHtml = {}; + fileHtml.left = ""; + fileHtml.right = ""; - var maxLinesNumber = Math.max(oldLines.length, newLines.length); - for (var i = 0; i < maxLinesNumber; i++) { - var oldLine = oldLines[i]; - var newLine = newLines[i]; + const maxLinesNumber = Math.max(oldLines.length, newLines.length); + for (let i = 0; i < maxLinesNumber; i++) { + const oldLine = oldLines[i]; + const newLine = newLines[i]; var oldContent; var newContent; var oldPrefix; @@ -210,16 +241,40 @@ } if (oldLine && newLine) { - fileHtml.left += that.generateSingleLineHtml(isCombined, oldLine.type, oldLine.oldNumber, oldContent, oldPrefix); - fileHtml.right += that.generateSingleLineHtml(isCombined, newLine.type, newLine.newNumber, newContent, newPrefix); + fileHtml.left += that.generateSingleLineHtml( + isCombined, + oldLine.type, + oldLine.oldNumber, + oldContent, + oldPrefix + ); + fileHtml.right += that.generateSingleLineHtml( + isCombined, + newLine.type, + newLine.newNumber, + newContent, + newPrefix + ); } else if (oldLine) { - fileHtml.left += that.generateSingleLineHtml(isCombined, oldLine.type, oldLine.oldNumber, oldContent, oldPrefix); - fileHtml.right += that.generateSingleLineHtml(isCombined, diffParser.LINE_TYPE.CONTEXT, '', '', ''); + fileHtml.left += that.generateSingleLineHtml( + isCombined, + oldLine.type, + oldLine.oldNumber, + oldContent, + oldPrefix + ); + fileHtml.right += that.generateSingleLineHtml(isCombined, diffParser.LINE_TYPE.CONTEXT, "", "", ""); } else if (newLine) { - fileHtml.left += that.generateSingleLineHtml(isCombined, diffParser.LINE_TYPE.CONTEXT, '', '', ''); - fileHtml.right += that.generateSingleLineHtml(isCombined, newLine.type, newLine.newNumber, newContent, newPrefix); + fileHtml.left += that.generateSingleLineHtml(isCombined, diffParser.LINE_TYPE.CONTEXT, "", "", ""); + fileHtml.right += that.generateSingleLineHtml( + isCombined, + newLine.type, + newLine.newNumber, + newContent, + newPrefix + ); } else { - console.error('How did it get here?'); + console.error("How did it get here?"); } } @@ -227,44 +282,43 @@ }; SideBySidePrinter.prototype.generateSingleLineHtml = function(isCombined, type, number, content, possiblePrefix) { - var lineWithoutPrefix = content; - var prefix = possiblePrefix; - var lineClass = 'd2h-code-side-linenumber'; - var contentClass = 'd2h-code-side-line'; + let lineWithoutPrefix = content; + let prefix = possiblePrefix; + let lineClass = "d2h-code-side-linenumber"; + let contentClass = "d2h-code-side-line"; if (!number && !content) { - lineClass += ' d2h-code-side-emptyplaceholder'; - contentClass += ' d2h-code-side-emptyplaceholder'; - type += ' d2h-emptyplaceholder'; - prefix = ' '; - lineWithoutPrefix = ' '; + lineClass += " d2h-code-side-emptyplaceholder"; + contentClass += " d2h-code-side-emptyplaceholder"; + type += " d2h-emptyplaceholder"; + prefix = " "; + lineWithoutPrefix = " "; } else if (!prefix) { - var lineWithPrefix = printerUtils.separatePrefix(isCombined, content); + const lineWithPrefix = printerUtils.separatePrefix(isCombined, content); prefix = lineWithPrefix.prefix; lineWithoutPrefix = lineWithPrefix.line; } - if (prefix === ' ') { - prefix = ' '; + if (prefix === " ") { + prefix = " "; } - return hoganUtils.render(genericTemplatesPath, 'line', - { - type: type, - lineClass: lineClass, - contentClass: contentClass, - prefix: prefix, - content: lineWithoutPrefix, - lineNumber: number - }); + return hoganUtils.render(genericTemplatesPath, "line", { + type: type, + lineClass: lineClass, + contentClass: contentClass, + prefix: prefix, + content: lineWithoutPrefix, + lineNumber: number + }); }; SideBySidePrinter.prototype.generateEmptyDiff = function() { - var fileHtml = {}; - fileHtml.right = ''; + const fileHtml = {}; + fileHtml.right = ""; - fileHtml.left = hoganUtils.render(genericTemplatesPath, 'empty-diff', { - contentClass: 'd2h-code-side-line', + fileHtml.left = hoganUtils.render(genericTemplatesPath, "empty-diff", { + contentClass: "d2h-code-side-line", diffParser: diffParser }); diff --git a/src/templates/diff2html-templates.js b/src/templates/diff2html-templates.js deleted file mode 100644 index 945a9f2..0000000 --- a/src/templates/diff2html-templates.js +++ /dev/null @@ -1,23 +0,0 @@ -(function() { -if (!!!global.browserTemplates) global.browserTemplates = {}; -var Hogan = require("hogan.js");global.browserTemplates["file-summary-line"] = new Hogan.Template({code: function (c,p,i) { var t=this;t.b(i=i||"");t.b("
  • ");t.b("\n" + i);t.b(" ");t.b("\n" + i);t.b(t.rp("");t.b(t.v(t.f("fileName",c,p,0)));t.b("");t.b("\n" + i);t.b(" ");t.b("\n" + i);t.b(" ");t.b(t.v(t.f("addedLines",c,p,0)));t.b("");t.b("\n" + i);t.b(" ");t.b(t.v(t.f("deletedLines",c,p,0)));t.b("");t.b("\n" + i);t.b(" ");t.b("\n" + i);t.b(" ");t.b("\n" + i);t.b("
  • ");return t.fl(); },partials: {"");t.b("\n" + i);t.b("
    ");t.b("\n" + i);t.b(" Files changed (");t.b(t.v(t.f("filesNumber",c,p,0)));t.b(")");t.b("\n" + i);t.b(" hide");t.b("\n" + i);t.b(" show");t.b("\n" + i);t.b("
    ");t.b("\n" + i);t.b("
      ");t.b("\n" + i);t.b(" ");t.b(t.t(t.f("files",c,p,0)));t.b("\n" + i);t.b("
    ");t.b("\n" + i);t.b("");return t.fl(); },partials: {}, subs: { }}); -global.browserTemplates["generic-column-line-number"] = new Hogan.Template({code: function (c,p,i) { var t=this;t.b(i=i||"");t.b("");t.b("\n" + i);t.b(" ");t.b("\n" + i);t.b(" ");t.b("\n" + i);t.b("
    ");t.b(t.t(t.f("blockHeader",c,p,0)));t.b("
    ");t.b("\n" + i);t.b(" ");t.b("\n" + i);t.b("");return t.fl(); },partials: {}, subs: { }}); -global.browserTemplates["generic-empty-diff"] = new Hogan.Template({code: function (c,p,i) { var t=this;t.b(i=i||"");t.b("");t.b("\n" + i);t.b(" ");t.b("\n" + i);t.b("
    ");t.b("\n" + i);t.b(" File without changes");t.b("\n" + i);t.b("
    ");t.b("\n" + i);t.b(" ");t.b("\n" + i);t.b("");return t.fl(); },partials: {}, subs: { }}); -global.browserTemplates["generic-file-path"] = new Hogan.Template({code: function (c,p,i) { var t=this;t.b(i=i||"");t.b("");t.b("\n" + i);t.b(t.rp("");t.b(t.v(t.f("fileDiffName",c,p,0)));t.b("");t.b("\n" + i);t.b(t.rp("");return t.fl(); },partials: {"");t.b("\n" + i);t.b(" ");t.b("\n" + i);t.b(" ");t.b(t.t(t.f("lineNumber",c,p,0)));t.b("\n" + i);t.b(" ");t.b("\n" + i);t.b(" ");t.b("\n" + i);t.b("
    ");t.b("\n" + i);if(t.s(t.f("prefix",c,p,1),c,p,0,171,247,"{{ }}")){t.rs(c,p,function(c,p,t){t.b(" ");t.b(t.t(t.f("prefix",c,p,0)));t.b("");t.b("\n" + i);});c.pop();}if(t.s(t.f("content",c,p,1),c,p,0,279,353,"{{ }}")){t.rs(c,p,function(c,p,t){t.b(" ");t.b(t.t(t.f("content",c,p,0)));t.b("");t.b("\n" + i);});c.pop();}t.b("
    ");t.b("\n" + i);t.b(" ");t.b("\n" + i);t.b("");return t.fl(); },partials: {}, subs: { }}); -global.browserTemplates["generic-wrapper"] = new Hogan.Template({code: function (c,p,i) { var t=this;t.b(i=i||"");t.b("
    ");t.b("\n" + i);t.b(" ");t.b(t.t(t.f("content",c,p,0)));t.b("\n" + i);t.b("
    ");return t.fl(); },partials: {}, subs: { }}); -global.browserTemplates["icon-file-added"] = new Hogan.Template({code: function (c,p,i) { var t=this;t.b(i=i||"");t.b("");t.b("\n" + i);t.b(" ");t.b("\n" + i);t.b("");return t.fl(); },partials: {}, subs: { }}); -global.browserTemplates["icon-file-changed"] = new Hogan.Template({code: function (c,p,i) { var t=this;t.b(i=i||"");t.b("");t.b("\n" + i);t.b(" ");t.b("\n" + i);t.b("");return t.fl(); },partials: {}, subs: { }}); -global.browserTemplates["icon-file-deleted"] = new Hogan.Template({code: function (c,p,i) { var t=this;t.b(i=i||"");t.b("");t.b("\n" + i);t.b(" ");t.b("\n" + i);t.b("");return t.fl(); },partials: {}, subs: { }}); -global.browserTemplates["icon-file-renamed"] = new Hogan.Template({code: function (c,p,i) { var t=this;t.b(i=i||"");t.b("");t.b("\n" + i);t.b(" ");t.b("\n" + i);t.b("");return t.fl(); },partials: {}, subs: { }}); -global.browserTemplates["icon-file"] = new Hogan.Template({code: function (c,p,i) { var t=this;t.b(i=i||"");t.b("");t.b("\n" + i);t.b(" ");t.b("\n" + i);t.b("");return t.fl(); },partials: {}, subs: { }}); -global.browserTemplates["line-by-line-file-diff"] = new Hogan.Template({code: function (c,p,i) { var t=this;t.b(i=i||"");t.b("
    ");t.b("\n" + i);t.b("
    ");t.b("\n" + i);t.b(" ");t.b(t.t(t.f("filePath",c,p,0)));t.b("\n" + i);t.b("
    ");t.b("\n" + i);t.b("
    ");t.b("\n" + i);t.b("
    ");t.b("\n" + i);t.b(" ");t.b("\n" + i);t.b(" ");t.b("\n" + i);t.b(" ");t.b(t.t(t.f("diffs",c,p,0)));t.b("\n" + i);t.b(" ");t.b("\n" + i);t.b("
    ");t.b("\n" + i);t.b("
    ");t.b("\n" + i);t.b("
    ");t.b("\n" + i);t.b("
    ");return t.fl(); },partials: {}, subs: { }}); -global.browserTemplates["line-by-line-numbers"] = new Hogan.Template({code: function (c,p,i) { var t=this;t.b(i=i||"");t.b("
    ");t.b(t.v(t.f("oldNumber",c,p,0)));t.b("
    ");t.b("\n" + i);t.b("
    ");t.b(t.v(t.f("newNumber",c,p,0)));t.b("
    ");return t.fl(); },partials: {}, subs: { }}); -global.browserTemplates["side-by-side-file-diff"] = new Hogan.Template({code: function (c,p,i) { var t=this;t.b(i=i||"");t.b("
    ");t.b("\n" + i);t.b("
    ");t.b("\n" + i);t.b(" ");t.b(t.t(t.f("filePath",c,p,0)));t.b("\n" + i);t.b("
    ");t.b("\n" + i);t.b("
    ");t.b("\n" + i);t.b("
    ");t.b("\n" + i);t.b("
    ");t.b("\n" + i);t.b(" ");t.b("\n" + i);t.b(" ");t.b("\n" + i);t.b(" ");t.b(t.t(t.d("diffs.left",c,p,0)));t.b("\n" + i);t.b(" ");t.b("\n" + i);t.b("
    ");t.b("\n" + i);t.b("
    ");t.b("\n" + i);t.b("
    ");t.b("\n" + i);t.b("
    ");t.b("\n" + i);t.b("
    ");t.b("\n" + i);t.b(" ");t.b("\n" + i);t.b(" ");t.b("\n" + i);t.b(" ");t.b(t.t(t.d("diffs.right",c,p,0)));t.b("\n" + i);t.b(" ");t.b("\n" + i);t.b("
    ");t.b("\n" + i);t.b("
    ");t.b("\n" + i);t.b("
    ");t.b("\n" + i);t.b("
    ");t.b("\n" + i);t.b("
    ");return t.fl(); },partials: {}, subs: { }}); -global.browserTemplates["tag-file-added"] = new Hogan.Template({code: function (c,p,i) { var t=this;t.b(i=i||"");t.b("ADDED");return t.fl(); },partials: {}, subs: { }}); -global.browserTemplates["tag-file-changed"] = new Hogan.Template({code: function (c,p,i) { var t=this;t.b(i=i||"");t.b("CHANGED");return t.fl(); },partials: {}, subs: { }}); -global.browserTemplates["tag-file-deleted"] = new Hogan.Template({code: function (c,p,i) { var t=this;t.b(i=i||"");t.b("DELETED");return t.fl(); },partials: {}, subs: { }}); -global.browserTemplates["tag-file-renamed"] = new Hogan.Template({code: function (c,p,i) { var t=this;t.b(i=i||"");t.b("RENAMED");return t.fl(); },partials: {}, subs: { }}); -module.exports = global.browserTemplates; -})(); diff --git a/src/ui/js/diff2html-ui.js b/src/ui/js/diff2html-ui.js index 979939b..f7c1138 100644 --- a/src/ui/js/diff2html-ui.js +++ b/src/ui/js/diff2html-ui.js @@ -8,17 +8,17 @@ * */ -/*global $, hljs, Diff2Html*/ +/* global $, hljs, Diff2Html */ (function() { - var highlightJS = require('./highlight.js-internals.js').HighlightJS; + const highlightJS = require("./highlight.js-internals.js").HighlightJS; - var diffJson = null; - var defaultTarget = 'body'; - var currentSelectionColumnId = -1; + let diffJson = null; + const defaultTarget = "body"; + let currentSelectionColumnId = -1; function Diff2HtmlUI(config) { - var cfg = config || {}; + const cfg = config || {}; if (cfg.diff) { diffJson = Diff2Html.getJsonFromDiff(cfg.diff); @@ -30,9 +30,9 @@ } Diff2HtmlUI.prototype.draw = function(targetId, config) { - var cfg = config || {}; - cfg.inputFormat = 'json'; - var $target = this._getTarget(targetId); + const cfg = config || {}; + cfg.inputFormat = "json"; + const $target = this._getTarget(targetId); $target.html(Diff2Html.getPrettyHtml(diffJson, cfg)); if (cfg.synchronisedScroll) { @@ -41,25 +41,27 @@ }; Diff2HtmlUI.prototype.synchronisedScroll = function(targetId) { - var $target = this._getTarget(targetId); - $target.find('.d2h-file-side-diff').scroll(function() { - var $this = $(this); - $this.closest('.d2h-file-wrapper').find('.d2h-file-side-diff') + const $target = this._getTarget(targetId); + $target.find(".d2h-file-side-diff").scroll(function() { + const $this = $(this); + $this + .closest(".d2h-file-wrapper") + .find(".d2h-file-side-diff") .scrollLeft($this.scrollLeft()); }); }; Diff2HtmlUI.prototype.fileListCloseable = function(targetId, startVisible) { - var $target = this._getTarget(targetId); + const $target = this._getTarget(targetId); - var hashTag = this._getHashTag(); + const hashTag = this._getHashTag(); - var $showBtn = $target.find('.d2h-show'); - var $hideBtn = $target.find('.d2h-hide'); - var $fileList = $target.find('.d2h-file-list'); + const $showBtn = $target.find(".d2h-show"); + const $hideBtn = $target.find(".d2h-hide"); + const $fileList = $target.find(".d2h-file-list"); - if (hashTag === 'files-summary-show') show(); - else if (hashTag === 'files-summary-hide') hide(); + if (hashTag === "files-summary-show") show(); + else if (hashTag === "files-summary-hide") hide(); else if (startVisible) show(); else hide(); @@ -80,51 +82,53 @@ }; Diff2HtmlUI.prototype.highlightCode = function(targetId) { - var that = this; + const that = this; - var $target = that._getTarget(targetId); + const $target = that._getTarget(targetId); // collect all the diff files and execute the highlight on their lines - var $files = $target.find('.d2h-file-wrapper'); + const $files = $target.find(".d2h-file-wrapper"); $files.map(function(_i, file) { - var oldLinesState; - var newLinesState; - var $file = $(file); - var language = $file.data('lang'); + let oldLinesState; + let newLinesState; + const $file = $(file); + const language = $file.data("lang"); // collect all the code lines and execute the highlight on them - var $codeLines = $file.find('.d2h-code-line-ctn'); + const $codeLines = $file.find(".d2h-code-line-ctn"); $codeLines.map(function(_j, line) { - var $line = $(line); - var text = line.textContent; - var lineParent = line.parentNode; + const $line = $(line); + const text = line.textContent; + const lineParent = line.parentNode; - var lineState; - if (lineParent.className.indexOf('d2h-del') !== -1) { + let lineState; + if (lineParent.className.indexOf("d2h-del") !== -1) { lineState = oldLinesState; } else { lineState = newLinesState; } - var result = hljs.getLanguage(language) ? hljs.highlight(language, text, true, lineState) : hljs.highlightAuto(text); + const result = hljs.getLanguage(language) + ? hljs.highlight(language, text, true, lineState) + : hljs.highlightAuto(text); - if (lineParent.className.indexOf('d2h-del') !== -1) { + if (lineParent.className.indexOf("d2h-del") !== -1) { oldLinesState = result.top; - } else if (lineParent.className.indexOf('d2h-ins') !== -1) { + } else if (lineParent.className.indexOf("d2h-ins") !== -1) { newLinesState = result.top; } else { oldLinesState = result.top; newLinesState = result.top; } - var originalStream = highlightJS.nodeStream(line); + const originalStream = highlightJS.nodeStream(line); if (originalStream.length) { - var resultNode = document.createElementNS('http://www.w3.org/1999/xhtml', 'div'); + const resultNode = document.createElementNS("http://www.w3.org/1999/xhtml", "div"); resultNode.innerHTML = result.value; result.value = highlightJS.mergeStreams(originalStream, highlightJS.nodeStream(resultNode), text); } - $line.addClass('hljs'); + $line.addClass("hljs"); $line.addClass(result.language); $line.html(result.value); }); @@ -132,15 +136,15 @@ }; Diff2HtmlUI.prototype._getTarget = function(targetId) { - var $target; + let $target; - if (typeof targetId === 'object' && targetId instanceof jQuery) { + if (typeof targetId === "object" && targetId instanceof jQuery) { $target = targetId; - } else if (typeof targetId === 'string') { + } else if (typeof targetId === "string") { $target = $(targetId); } else { console.error("Wrong target provided! Falling back to default value 'body'."); - console.log('Please provide a jQuery object or a valid DOM query string.'); + console.log("Please provide a jQuery object or a valid DOM query string."); $target = $(defaultTarget); } @@ -148,10 +152,10 @@ }; Diff2HtmlUI.prototype._getHashTag = function() { - var docUrl = document.URL; - var hashTagIndex = docUrl.indexOf('#'); + const docUrl = document.URL; + const hashTagIndex = docUrl.indexOf("#"); - var hashTag = null; + let hashTag = null; if (hashTagIndex !== -1) { hashTag = docUrl.substr(hashTagIndex + 1); } @@ -166,46 +170,46 @@ }; Diff2HtmlUI.prototype._initSelection = function() { - var body = $('body'); - var that = this; + const body = $("body"); + const that = this; - body.on('mousedown', '.d2h-diff-table', function(event) { - var target = $(event.target); - var table = target.closest('.d2h-diff-table'); + body.on("mousedown", ".d2h-diff-table", function(event) { + const target = $(event.target); + const table = target.closest(".d2h-diff-table"); - if (target.closest('.d2h-code-line,.d2h-code-side-line').length) { - table.removeClass('selecting-left'); - table.addClass('selecting-right'); + if (target.closest(".d2h-code-line,.d2h-code-side-line").length) { + table.removeClass("selecting-left"); + table.addClass("selecting-right"); currentSelectionColumnId = 1; - } else if (target.closest('.d2h-code-linenumber,.d2h-code-side-linenumber').length) { - table.removeClass('selecting-right'); - table.addClass('selecting-left'); + } else if (target.closest(".d2h-code-linenumber,.d2h-code-side-linenumber").length) { + table.removeClass("selecting-right"); + table.addClass("selecting-left"); currentSelectionColumnId = 0; } }); - body.on('copy', '.d2h-diff-table', function(event) { - var clipboardData = event.originalEvent.clipboardData; - var text = that._getSelectedText(); - clipboardData.setData('text', text); + body.on("copy", ".d2h-diff-table", function(event) { + const clipboardData = event.originalEvent.clipboardData; + const text = that._getSelectedText(); + clipboardData.setData("text", text); event.preventDefault(); }); }; Diff2HtmlUI.prototype._getSelectedText = function() { - var sel = window.getSelection(); - var range = sel.getRangeAt(0); - var doc = range.cloneContents(); - var nodes = doc.querySelectorAll('tr'); - var text = ''; - var idx = currentSelectionColumnId; + const sel = window.getSelection(); + const range = sel.getRangeAt(0); + const doc = range.cloneContents(); + const nodes = doc.querySelectorAll("tr"); + let text = ""; + const idx = currentSelectionColumnId; if (nodes.length === 0) { text = doc.textContent; } else { [].forEach.call(nodes, function(tr, i) { - var td = tr.cells[tr.cells.length === 1 ? 0 : idx]; - text += (i ? '\n' : '') + td.textContent.replace(/(?:\r\n|\r|\n)/g, ''); + const td = tr.cells[tr.cells.length === 1 ? 0 : idx]; + text += (i ? "\n" : "") + td.textContent.replace(/(?:\r\n|\r|\n)/g, ""); }); } diff --git a/src/ui/js/highlight.js-internals.js b/src/ui/js/highlight.js-internals.js index 52a1ccd..3bf89f0 100644 --- a/src/ui/js/highlight.js-internals.js +++ b/src/ui/js/highlight.js-internals.js @@ -6,8 +6,7 @@ */ (function() { - function HighlightJS() { - } + function HighlightJS() {} /* * Copied from Highlight.js Private API @@ -16,12 +15,15 @@ /* Utility vars */ - var ArrayProto = []; + const ArrayProto = []; /* Utility functions */ function escape(value) { - return value.replace(/&/gm, '&').replace(//gm, '>'); + return value + .replace(/&/gm, "&") + .replace(//gm, ">"); } function tag(node) { @@ -31,14 +33,14 @@ /* Stream merging */ HighlightJS.prototype.nodeStream = function(node) { - var result = []; + const result = []; (function _nodeStream(node, offset) { - for (var child = node.firstChild; child; child = child.nextSibling) { + for (let child = node.firstChild; child; child = child.nextSibling) { if (child.nodeType === 3) { offset += child.nodeValue.length; } else if (child.nodeType === 1) { result.push({ - event: 'start', + event: "start", offset: offset, node: child }); @@ -48,7 +50,7 @@ // but we list only those realistically expected in code display. if (!tag(child).match(/br|hr|img|input/)) { result.push({ - event: 'stop', + event: "stop", offset: offset, node: child }); @@ -61,16 +63,16 @@ }; HighlightJS.prototype.mergeStreams = function(original, highlighted, value) { - var processed = 0; - var result = ''; - var nodeStack = []; + let processed = 0; + let result = ""; + const nodeStack = []; function selectStream() { if (!original.length || !highlighted.length) { return original.length ? original : highlighted; } if (original[0].offset !== highlighted[0].offset) { - return (original[0].offset < highlighted[0].offset) ? original : highlighted; + return original[0].offset < highlighted[0].offset ? original : highlighted; } /* @@ -86,27 +88,27 @@ return highlighted; ... which is collapsed to: */ - return highlighted[0].event === 'start' ? original : highlighted; + return highlighted[0].event === "start" ? original : highlighted; } function open(node) { function attr_str(a) { - return ' ' + a.nodeName + '="' + escape(a.value) + '"'; + return " " + a.nodeName + '="' + escape(a.value) + '"'; } - result += '<' + tag(node) + ArrayProto.map.call(node.attributes, attr_str).join('') + '>'; + result += "<" + tag(node) + ArrayProto.map.call(node.attributes, attr_str).join("") + ">"; } function close(node) { - result += ''; + result += ""; } function render(event) { - (event.event === 'start' ? open : close)(event.node); + (event.event === "start" ? open : close)(event.node); } while (original.length || highlighted.length) { - var stream = selectStream(); + let stream = selectStream(); result += escape(value.substring(processed, stream[0].offset)); processed = stream[0].offset; if (stream === original) { @@ -123,7 +125,7 @@ } while (stream === original && stream.length && stream[0].offset === processed); nodeStack.reverse().forEach(open); } else { - if (stream[0].event === 'start') { + if (stream[0].event === "start") { nodeStack.push(stream[0].node); } else { nodeStack.pop(); diff --git a/src/utils.js b/src/utils.js index 395d267..4b62912 100644 --- a/src/utils.js +++ b/src/utils.js @@ -6,24 +6,24 @@ */ (function() { - var merge = require('merge'); + const merge = require("merge"); - function Utils() { - } + function Utils() {} Utils.prototype.escape = function(str) { - return str.slice(0) - .replace(/&/g, '&') - .replace(//g, '>') - .replace(/"/g, '"') - .replace(/'/g, ''') - .replace(/\//g, '/'); + return str + .slice(0) + .replace(/&/g, "&") + .replace(//g, ">") + .replace(/"/g, """) + .replace(/'/g, "'") + .replace(/\//g, "/"); }; Utils.prototype.startsWith = function(str, start) { - if (typeof start === 'object') { - var result = false; + if (typeof start === "object") { + let result = false; start.forEach(function(s) { if (str.indexOf(s) === 0) { result = true; @@ -37,7 +37,7 @@ }; Utils.prototype.valueOrEmpty = function(value) { - return value || ''; + return value || ""; }; Utils.prototype.safeConfig = function(cfg, defaultConfig) { diff --git a/test/diff-parser-tests.js b/test/diff-parser-tests.js deleted file mode 100644 index 2574c19..0000000 --- a/test/diff-parser-tests.js +++ /dev/null @@ -1,743 +0,0 @@ -var assert = require('assert'); - -var DiffParser = require('../src/diff-parser.js').DiffParser; - -describe('DiffParser', function() { - describe('generateDiffJson', function() { - it('should parse unix with \n diff', function() { - var diff = - 'diff --git a/sample b/sample\n' + - 'index 0000001..0ddf2ba\n' + - '--- a/sample\n' + - '+++ b/sample\n' + - '@@ -1 +1 @@\n' + - '-test\n' + - '+test1r\n'; - checkDiffSample(diff); - }); - - it('should parse windows with \r\n diff', function() { - var diff = - 'diff --git a/sample b/sample\r\n' + - 'index 0000001..0ddf2ba\r\n' + - '--- a/sample\r\n' + - '+++ b/sample\r\n' + - '@@ -1 +1 @@\r\n' + - '-test\r\n' + - '+test1r\r\n'; - checkDiffSample(diff); - }); - - it('should parse old os x with \r diff', function() { - var diff = - 'diff --git a/sample b/sample\r' + - 'index 0000001..0ddf2ba\r' + - '--- a/sample\r' + - '+++ b/sample\r' + - '@@ -1 +1 @@\r' + - '-test\r' + - '+test1r\r'; - checkDiffSample(diff); - }); - - it('should parse mixed eols diff', function() { - var diff = - 'diff --git a/sample b/sample\n' + - 'index 0000001..0ddf2ba\r\n' + - '--- a/sample\r' + - '+++ b/sample\r\n' + - '@@ -1 +1 @@\n' + - '-test\r' + - '+test1r\n'; - checkDiffSample(diff); - }); - - function checkDiffSample(diff) { - var result = DiffParser.generateDiffJson(diff); - var file1 = result[0]; - assert.equal(1, result.length); - assert.equal(1, file1.addedLines); - assert.equal(1, file1.deletedLines); - assert.equal('sample', file1.oldName); - assert.equal('sample', file1.newName); - assert.equal(1, file1.blocks.length); - } - - it('should parse diff with special characters', function() { - var diff = - 'diff --git "a/bla with \ttab.scala" "b/bla with \ttab.scala"\n' + - 'index 4c679d7..e9bd385 100644\n' + - '--- "a/bla with \ttab.scala"\n' + - '+++ "b/bla with \ttab.scala"\n' + - '@@ -1 +1,2 @@\n' + - '-cenas\n' + - '+cenas com ananas\n' + - '+bananas'; - - var result = DiffParser.generateDiffJson(diff); - var file1 = result[0]; - assert.equal(1, result.length); - assert.equal(2, file1.addedLines); - assert.equal(1, file1.deletedLines); - assert.equal('bla with \ttab.scala', file1.oldName); - assert.equal('bla with \ttab.scala', file1.newName); - assert.equal(1, file1.blocks.length); - }); - - it('should parse diff with prefix', function() { - var diff = - 'diff --git "\tbla with \ttab.scala" "\tbla with \ttab.scala"\n' + - 'index 4c679d7..e9bd385 100644\n' + - '--- "\tbla with \ttab.scala"\n' + - '+++ "\tbla with \ttab.scala"\n' + - '@@ -1 +1,2 @@\n' + - '-cenas\n' + - '+cenas com ananas\n' + - '+bananas'; - - var result = DiffParser.generateDiffJson(diff, {'srcPrefix': '\t', 'dstPrefix': '\t'}); - var file1 = result[0]; - assert.equal(1, result.length); - assert.equal(2, file1.addedLines); - assert.equal(1, file1.deletedLines); - assert.equal('bla with \ttab.scala', file1.oldName); - assert.equal('bla with \ttab.scala', file1.newName); - assert.equal(1, file1.blocks.length); - }); - - it('should parse diff with deleted file', function() { - var diff = - 'diff --git a/src/var/strundefined.js b/src/var/strundefined.js\n' + - 'deleted file mode 100644\n' + - 'index 04e16b0..0000000\n' + - '--- a/src/var/strundefined.js\n' + - '+++ /dev/null\n' + - '@@ -1,3 +0,0 @@\n' + - '-define(function() {\n' + - '- return typeof undefined;\n' + - '-});\n'; - - var result = DiffParser.generateDiffJson(diff); - assert.equal(1, result.length); - - var file1 = result[0]; - assert.equal(false, file1.isCombined); - assert.equal(0, file1.addedLines); - assert.equal(3, file1.deletedLines); - assert.equal('src/var/strundefined.js', file1.oldName); - assert.equal('/dev/null', file1.newName); - assert.equal(1, file1.blocks.length); - assert.equal(true, file1.isDeleted); - assert.equal('04e16b0', file1.checksumBefore); - assert.equal('0000000', file1.checksumAfter); - }); - - it('should parse diff with new file', function() { - var diff = - 'diff --git a/test.js b/test.js\n' + - 'new file mode 100644\n' + - 'index 0000000..e1e22ec\n' + - '--- /dev/null\n' + - '+++ b/test.js\n' + - '@@ -0,0 +1,5 @@\n' + - "+var parser = require('./source/git-parser');\n" + - '+\n' + - '+var patchLineList = [ false, false, false, false ];\n' + - '+\n' + - '+console.log(parser.parsePatchDiffResult(text, patchLineList));\n'; - - var result = DiffParser.generateDiffJson(diff); - assert.equal(1, result.length); - - var file1 = result[0]; - assert.equal(false, file1.isCombined); - assert.equal(5, file1.addedLines); - assert.equal(0, file1.deletedLines); - assert.equal('/dev/null', file1.oldName); - assert.equal('test.js', file1.newName); - assert.equal(1, file1.blocks.length); - assert.equal(true, file1.isNew); - assert.equal(100644, file1.newFileMode); - assert.equal('0000000', file1.checksumBefore); - assert.equal('e1e22ec', file1.checksumAfter); - }); - - it('should parse diff with nested diff', function() { - var diff = - 'diff --git a/src/offset.js b/src/offset.js\n' + - 'index cc6ffb4..fa51f18 100644\n' + - '--- a/src/offset.js\n' + - '+++ b/src/offset.js\n' + - '@@ -1,6 +1,5 @@\n' + - "+var parser = require('./source/git-parser');\n" + - '+\n' + - "+var text = 'diff --git a/components/app/app.html b/components/app/app.html\\nindex ecb7a95..027bd9b 100644\\n--- a/components/app/app.html\\n+++ b/components/app/app.html\\n@@ -52,0 +53,3 @@\\n+\\n+\\n+\\n@@ -56,0 +60,3 @@\\n+\\n+\\n+\\n'\n" + - '+var patchLineList = [ false, false, false, false ];\n' + - '+\n' + - '+console.log(parser.parsePatchDiffResult(text, patchLineList));\n'; - - var result = DiffParser.generateDiffJson(diff); - assert.equal(1, result.length); - - var file1 = result[0]; - assert.equal(false, file1.isCombined); - assert.equal(6, file1.addedLines); - assert.equal(0, file1.deletedLines); - assert.equal('src/offset.js', file1.oldName); - assert.equal('src/offset.js', file1.newName); - assert.equal(1, file1.blocks.length); - assert.equal(6, file1.blocks[0].lines.length); - assert.equal('cc6ffb4', file1.checksumBefore); - assert.equal('fa51f18', file1.checksumAfter); - }); - - it('should parse diff with multiple blocks', function() { - var diff = - 'diff --git a/src/attributes/classes.js b/src/attributes/classes.js\n' + - 'index c617824..c8d1393 100644\n' + - '--- a/src/attributes/classes.js\n' + - '+++ b/src/attributes/classes.js\n' + - '@@ -1,10 +1,9 @@\n' + - ' define([\n' + - ' "../core",\n' + - ' "../var/rnotwhite",\n' + - '- "../var/strundefined",\n' + - ' "../data/var/dataPriv",\n' + - ' "../core/init"\n' + - '-], function( jQuery, rnotwhite, strundefined, dataPriv ) {\n' + - '+], function( jQuery, rnotwhite, dataPriv ) {\n' + - ' \n' + - ' var rclass = /[\\t\\r\\n\\f]/g;\n' + - ' \n' + - '@@ -128,7 +127,7 @@ jQuery.fn.extend({\n' + - ' }\n' + - ' \n' + - ' // Toggle whole class name\n' + - '- } else if ( type === strundefined || type === "boolean" ) {\n' + - '+ } else if ( value === undefined || type === "boolean" ) {\n' + - ' if ( this.className ) {\n' + - ' // store className if set\n' + - ' dataPriv.set( this, "__className__", this.className );\n'; - - var result = DiffParser.generateDiffJson(diff); - assert.equal(1, result.length); - - var file1 = result[0]; - assert.equal(false, file1.isCombined); - assert.equal(2, file1.addedLines); - assert.equal(3, file1.deletedLines); - assert.equal('src/attributes/classes.js', file1.oldName); - assert.equal('src/attributes/classes.js', file1.newName); - assert.equal(2, file1.blocks.length); - assert.equal(11, file1.blocks[0].lines.length); - assert.equal(8, file1.blocks[1].lines.length); - assert.equal('c617824', file1.checksumBefore); - assert.equal('c8d1393', file1.checksumAfter); - }); - - it('should parse diff with multiple files', function() { - var diff = - 'diff --git a/src/core/init.js b/src/core/init.js\n' + - 'index e49196a..50f310c 100644\n' + - '--- a/src/core/init.js\n' + - '+++ b/src/core/init.js\n' + - '@@ -101,7 +101,7 @@ var rootjQuery,\n' + - ' // HANDLE: $(function)\n' + - ' // Shortcut for document ready\n' + - ' } else if ( jQuery.isFunction( selector ) ) {\n' + - '- return typeof rootjQuery.ready !== "undefined" ?\n' + - '+ return rootjQuery.ready !== undefined ?\n' + - ' rootjQuery.ready( selector ) :\n' + - ' // Execute immediately if ready is not present\n' + - ' selector( jQuery );\n' + - 'diff --git a/src/event.js b/src/event.js\n' + - 'index 7336f4d..6183f70 100644\n' + - '--- a/src/event.js\n' + - '+++ b/src/event.js\n' + - '@@ -1,6 +1,5 @@\n' + - ' define([\n' + - ' "./core",\n' + - '- "./var/strundefined",\n' + - ' "./var/rnotwhite",\n' + - ' "./var/hasOwn",\n' + - ' "./var/slice",\n'; - - var result = DiffParser.generateDiffJson(diff); - assert.equal(2, result.length); - - var file1 = result[0]; - assert.equal(false, file1.isCombined); - assert.equal(1, file1.addedLines); - assert.equal(1, file1.deletedLines); - assert.equal('src/core/init.js', file1.oldName); - assert.equal('src/core/init.js', file1.newName); - assert.equal(1, file1.blocks.length); - assert.equal(8, file1.blocks[0].lines.length); - assert.equal('e49196a', file1.checksumBefore); - assert.equal('50f310c', file1.checksumAfter); - - var file2 = result[1]; - assert.equal(false, file2.isCombined); - assert.equal(0, file2.addedLines); - assert.equal(1, file2.deletedLines); - assert.equal('src/event.js', file2.oldName); - assert.equal('src/event.js', file2.newName); - assert.equal(1, file2.blocks.length); - assert.equal(6, file2.blocks[0].lines.length); - assert.equal('7336f4d', file2.checksumBefore); - assert.equal('6183f70', file2.checksumAfter); - }); - - it('should parse combined diff', function() { - var diff = - 'diff --combined describe.c\n' + - 'index fabadb8,cc95eb0..4866510\n' + - '--- a/describe.c\n' + - '+++ b/describe.c\n' + - '@@@ -98,20 -98,12 +98,20 @@@\n' + - ' return (a_date > b_date) ? -1 : (a_date == b_date) ? 0 : 1;\n' + - ' }\n' + - ' \n' + - '- static void describe(char *arg)\n' + - ' -static void describe(struct commit *cmit, int last_one)\n' + - '++static void describe(char *arg, int last_one)\n' + - ' {\n' + - ' + unsigned char sha1[20];\n' + - ' + struct commit *cmit;\n' + - ' struct commit_list *list;\n' + - ' static int initialized = 0;\n' + - ' struct commit_name *n;\n' + - ' \n' + - ' + if (get_sha1(arg, sha1) < 0)\n' + - ' + usage(describe_usage);\n' + - ' + cmit = lookup_commit_reference(sha1);\n' + - ' + if (!cmit)\n' + - ' + usage(describe_usage);\n' + - ' +\n' + - ' if (!initialized) {\n' + - ' initialized = 1;\n' + - ' for_each_ref(get_name);\n'; - - var result = DiffParser.generateDiffJson(diff); - assert.equal(1, result.length); - - var file1 = result[0]; - assert.equal(true, file1.isCombined); - assert.equal(9, file1.addedLines); - assert.equal(2, file1.deletedLines); - assert.equal('describe.c', file1.oldName); - assert.equal('describe.c', file1.newName); - assert.equal(1, file1.blocks.length); - assert.equal(22, file1.blocks[0].lines.length); - assert.deepEqual(['4866510', 'cc95eb0'].sort(), file1.checksumBefore.sort()); - assert.equal('fabadb8', file1.checksumAfter); - }); - - it('should parse diffs with copied files', function() { - var diff = - 'diff --git a/index.js b/more-index.js\n' + - 'dissimilarity index 5%\n' + - 'copy from index.js\n' + - 'copy to more-index.js\n'; - - var result = DiffParser.generateDiffJson(diff); - assert.equal(1, result.length); - - var file1 = result[0]; - assert.equal(0, file1.addedLines); - assert.equal(0, file1.deletedLines); - assert.equal('index.js', file1.oldName); - assert.equal('more-index.js', file1.newName); - assert.equal(0, file1.blocks.length); - assert.equal(true, file1.isCopy); - assert.equal(5, file1.changedPercentage); - }); - - it('should parse diffs with moved files', function() { - var diff = - 'diff --git a/more-index.js b/other-index.js\n' + - 'similarity index 86%\n' + - 'rename from more-index.js\n' + - 'rename to other-index.js\n'; - - var result = DiffParser.generateDiffJson(diff); - assert.equal(1, result.length); - - var file1 = result[0]; - assert.equal(0, file1.addedLines); - assert.equal(0, file1.deletedLines); - assert.equal('more-index.js', file1.oldName); - assert.equal('other-index.js', file1.newName); - assert.equal(0, file1.blocks.length); - assert.equal(true, file1.isRename); - assert.equal(86, file1.unchangedPercentage); - }); - - it('should parse diffs correct line numbers', function() { - var diff = - 'diff --git a/sample b/sample\n' + - 'index 0000001..0ddf2ba\n' + - '--- a/sample\n' + - '+++ b/sample\n' + - '@@ -1 +1,2 @@\n' + - '-test\n' + - '+test1r\n'; - - var result = DiffParser.generateDiffJson(diff); - assert.equal(1, result.length); - - var file1 = result[0]; - assert.equal(1, file1.addedLines); - assert.equal(1, file1.deletedLines); - assert.equal('sample', file1.oldName); - assert.equal('sample', file1.newName); - assert.equal(1, file1.blocks.length); - assert.equal(2, file1.blocks[0].lines.length); - assert.equal(1, file1.blocks[0].lines[0].oldNumber); - assert.equal(null, file1.blocks[0].lines[0].newNumber); - assert.equal(null, file1.blocks[0].lines[1].oldNumber); - assert.equal(1, file1.blocks[0].lines[1].newNumber); - }); - - it('should parse unified non git diff and strip timestamps off the headers', function() { - var diffs = [ - // 2 hours ahead of GMT - '--- a/sample.js 2016-10-25 11:37:14.000000000 +0200\n' + - '+++ b/sample.js 2016-10-25 11:37:14.000000000 +0200\n' + - '@@ -1 +1,2 @@\n' + - '-test\n' + - '+test1r\n' + - '+test2r\n', - // 2 hours behind GMT - '--- a/sample.js 2016-10-25 11:37:14.000000000 -0200\n' + - '+++ b/sample.js 2016-10-25 11:37:14.000000000 -0200\n' + - '@@ -1 +1,2 @@\n' + - '-test\n' + - '+test1r\n' + - '+test2r\n' - ]; - - diffs.forEach(function(diff) { - var result = DiffParser.generateDiffJson(diff); - var file1 = result[0]; - assert.equal(1, result.length); - assert.equal(2, file1.addedLines); - assert.equal(1, file1.deletedLines); - assert.equal('sample.js', file1.oldName); - assert.equal('sample.js', file1.newName); - assert.equal(1, file1.blocks.length); - - var linesContent = file1.blocks[0].lines.map(function(line) { - return line.content; - }); - assert.deepEqual(linesContent, ['-test', '+test1r', '+test2r']); - }); - }); - - it('should parse unified non git diff', function() { - var diff = - '--- a/sample.js\n' + - '+++ b/sample.js\n' + - '@@ -1 +1,2 @@\n' + - '-test\n' + - '+test1r\n' + - '+test2r\n'; - - var result = DiffParser.generateDiffJson(diff); - var file1 = result[0]; - assert.equal(1, result.length); - assert.equal(2, file1.addedLines); - assert.equal(1, file1.deletedLines); - assert.equal('sample.js', file1.oldName); - assert.equal('sample.js', file1.newName); - assert.equal(1, file1.blocks.length); - - var linesContent = file1.blocks[0].lines.map(function(line) { - return line.content; - }); - assert.deepEqual(linesContent, ['-test', '+test1r', '+test2r']); - }); - - it('should parse unified diff with multiple hunks and files', function() { - var diff = - '--- sample.js\n' + - '+++ sample.js\n' + - '@@ -1 +1,2 @@\n' + - '-test\n' + - '@@ -10 +20,2 @@\n' + - '+test\n' + - '--- sample1.js\n' + - '+++ sample1.js\n' + - '@@ -1 +1,2 @@\n' + - '+test1'; - - var result = DiffParser.generateDiffJson(diff); - assert.equal(2, result.length); - - var file1 = result[0]; - assert.equal(1, file1.addedLines); - assert.equal(1, file1.deletedLines); - assert.equal('sample.js', file1.oldName); - assert.equal('sample.js', file1.newName); - assert.equal(2, file1.blocks.length); - - var linesContent1 = file1.blocks[0].lines.map(function(line) { - return line.content; - }); - assert.deepEqual(linesContent1, ['-test']); - - var linesContent2 = file1.blocks[1].lines.map(function(line) { - return line.content; - }); - assert.deepEqual(linesContent2, ['+test']); - - var file2 = result[1]; - assert.equal(1, file2.addedLines); - assert.equal(0, file2.deletedLines); - assert.equal('sample1.js', file2.oldName); - assert.equal('sample1.js', file2.newName); - assert.equal(1, file2.blocks.length); - - var linesContent = file2.blocks[0].lines.map(function(line) { - return line.content; - }); - assert.deepEqual(linesContent, ['+test1']); - }); - - it('should parse diff with --- and +++ in the context lines', function() { - var diff = - '--- sample.js\n' + - '+++ sample.js\n' + - '@@ -1,8 +1,8 @@\n' + - ' test\n' + - ' \n' + - '-- 1\n' + - '--- 1\n' + - '---- 1\n' + - ' \n' + - '++ 2\n' + - '+++ 2\n' + - '++++ 2'; - - var result = DiffParser.generateDiffJson(diff); - var file1 = result[0]; - assert.equal(1, result.length); - assert.equal(3, file1.addedLines); - assert.equal(3, file1.deletedLines); - assert.equal('sample.js', file1.oldName); - assert.equal('sample.js', file1.newName); - assert.equal(1, file1.blocks.length); - - var linesContent = file1.blocks[0].lines.map(function(line) { - return line.content; - }); - assert.deepEqual(linesContent, - [' test', ' ', '-- 1', '--- 1', '---- 1', ' ', '++ 2', '+++ 2', '++++ 2']); - }); - - it('should parse diff without proper hunk headers', function() { - var diff = - '--- sample.js\n' + - '+++ sample.js\n' + - '@@ @@\n' + - ' test'; - - var result = DiffParser.generateDiffJson(diff); - var file1 = result[0]; - assert.equal(1, result.length); - assert.equal(0, file1.addedLines); - assert.equal(0, file1.deletedLines); - assert.equal('sample.js', file1.oldName); - assert.equal('sample.js', file1.newName); - assert.equal(1, file1.blocks.length); - - var linesContent = file1.blocks[0].lines.map(function(line) { - return line.content; - }); - assert.deepEqual(linesContent, [' test']); - }); - - it('should parse binary file diff', function() { - var diff = - 'diff --git a/last-changes-config.png b/last-changes-config.png\n' + - 'index 322248b..56fc1f2 100644\n' + - '--- a/last-changes-config.png\n' + - '+++ b/last-changes-config.png\n' + - 'Binary files differ'; - - var result = DiffParser.generateDiffJson(diff); - var file1 = result[0]; - assert.equal(1, result.length); - assert.equal(0, file1.addedLines); - assert.equal(0, file1.deletedLines); - assert.equal('last-changes-config.png', file1.oldName); - assert.equal('last-changes-config.png', file1.newName); - assert.equal(1, file1.blocks.length); - assert.equal(0, file1.blocks[0].lines.length); - assert.equal('Binary files differ', file1.blocks[0].header); - }); - - it('should parse diff with --find-renames', function() { - var diff = - 'diff --git a/src/test-bar.js b/src/test-baz.js\n' + - 'similarity index 98%\n' + - 'rename from src/test-bar.js\n' + - 'rename to src/test-baz.js\n' + - 'index e01513b..f14a870 100644\n' + - '--- a/src/test-bar.js\n' + - '+++ b/src/test-baz.js\n' + - '@@ -1,4 +1,32 @@\n' + - ' function foo() {\n' + - '-var bar = "Whoops!";\n' + - '+var baz = "Whoops!";\n' + - ' }\n' + - ' '; - - var result = DiffParser.generateDiffJson(diff); - var file1 = result[0]; - assert.equal(1, result.length); - assert.equal(1, file1.addedLines); - assert.equal(1, file1.deletedLines); - assert.equal('src/test-bar.js', file1.oldName); - assert.equal('src/test-baz.js', file1.newName); - assert.equal(1, file1.blocks.length); - assert.equal(5, file1.blocks[0].lines.length); - var linesContent = file1.blocks[0].lines.map(function(line) { - return line.content; - }); - assert.deepEqual(linesContent, - [' function foo() {', '-var bar = "Whoops!";', '+var baz = "Whoops!";', ' }', ' ']); - }); - - it('should parse diff with prefix', function() { - var diff = - 'diff --git "\tTest.scala" "\tScalaTest.scala"\n' + - 'similarity index 88%\n' + - 'rename from Test.scala\n' + - 'rename to ScalaTest.scala\n' + - 'index 7d1f9bf..8b13271 100644\n' + - '--- "\tTest.scala"\n' + - '+++ "\tScalaTest.scala"\n' + - '@@ -1,6 +1,8 @@\n' + - ' class Test {\n' + - ' \n' + - ' def method1 = ???\n' + - '+\n' + - '+ def method2 = ???\n' + - ' \n' + - ' def myMethod = ???\n' + - ' \n' + - '@@ -10,7 +12,6 @@ class Test {\n' + - ' \n' + - ' def + = ???\n' + - ' \n' + - '- def |> = ???\n' + - ' \n' + - ' }\n' + - ' \n' + - 'diff --git "\ttardis.png" "\ttardis.png"\n' + - 'new file mode 100644\n' + - 'index 0000000..d503a29\n' + - 'Binary files /dev/null and "\ttardis.png" differ\n' + - 'diff --git a/src/test-bar.js b/src/test-baz.js\n' + - 'similarity index 98%\n' + - 'rename from src/test-bar.js\n' + - 'rename to src/test-baz.js\n' + - 'index e01513b..f14a870 100644\n' + - '--- a/src/test-bar.js\n' + - '+++ b/src/test-baz.js\n' + - '@@ -1,4 +1,32 @@\n' + - ' function foo() {\n' + - '-var bar = "Whoops!";\n' + - '+var baz = "Whoops!";\n' + - ' }\n' + - ' '; - - var result = DiffParser.generateDiffJson(diff, {'srcPrefix': '\t', 'dstPrefix': '\t'}); - assert.equal(3, result.length); - - var file1 = result[0]; - assert.equal(2, file1.addedLines); - assert.equal(1, file1.deletedLines); - assert.equal('Test.scala', file1.oldName); - assert.equal('ScalaTest.scala', file1.newName); - assert.equal(2, file1.blocks.length); - assert.equal(8, file1.blocks[0].lines.length); - assert.equal(7, file1.blocks[1].lines.length); - - var file2 = result[1]; - assert.equal('/dev/null', file2.oldName); - assert.equal('tardis.png', file2.newName); - - var file3 = result[2]; - assert.equal(1, file3.addedLines); - assert.equal(1, file3.deletedLines); - assert.equal('src/test-bar.js', file3.oldName); - assert.equal('src/test-baz.js', file3.newName); - assert.equal(1, file3.blocks.length); - assert.equal(5, file3.blocks[0].lines.length); - var linesContent = file3.blocks[0].lines.map(function(line) { - return line.content; - }); - assert.deepEqual(linesContent, - [' function foo() {', '-var bar = "Whoops!";', '+var baz = "Whoops!";', ' }', ' ']); - }); - - it('should parse binary with content', function() { - var diff = - 'diff --git a/favicon.png b/favicon.png\n' + - 'deleted file mode 100644\n' + - 'index 2a9d516a5647205d7be510dd0dff93a3663eff6f..0000000000000000000000000000000000000000\n' + - 'GIT binary patch\n' + - 'literal 0\n' + - 'HcmV?d00001\n' + - '\n' + - 'literal 471\n' + - 'zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61|;P_|4#%`EX7WqAsj$Z!;#Vf4nJ\n' + - 'za0`JjqPVOAS4ANVKzqmCp=Cty@U^(7zk!jHsvT~YI{F^=Ex6g|gox78w\n' + - 'z+Sn2Du3GS9U7qU`1*NYYlJi3u-!-_B#8k9H0\n' + - 'zGl{FnZs<2$wz5^=Q2h-1XI^s{LQL1#T4epqNPC%Orl(tD_@!*EY++~^Lt2<2&!&%=\n' + - 'z`m>(TYj6uS7jDdt=eH>iOyQg(QMR<-Fw8)Dk^ZG)XQTuzEgl{`GpS?Cfq9818R9~=\n' + - 'z{&h9@9n8F^?|qusoPy{k#%tVHzu7H$t26CR`BJZk*Ixf&u36WuS=?6m2^ho-p00i_\n' + - 'I>zopr0Nz-&lmGw#\n' + - 'diff --git a/src/test-bar.js b/src/test-baz.js\n' + - 'similarity index 98%\n' + - 'rename from src/test-bar.js\n' + - 'rename to src/test-baz.js\n' + - 'index e01513b..f14a870 100644\n' + - '--- a/src/test-bar.js\n' + - '+++ b/src/test-baz.js\n' + - '@@ -1,4 +1,32 @@\n' + - ' function foo() {\n' + - '-var bar = "Whoops!";\n' + - '+var baz = "Whoops!";\n' + - ' }\n' + - ' '; - - var result = DiffParser.generateDiffJson(diff); - assert.equal(2, result.length); - - var file1 = result[0]; - assert.equal('favicon.png', file1.oldName); - assert.equal('favicon.png', file1.newName); - assert.equal(1, file1.blocks.length); - assert.equal(0, file1.blocks[0].lines.length); - - var file2 = result[1]; - assert.equal(1, file2.addedLines); - assert.equal(1, file2.deletedLines); - assert.equal('src/test-bar.js', file2.oldName); - assert.equal('src/test-baz.js', file2.newName); - assert.equal(1, file2.blocks.length); - assert.equal(5, file2.blocks[0].lines.length); - var linesContent = file2.blocks[0].lines.map(function(line) { - return line.content; - }); - assert.deepEqual(linesContent, - [' function foo() {', '-var bar = "Whoops!";', '+var baz = "Whoops!";', ' }', ' ']); - }); - }); -}); diff --git a/test/hogan-cache-tests.js b/test/hogan-cache-tests.js deleted file mode 100644 index a34839c..0000000 --- a/test/hogan-cache-tests.js +++ /dev/null @@ -1,70 +0,0 @@ -var assert = require('assert'); - -var HoganJsUtils = new (require('../src/hoganjs-utils.js').HoganJsUtils)(); -var diffParser = require('../src/diff-parser.js').DiffParser; - -describe('HoganJsUtils', function() { - describe('render', function() { - var emptyDiffHtml = - '\n' + - ' \n' + - '
    \n' + - ' File without changes\n' + - '
    \n' + - ' \n' + - ''; - - it('should render view', function() { - var result = HoganJsUtils.render('generic', 'empty-diff', { - contentClass: 'd2h-code-line', - diffParser: diffParser - }); - assert.equal(emptyDiffHtml, result); - }); - - it('should render view without cache', function() { - var result = HoganJsUtils.render('generic', 'empty-diff', { - contentClass: 'd2h-code-line', - diffParser: diffParser - }, {noCache: true}); - assert.equal(emptyDiffHtml, result); - }); - - it('should return null if template is missing', function() { - var hoganUtils = new (require('../src/hoganjs-utils.js').HoganJsUtils)({noCache: true}); - var result = hoganUtils.render('generic', 'missing-template', {}); - assert.equal(null, result); - }); - - it('should allow templates to be overridden with compiled templates', function() { - var emptyDiffTemplate = HoganJsUtils.compile('

    {{myName}}

    '); - - var config = {templates: {'generic-empty-diff': emptyDiffTemplate}}; - var hoganUtils = new (require('../src/hoganjs-utils.js').HoganJsUtils)(config); - var result = hoganUtils.render('generic', 'empty-diff', {myName: 'Rodrigo Fernandes'}); - assert.equal('

    Rodrigo Fernandes

    ', result); - }); - - it('should allow templates to be overridden with uncompiled templates', function() { - var emptyDiffTemplate = '

    {{myName}}

    '; - - var config = {rawTemplates: {'generic-empty-diff': emptyDiffTemplate}}; - var hoganUtils = new (require('../src/hoganjs-utils.js').HoganJsUtils)(config); - var result = hoganUtils.render('generic', 'empty-diff', {myName: 'Rodrigo Fernandes'}); - assert.equal('

    Rodrigo Fernandes

    ', result); - }); - - it('should allow templates to be overridden giving priority to compiled templates', function() { - var emptyDiffTemplate = HoganJsUtils.compile('

    {{myName}}

    '); - var emptyDiffTemplateUncompiled = '

    Not used!

    '; - - var config = { - templates: {'generic-empty-diff': emptyDiffTemplate}, - rawTemplates: {'generic-empty-diff': emptyDiffTemplateUncompiled} - }; - var hoganUtils = new (require('../src/hoganjs-utils.js').HoganJsUtils)(config); - var result = hoganUtils.render('generic', 'empty-diff', {myName: 'Rodrigo Fernandes'}); - assert.equal('

    Rodrigo Fernandes

    ', result); - }); - }); -}); diff --git a/test/printer-utils-tests.js b/test/printer-utils-tests.js deleted file mode 100644 index b3c8213..0000000 --- a/test/printer-utils-tests.js +++ /dev/null @@ -1,140 +0,0 @@ -var assert = require('assert'); - -var PrinterUtils = require('../src/printer-utils.js').PrinterUtils; - -describe('Utils', function() { - describe('getHtmlId', function() { - it('should generate file unique id', function() { - var result = PrinterUtils.getHtmlId({ - oldName: 'sample.js', - newName: 'sample.js' - }); - assert.equal('d2h-960013', result); - }); - it('should generate file unique id for empty hashes', function() { - var result = PrinterUtils.getHtmlId({ - oldName: 'sample.js', - newName: 'sample.js' - }); - assert.equal('d2h-960013', result); - }); - }); - - describe('getDiffName', function() { - it('should generate the file name for a changed file', function() { - var result = PrinterUtils.getDiffName({ - oldName: 'sample.js', - newName: 'sample.js' - }); - assert.equal('sample.js', result); - }); - it('should generate the file name for a changed file and full rename', function() { - var result = PrinterUtils.getDiffName({ - oldName: 'sample1.js', - newName: 'sample2.js' - }); - assert.equal('sample1.js → sample2.js', result); - }); - it('should generate the file name for a changed file and prefix rename', function() { - var result = PrinterUtils.getDiffName({ - oldName: 'src/path/sample.js', - newName: 'source/path/sample.js' - }); - assert.equal('{src → source}/path/sample.js', result); - }); - it('should generate the file name for a changed file and suffix rename', function() { - var result = PrinterUtils.getDiffName({ - oldName: 'src/path/sample1.js', - newName: 'src/path/sample2.js' - }); - assert.equal('src/path/{sample1.js → sample2.js}', result); - }); - it('should generate the file name for a changed file and middle rename', function() { - var result = PrinterUtils.getDiffName({ - oldName: 'src/really/big/path/sample.js', - newName: 'src/small/path/sample.js' - }); - assert.equal('src/{really/big → small}/path/sample.js', result); - }); - it('should generate the file name for a deleted file', function() { - var result = PrinterUtils.getDiffName({ - oldName: 'src/my/file.js', - newName: '/dev/null' - }); - assert.equal('src/my/file.js', result); - }); - it('should generate the file name for a new file', function() { - var result = PrinterUtils.getDiffName({ - oldName: '/dev/null', - newName: 'src/my/file.js' - }); - assert.equal('src/my/file.js', result); - }); - it('should generate handle undefined filename', function() { - var result = PrinterUtils.getDiffName({}); - assert.equal('unknown/file/path', result); - }); - }); - - describe('diffHighlight', function() { - it('should highlight two lines', function() { - var result = PrinterUtils.diffHighlight( - '-var myVar = 2;', - '+var myVariable = 3;', - {matching: 'words'} - ); - - assert.deepEqual({ - first: { - prefix: '-', - line: 'var myVar = 2;' - }, - second: { - prefix: '+', - line: 'var myVariable = 3;' - } - }, result); - }); - it('should highlight two lines char by char', function() { - var result = PrinterUtils.diffHighlight( - '-var myVar = 2;', - '+var myVariable = 3;', - { diffStyle: 'char' } - ); - - assert.deepEqual({ - first: { - prefix: '-', - line: 'var myVar = 2;' - }, - second: { - prefix: '+', - line: 'var myVariable = 3;' - } - }, result); - }); - it('should highlight combined diff lines', function() { - var result = PrinterUtils.diffHighlight( - ' -var myVar = 2;', - ' +var myVariable = 3;', - { - diffStyle: 'word', - isCombined: true, - matching: 'words', - matchWordsThreshold: 1.00 - } - ); - - assert.deepEqual({ - first: { - prefix: ' -', - line: 'var myVar = 2;' - }, - second: { - prefix: ' +', - line: 'var myVariable = 3;' - } - }, result); - }); - }); -}); diff --git a/test/utils-tests.js b/test/utils-tests.js deleted file mode 100644 index fec64a9..0000000 --- a/test/utils-tests.js +++ /dev/null @@ -1,25 +0,0 @@ -var assert = require('assert'); - -var Utils = require('../src/utils.js').Utils; - -describe('Utils', function() { - describe('escape', function() { - it('should escape & with &', function() { - var result = Utils.escape('&'); - assert.equal('&', result); - }); - it('should escape < with <', function() { - var result = Utils.escape('<'); - assert.equal('<', result); - }); - it('should escape > with >', function() { - var result = Utils.escape('>'); - assert.equal('>', result); - }); - it('should escape a string with multiple problematic characters', function() { - var result = Utils.escape('\tlink text'); - var expected = '<a href="#">\tlink text</a>'; - assert.equal(expected, result); - }); - }); -}); diff --git a/tsconfig.json b/tsconfig.json new file mode 100644 index 0000000..ead2b45 --- /dev/null +++ b/tsconfig.json @@ -0,0 +1,28 @@ +{ + "compilerOptions": { + "outDir": "./build/commonjs-node", + "target": "es5", + "module": "commonjs", + "moduleResolution": "node", + // TODO: Change to true after migration to TS is complete + "allowJs": true, + "declaration": false, + "declarationMap": false, + ///////////////////////////////////////////////////////// + "strictNullChecks": true, + "removeComments": true, + "preserveConstEnums": true, + "sourceMap": true, + "alwaysStrict": true, + "strict": true, + "noImplicitAny": true, + "noImplicitThis": true, + "noUnusedParameters": true, + "noUnusedLocals": true, + "noImplicitReturns": true, + "noFallthroughCasesInSwitch": true, + "forceConsistentCasingInFileNames": true + }, + "include": ["./src/**/*"], + "exclude": ["node_modules", "./src/__tests__/*"] +} diff --git a/website/templates/pages/demo/demo.js b/website/templates/pages/demo/demo.js index f2b1326..ff96e78 100644 --- a/website/templates/pages/demo/demo.js +++ b/website/templates/pages/demo/demo.js @@ -15,20 +15,20 @@ $(document).ready(function() { // Improves browser compatibility - require('whatwg-fetch'); + require("whatwg-fetch"); - var searchParam = 'diff'; + const searchParam = "diff"; - var $container = $('.container'); - var $url = $('#url'); - var $outputFormat = $('#diff-url-options-output-format'); - var $showFiles = $('#diff-url-options-show-files'); - var $matching = $('#diff-url-options-matching'); - var $wordsThreshold = $('#diff-url-options-match-words-threshold'); - var $matchingMaxComparisons = $('#diff-url-options-matching-max-comparisons'); + const $container = $(".container"); + const $url = $("#url"); + const $outputFormat = $("#diff-url-options-output-format"); + const $showFiles = $("#diff-url-options-show-files"); + const $matching = $("#diff-url-options-matching"); + const $wordsThreshold = $("#diff-url-options-match-words-threshold"); + const $matchingMaxComparisons = $("#diff-url-options-matching-max-comparisons"); if (window.location.search) { - var url = getUrlFromSearch(window.location.search); + const url = getUrlFromSearch(window.location.search); $url.val(url); smartDraw(url); } @@ -41,99 +41,99 @@ $(document).ready(function() { .add($wordsThreshold) .add($matchingMaxComparisons) .change(function(e) { - console.log(''); + console.log(""); console.log(e); - console.log(''); + console.log(""); smartDraw(null, true); }); function getUrlFromSearch(search) { try { return search - .split('?')[1] - .split(searchParam + '=')[1] - .split('&')[0]; - } catch (_ignore) { - } + .split("?")[1] + .split(searchParam + "=")[1] + .split("&")[0]; + } catch (_ignore) {} return null; } function getParamsFromSearch(search) { - var map = {}; + const map = {}; try { search - .split('?')[1] - .split('&') + .split("?")[1] + .split("&") .map(function(e) { - var values = e.split('='); + const values = e.split("="); map[values[0]] = values[1]; }); - } catch (_ignore) { - } + } catch (_ignore) {} return map; } function bind() { - $('#url-btn').click(function(e) { + $("#url-btn").click(function(e) { e.preventDefault(); - var url = $url.val(); + const url = $url.val(); smartDraw(url); }); - $url.on('paste', function(e) { - var url = e.originalEvent.clipboardData.getData('Text'); + $url.on("paste", function(e) { + const url = e.originalEvent.clipboardData.getData("Text"); smartDraw(url); }); } function prepareUrl(url) { - var fetchUrl; - var headers = new Headers(); + let fetchUrl; + const headers = new Headers(); - var githubCommitUrl = /^https?:\/\/(?:www\.)?github\.com\/(.*?)\/(.*?)\/commit\/(.*?)(?:\.diff)?(?:\.patch)?(?:\/.*)?$/; - var githubPrUrl = /^https?:\/\/(?:www\.)?github\.com\/(.*?)\/(.*?)\/pull\/(.*?)(?:\.diff)?(?:\.patch)?(?:\/.*)?$/; + const githubCommitUrl = /^https?:\/\/(?:www\.)?github\.com\/(.*?)\/(.*?)\/commit\/(.*?)(?:\.diff)?(?:\.patch)?(?:\/.*)?$/; + const githubPrUrl = /^https?:\/\/(?:www\.)?github\.com\/(.*?)\/(.*?)\/pull\/(.*?)(?:\.diff)?(?:\.patch)?(?:\/.*)?$/; - var gitlabCommitUrl = /^https?:\/\/(?:www\.)?gitlab\.com\/(.*?)\/(.*?)\/commit\/(.*?)(?:\.diff)?(?:\.patch)?(?:\/.*)?$/; - var gitlabPrUrl = /^https?:\/\/(?:www\.)?gitlab\.com\/(.*?)\/(.*?)\/merge_requests\/(.*?)(?:\.diff)?(?:\.patch)?(?:\/.*)?$/; + const gitlabCommitUrl = /^https?:\/\/(?:www\.)?gitlab\.com\/(.*?)\/(.*?)\/commit\/(.*?)(?:\.diff)?(?:\.patch)?(?:\/.*)?$/; + const gitlabPrUrl = /^https?:\/\/(?:www\.)?gitlab\.com\/(.*?)\/(.*?)\/merge_requests\/(.*?)(?:\.diff)?(?:\.patch)?(?:\/.*)?$/; - var bitbucketCommitUrl = /^https?:\/\/(?:www\.)?bitbucket\.org\/(.*?)\/(.*?)\/commits\/(.*?)(?:\/raw)?(?:\/.*)?$/; - var bitbucketPrUrl = /^https?:\/\/(?:www\.)?bitbucket\.org\/(.*?)\/(.*?)\/pull-requests\/(.*?)(?:\/.*)?$/; + const bitbucketCommitUrl = /^https?:\/\/(?:www\.)?bitbucket\.org\/(.*?)\/(.*?)\/commits\/(.*?)(?:\/raw)?(?:\/.*)?$/; + const bitbucketPrUrl = /^https?:\/\/(?:www\.)?bitbucket\.org\/(.*?)\/(.*?)\/pull-requests\/(.*?)(?:\/.*)?$/; function gitLabUrlGen(userName, projectName, type, value) { - return 'https://crossorigin.me/https://gitlab.com/' + userName + '/' + projectName + '/' + type + '/' + value + '.diff'; + return ( + "https://crossorigin.me/https://gitlab.com/" + userName + "/" + projectName + "/" + type + "/" + value + ".diff" + ); } function gitHubUrlGen(userName, projectName, type, value) { - headers.append('Accept', 'application/vnd.github.v3.diff'); - return 'https://api.github.com/repos/' + userName + '/' + projectName + '/' + type + '/' + value; + headers.append("Accept", "application/vnd.github.v3.diff"); + return "https://api.github.com/repos/" + userName + "/" + projectName + "/" + type + "/" + value; } function bitbucketUrlGen(userName, projectName, type, value) { - var baseUrl = 'https://bitbucket.org/api/2.0/repositories/'; - if (type === 'pullrequests') { - return baseUrl + userName + '/' + projectName + '/pullrequests/' + value + '/diff'; + const baseUrl = "https://bitbucket.org/api/2.0/repositories/"; + if (type === "pullrequests") { + return baseUrl + userName + "/" + projectName + "/pullrequests/" + value + "/diff"; } - return baseUrl + userName + '/' + projectName + '/diff/' + value; + return baseUrl + userName + "/" + projectName + "/diff/" + value; } - var values; + let values; if ((values = githubCommitUrl.exec(url))) { - fetchUrl = gitHubUrlGen(values[1], values[2], 'commits', values[3]); + fetchUrl = gitHubUrlGen(values[1], values[2], "commits", values[3]); } else if ((values = githubPrUrl.exec(url))) { - fetchUrl = gitHubUrlGen(values[1], values[2], 'pulls', values[3]); + fetchUrl = gitHubUrlGen(values[1], values[2], "pulls", values[3]); } else if ((values = gitlabCommitUrl.exec(url))) { - fetchUrl = gitLabUrlGen(values[1], values[2], 'commit', values[3]); + fetchUrl = gitLabUrlGen(values[1], values[2], "commit", values[3]); } else if ((values = gitlabPrUrl.exec(url))) { - fetchUrl = gitLabUrlGen(values[1], values[2], 'merge_requests', values[3]); + fetchUrl = gitLabUrlGen(values[1], values[2], "merge_requests", values[3]); } else if ((values = bitbucketCommitUrl.exec(url))) { - fetchUrl = bitbucketUrlGen(values[1], values[2], 'commit', values[3]); + fetchUrl = bitbucketUrlGen(values[1], values[2], "commit", values[3]); } else if ((values = bitbucketPrUrl.exec(url))) { - fetchUrl = bitbucketUrlGen(values[1], values[2], 'pullrequests', values[3]); + fetchUrl = bitbucketUrlGen(values[1], values[2], "pullrequests", values[3]); } else { - console.info('Could not parse url, using the provided url.'); - fetchUrl = 'https://crossorigin.me/' + url; + console.info("Could not parse url, using the provided url."); + fetchUrl = "https://crossorigin.me/" + url; } return { @@ -144,90 +144,96 @@ $(document).ready(function() { } function smartDraw(urlOpt, forced) { - var url = urlOpt || $url.val(); - var req = prepareUrl(url); + const url = urlOpt || $url.val(); + const req = prepareUrl(url); draw(req, forced); } function draw(req, forced) { if (!validateUrl(req.url)) { - console.error('Invalid url provided!'); + console.error("Invalid url provided!"); return; } if (validateUrl(req.originalUrl)) updateUrl(req.originalUrl); - var outputFormat = $outputFormat.val(); - var showFiles = $showFiles.is(':checked'); - var matching = $matching.val(); - var wordsThreshold = $wordsThreshold.val(); - var matchingMaxComparisons = $matchingMaxComparisons.val(); + const outputFormat = $outputFormat.val(); + const showFiles = $showFiles.is(":checked"); + const matching = $matching.val(); + const wordsThreshold = $wordsThreshold.val(); + const matchingMaxComparisons = $matchingMaxComparisons.val(); fetch(req.url, { - method: 'GET', + method: "GET", headers: req.headers, - mode: 'cors', - cache: 'default' + mode: "cors", + cache: "default" }) .then(function(res) { return res.text(); }) .then(function(data) { - var container = '#url-diff-container'; - var diff2htmlUi = new Diff2HtmlUI({diff: data}); + const container = "#url-diff-container"; + const diff2htmlUi = new Diff2HtmlUI({ diff: data }); - if (outputFormat === 'side-by-side') { - $container.css({'width': '100%'}); + if (outputFormat === "side-by-side") { + $container.css({ width: "100%" }); } else { - $container.css({'width': ''}); + $container.css({ width: "" }); } - var params = getParamsFromSearch(window.location.search); + const params = getParamsFromSearch(window.location.search); delete params[searchParam]; if (forced) { - params['outputFormat'] = outputFormat; - params['showFiles'] = showFiles; - params['matching'] = matching; - params['wordsThreshold'] = wordsThreshold; - params['matchingMaxComparisons'] = matchingMaxComparisons; + params.outputFormat = outputFormat; + params.showFiles = showFiles; + params.matching = matching; + params.wordsThreshold = wordsThreshold; + params.matchingMaxComparisons = matchingMaxComparisons; } else { - params['outputFormat'] = params['outputFormat'] || outputFormat; - params['showFiles'] = String(params['showFiles']) !== 'false' || (params['showFiles'] === null && showFiles); - params['matching'] = params['matching'] || matching; - params['wordsThreshold'] = params['wordsThreshold'] || wordsThreshold; - params['matchingMaxComparisons'] = params['matchingMaxComparisons'] || matchingMaxComparisons; + params.outputFormat = params.outputFormat || outputFormat; + params.showFiles = String(params.showFiles) !== "false" || (params.showFiles === null && showFiles); + params.matching = params.matching || matching; + params.wordsThreshold = params.wordsThreshold || wordsThreshold; + params.matchingMaxComparisons = params.matchingMaxComparisons || matchingMaxComparisons; - $outputFormat.val(params['outputFormat']); - $showFiles.prop('checked', params['showFiles']); - $matching.val(params['matching']); - $wordsThreshold.val(params['wordsThreshold']); - $matchingMaxComparisons.val(params['matchingMaxComparisons']); + $outputFormat.val(params.outputFormat); + $showFiles.prop("checked", params.showFiles); + $matching.val(params.matching); + $wordsThreshold.val(params.wordsThreshold); + $matchingMaxComparisons.val(params.matchingMaxComparisons); } - params['synchronisedScroll'] = params['synchronisedScroll'] || true; + params.synchronisedScroll = params.synchronisedScroll || true; diff2htmlUi.draw(container, params); - diff2htmlUi.fileListCloseable(container, params['fileListCloseable'] || false); - if (params['highlight'] === undefined || params['highlight']) { + diff2htmlUi.fileListCloseable(container, params.fileListCloseable || false); + if (params.highlight === undefined || params.highlight) { diff2htmlUi.highlightCode(container); } }); } function validateUrl(url) { - return /^(?:(?:(?:https?|ftp):)?\/\/)(?:\S+(?::\S*)?@)?(?:(?!(?:10|127)(?:\.\d{1,3}){3})(?!(?:169\.254|192\.168)(?:\.\d{1,3}){2})(?!172\.(?:1[6-9]|2\d|3[0-1])(?:\.\d{1,3}){2})(?:[1-9]\d?|1\d\d|2[01]\d|22[0-3])(?:\.(?:1?\d{1,2}|2[0-4]\d|25[0-5])){2}(?:\.(?:[1-9]\d?|1\d\d|2[0-4]\d|25[0-4]))|(?:(?:[a-z\u00a1-\uffff0-9]-*)*[a-z\u00a1-\uffff0-9]+)(?:\.(?:[a-z\u00a1-\uffff0-9]-*)*[a-z\u00a1-\uffff0-9]+)*(?:\.(?:[a-z\u00a1-\uffff]{2,})).?)(?::\d{2,5})?(?:[/?#]\S*)?$/i.test(url); + return /^(?:(?:(?:https?|ftp):)?\/\/)(?:\S+(?::\S*)?@)?(?:(?!(?:10|127)(?:\.\d{1,3}){3})(?!(?:169\.254|192\.168)(?:\.\d{1,3}){2})(?!172\.(?:1[6-9]|2\d|3[0-1])(?:\.\d{1,3}){2})(?:[1-9]\d?|1\d\d|2[01]\d|22[0-3])(?:\.(?:1?\d{1,2}|2[0-4]\d|25[0-5])){2}(?:\.(?:[1-9]\d?|1\d\d|2[0-4]\d|25[0-4]))|(?:(?:[a-z\u00a1-\uffff0-9]-*)*[a-z\u00a1-\uffff0-9]+)(?:\.(?:[a-z\u00a1-\uffff0-9]-*)*[a-z\u00a1-\uffff0-9]+)*(?:\.(?:[a-z\u00a1-\uffff]{2,})).?)(?::\d{2,5})?(?:[/?#]\S*)?$/i.test( + url + ); } function updateUrl(url) { - var params = getParamsFromSearch(window.location.search); + const params = getParamsFromSearch(window.location.search); if (params[searchParam] === url) return; params[searchParam] = url; - var paramString = Object.keys(params).map(function(k) { return k + '=' + params[k]; }).join('&'); + const paramString = Object.keys(params) + .map(function(k) { + return k + "=" + params[k]; + }) + .join("&"); - window.location = 'demo.html?' + paramString; + window.location = "demo.html?" + paramString; } }); diff --git a/yarn.lock b/yarn.lock index 0f6e710..1c76a08 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2,13 +2,80 @@ # yarn lockfile v1 -"@babel/code-frame@^7.0.0": - version "7.0.0" - resolved "https://registry.yarnpkg.com/@babel/code-frame/-/code-frame-7.0.0.tgz#06e2ab19bdb535385559aabb5ba59729482800f8" - integrity sha512-OfC2uemaknXr87bdLUkWog7nYuliM9Ij5HUcajsVcMCpQrcLmtxRbVFTIqmcSkSeYRBFBRxs2FiUqFJDLdiebA== +"@babel/code-frame@^7.0.0", "@babel/code-frame@^7.5.5": + version "7.5.5" + resolved "https://registry.yarnpkg.com/@babel/code-frame/-/code-frame-7.5.5.tgz#bc0782f6d69f7b7d49531219699b988f669a8f9d" + integrity sha512-27d4lZoomVyo51VegxI20xZPuSHusqbQag/ztrBC7wegWoQ1nLREPVSKSW8byhTlzTKyNE4ifaTA6lCp7JjpFw== dependencies: "@babel/highlight" "^7.0.0" +"@babel/core@^7.1.0": + version "7.6.2" + resolved "https://registry.yarnpkg.com/@babel/core/-/core-7.6.2.tgz#069a776e8d5e9eefff76236bc8845566bd31dd91" + integrity sha512-l8zto/fuoZIbncm+01p8zPSDZu/VuuJhAfA7d/AbzM09WR7iVhavvfNDYCNpo1VvLk6E6xgAoP9P+/EMJHuRkQ== + dependencies: + "@babel/code-frame" "^7.5.5" + "@babel/generator" "^7.6.2" + "@babel/helpers" "^7.6.2" + "@babel/parser" "^7.6.2" + "@babel/template" "^7.6.0" + "@babel/traverse" "^7.6.2" + "@babel/types" "^7.6.0" + convert-source-map "^1.1.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" + +"@babel/generator@^7.4.0", "@babel/generator@^7.6.2": + version "7.6.2" + resolved "https://registry.yarnpkg.com/@babel/generator/-/generator-7.6.2.tgz#dac8a3c2df118334c2a29ff3446da1636a8f8c03" + integrity sha512-j8iHaIW4gGPnViaIHI7e9t/Hl8qLjERI6DcV9kEpAIDJsAOrcnXqRS7t+QbhL76pwbtqP+QCQLL0z1CyVmtjjQ== + dependencies: + "@babel/types" "^7.6.0" + jsesc "^2.5.1" + lodash "^4.17.13" + source-map "^0.5.0" + +"@babel/helper-function-name@^7.1.0": + version "7.1.0" + resolved "https://registry.yarnpkg.com/@babel/helper-function-name/-/helper-function-name-7.1.0.tgz#a0ceb01685f73355d4360c1247f582bfafc8ff53" + integrity sha512-A95XEoCpb3TO+KZzJ4S/5uW5fNe26DjBGqf1o9ucyLyCmi1dXq/B3c8iaWTfBk3VvetUxl16e8tIrd5teOCfGw== + dependencies: + "@babel/helper-get-function-arity" "^7.0.0" + "@babel/template" "^7.1.0" + "@babel/types" "^7.0.0" + +"@babel/helper-get-function-arity@^7.0.0": + version "7.0.0" + resolved "https://registry.yarnpkg.com/@babel/helper-get-function-arity/-/helper-get-function-arity-7.0.0.tgz#83572d4320e2a4657263734113c42868b64e49c3" + integrity sha512-r2DbJeg4svYvt3HOS74U4eWKsUAMRH01Z1ds1zx8KNTPtpTL5JAsdFv8BNyOpVqdFhHkkRDIg5B4AsxmkjAlmQ== + dependencies: + "@babel/types" "^7.0.0" + +"@babel/helper-plugin-utils@^7.0.0": + version "7.0.0" + resolved "https://registry.yarnpkg.com/@babel/helper-plugin-utils/-/helper-plugin-utils-7.0.0.tgz#bbb3fbee98661c569034237cc03967ba99b4f250" + integrity sha512-CYAOUCARwExnEixLdB6sDm2dIJ/YgEAKDM1MOeMeZu9Ld/bDgVo8aiWrXwcY7OBh+1Ea2uUcVRcxKk0GJvW7QA== + +"@babel/helper-split-export-declaration@^7.4.4": + version "7.4.4" + resolved "https://registry.yarnpkg.com/@babel/helper-split-export-declaration/-/helper-split-export-declaration-7.4.4.tgz#ff94894a340be78f53f06af038b205c49d993677" + integrity sha512-Ro/XkzLf3JFITkW6b+hNxzZ1n5OQ80NvIUdmHspih1XAhtN3vPTuUFT4eQnela+2MaZ5ulH+iyP513KJrxbN7Q== + dependencies: + "@babel/types" "^7.4.4" + +"@babel/helpers@^7.6.2": + version "7.6.2" + resolved "https://registry.yarnpkg.com/@babel/helpers/-/helpers-7.6.2.tgz#681ffe489ea4dcc55f23ce469e58e59c1c045153" + integrity sha512-3/bAUL8zZxYs1cdX2ilEE0WobqbCmKWr/889lf2SS0PpDcpEIY8pb1CCyz0pEcX3pEb+MCbks1jIokz2xLtGTA== + dependencies: + "@babel/template" "^7.6.0" + "@babel/traverse" "^7.6.2" + "@babel/types" "^7.6.0" + "@babel/highlight@^7.0.0": version "7.5.0" resolved "https://registry.yarnpkg.com/@babel/highlight/-/highlight-7.5.0.tgz#56d11312bd9248fa619591d02472be6e8cb32540" @@ -18,6 +85,207 @@ esutils "^2.0.2" js-tokens "^4.0.0" +"@babel/parser@^7.1.0", "@babel/parser@^7.4.3", "@babel/parser@^7.6.0", "@babel/parser@^7.6.2": + version "7.6.2" + resolved "https://registry.yarnpkg.com/@babel/parser/-/parser-7.6.2.tgz#205e9c95e16ba3b8b96090677a67c9d6075b70a1" + integrity sha512-mdFqWrSPCmikBoaBYMuBulzTIKuXVPtEISFbRRVNwMWpCms/hmE2kRq0bblUHaNRKrjRlmVbx1sDHmjmRgD2Xg== + +"@babel/plugin-syntax-object-rest-spread@^7.0.0": + version "7.2.0" + resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-object-rest-spread/-/plugin-syntax-object-rest-spread-7.2.0.tgz#3b7a3e733510c57e820b9142a6579ac8b0dfad2e" + integrity sha512-t0JKGgqk2We+9may3t0xDdmneaXmyxq0xieYcKHxIsrJO64n1OiMWNUtc5gQK1PA0NpdCRrtZp4z+IUaKugrSA== + dependencies: + "@babel/helper-plugin-utils" "^7.0.0" + +"@babel/template@^7.1.0", "@babel/template@^7.4.0", "@babel/template@^7.6.0": + version "7.6.0" + resolved "https://registry.yarnpkg.com/@babel/template/-/template-7.6.0.tgz#7f0159c7f5012230dad64cca42ec9bdb5c9536e6" + integrity sha512-5AEH2EXD8euCk446b7edmgFdub/qfH1SN6Nii3+fyXP807QRx9Q73A2N5hNwRRslC2H9sNzaFhsPubkS4L8oNQ== + dependencies: + "@babel/code-frame" "^7.0.0" + "@babel/parser" "^7.6.0" + "@babel/types" "^7.6.0" + +"@babel/traverse@^7.1.0", "@babel/traverse@^7.4.3", "@babel/traverse@^7.6.2": + version "7.6.2" + resolved "https://registry.yarnpkg.com/@babel/traverse/-/traverse-7.6.2.tgz#b0e2bfd401d339ce0e6c05690206d1e11502ce2c" + integrity sha512-8fRE76xNwNttVEF2TwxJDGBLWthUkHWSldmfuBzVRmEDWOtu4XdINTgN7TDWzuLg4bbeIMLvfMFD9we5YcWkRQ== + dependencies: + "@babel/code-frame" "^7.5.5" + "@babel/generator" "^7.6.2" + "@babel/helper-function-name" "^7.1.0" + "@babel/helper-split-export-declaration" "^7.4.4" + "@babel/parser" "^7.6.2" + "@babel/types" "^7.6.0" + debug "^4.1.0" + globals "^11.1.0" + lodash "^4.17.13" + +"@babel/types@^7.0.0", "@babel/types@^7.3.0", "@babel/types@^7.4.0", "@babel/types@^7.4.4", "@babel/types@^7.6.0": + version "7.6.1" + resolved "https://registry.yarnpkg.com/@babel/types/-/types-7.6.1.tgz#53abf3308add3ac2a2884d539151c57c4b3ac648" + integrity sha512-X7gdiuaCmA0uRjCmRtYJNAVCc/q+5xSgsfKJHqMN4iNLILX39677fJE1O40arPMh0TTtS9ItH67yre6c7k6t0g== + dependencies: + esutils "^2.0.2" + lodash "^4.17.13" + to-fast-properties "^2.0.0" + +"@cnakazawa/watch@^1.0.3": + version "1.0.3" + resolved "https://registry.yarnpkg.com/@cnakazawa/watch/-/watch-1.0.3.tgz#099139eaec7ebf07a27c1786a3ff64f39464d2ef" + integrity sha512-r5160ogAvGyHsal38Kux7YYtodEKOj89RGb28ht1jh3SJb08VwRwAKKJL0bGb04Zd/3r9FL3BFIc3bBidYffCA== + dependencies: + exec-sh "^0.3.2" + minimist "^1.2.0" + +"@jest/console@^24.7.1", "@jest/console@^24.9.0": + version "24.9.0" + resolved "https://registry.yarnpkg.com/@jest/console/-/console-24.9.0.tgz#79b1bc06fb74a8cfb01cbdedf945584b1b9707f0" + integrity sha512-Zuj6b8TnKXi3q4ymac8EQfc3ea/uhLeCGThFqXeC8H9/raaH8ARPUTdId+XyGd03Z4In0/VjD2OYFcBF09fNLQ== + dependencies: + "@jest/source-map" "^24.9.0" + chalk "^2.0.1" + slash "^2.0.0" + +"@jest/core@^24.9.0": + version "24.9.0" + resolved "https://registry.yarnpkg.com/@jest/core/-/core-24.9.0.tgz#2ceccd0b93181f9c4850e74f2a9ad43d351369c4" + integrity sha512-Fogg3s4wlAr1VX7q+rhV9RVnUv5tD7VuWfYy1+whMiWUrvl7U3QJSJyWcDio9Lq2prqYsZaeTv2Rz24pWGkJ2A== + dependencies: + "@jest/console" "^24.7.1" + "@jest/reporters" "^24.9.0" + "@jest/test-result" "^24.9.0" + "@jest/transform" "^24.9.0" + "@jest/types" "^24.9.0" + ansi-escapes "^3.0.0" + chalk "^2.0.1" + exit "^0.1.2" + graceful-fs "^4.1.15" + jest-changed-files "^24.9.0" + jest-config "^24.9.0" + jest-haste-map "^24.9.0" + jest-message-util "^24.9.0" + jest-regex-util "^24.3.0" + jest-resolve "^24.9.0" + jest-resolve-dependencies "^24.9.0" + jest-runner "^24.9.0" + jest-runtime "^24.9.0" + jest-snapshot "^24.9.0" + jest-util "^24.9.0" + jest-validate "^24.9.0" + jest-watcher "^24.9.0" + micromatch "^3.1.10" + p-each-series "^1.0.0" + realpath-native "^1.1.0" + rimraf "^2.5.4" + slash "^2.0.0" + strip-ansi "^5.0.0" + +"@jest/environment@^24.9.0": + version "24.9.0" + resolved "https://registry.yarnpkg.com/@jest/environment/-/environment-24.9.0.tgz#21e3afa2d65c0586cbd6cbefe208bafade44ab18" + integrity sha512-5A1QluTPhvdIPFYnO3sZC3smkNeXPVELz7ikPbhUj0bQjB07EoE9qtLrem14ZUYWdVayYbsjVwIiL4WBIMV4aQ== + dependencies: + "@jest/fake-timers" "^24.9.0" + "@jest/transform" "^24.9.0" + "@jest/types" "^24.9.0" + jest-mock "^24.9.0" + +"@jest/fake-timers@^24.9.0": + version "24.9.0" + resolved "https://registry.yarnpkg.com/@jest/fake-timers/-/fake-timers-24.9.0.tgz#ba3e6bf0eecd09a636049896434d306636540c93" + integrity sha512-eWQcNa2YSwzXWIMC5KufBh3oWRIijrQFROsIqt6v/NS9Io/gknw1jsAC9c+ih/RQX4A3O7SeWAhQeN0goKhT9A== + dependencies: + "@jest/types" "^24.9.0" + jest-message-util "^24.9.0" + jest-mock "^24.9.0" + +"@jest/reporters@^24.9.0": + version "24.9.0" + resolved "https://registry.yarnpkg.com/@jest/reporters/-/reporters-24.9.0.tgz#86660eff8e2b9661d042a8e98a028b8d631a5b43" + integrity sha512-mu4X0yjaHrffOsWmVLzitKmmmWSQ3GGuefgNscUSWNiUNcEOSEQk9k3pERKEQVBb0Cnn88+UESIsZEMH3o88Gw== + dependencies: + "@jest/environment" "^24.9.0" + "@jest/test-result" "^24.9.0" + "@jest/transform" "^24.9.0" + "@jest/types" "^24.9.0" + chalk "^2.0.1" + exit "^0.1.2" + glob "^7.1.2" + istanbul-lib-coverage "^2.0.2" + istanbul-lib-instrument "^3.0.1" + istanbul-lib-report "^2.0.4" + istanbul-lib-source-maps "^3.0.1" + istanbul-reports "^2.2.6" + jest-haste-map "^24.9.0" + jest-resolve "^24.9.0" + jest-runtime "^24.9.0" + jest-util "^24.9.0" + jest-worker "^24.6.0" + node-notifier "^5.4.2" + slash "^2.0.0" + source-map "^0.6.0" + string-length "^2.0.0" + +"@jest/source-map@^24.3.0", "@jest/source-map@^24.9.0": + version "24.9.0" + resolved "https://registry.yarnpkg.com/@jest/source-map/-/source-map-24.9.0.tgz#0e263a94430be4b41da683ccc1e6bffe2a191714" + integrity sha512-/Xw7xGlsZb4MJzNDgB7PW5crou5JqWiBQaz6xyPd3ArOg2nfn/PunV8+olXbbEZzNl591o5rWKE9BRDaFAuIBg== + dependencies: + callsites "^3.0.0" + graceful-fs "^4.1.15" + source-map "^0.6.0" + +"@jest/test-result@^24.9.0": + version "24.9.0" + resolved "https://registry.yarnpkg.com/@jest/test-result/-/test-result-24.9.0.tgz#11796e8aa9dbf88ea025757b3152595ad06ba0ca" + integrity sha512-XEFrHbBonBJ8dGp2JmF8kP/nQI/ImPpygKHwQ/SY+es59Z3L5PI4Qb9TQQMAEeYsThG1xF0k6tmG0tIKATNiiA== + dependencies: + "@jest/console" "^24.9.0" + "@jest/types" "^24.9.0" + "@types/istanbul-lib-coverage" "^2.0.0" + +"@jest/test-sequencer@^24.9.0": + version "24.9.0" + resolved "https://registry.yarnpkg.com/@jest/test-sequencer/-/test-sequencer-24.9.0.tgz#f8f334f35b625a4f2f355f2fe7e6036dad2e6b31" + integrity sha512-6qqsU4o0kW1dvA95qfNog8v8gkRN9ph6Lz7r96IvZpHdNipP2cBcb07J1Z45mz/VIS01OHJ3pY8T5fUY38tg4A== + dependencies: + "@jest/test-result" "^24.9.0" + jest-haste-map "^24.9.0" + jest-runner "^24.9.0" + jest-runtime "^24.9.0" + +"@jest/transform@^24.9.0": + version "24.9.0" + resolved "https://registry.yarnpkg.com/@jest/transform/-/transform-24.9.0.tgz#4ae2768b296553fadab09e9ec119543c90b16c56" + integrity sha512-TcQUmyNRxV94S0QpMOnZl0++6RMiqpbH/ZMccFB/amku6Uwvyb1cjYX7xkp5nGNkbX4QPH/FcB6q1HBTHynLmQ== + dependencies: + "@babel/core" "^7.1.0" + "@jest/types" "^24.9.0" + babel-plugin-istanbul "^5.1.0" + chalk "^2.0.1" + convert-source-map "^1.4.0" + fast-json-stable-stringify "^2.0.0" + graceful-fs "^4.1.15" + jest-haste-map "^24.9.0" + jest-regex-util "^24.9.0" + jest-util "^24.9.0" + micromatch "^3.1.10" + pirates "^4.0.1" + realpath-native "^1.1.0" + slash "^2.0.0" + source-map "^0.6.1" + write-file-atomic "2.4.1" + +"@jest/types@^24.9.0": + version "24.9.0" + resolved "https://registry.yarnpkg.com/@jest/types/-/types-24.9.0.tgz#63cb26cb7500d069e5a389441a7c6ab5e909fc59" + integrity sha512-XKK7ze1apu5JWQ5eZjHITP66AX+QsLlbaJRBGYr8pNzwcAE2JVkwnf0yqjHTsDRcjR0mujy/NmZMXw5kl+kGBw== + dependencies: + "@types/istanbul-lib-coverage" "^2.0.0" + "@types/istanbul-reports" "^1.1.1" + "@types/yargs" "^13.0.0" + "@mrmlnc/readdir-enhanced@^2.2.1": version "2.2.1" resolved "https://registry.yarnpkg.com/@mrmlnc/readdir-enhanced/-/readdir-enhanced-2.2.1.tgz#524af240d1a360527b730475ecfa1344aa540dde" @@ -31,6 +299,44 @@ resolved "https://registry.yarnpkg.com/@nodelib/fs.stat/-/fs.stat-1.1.3.tgz#2b5a3ab3f918cca48a8c754c08168e3f03eba61b" integrity sha512-shAmDyaQC4H92APFoIaVDHCx5bStIocgvbwQyxPRrbUY20V1EYTbSDchWbuwlMG3V17cprZhA6+78JfB+3DTPw== +"@types/babel__core@^7.1.0": + version "7.1.3" + resolved "https://registry.yarnpkg.com/@types/babel__core/-/babel__core-7.1.3.tgz#e441ea7df63cd080dfcd02ab199e6d16a735fc30" + integrity sha512-8fBo0UR2CcwWxeX7WIIgJ7lXjasFxoYgRnFHUj+hRvKkpiBJbxhdAPTCY6/ZKM0uxANFVzt4yObSLuTiTnazDA== + dependencies: + "@babel/parser" "^7.1.0" + "@babel/types" "^7.0.0" + "@types/babel__generator" "*" + "@types/babel__template" "*" + "@types/babel__traverse" "*" + +"@types/babel__generator@*": + version "7.6.0" + resolved "https://registry.yarnpkg.com/@types/babel__generator/-/babel__generator-7.6.0.tgz#f1ec1c104d1bb463556ecb724018ab788d0c172a" + integrity sha512-c1mZUu4up5cp9KROs/QAw0gTeHrw/x7m52LcnvMxxOZ03DmLwPV0MlGmlgzV3cnSdjhJOZsj7E7FHeioai+egw== + dependencies: + "@babel/types" "^7.0.0" + +"@types/babel__template@*": + version "7.0.2" + resolved "https://registry.yarnpkg.com/@types/babel__template/-/babel__template-7.0.2.tgz#4ff63d6b52eddac1de7b975a5223ed32ecea9307" + integrity sha512-/K6zCpeW7Imzgab2bLkLEbz0+1JlFSrUMdw7KoIIu+IUdu51GWaBZpd3y1VXGVXzynvGa4DaIaxNZHiON3GXUg== + dependencies: + "@babel/parser" "^7.1.0" + "@babel/types" "^7.0.0" + +"@types/babel__traverse@*", "@types/babel__traverse@^7.0.6": + version "7.0.7" + resolved "https://registry.yarnpkg.com/@types/babel__traverse/-/babel__traverse-7.0.7.tgz#2496e9ff56196cc1429c72034e07eab6121b6f3f" + integrity sha512-CeBpmX1J8kWLcDEnI3Cl2Eo6RfbGvzUctA+CjZUhOKDFbLfcr7fc4usEqLNWetrlJd7RhAkyYe2czXop4fICpw== + dependencies: + "@babel/types" "^7.3.0" + +"@types/eslint-visitor-keys@^1.0.0": + version "1.0.0" + resolved "https://registry.yarnpkg.com/@types/eslint-visitor-keys/-/eslint-visitor-keys-1.0.0.tgz#1ee30d79544ca84d68d4b3cdb0af4f205663dd2d" + integrity sha512-OCutwjDZ4aFS6PB1UZ988C4YgwlBHJd6wCeQqaLdmadZ/7e+w79+hbMUFC1QXDNCmdyoRfAFdm0RypzwR+Qpag== + "@types/events@*": version "3.0.0" resolved "https://registry.yarnpkg.com/@types/events/-/events-3.0.0.tgz#2862f3f58a9a7f7c3e78d79f130dd4d71c25c2a7" @@ -45,15 +351,124 @@ "@types/minimatch" "*" "@types/node" "*" +"@types/istanbul-lib-coverage@*", "@types/istanbul-lib-coverage@^2.0.0": + version "2.0.1" + resolved "https://registry.yarnpkg.com/@types/istanbul-lib-coverage/-/istanbul-lib-coverage-2.0.1.tgz#42995b446db9a48a11a07ec083499a860e9138ff" + integrity sha512-hRJD2ahnnpLgsj6KWMYSrmXkM3rm2Dl1qkx6IOFD5FnuNPXJIG5L0dhgKXCYTRMGzU4n0wImQ/xfmRc4POUFlg== + +"@types/istanbul-lib-report@*": + version "1.1.1" + resolved "https://registry.yarnpkg.com/@types/istanbul-lib-report/-/istanbul-lib-report-1.1.1.tgz#e5471e7fa33c61358dd38426189c037a58433b8c" + integrity sha512-3BUTyMzbZa2DtDI2BkERNC6jJw2Mr2Y0oGI7mRxYNBPxppbtEK1F66u3bKwU2g+wxwWI7PAoRpJnOY1grJqzHg== + dependencies: + "@types/istanbul-lib-coverage" "*" + +"@types/istanbul-reports@^1.1.1": + version "1.1.1" + resolved "https://registry.yarnpkg.com/@types/istanbul-reports/-/istanbul-reports-1.1.1.tgz#7a8cbf6a406f36c8add871625b278eaf0b0d255a" + integrity sha512-UpYjBi8xefVChsCoBpKShdxTllC9pwISirfoZsUa2AAdQg/Jd2KQGtSbw+ya7GPo7x/wAPlH6JBhKhAsXUEZNA== + dependencies: + "@types/istanbul-lib-coverage" "*" + "@types/istanbul-lib-report" "*" + +"@types/jest-diff@*": + version "20.0.1" + resolved "https://registry.yarnpkg.com/@types/jest-diff/-/jest-diff-20.0.1.tgz#35cc15b9c4f30a18ef21852e255fdb02f6d59b89" + integrity sha512-yALhelO3i0hqZwhjtcr6dYyaLoCHbAMshwtj6cGxTvHZAKXHsYGdff6E8EPw3xLKY0ELUTQ69Q1rQiJENnccMA== + +"@types/jest@24.0.18": + version "24.0.18" + resolved "https://registry.yarnpkg.com/@types/jest/-/jest-24.0.18.tgz#9c7858d450c59e2164a8a9df0905fc5091944498" + integrity sha512-jcDDXdjTcrQzdN06+TSVsPPqxvsZA/5QkYfIZlq1JMw7FdP5AZylbOc+6B/cuDurctRe+MziUMtQ3xQdrbjqyQ== + dependencies: + "@types/jest-diff" "*" + +"@types/json-schema@^7.0.3": + version "7.0.3" + resolved "https://registry.yarnpkg.com/@types/json-schema/-/json-schema-7.0.3.tgz#bdfd69d61e464dcc81b25159c270d75a73c1a636" + integrity sha512-Il2DtDVRGDcqjDtE+rF8iqg1CArehSK84HZJCT7AMITlyXRBpuPhqGLDQMowraqqu1coEaimg4ZOqggt6L6L+A== + "@types/minimatch@*": version "3.0.3" resolved "https://registry.yarnpkg.com/@types/minimatch/-/minimatch-3.0.3.tgz#3dca0e3f33b200fc7d1139c0cd96c1268cadfd9d" integrity sha512-tHq6qdbT9U1IRSGf14CL0pUlULksvY9OZ+5eEgl1N7t+OA3tGvNpxJCzuKQlsNgCVwbAs670L1vcVQi8j9HjnA== -"@types/node@*": - version "12.6.2" - resolved "https://registry.yarnpkg.com/@types/node/-/node-12.6.2.tgz#a5ccec6abb6060d5f20d256fb03ed743e9774999" - integrity sha512-gojym4tX0FWeV2gsW4Xmzo5wxGjXGm550oVUII7f7G5o4BV6c7DBdiG1RRQd+y1bvqRyYtPfMK85UM95vsapqQ== +"@types/node@*", "@types/node@^12.7.2": + version "12.7.11" + resolved "https://registry.yarnpkg.com/@types/node/-/node-12.7.11.tgz#be879b52031cfb5d295b047f5462d8ef1a716446" + integrity sha512-Otxmr2rrZLKRYIybtdG/sgeO+tHY20GxeDjcGmUnmmlCWyEnv2a2x1ZXBo3BTec4OiTXMQCiazB8NMBf0iRlFw== + +"@types/stack-utils@^1.0.1": + version "1.0.1" + resolved "https://registry.yarnpkg.com/@types/stack-utils/-/stack-utils-1.0.1.tgz#0a851d3bd96498fa25c33ab7278ed3bd65f06c3e" + integrity sha512-l42BggppR6zLmpfU6fq9HEa2oGPEI8yrSPL3GITjfRInppYFahObbIQOQK3UGxEnyQpltZLaPe75046NOZQikw== + +"@types/yargs-parser@*": + version "13.1.0" + resolved "https://registry.yarnpkg.com/@types/yargs-parser/-/yargs-parser-13.1.0.tgz#c563aa192f39350a1d18da36c5a8da382bbd8228" + integrity sha512-gCubfBUZ6KxzoibJ+SCUc/57Ms1jz5NjHe4+dI2krNmU5zCPAphyLJYyTOg06ueIyfj+SaCUqmzun7ImlxDcKg== + +"@types/yargs@^13.0.0": + version "13.0.3" + resolved "https://registry.yarnpkg.com/@types/yargs/-/yargs-13.0.3.tgz#76482af3981d4412d65371a318f992d33464a380" + integrity sha512-K8/LfZq2duW33XW/tFwEAfnZlqIfVsoyRB3kfXdPXYhl0nfM8mmh7GS0jg7WrX2Dgq/0Ha/pR1PaR+BvmWwjiQ== + dependencies: + "@types/yargs-parser" "*" + +"@typescript-eslint/eslint-plugin@2.0.0": + version "2.0.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/eslint-plugin/-/eslint-plugin-2.0.0.tgz#609a5d7b00ce21a6f94d7ef282eba9da57ca1e42" + integrity sha512-Mo45nxTTELODdl7CgpZKJISvLb+Fu64OOO2ZFc2x8sYSnUpFrBUW3H+H/ZGYmEkfnL6VkdtOSxgdt+Av79j0sA== + dependencies: + "@typescript-eslint/experimental-utils" "2.0.0" + eslint-utils "^1.4.0" + functional-red-black-tree "^1.0.1" + regexpp "^2.0.1" + tsutils "^3.14.0" + +"@typescript-eslint/experimental-utils@2.0.0": + version "2.0.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/experimental-utils/-/experimental-utils-2.0.0.tgz#f3d298bb411357f35c4184e24280b256b6321949" + integrity sha512-XGJG6GNBXIEx/mN4eTRypN/EUmsd0VhVGQ1AG+WTgdvjHl0G8vHhVBHrd/5oI6RRYBRnedNymSYWW1HAdivtmg== + dependencies: + "@types/json-schema" "^7.0.3" + "@typescript-eslint/typescript-estree" "2.0.0" + eslint-scope "^4.0.0" + +"@typescript-eslint/experimental-utils@^1.13.0": + version "1.13.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/experimental-utils/-/experimental-utils-1.13.0.tgz#b08c60d780c0067de2fb44b04b432f540138301e" + integrity sha512-zmpS6SyqG4ZF64ffaJ6uah6tWWWgZ8m+c54XXgwFtUv0jNz8aJAVx8chMCvnk7yl6xwn8d+d96+tWp7fXzTuDg== + dependencies: + "@types/json-schema" "^7.0.3" + "@typescript-eslint/typescript-estree" "1.13.0" + eslint-scope "^4.0.0" + +"@typescript-eslint/parser@2.0.0": + version "2.0.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/parser/-/parser-2.0.0.tgz#4273bb19d03489daf8372cdaccbc8042e098178f" + integrity sha512-ibyMBMr0383ZKserIsp67+WnNVoM402HKkxqXGlxEZsXtnGGurbnY90pBO3e0nBUM7chEEOcxUhgw9aPq7fEBA== + dependencies: + "@types/eslint-visitor-keys" "^1.0.0" + "@typescript-eslint/experimental-utils" "2.0.0" + "@typescript-eslint/typescript-estree" "2.0.0" + eslint-visitor-keys "^1.0.0" + +"@typescript-eslint/typescript-estree@1.13.0": + version "1.13.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/typescript-estree/-/typescript-estree-1.13.0.tgz#8140f17d0f60c03619798f1d628b8434913dc32e" + integrity sha512-b5rCmd2e6DCC6tCTN9GSUAuxdYwCM/k/2wdjHGrIRGPSJotWMCe/dGpi66u42bhuh8q3QBzqM4TMA1GUUCJvdw== + dependencies: + lodash.unescape "4.0.1" + semver "5.5.0" + +"@typescript-eslint/typescript-estree@2.0.0": + version "2.0.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/typescript-estree/-/typescript-estree-2.0.0.tgz#c9f6c0efd1b11475540d6a55dc973cc5b9a67e77" + integrity sha512-NXbmzA3vWrSgavymlzMWNecgNOuiMMp62MO3kI7awZRLRcsA1QrYWo6q08m++uuAGVbXH/prZi2y1AWuhSu63w== + dependencies: + lodash.unescape "4.0.1" + semver "^6.2.0" JSONStream@^1.0.3: version "1.3.5" @@ -63,62 +478,74 @@ JSONStream@^1.0.3: jsonparse "^1.2.0" through ">=2.2.7 <3" +abab@^2.0.0: + version "2.0.2" + resolved "https://registry.yarnpkg.com/abab/-/abab-2.0.2.tgz#a2fba1b122c69a85caa02d10f9270c7219709a9d" + integrity sha512-2scffjvioEmNz0OyDSLGWDfKCVwaKc6l9Pm9kOIREU13ClXZvHpg/nRL5xyjSSSLhOnXqft2HpsAzNEEA8cFFg== + abbrev@1: version "1.1.1" resolved "https://registry.yarnpkg.com/abbrev/-/abbrev-1.1.1.tgz#f8f2c887ad10bf67f634f005b6987fed3179aac8" integrity sha512-nne9/IiQ/hzIhY6pdDnbBtz7DjPTKrY00P/zvPSm5pOFkl6xuGrGnXn/VtTNNfNtAfZ9/1RtehkszU9qcTii0Q== -abbrev@1.0.x: - version "1.0.9" - resolved "https://registry.yarnpkg.com/abbrev/-/abbrev-1.0.9.tgz#91b4792588a7738c25f35dd6f63752a2f8776135" - integrity sha1-kbR5JYinc4wl813W9jdSovh3YTU= +acorn-globals@^4.1.0: + version "4.3.4" + resolved "https://registry.yarnpkg.com/acorn-globals/-/acorn-globals-4.3.4.tgz#9fa1926addc11c97308c4e66d7add0d40c3272e7" + integrity sha512-clfQEh21R+D0leSbUdWf3OcfqyaCSAQ8Ryq00bofSekfr9W8u1jyYZo6ir0xu9Gtcf7BjcHJpnbZH7JOCpP60A== + dependencies: + acorn "^6.0.1" + acorn-walk "^6.0.1" -acorn-dynamic-import@^4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/acorn-dynamic-import/-/acorn-dynamic-import-4.0.0.tgz#482210140582a36b83c3e342e1cfebcaa9240948" - integrity sha512-d3OEjQV4ROpoflsnUA8HozoIR504TFxNivYEUi6uwz0IYhBkTDXGuWlNdMtybRt3nqVx/L6XqMt0FxkXuWKZhw== - -acorn-jsx@^5.0.0: - version "5.0.1" - resolved "https://registry.yarnpkg.com/acorn-jsx/-/acorn-jsx-5.0.1.tgz#32a064fd925429216a09b141102bfdd185fae40e" - integrity sha512-HJ7CfNHrfJLlNTzIEUTj43LNWGkqpRLxm3YjAlcD0ACydk9XynzYsCBHxut+iqt+1aBXkx9UP/w/ZqMr13XIzg== +acorn-jsx@^5.0.2: + version "5.0.2" + resolved "https://registry.yarnpkg.com/acorn-jsx/-/acorn-jsx-5.0.2.tgz#84b68ea44b373c4f8686023a551f61a21b7c4a4f" + integrity sha512-tiNTrP1MP0QrChmD2DdupCr6HWSFeKVw5d/dHTu4Y7rkAkRhU/Dt7dphAfIUyxtHpl/eBVip5uTNSpQJHylpAw== acorn-node@^1.2.0, acorn-node@^1.3.0, acorn-node@^1.5.2, acorn-node@^1.6.1: - version "1.7.0" - resolved "https://registry.yarnpkg.com/acorn-node/-/acorn-node-1.7.0.tgz#aac6a559d27af6176b076ab6fb13c5974c213e3b" - integrity sha512-XhahLSsCB6X6CJbe+uNu3Mn9sJBNFxtBN9NLgAOQovfS6Kh0lDUtmlclhjn9CvEK7A7YyRU13PXlNcpSiLI9Yw== + version "1.8.2" + resolved "https://registry.yarnpkg.com/acorn-node/-/acorn-node-1.8.2.tgz#114c95d64539e53dede23de8b9d96df7c7ae2af8" + integrity sha512-8mt+fslDufLYntIoPAaIMUe/lrbrehIiwmR3t2k9LljIzoigEPF27eLk2hy8zSGzmR/ogr7zbRKINMo1u0yh5A== dependencies: - acorn "^6.1.1" - acorn-dynamic-import "^4.0.0" - acorn-walk "^6.1.1" - xtend "^4.0.1" + acorn "^7.0.0" + acorn-walk "^7.0.0" + xtend "^4.0.2" -acorn-walk@^6.1.1: +acorn-walk@^6.0.1: version "6.2.0" resolved "https://registry.yarnpkg.com/acorn-walk/-/acorn-walk-6.2.0.tgz#123cb8f3b84c2171f1f7fb252615b1c78a6b1a8c" integrity sha512-7evsyfH1cLOCdAzZAd43Cic04yKydNx0cF+7tiA19p1XnLLPU4dpCQOqpjqwokFe//vS0QqfqqjCS2JkiIs0cA== -acorn@^6.0.7, acorn@^6.1.1: - version "6.2.0" - resolved "https://registry.yarnpkg.com/acorn/-/acorn-6.2.0.tgz#67f0da2fc339d6cfb5d6fb244fd449f33cd8bbe3" - integrity sha512-8oe72N3WPMjA+2zVG71Ia0nXZ8DpQH+QyyHO+p06jT8eg8FGG3FbcUIi8KziHlAfheJQZeoqbvq1mQSQHXKYLw== +acorn-walk@^7.0.0: + version "7.0.0" + resolved "https://registry.yarnpkg.com/acorn-walk/-/acorn-walk-7.0.0.tgz#c8ba6f0f1aac4b0a9e32d1f0af12be769528f36b" + integrity sha512-7Bv1We7ZGuU79zZbb6rRqcpxo3OY+zrdtloZWoyD8fmGX+FeXRjE+iuGkZjSXLVovLzrsvMGMy0EkwA0E0umxg== -ajv@^6.5.5, ajv@^6.9.1: - version "6.10.1" - resolved "https://registry.yarnpkg.com/ajv/-/ajv-6.10.1.tgz#ebf8d3af22552df9dd049bfbe50cc2390e823593" - integrity sha512-w1YQaVGNC6t2UCPjEawK/vo/dG8OOrVtUmhBT1uJJYxbl5kU2Tj3v6LGqBcsysN1yhuCStJCCA3GqdvKY8sqXQ== +acorn@^5.5.3: + version "5.7.3" + resolved "https://registry.yarnpkg.com/acorn/-/acorn-5.7.3.tgz#67aa231bf8812974b85235a96771eb6bd07ea279" + integrity sha512-T/zvzYRfbVojPWahDsE5evJdHb3oJoQfFbsrKM7w5Zcs++Tr257tia3BmMP8XYVjp1S9RZXQMh7gao96BlqZOw== + +acorn@^6.0.1: + version "6.3.0" + resolved "https://registry.yarnpkg.com/acorn/-/acorn-6.3.0.tgz#0087509119ffa4fc0a0041d1e93a417e68cb856e" + integrity sha512-/czfa8BwS88b9gWQVhc8eknunSA2DoJpJyTQkhheIf5E48u1N0R4q/YxxsAeqRrmK9TQ/uYfgLDfZo91UlANIA== + +acorn@^7.0.0: + version "7.1.0" + resolved "https://registry.yarnpkg.com/acorn/-/acorn-7.1.0.tgz#949d36f2c292535da602283586c2477c57eb2d6c" + integrity sha512-kL5CuoXA/dgxlBbVrflsflzQ3PAas7RYZB52NOm/6839iVYJgKMJ3cQJD+t2i5+qFa8h3MDpEOJiS64E8JLnSQ== + +ajv@^6.10.0, ajv@^6.10.2, ajv@^6.5.5: + version "6.10.2" + resolved "https://registry.yarnpkg.com/ajv/-/ajv-6.10.2.tgz#d3cea04d6b017b2894ad69040fec8b623eb4bd52" + integrity sha512-TXtUUEYHuaTEbLZWIKUr5pmBuhDLy+8KYtPYdcV8qC+pOZL+NKqYwvWSRrVXHn+ZmRRAu8vJTAznH7Oag6RVRw== dependencies: fast-deep-equal "^2.0.1" fast-json-stable-stringify "^2.0.0" json-schema-traverse "^0.4.1" uri-js "^4.2.2" -amdefine@>=0.0.4: - version "1.0.1" - resolved "https://registry.yarnpkg.com/amdefine/-/amdefine-1.0.1.tgz#4a5282ac164729e93619bcfd3ad151f817ce91f5" - integrity sha1-SlKCrBZHKek2Gbz9OtFR+BfOkfU= - -ansi-escapes@^3.2.0: +ansi-escapes@^3.0.0, ansi-escapes@^3.2.0: version "3.2.0" resolved "https://registry.yarnpkg.com/ansi-escapes/-/ansi-escapes-3.2.0.tgz#8780b98ff9dbf5638152d1f1fe5c1d7b4442976b" integrity sha512-cBhpre4ma+U0T1oM5fXg7Dy1Jw7zzwv7lt/GoCpr+hDQJoYnKVPLL4dCvSEFMmQurOQvSrwT7SL/DAlhBI97RQ== @@ -133,7 +560,7 @@ ansi-regex@^3.0.0: resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-3.0.0.tgz#ed0317c322064f79466c02966bddb605ab37d998" integrity sha1-7QMXwyIGT3lGbAKWa922Bas32Zg= -ansi-regex@^4.1.0: +ansi-regex@^4.0.0, ansi-regex@^4.1.0: version "4.1.0" resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-4.1.0.tgz#8b9f8f08cf1acb843756a839ca8c7e3168c51997" integrity sha512-1apePfXM1UOSqw0o9IiFAovVz9M5S1Dg+4TrDwfMewQ6p/rmMueb7tWZjQ1rx4Loy1ArBggoqGpfqqdI4rondg== @@ -193,20 +620,18 @@ arr-union@^3.1.0: resolved "https://registry.yarnpkg.com/arr-union/-/arr-union-3.1.0.tgz#e39b09aea9def866a8f206e288af63919bae39c4" integrity sha1-45sJrqne+Gao8gbiiK9jkZuuOcQ= -array-filter@~0.0.0: - version "0.0.1" - resolved "https://registry.yarnpkg.com/array-filter/-/array-filter-0.0.1.tgz#7da8cf2e26628ed732803581fd21f67cacd2eeec" - integrity sha1-fajPLiZijtcygDWB/SH2fKzS7uw= +array-equal@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/array-equal/-/array-equal-1.0.0.tgz#8c2a5ef2472fd9ea742b04c77a75093ba2757c93" + integrity sha1-jCpe8kcv2ep0KwTHenUJO6J1fJM= -array-map@~0.0.0: - version "0.0.0" - resolved "https://registry.yarnpkg.com/array-map/-/array-map-0.0.0.tgz#88a2bab73d1cf7bcd5c1b118a003f66f665fa662" - integrity sha1-iKK6tz0c97zVwbEYoAP2b2ZfpmI= - -array-reduce@~0.0.0: - version "0.0.0" - resolved "https://registry.yarnpkg.com/array-reduce/-/array-reduce-0.0.0.tgz#173899d3ffd1c7d9383e4479525dbe278cab5f2b" - integrity sha1-FziZ0//Rx9k4PkR5Ul2+J4yrXys= +array-includes@^3.0.3: + version "3.0.3" + resolved "https://registry.yarnpkg.com/array-includes/-/array-includes-3.0.3.tgz#184b48f62d92d7452bb31b323165c7f8bd02266d" + integrity sha1-GEtI9i2S10UrsxsyMWXH+L0CJm0= + dependencies: + define-properties "^1.1.2" + es-abstract "^1.7.0" array-union@^1.0.2: version "1.0.2" @@ -269,10 +694,10 @@ async-each@^1.0.1: resolved "https://registry.yarnpkg.com/async-each/-/async-each-1.0.3.tgz#b727dbf87d7651602f06f4d4ac387f47d91b0cbf" integrity sha512-z/WhQ5FPySLdvREByI2vZiTWwCnF0moMJ1hK9YQwDTHKh6I7/uSckMetoRGb5UBZPC1z0jlw+n/XCgjeH7y1AQ== -async@1.x: - version "1.5.2" - resolved "https://registry.yarnpkg.com/async/-/async-1.5.2.tgz#ec6a61ae56480c0c3cb241c95618e20892f9672a" - integrity sha1-7GphrlZIDAw8skHJVhjiCJL5Zyo= +async-limiter@~1.0.0: + version "1.0.1" + resolved "https://registry.yarnpkg.com/async-limiter/-/async-limiter-1.0.1.tgz#dd379e94f0db8310b08291f9d64c3209766617fd" + integrity sha512-csOlWGAcRFJaI6m+F2WKdnMKr4HhdhFVBk0H/QbJFMCr+uO2kwohwXQPxw/9OCxp05r5ghVBFSyioixx3gfkNQ== asynckit@^0.4.0: version "0.4.0" @@ -285,17 +710,17 @@ atob@^2.1.1: integrity sha512-Wm6ukoaOGJi/73p/cl2GvLjTI5JM1k/O14isD73YML8StrH/7/lRFgmg8nICZgD3bZZvjwCGxtMOD3wWNAu8cg== autoprefixer@^9.6.0: - version "9.6.1" - resolved "https://registry.yarnpkg.com/autoprefixer/-/autoprefixer-9.6.1.tgz#51967a02d2d2300bb01866c1611ec8348d355a47" - integrity sha512-aVo5WxR3VyvyJxcJC3h4FKfwCQvQWb1tSI5VHNibddCVWrcD1NvlxEweg3TSgiPztMnWfjpy2FURKA2kvDE+Tw== + version "9.6.4" + resolved "https://registry.yarnpkg.com/autoprefixer/-/autoprefixer-9.6.4.tgz#e6453be47af316b2923eaeaed87860f52ad4b7eb" + integrity sha512-Koz2cJU9dKOxG8P1f8uVaBntOv9lP4yz9ffWvWaicv9gHBPhpQB22nGijwd8gqW9CNT+UdkbQOQNLVI8jN1ZfQ== dependencies: - browserslist "^4.6.3" - caniuse-lite "^1.0.30000980" + browserslist "^4.7.0" + caniuse-lite "^1.0.30000998" chalk "^2.4.2" normalize-range "^0.1.2" num2fraction "^1.2.2" - postcss "^7.0.17" - postcss-value-parser "^4.0.0" + postcss "^7.0.18" + postcss-value-parser "^4.0.2" aws-sign2@~0.7.0: version "0.7.0" @@ -307,15 +732,53 @@ aws4@^1.8.0: resolved "https://registry.yarnpkg.com/aws4/-/aws4-1.8.0.tgz#f0e003d9ca9e7f59c7a508945d7b2ef9a04a542f" integrity sha512-ReZxvNHIOv88FlT7rxcXIIC0fPt4KZqZbOlivyWtXLt8ESx84zd3kMC6iK5jVeS2qt+g7ftS7ye4fi06X5rtRQ== +babel-jest@^24.9.0: + version "24.9.0" + resolved "https://registry.yarnpkg.com/babel-jest/-/babel-jest-24.9.0.tgz#3fc327cb8467b89d14d7bc70e315104a783ccd54" + integrity sha512-ntuddfyiN+EhMw58PTNL1ph4C9rECiQXjI4nMMBKBaNjXvqLdkXpPRcMSr4iyBrJg/+wz9brFUD6RhOAT6r4Iw== + dependencies: + "@jest/transform" "^24.9.0" + "@jest/types" "^24.9.0" + "@types/babel__core" "^7.1.0" + babel-plugin-istanbul "^5.1.0" + babel-preset-jest "^24.9.0" + chalk "^2.4.2" + slash "^2.0.0" + +babel-plugin-istanbul@^5.1.0: + version "5.2.0" + resolved "https://registry.yarnpkg.com/babel-plugin-istanbul/-/babel-plugin-istanbul-5.2.0.tgz#df4ade83d897a92df069c4d9a25cf2671293c854" + integrity sha512-5LphC0USA8t4i1zCtjbbNb6jJj/9+X6P37Qfirc/70EQ34xKlMW+a1RHGwxGI+SwWpNwZ27HqvzAobeqaXwiZw== + dependencies: + "@babel/helper-plugin-utils" "^7.0.0" + find-up "^3.0.0" + istanbul-lib-instrument "^3.3.0" + test-exclude "^5.2.3" + +babel-plugin-jest-hoist@^24.9.0: + version "24.9.0" + resolved "https://registry.yarnpkg.com/babel-plugin-jest-hoist/-/babel-plugin-jest-hoist-24.9.0.tgz#4f837091eb407e01447c8843cbec546d0002d756" + integrity sha512-2EMA2P8Vp7lG0RAzr4HXqtYwacfMErOuv1U3wrvxHX6rD1sV6xS3WXG3r8TRQ2r6w8OhvSdWt+z41hQNwNm3Xw== + dependencies: + "@types/babel__traverse" "^7.0.6" + +babel-preset-jest@^24.9.0: + version "24.9.0" + resolved "https://registry.yarnpkg.com/babel-preset-jest/-/babel-preset-jest-24.9.0.tgz#192b521e2217fb1d1f67cf73f70c336650ad3cdc" + integrity sha512-izTUuhE4TMfTRPF92fFwD2QfdXaZW08qvWTFCI51V8rW5x00UuPgc3ajRoWofXOuxjfcOM5zzSYsQS3H8KGCAg== + dependencies: + "@babel/plugin-syntax-object-rest-spread" "^7.0.0" + babel-plugin-jest-hoist "^24.9.0" + balanced-match@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/balanced-match/-/balanced-match-1.0.0.tgz#89b4d199ab2bee49de164ea02b89ce462d71b767" integrity sha1-ibTRmasr7kneFk6gK4nORi1xt2c= base64-js@^1.0.2: - version "1.3.0" - resolved "https://registry.yarnpkg.com/base64-js/-/base64-js-1.3.0.tgz#cab1e6118f051095e58b5281aea8c1cd22bfc0e3" - integrity sha512-ccav/yGvoa80BQDljCxsmmQ3Xvx60/UpBIij5QN21W3wBi/hhIC9OoO+KLpu9IJTS9j4DRVJ3aDDF9cMSoa2lw== + version "1.3.1" + resolved "https://registry.yarnpkg.com/base64-js/-/base64-js-1.3.1.tgz#58ece8cb75dd07e71ed08c736abc5fac4dbf8df1" + integrity sha512-mLQ4i2QO1ytvGWFWmcngKO//JXAQueZvwEKtjgQFM4jIK0kU+ytMfplL8j+n5mspOfjHwoAg+9yhb7BwAHm36g== base@^0.11.1: version "0.11.2" @@ -343,9 +806,9 @@ binary-extensions@^1.0.0: integrity sha512-Un7MIEDdUC5gNpcGDV97op1Ywk748MpHcFTHoYs6qnj1Z3j7I53VG3nwZhKzoBZmbdRNnb6WRdFlwl7tSDuZGw== bluebird@^3.5.0, bluebird@^3.5.x: - version "3.5.5" - resolved "https://registry.yarnpkg.com/bluebird/-/bluebird-3.5.5.tgz#a8d0afd73251effbbd5fe384a77d73003c17a71f" - integrity sha512-5am6HnnfN+urzt4yfg7IgTbotDjIT/u8AJpEt0sIU9FtXfVeezXAPKswrG+xKUCOYAINpSdgZVDU6QFh+cuH3w== + version "3.7.0" + resolved "https://registry.yarnpkg.com/bluebird/-/bluebird-3.7.0.tgz#56a6a886e03f6ae577cffedeb524f8f2450293cf" + integrity sha512-aBQ1FxIa7kSWCcmKHlcHFlT2jt6J/l4FzC7KcPELkOJOsPOb/bccdhmIrKDfXhwFrmc7vDoDrrepFvGqjyXGJg== bn.js@^4.0.0, bn.js@^4.1.0, bn.js@^4.1.1, bn.js@^4.4.0: version "4.11.8" @@ -393,7 +856,12 @@ browser-pack@^6.0.1: through2 "^2.0.0" umd "^3.0.0" -browser-resolve@^1.11.0, browser-resolve@^1.7.0: +browser-process-hrtime@^0.1.2: + version "0.1.3" + resolved "https://registry.yarnpkg.com/browser-process-hrtime/-/browser-process-hrtime-0.1.3.tgz#616f00faef1df7ec1b5bf9cfe2bdc3170f26c7b4" + integrity sha512-bRFnI4NnjO6cnyLmOV/7PVoDEMJChlcfN0z4s1YMBY989/SvlfMI1lgCnkFUs53e9gQF+w7qu7XdllSTiSl8Aw== + +browser-resolve@^1.11.0, browser-resolve@^1.11.3, browser-resolve@^1.7.0: version "1.11.3" resolved "https://registry.yarnpkg.com/browser-resolve/-/browser-resolve-1.11.3.tgz#9b7cbb3d0f510e4cb86bdbd796124d28b5890af6" integrity sha512-exDi1BYWB/6raKHmDTCicQfTkqwN5fioMFV4j8BsfMU4R2DK/QfZfK7kOVkmWCNANf0snkBzqGqAJBao9gZMdQ== @@ -464,10 +932,10 @@ browserify-zlib@~0.2.0: dependencies: pako "~1.0.5" -browserify@^16.2.3: - version "16.3.0" - resolved "https://registry.yarnpkg.com/browserify/-/browserify-16.3.0.tgz#4d414466e0b07492fff493a009ea883a9f2db230" - integrity sha512-BWaaD7alyGZVEBBwSTYx4iJF5DswIGzK17o8ai9w4iKRbYpk3EOiprRHMRRA8DCZFmFeOdx7A385w2XdFvxWmg== +browserify@^16.5.0: + version "16.5.0" + resolved "https://registry.yarnpkg.com/browserify/-/browserify-16.5.0.tgz#a1c2bc0431bec11fd29151941582e3f645ede881" + integrity sha512-6bfI3cl76YLAnCZ75AGu/XPOsqUhRyc0F/olGIJeCxtfxF2HvPKEcmjU9M8oAPxl4uBY1U7Nry33Q6koV3f2iw== dependencies: JSONStream "^1.0.3" assert "^1.4.0" @@ -506,7 +974,7 @@ browserify@^16.2.3: shasum "^1.0.0" shell-quote "^1.6.1" stream-browserify "^2.0.0" - stream-http "^2.0.0" + stream-http "^3.0.0" string_decoder "^1.1.1" subarg "^1.0.0" syntax-error "^1.1.1" @@ -518,16 +986,30 @@ browserify@^16.2.3: vm-browserify "^1.0.0" xtend "^4.0.0" -browserslist@^4.6.3: - version "4.6.4" - resolved "https://registry.yarnpkg.com/browserslist/-/browserslist-4.6.4.tgz#fd0638b3f8867fec2c604ed0ed9300379f8ec7c2" - integrity sha512-ErJT8qGfRt/VWHSr1HeqZzz50DvxHtr1fVL1m5wf20aGrG8e1ce8fpZ2EjZEfs09DDZYSvtRaDlMpWslBf8Low== +browserslist@^4.7.0: + version "4.7.0" + resolved "https://registry.yarnpkg.com/browserslist/-/browserslist-4.7.0.tgz#9ee89225ffc07db03409f2fee524dc8227458a17" + integrity sha512-9rGNDtnj+HaahxiVV38Gn8n8Lr8REKsel68v1sPFfIGEK6uSXTY3h9acgiT1dZVtOOUtifo/Dn8daDQ5dUgVsA== dependencies: - caniuse-lite "^1.0.30000981" - electron-to-chromium "^1.3.188" - node-releases "^1.1.25" + caniuse-lite "^1.0.30000989" + electron-to-chromium "^1.3.247" + node-releases "^1.1.29" -buffer-from@^1.0.0: +bs-logger@0.x: + version "0.2.6" + resolved "https://registry.yarnpkg.com/bs-logger/-/bs-logger-0.2.6.tgz#eb7d365307a72cf974cc6cda76b68354ad336bd8" + integrity sha512-pd8DCoxmbgc7hyPKOvxtqNcjYoOsABPQdcCUjGp3d42VR2CX1ORhk2A87oqqu5R1kk+76nsxZupkmyd+MVtCog== + dependencies: + fast-json-stable-stringify "2.x" + +bser@^2.0.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/bser/-/bser-2.1.0.tgz#65fc784bf7f87c009b973c12db6546902fa9c7b5" + integrity sha512-8zsjWrQkkBoLK6uxASk1nJ2SKv97ltiGDo6A3wA0/yRPz+CwmEyDo0hUrhIuukG2JHpAl3bvFIixw2/3Hi0DOg== + dependencies: + node-int64 "^0.4.0" + +buffer-from@1.x, buffer-from@^1.0.0: version "1.1.1" resolved "https://registry.yarnpkg.com/buffer-from/-/buffer-from-1.1.1.tgz#32713bc028f75c02fdb710d7c7bcec1f2c6070ef" integrity sha512-MQcXEUbCKtEo7bhqEs6560Hyd4XaovZlO/k9V3hjVUF/zwW7KBVdSK4gIt/bzwS9MbR5qob+F5jusZsb0YQK2A== @@ -538,9 +1020,9 @@ buffer-xor@^1.0.3: integrity sha1-JuYe0UIvtw3ULm42cp7VHYVf6Nk= buffer@^5.0.2: - version "5.2.1" - resolved "https://registry.yarnpkg.com/buffer/-/buffer-5.2.1.tgz#dd57fa0f109ac59c602479044dca7b8b3d0b71d6" - integrity sha512-c+Ko0loDaFfuPWiL02ls9Xd3GO3cPVmUobQ6t3rXNUk304u6hGq+8N/kFi+QEIKhzK3uwolVhLzszmfLmMLnqg== + version "5.4.3" + resolved "https://registry.yarnpkg.com/buffer/-/buffer-5.4.3.tgz#3fbc9c69eb713d323e3fc1a895eee0710c072115" + integrity sha512-zvj65TkFeIt3i6aj5bIvJDzjjQQGs4o/sNoezg1F1kYap9Nu2jcUdpwzRSJTHMMzG0H7bZkn4rNQpImhuxWX2A== dependencies: base64-js "^1.0.2" ieee754 "^1.1.4" @@ -599,15 +1081,27 @@ callsites@^3.0.0: resolved "https://registry.yarnpkg.com/callsites/-/callsites-3.1.0.tgz#b3630abd8943432f54b3f0519238e33cd7df2f73" integrity sha512-P8BjAsXvZS+VIDUI11hHCQEv74YT67YUi5JJFNWIqL235sBmjX4+qx9Muvls5ivyNENctx46xQLQ3aTuE7ssaQ== -camelcase@^5.0.0: +camelcase@^4.1.0: + version "4.1.0" + resolved "https://registry.yarnpkg.com/camelcase/-/camelcase-4.1.0.tgz#d545635be1e33c542649c69173e5de6acfae34dd" + integrity sha1-1UVjW+HjPFQmScaRc+Xeas+uNN0= + +camelcase@^5.0.0, camelcase@^5.3.1: version "5.3.1" resolved "https://registry.yarnpkg.com/camelcase/-/camelcase-5.3.1.tgz#e3c9b31569e106811df242f715725a1f4c494320" integrity sha512-L28STB170nwWS63UjtlEOE3dldQApaJXZkOI1uMFfzf3rRuPegHaHesyee+YxQ+W6SvRDQV6UrdOdRiR153wJg== -caniuse-lite@^1.0.30000980, caniuse-lite@^1.0.30000981: - version "1.0.30000983" - resolved "https://registry.yarnpkg.com/caniuse-lite/-/caniuse-lite-1.0.30000983.tgz#ab3c70061ca2a3467182a10ac75109b199b647f8" - integrity sha512-/llD1bZ6qwNkt41AsvjsmwNOoA4ZB+8iqmf5LVyeSXuBODT/hAMFNVOh84NdUzoiYiSKqo5vQ3ZzeYHSi/olDQ== +caniuse-lite@^1.0.30000989, caniuse-lite@^1.0.30000998: + version "1.0.30000999" + resolved "https://registry.yarnpkg.com/caniuse-lite/-/caniuse-lite-1.0.30000999.tgz#427253a69ad7bea4aa8d8345687b8eec51ca0e43" + integrity sha512-1CUyKyecPeksKwXZvYw0tEoaMCo/RwBlXmEtN5vVnabvO0KPd9RQLcaAuR9/1F+KDMv6esmOFWlsXuzDk+8rxg== + +capture-exit@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/capture-exit/-/capture-exit-2.0.0.tgz#fb953bfaebeb781f62898239dabb426d08a509a4" + integrity sha512-PiT/hQmTonHhl/HFGN+Lx3JJUznrVYJ3+AQsnthneZbvW7x+f08Tk7yLJTLEOUvBTbduLeeBkxEaYXUOUrRq6g== + dependencies: + rsvp "^4.8.4" caseless@~0.12.0: version "0.12.0" @@ -629,9 +1123,9 @@ chardet@^0.7.0: integrity sha512-mT8iDcrh03qDGRRmoA2hmBJnxpllMR+0/0qlzjqZES6NdiWDcZkCNAk4rPFZ9Q85r27unkiNNg8ZOiwZXBHwcA== chokidar@^2.0.0: - version "2.1.6" - resolved "https://registry.yarnpkg.com/chokidar/-/chokidar-2.1.6.tgz#b6cad653a929e244ce8a834244164d241fa954c5" - integrity sha512-V2jUo67OKkc6ySiRpJrjlpJKl9kDuG+Xb8VgsGzb+aEouhgS1D0weyPU4lEzdAcsCAvrih2J2BqyXqHWvVLw5g== + version "2.1.8" + resolved "https://registry.yarnpkg.com/chokidar/-/chokidar-2.1.8.tgz#804b3a7b6a99358c3c5c61e71d8728f041cff917" + integrity sha512-ZmZUazfOzf0Nve7duiCKD23PFSCs4JPoYyccjUFF3aQkQadqBhfzhjkwBH2mNOG9cTBwhamM37EIsIkZw3nRgg== dependencies: anymatch "^2.0.0" async-each "^1.0.1" @@ -648,9 +1142,14 @@ chokidar@^2.0.0: fsevents "^1.2.7" chownr@^1.1.1: - version "1.1.2" - resolved "https://registry.yarnpkg.com/chownr/-/chownr-1.1.2.tgz#a18f1e0b269c8a6a5d3c86eb298beb14c3dd7bf6" - integrity sha512-GkfeAQh+QNy3wquu9oIZr6SS5x7wGdSgNQvD10X3r+AZr1Oys22HW8kAmDMvNg2+Dm0TeGaEuO8gFwdBXxwO8A== + version "1.1.3" + resolved "https://registry.yarnpkg.com/chownr/-/chownr-1.1.3.tgz#42d837d5239688d55f303003a508230fa6727142" + integrity sha512-i70fVHhmV3DtTl6nqvZOnIjbY0Pe4kAUjwHj8z0zAdgBtYrJyYwLKCCuRBQ5ppkyL0AkN7HKRnETdmdp1zqNXw== + +ci-info@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/ci-info/-/ci-info-2.0.0.tgz#67a9e964be31a51e15e5010d58e6f12834002f46" + integrity sha512-5tK7EtrZ0N+OLFMthtqOj4fI2Jeb88C4CAZPu25LDVUgXJ0A3Js4PMGqrn0JU1W0Mh1/Z8wZzYPxqUrXeBboCQ== cipher-base@^1.0.0, cipher-base@^1.0.1, cipher-base@^1.0.3: version "1.0.4" @@ -707,6 +1206,20 @@ cliui@^4.0.0: strip-ansi "^4.0.0" wrap-ansi "^2.0.0" +cliui@^5.0.0: + version "5.0.0" + resolved "https://registry.yarnpkg.com/cliui/-/cliui-5.0.0.tgz#deefcfdb2e800784aa34f46fa08e06851c7bbbc5" + integrity sha512-PYeGSEmmHM6zvoef2w8TPzlrnNpXIjTipYK780YswmIP9vjxmd6Y2a3CB2Ks6/AU8NHjZugXvo8w3oWM2qnwXA== + dependencies: + string-width "^3.1.0" + strip-ansi "^5.2.0" + wrap-ansi "^5.1.0" + +co@^4.6.0: + version "4.6.0" + resolved "https://registry.yarnpkg.com/co/-/co-4.6.0.tgz#6ea6bdf3d853ae54ccb8e47bfa0bf3f9031fb184" + integrity sha1-bqa989hTrlTMuOR7+gvz+QMfsYQ= + codacy-coverage@^3.4.0: version "3.4.0" resolved "https://registry.yarnpkg.com/codacy-coverage/-/codacy-coverage-3.4.0.tgz#196af70844c4e4179718f7a7f9d96b921b4b3a67" @@ -769,10 +1282,10 @@ commander@2.15.1: resolved "https://registry.yarnpkg.com/commander/-/commander-2.15.1.tgz#df46e867d0fc2aec66a34662b406a9ccafff5b0f" integrity sha512-VlfT9F3V0v+jr4yxPc5gg9s62/fIVWsd2Bk2iD435um1NlGMYdVCq+MjcXnhYq2icNOizHr1kK+5TI6H0Hy0ag== -commander@2.x, commander@^2.x, commander@~2.20.0: - version "2.20.0" - resolved "https://registry.yarnpkg.com/commander/-/commander-2.20.0.tgz#d58bb2b5c1ee8f87b0d340027e9e94e222c5a422" - integrity sha512-7j2y+40w61zy6YC2iRNpUe/NwhNyoXrYpHMrSunaMG64nRnaf96zO/KMQR4OyN/UnE5KLyEBnKHd4aG3rskjpQ== +commander@2.x, commander@^2.20.0, commander@^2.x, commander@~2.20.0: + version "2.20.1" + resolved "https://registry.yarnpkg.com/commander/-/commander-2.20.1.tgz#3863ce3ca92d0831dcf2a102f5fb4b5926afd0f9" + integrity sha512-cCuLsMhJeWQ/ZpsFTbE765kvVfoeSddc4nU3up4fV+fDBcfUXnbITJ+JzhkdjzOqhURjZgujxaioam4RM9yGUg== component-emitter@^1.2.1: version "1.3.0" @@ -811,6 +1324,18 @@ constants-browserify@~1.0.0: resolved "https://registry.yarnpkg.com/constants-browserify/-/constants-browserify-1.0.0.tgz#c20b96d8c617748aaf1c16021760cd27fcb8cb75" integrity sha1-wguW2MYXdIqvHBYCF2DNJ/y4y3U= +contains-path@^0.1.0: + version "0.1.0" + resolved "https://registry.yarnpkg.com/contains-path/-/contains-path-0.1.0.tgz#fe8cf184ff6670b6baef01a9d4861a5cbec4120a" + integrity sha1-/ozxhP9mcLa67wGp1IYaXL7EEgo= + +convert-source-map@^1.1.0, convert-source-map@^1.4.0: + version "1.6.0" + resolved "https://registry.yarnpkg.com/convert-source-map/-/convert-source-map-1.6.0.tgz#51b537a8c43e0f04dec1993bffcdd504e758ac20" + integrity sha512-eFu7XigvxdZ1ETfbgPBohgyQ/Z++C0eEhTor0qRwBw9unw+L0/6V8wkSuGgzdThkiS5lSpdptOQPD8Ak40a+7A== + dependencies: + safe-buffer "~5.1.1" + convert-source-map@~1.1.0: version "1.1.3" resolved "https://registry.yarnpkg.com/convert-source-map/-/convert-source-map-1.1.3.tgz#4829c877e9fe49b3161f3bf3673888e204699860" @@ -895,6 +1420,18 @@ crypto-browserify@^3.0.0: randombytes "^2.0.0" randomfill "^1.0.3" +cssom@0.3.x, "cssom@>= 0.3.2 < 0.4.0": + version "0.3.8" + resolved "https://registry.yarnpkg.com/cssom/-/cssom-0.3.8.tgz#9f1276f5b2b463f2114d3f2c75250af8c1a36f4a" + integrity sha512-b0tGHbfegbhPJpxpiBPU2sCkigAqtM9O121le6bbOlgyV+NyGyCmVfJ6QW9eRjz8CpNfWEOYBIMIGRYkLwsIYg== + +cssstyle@^1.0.0: + version "1.4.0" + resolved "https://registry.yarnpkg.com/cssstyle/-/cssstyle-1.4.0.tgz#9d31328229d3c565c61e586b02041a28fccdccf1" + integrity sha512-GBrLZYZ4X4x6/QEoBnIrqb8B/f5l4+8me2dkom/j1Gtbxy0kBv6OGzKuAsGM75bkGwGAFkt56Iwg28S3XTZgSA== + dependencies: + cssom "0.3.x" + dash-ast@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/dash-ast/-/dash-ast-1.0.0.tgz#12029ba5fb2f8aa6f0a861795b23c1b4b6c27d37" @@ -907,6 +1444,15 @@ dashdash@^1.12.0: dependencies: assert-plus "^1.0.0" +data-urls@^1.0.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/data-urls/-/data-urls-1.1.0.tgz#15ee0582baa5e22bb59c77140da8f9c76963bbfe" + integrity sha512-YTWYI9se1P55u58gL5GkQHW4P6VJBJ5iBT+B5a7i2Tjadhv52paJG0qHX4A0OR6/t52odI64KP2YvFpkDOi3eQ== + dependencies: + abab "^2.0.0" + whatwg-mimetype "^2.2.0" + whatwg-url "^7.0.0" + date-now@^0.1.4: version "0.1.4" resolved "https://registry.yarnpkg.com/date-now/-/date-now-0.1.4.tgz#eaf439fd4d4848ad74e5cc7dbef200672b9e345b" @@ -919,7 +1465,7 @@ debug@3.1.0: dependencies: ms "2.0.0" -debug@^2.2.0, debug@^2.3.3: +debug@^2.2.0, debug@^2.3.3, debug@^2.6.8, debug@^2.6.9: version "2.6.9" resolved "https://registry.yarnpkg.com/debug/-/debug-2.6.9.tgz#5d128515df134ff327e90a4c93f4e077a536341f" integrity sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA== @@ -933,7 +1479,7 @@ debug@^3.2.6: dependencies: ms "^2.1.1" -debug@^4.0.1: +debug@^4.0.1, debug@^4.1.0, debug@^4.1.1: version "4.1.1" resolved "https://registry.yarnpkg.com/debug/-/debug-4.1.1.tgz#3b72260255109c6b589cee050f1d516139664791" integrity sha512-pYAIzeRo8J6KPEaJ0VWOh5Pzkbw/RetuzehGM7QRRX5he4fPHx2rdKMB256ehJCkX+XRQm16eZLqLNS8RSZXZw== @@ -960,6 +1506,13 @@ deep-is@~0.1.3: resolved "https://registry.yarnpkg.com/deep-is/-/deep-is-0.1.3.tgz#b369d6fb5dbc13eecf524f91b070feedc357cf34" integrity sha1-s2nW+128E+7PUk+RsHD+7cNXzzQ= +define-properties@^1.1.2, define-properties@^1.1.3: + version "1.1.3" + resolved "https://registry.yarnpkg.com/define-properties/-/define-properties-1.1.3.tgz#cf88da6cbee26fe6db7094f61d870cbd84cee9f1" + integrity sha512-3MqfYKj2lLzdMSf8ZIZE/V+Zuy+BgD6f164e8K2w7dgnpKArBDerGYpM46IYYcjnkdPNMjPk9A6VFB8+3SKlXQ== + dependencies: + object-keys "^1.0.12" + define-property@^0.2.5: version "0.2.5" resolved "https://registry.yarnpkg.com/define-property/-/define-property-0.2.5.tgz#c35b1ef918ec3c990f9a5bc57be04aacec5c8116" @@ -1025,6 +1578,11 @@ detect-libc@^1.0.2: resolved "https://registry.yarnpkg.com/detect-libc/-/detect-libc-1.0.3.tgz#fa137c4bd698edf55cd5cd02ac559f91a4c4ba9b" integrity sha1-+hN8S9aY7fVc1c0CrFWfkaTEups= +detect-newline@^2.1.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/detect-newline/-/detect-newline-2.1.0.tgz#f41f1c10be4b00e87b5f13da680759f2c5bfd3e2" + integrity sha1-9B8cEL5LAOh7XxPaaAdZ8sW/0+I= + detective@^5.0.2: version "5.2.0" resolved "https://registry.yarnpkg.com/detective/-/detective-5.2.0.tgz#feb2a77e85b904ecdea459ad897cc90a99bd2a7b" @@ -1034,6 +1592,11 @@ detective@^5.0.2: defined "^1.0.0" minimist "^1.1.1" +diff-sequences@^24.9.0: + version "24.9.0" + resolved "https://registry.yarnpkg.com/diff-sequences/-/diff-sequences-24.9.0.tgz#5715d6244e2aa65f48bba0bc972db0b0b11e95b5" + integrity sha512-Dj6Wk3tWyTE+Fo1rW8v0Xhwk80um6yFYKbuAxc9c3EZxIHFDYwbi34Uk42u1CdnIiVorvt4RmlSDjIPyzGC2ew== + diff@3.5.0: version "3.5.0" resolved "https://registry.yarnpkg.com/diff/-/diff-3.5.0.tgz#800c0dd1e0a8bfbc95835c202ad220fe317e5a12" @@ -1060,6 +1623,14 @@ dir-glob@^2.2.2: dependencies: path-type "^3.0.0" +doctrine@1.5.0: + version "1.5.0" + resolved "https://registry.yarnpkg.com/doctrine/-/doctrine-1.5.0.tgz#379dce730f6166f76cefa4e6707a159b02c5a6fa" + integrity sha1-N53Ocw9hZvds76TmcHoVmwLFpvo= + dependencies: + esutils "^2.0.2" + isarray "^1.0.0" + doctrine@^3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/doctrine/-/doctrine-3.0.0.tgz#addebead72a6574db783639dc87a121773973961" @@ -1072,6 +1643,13 @@ domain-browser@^1.2.0: resolved "https://registry.yarnpkg.com/domain-browser/-/domain-browser-1.2.0.tgz#3d31f50191a6749dd1375a7f522e823d42e54eda" integrity sha512-jnjyiM6eRyZl2H+W8Q/zLMA481hzi0eszAaBUzIVnmYVDBbnLxVNnfu1HgEBvCbL+71FrxMl3E6lpKH7Ge3OXA== +domexception@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/domexception/-/domexception-1.0.1.tgz#937442644ca6a31261ef36e3ec677fe805582c90" + integrity sha512-raigMkn7CJNNo6Ihro1fzG7wr3fHuYVytzquZKX5n0yizGsTcYgzdIUwj1X9pK0VvjeihV+XiclP+DjwbsSKug== + dependencies: + webidl-conversions "^4.0.2" + duplexer2@^0.1.2, duplexer2@~0.1.0, duplexer2@~0.1.2: version "0.1.4" resolved "https://registry.yarnpkg.com/duplexer2/-/duplexer2-0.1.4.tgz#8b12dab878c0d69e3e7891051662a32fc6bddcc1" @@ -1087,15 +1665,15 @@ ecc-jsbn@~0.1.1: jsbn "~0.1.0" safer-buffer "^2.1.0" -electron-to-chromium@^1.3.188: - version "1.3.190" - resolved "https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.3.190.tgz#5bf599519983bfffd9d4387817039a3ed7ca085f" - integrity sha512-cs9WnTnGBGnYYVFMCtLmr9jXNTOkdp95RLz5VhwzDn7dErg1Lnt9o4d01gEH69XlmRKWUr91Yu1hA+Hi8qW0PA== +electron-to-chromium@^1.3.247: + version "1.3.275" + resolved "https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.3.275.tgz#19a38436e34216f51820fa2f4326d5ce141fa36f" + integrity sha512-/YWtW/VapMnuYA1lNOaa1F4GhR1LBf+CUTp60lzDPEEh0XOzyOAyULyYZVF9vziZ3qSbTqCwmKwsyRXp66STbw== elliptic@^6.0.0: - version "6.5.0" - resolved "https://registry.yarnpkg.com/elliptic/-/elliptic-6.5.0.tgz#2b8ed4c891b7de3200e14412a5b8248c7af505ca" - integrity sha512-eFOJTMyCYb7xtE/caJ6JJu+bhi67WCYNbkGSknu20pmM8Ke/bqOfdnZWxyoGN26JgfxTbXrsCkEw4KheCT/KGg== + version "6.5.1" + resolved "https://registry.yarnpkg.com/elliptic/-/elliptic-6.5.1.tgz#c380f5f909bf1b9b4428d028cd18d3b0efd6b52b" + integrity sha512-xvJINNLbTeWQjrl6X+7eQCrIy/YPv5XCpKW6kB5mKvtnGILoLDcySuwomfdzt0BMdLNVnuRNTuzKNHj0bva1Cg== dependencies: bn.js "^4.4.0" brorand "^1.0.1" @@ -1111,9 +1689,9 @@ emoji-regex@^7.0.1: integrity sha512-CwBLREIQ7LvYFB0WyRvwhq5N5qPhc6PMjD6bYggFlI5YyDgl+0vxq5VHbMOFqLg7hfWzmu8T5Z1QofhmTIhItA== end-of-stream@^1.1.0: - version "1.4.1" - resolved "https://registry.yarnpkg.com/end-of-stream/-/end-of-stream-1.4.1.tgz#ed29634d19baba463b6ce6b80a37213eab71ec43" - integrity sha512-1MkrZNvWTKCaigbn+W15elq2BB/L22nqrSY5DKlo3X6+vclJm8Bb5djXJBmEX6fS3+zCh/F4VBK5Z2KxJt4s2Q== + version "1.4.4" + resolved "https://registry.yarnpkg.com/end-of-stream/-/end-of-stream-1.4.4.tgz#5ae64a5f45057baf3626ec14da0ca5e4b2431eb0" + integrity sha512-+uw1inIHVPQoaVuHzRyXd21icM+cnt4CzD5rW+NC1wjOUSTOs+Te7FOv7AhN7vS9x/oIyhLP5PR1H+phQAHu5Q== dependencies: once "^1.4.0" @@ -1122,41 +1700,145 @@ entities@^1.1.1: resolved "https://registry.yarnpkg.com/entities/-/entities-1.1.2.tgz#bdfa735299664dfafd34529ed4f8522a275fea56" integrity sha512-f2LZMYl1Fzu7YSBKg+RoROelpOaNrcGmE9AZubeDfrCEia483oW4MI4VyFd5VNHIgQ/7qm1I0wUHK1eJnn2y2w== -error-ex@^1.3.1: +error-ex@^1.2.0, error-ex@^1.3.1: version "1.3.2" resolved "https://registry.yarnpkg.com/error-ex/-/error-ex-1.3.2.tgz#b4ac40648107fdcdcfae242f428bea8a14d4f1bf" integrity sha512-7dFHNmqeFSEt2ZBsCriorKnn3Z2pj+fd9kmI6QoWw4//DL+icEBfc0U7qJCisqrTsKTjw4fNFy2pW9OqStD84g== dependencies: is-arrayish "^0.2.1" +es-abstract@^1.12.0, es-abstract@^1.5.1, es-abstract@^1.7.0: + version "1.15.0" + resolved "https://registry.yarnpkg.com/es-abstract/-/es-abstract-1.15.0.tgz#8884928ec7e40a79e3c9bc812d37d10c8b24cc57" + integrity sha512-bhkEqWJ2t2lMeaJDuk7okMkJWI/yqgH/EoGwpcvv0XW9RWQsRspI4wt6xuyuvMvvQE3gg/D9HXppgk21w78GyQ== + dependencies: + es-to-primitive "^1.2.0" + function-bind "^1.1.1" + has "^1.0.3" + has-symbols "^1.0.0" + is-callable "^1.1.4" + is-regex "^1.0.4" + object-inspect "^1.6.0" + object-keys "^1.1.1" + string.prototype.trimleft "^2.1.0" + string.prototype.trimright "^2.1.0" + +es-to-primitive@^1.2.0: + version "1.2.0" + resolved "https://registry.yarnpkg.com/es-to-primitive/-/es-to-primitive-1.2.0.tgz#edf72478033456e8dda8ef09e00ad9650707f377" + integrity sha512-qZryBOJjV//LaxLTV6UC//WewneB3LcXOL9NP++ozKVXsIIIpm/2c13UDiD9Jp2eThsecw9m3jPqDwTyobcdbg== + dependencies: + is-callable "^1.1.4" + is-date-object "^1.0.1" + is-symbol "^1.0.2" + escape-string-regexp@1.0.5, escape-string-regexp@^1.0.5: version "1.0.5" resolved "https://registry.yarnpkg.com/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz#1b61c0562190a8dff6ae3bb2cf0200ca130b86d4" integrity sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ= -escodegen@1.8.x: - version "1.8.1" - resolved "https://registry.yarnpkg.com/escodegen/-/escodegen-1.8.1.tgz#5a5b53af4693110bebb0867aa3430dd3b70a1018" - integrity sha1-WltTr0aTEQvrsIZ6o0MN07cKEBg= +escodegen@^1.9.1: + version "1.12.0" + resolved "https://registry.yarnpkg.com/escodegen/-/escodegen-1.12.0.tgz#f763daf840af172bb3a2b6dd7219c0e17f7ff541" + integrity sha512-TuA+EhsanGcme5T3R0L80u4t8CpbXQjegRmf7+FPTJrtCTErXFeelblRgHQa1FofEzqYYJmJ/OqjTwREp9qgmg== dependencies: - esprima "^2.7.1" - estraverse "^1.9.1" + esprima "^3.1.3" + estraverse "^4.2.0" esutils "^2.0.2" optionator "^0.8.1" optionalDependencies: - source-map "~0.2.0" + source-map "~0.6.1" -eslint-plugin-promise@^4.1.1: +eslint-config-prettier@6.1.0: + version "6.1.0" + resolved "https://registry.yarnpkg.com/eslint-config-prettier/-/eslint-config-prettier-6.1.0.tgz#e6f678ba367fbd1273998d5510f76f004e9dce7b" + integrity sha512-k9fny9sPjIBQ2ftFTesJV21Rg4R/7a7t7LCtZVrYQiHEp8Nnuk3EGaDmsKSAnsPj0BYcgB2zxzHa2NTkIxcOLg== + dependencies: + get-stdin "^6.0.0" + +eslint-config-standard@14.0.1: + version "14.0.1" + resolved "https://registry.yarnpkg.com/eslint-config-standard/-/eslint-config-standard-14.0.1.tgz#375c3636fb4bd453cb95321d873de12e4eef790b" + integrity sha512-1RWsAKTDTZgA8bIM6PSC9aTGDAUlKqNkYNJlTZ5xYD/HYkIM6GlcefFvgcJ8xi0SWG5203rttKYX28zW+rKNOg== + +eslint-import-resolver-node@^0.3.2: + version "0.3.2" + resolved "https://registry.yarnpkg.com/eslint-import-resolver-node/-/eslint-import-resolver-node-0.3.2.tgz#58f15fb839b8d0576ca980413476aab2472db66a" + integrity sha512-sfmTqJfPSizWu4aymbPr4Iidp5yKm8yDkHp+Ir3YiTHiiDfxh69mOUsmiqW6RZ9zRXFaF64GtYmN7e+8GHBv6Q== + dependencies: + debug "^2.6.9" + resolve "^1.5.0" + +eslint-module-utils@^2.4.0: + version "2.4.1" + resolved "https://registry.yarnpkg.com/eslint-module-utils/-/eslint-module-utils-2.4.1.tgz#7b4675875bf96b0dbf1b21977456e5bb1f5e018c" + integrity sha512-H6DOj+ejw7Tesdgbfs4jeS4YMFrT8uI8xwd1gtQqXssaR0EQ26L+2O/w6wkYFy2MymON0fTwHmXBvvfLNZVZEw== + dependencies: + debug "^2.6.8" + pkg-dir "^2.0.0" + +eslint-plugin-es@^1.4.0: + version "1.4.1" + resolved "https://registry.yarnpkg.com/eslint-plugin-es/-/eslint-plugin-es-1.4.1.tgz#12acae0f4953e76ba444bfd1b2271081ac620998" + integrity sha512-5fa/gR2yR3NxQf+UXkeLeP8FBBl6tSgdrAz1+cF84v1FMM4twGwQoqTnn+QxFLcPOrF4pdKEJKDB/q9GoyJrCA== + dependencies: + eslint-utils "^1.4.2" + regexpp "^2.0.1" + +eslint-plugin-import@2.18.2: + version "2.18.2" + resolved "https://registry.yarnpkg.com/eslint-plugin-import/-/eslint-plugin-import-2.18.2.tgz#02f1180b90b077b33d447a17a2326ceb400aceb6" + integrity sha512-5ohpsHAiUBRNaBWAF08izwUGlbrJoJJ+W9/TBwsGoR1MnlgfwMIKrFeSjWbt6moabiXW9xNvtFz+97KHRfI4HQ== + dependencies: + array-includes "^3.0.3" + contains-path "^0.1.0" + debug "^2.6.9" + doctrine "1.5.0" + eslint-import-resolver-node "^0.3.2" + eslint-module-utils "^2.4.0" + has "^1.0.3" + minimatch "^3.0.4" + object.values "^1.1.0" + read-pkg-up "^2.0.0" + resolve "^1.11.0" + +eslint-plugin-jest@22.15.2: + version "22.15.2" + resolved "https://registry.yarnpkg.com/eslint-plugin-jest/-/eslint-plugin-jest-22.15.2.tgz#e3c10d9391f787744e31566f69ebb70c3a98e398" + integrity sha512-p4NME9TgXIt+KgpxcXyNBvO30ZKxwFAO1dJZBc2OGfDnXVEtPwEyNs95GSr6RIE3xLHdjd8ngDdE2icRRXrbxg== + dependencies: + "@typescript-eslint/experimental-utils" "^1.13.0" + +eslint-plugin-node@9.1.0: + version "9.1.0" + resolved "https://registry.yarnpkg.com/eslint-plugin-node/-/eslint-plugin-node-9.1.0.tgz#f2fd88509a31ec69db6e9606d76dabc5adc1b91a" + integrity sha512-ZwQYGm6EoV2cfLpE1wxJWsfnKUIXfM/KM09/TlorkukgCAwmkgajEJnPCmyzoFPQQkmvo5DrW/nyKutNIw36Mw== + dependencies: + eslint-plugin-es "^1.4.0" + eslint-utils "^1.3.1" + ignore "^5.1.1" + minimatch "^3.0.4" + resolve "^1.10.1" + semver "^6.1.0" + +eslint-plugin-prettier@3.1.0: + version "3.1.0" + resolved "https://registry.yarnpkg.com/eslint-plugin-prettier/-/eslint-plugin-prettier-3.1.0.tgz#8695188f95daa93b0dc54b249347ca3b79c4686d" + integrity sha512-XWX2yVuwVNLOUhQijAkXz+rMPPoCr7WFiAl8ig6I7Xn+pPVhDhzg4DxHpmbeb0iqjO9UronEA3Tb09ChnFVHHA== + dependencies: + prettier-linter-helpers "^1.0.0" + +eslint-plugin-promise@^4.2.1: version "4.2.1" resolved "https://registry.yarnpkg.com/eslint-plugin-promise/-/eslint-plugin-promise-4.2.1.tgz#845fd8b2260ad8f82564c1222fce44ad71d9418a" integrity sha512-VoM09vT7bfA7D+upt+FjeBO5eHIJQBUWki1aPvB+vbNiHS3+oGIJGIeyBtKQTME6UPXXy3vV07OL1tHd3ANuDw== -eslint-plugin-standard@^4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/eslint-plugin-standard/-/eslint-plugin-standard-4.0.0.tgz#f845b45109c99cd90e77796940a344546c8f6b5c" - integrity sha512-OwxJkR6TQiYMmt1EsNRMe5qG3GsbjlcOhbGUBY4LtavF9DsLaTcoR+j2Tdjqi23oUwKNUqX7qcn5fPStafMdlA== +eslint-plugin-standard@^4.0.1: + version "4.0.1" + resolved "https://registry.yarnpkg.com/eslint-plugin-standard/-/eslint-plugin-standard-4.0.1.tgz#ff0519f7ffaff114f76d1bd7c3996eef0f6e20b4" + integrity sha512-v/KBnfyaOMPmZc/dmc6ozOdWqekGp7bBGq4jLAecEfPGmfKiWS4sA8sC0LqiV9w5qmXAtXVn4M3p1jSyhY85SQ== -eslint-scope@^4.0.3: +eslint-scope@^4.0.0: version "4.0.3" resolved "https://registry.yarnpkg.com/eslint-scope/-/eslint-scope-4.0.3.tgz#ca03833310f6889a3264781aa82e63eb9cfe7848" integrity sha512-p7VutNr1O/QrxysMo3E45FjYDTeXBy0iTltPFNSqKAIfjDSXC+4dj+qfyuD8bfAXrW/y6lW3O76VaYNPKfpKrg== @@ -1164,73 +1846,82 @@ eslint-scope@^4.0.3: esrecurse "^4.1.0" estraverse "^4.1.1" -eslint-utils@^1.3.1: +eslint-scope@^5.0.0: + version "5.0.0" + resolved "https://registry.yarnpkg.com/eslint-scope/-/eslint-scope-5.0.0.tgz#e87c8887c73e8d1ec84f1ca591645c358bfc8fb9" + integrity sha512-oYrhJW7S0bxAFDvWqzvMPRm6pcgcnWc4QnofCAqRTRfQC0JcwenzGglTtsLyIuuWFfkqDG9vz67cnttSd53djw== + dependencies: + esrecurse "^4.1.0" + estraverse "^4.1.1" + +eslint-utils@^1.3.1, eslint-utils@^1.4.0, eslint-utils@^1.4.2: version "1.4.2" resolved "https://registry.yarnpkg.com/eslint-utils/-/eslint-utils-1.4.2.tgz#166a5180ef6ab7eb462f162fd0e6f2463d7309ab" integrity sha512-eAZS2sEUMlIeCjBeubdj45dmBHQwPHWyBcT1VSYB7o9x9WRRqKxyUoiXlRjyAwzN7YEzHJlYg0NmzDRWx6GP4Q== dependencies: eslint-visitor-keys "^1.0.0" -eslint-visitor-keys@^1.0.0: +eslint-visitor-keys@^1.0.0, eslint-visitor-keys@^1.1.0: version "1.1.0" resolved "https://registry.yarnpkg.com/eslint-visitor-keys/-/eslint-visitor-keys-1.1.0.tgz#e2a82cea84ff246ad6fb57f9bde5b46621459ec2" integrity sha512-8y9YjtM1JBJU/A9Kc+SbaOV4y29sSWckBwMHa+FGtVj5gN/sbnKDf6xJUl+8g7FAij9LVaP8C24DUiH/f/2Z9A== -eslint@^5.16.0: - version "5.16.0" - resolved "https://registry.yarnpkg.com/eslint/-/eslint-5.16.0.tgz#a1e3ac1aae4a3fbd8296fcf8f7ab7314cbb6abea" - integrity sha512-S3Rz11i7c8AA5JPv7xAH+dOyq/Cu/VXHiHXBPOU1k/JAM5dXqQPt3qcrhpHSorXmrpu2g0gkIBVXAqCpzfoZIg== +eslint@6.2.2: + version "6.2.2" + resolved "https://registry.yarnpkg.com/eslint/-/eslint-6.2.2.tgz#03298280e7750d81fcd31431f3d333e43d93f24f" + integrity sha512-mf0elOkxHbdyGX1IJEUsNBzCDdyoUgljF3rRlgfyYh0pwGnreLc0jjD6ZuleOibjmnUWZLY2eXwSooeOgGJ2jw== dependencies: "@babel/code-frame" "^7.0.0" - ajv "^6.9.1" + ajv "^6.10.0" chalk "^2.1.0" cross-spawn "^6.0.5" debug "^4.0.1" doctrine "^3.0.0" - eslint-scope "^4.0.3" - eslint-utils "^1.3.1" - eslint-visitor-keys "^1.0.0" - espree "^5.0.1" + eslint-scope "^5.0.0" + eslint-utils "^1.4.2" + eslint-visitor-keys "^1.1.0" + espree "^6.1.1" esquery "^1.0.1" esutils "^2.0.2" file-entry-cache "^5.0.1" functional-red-black-tree "^1.0.1" - glob "^7.1.2" + glob-parent "^5.0.0" globals "^11.7.0" ignore "^4.0.6" import-fresh "^3.0.0" imurmurhash "^0.1.4" - inquirer "^6.2.2" - js-yaml "^3.13.0" + inquirer "^6.4.1" + is-glob "^4.0.0" + js-yaml "^3.13.1" json-stable-stringify-without-jsonify "^1.0.1" levn "^0.3.0" - lodash "^4.17.11" + lodash "^4.17.14" minimatch "^3.0.4" mkdirp "^0.5.1" natural-compare "^1.4.0" optionator "^0.8.2" - path-is-inside "^1.0.2" progress "^2.0.0" regexpp "^2.0.1" - semver "^5.5.1" - strip-ansi "^4.0.0" - strip-json-comments "^2.0.1" + semver "^6.1.2" + strip-ansi "^5.2.0" + strip-json-comments "^3.0.1" table "^5.2.3" text-table "^0.2.0" + v8-compile-cache "^2.0.3" -espree@^5.0.1: - version "5.0.1" - resolved "https://registry.yarnpkg.com/espree/-/espree-5.0.1.tgz#5d6526fa4fc7f0788a5cf75b15f30323e2f81f7a" - integrity sha512-qWAZcWh4XE/RwzLJejfcofscgMc9CamR6Tn1+XRXNzrvUSSbiAjGOI/fggztjIi7y9VLPqnICMIPiGyr8JaZ0A== +espree@^6.1.1: + version "6.1.1" + resolved "https://registry.yarnpkg.com/espree/-/espree-6.1.1.tgz#7f80e5f7257fc47db450022d723e356daeb1e5de" + integrity sha512-EYbr8XZUhWbYCqQRW0duU5LxzL5bETN6AjKBGy1302qqzPaCH10QbRg3Wvco79Z8x9WbiE8HYB4e75xl6qUYvQ== dependencies: - acorn "^6.0.7" - acorn-jsx "^5.0.0" - eslint-visitor-keys "^1.0.0" + acorn "^7.0.0" + acorn-jsx "^5.0.2" + eslint-visitor-keys "^1.1.0" -esprima@2.7.x, esprima@^2.7.1: - version "2.7.3" - resolved "https://registry.yarnpkg.com/esprima/-/esprima-2.7.3.tgz#96e3b70d5779f6ad49cd032673d1c312767ba581" - integrity sha1-luO3DVd59q1JzQMmc9HDEnZ7pYE= +esprima@^3.1.3: + version "3.1.3" + resolved "https://registry.yarnpkg.com/esprima/-/esprima-3.1.3.tgz#fdca51cee6133895e3c88d535ce49dbff62a4633" + integrity sha1-/cpRzuYTOJXjyI1TXOSdv/YqRjM= esprima@^4.0.0: version "4.0.1" @@ -1251,20 +1942,15 @@ esrecurse@^4.1.0: dependencies: estraverse "^4.1.0" -estraverse@^1.9.1: - version "1.9.3" - resolved "https://registry.yarnpkg.com/estraverse/-/estraverse-1.9.3.tgz#af67f2dc922582415950926091a4005d29c9bb44" - integrity sha1-r2fy3JIlgkFZUJJgkaQAXSnJu0Q= - -estraverse@^4.0.0, estraverse@^4.1.0, estraverse@^4.1.1: - version "4.2.0" - resolved "https://registry.yarnpkg.com/estraverse/-/estraverse-4.2.0.tgz#0dee3fed31fcd469618ce7342099fc1afa0bdb13" - integrity sha1-De4/7TH81GlhjOc0IJn8GvoL2xM= +estraverse@^4.0.0, estraverse@^4.1.0, estraverse@^4.1.1, estraverse@^4.2.0: + version "4.3.0" + resolved "https://registry.yarnpkg.com/estraverse/-/estraverse-4.3.0.tgz#398ad3f3c5a24948be7725e83d11a7de28cdbd1d" + integrity sha512-39nnKffWz8xN1BU/2c79n9nB9HDzo0niYUqx6xyqUnyoAnQyyWpOTdZEeiCch8BBu515t4wp9ZmgVfVhn9EBpw== esutils@^2.0.2: - version "2.0.2" - resolved "https://registry.yarnpkg.com/esutils/-/esutils-2.0.2.tgz#0abf4f1caa5bcb1f7a9d8acc6dea4faaa04bac9b" - integrity sha1-Cr9PHKpbyx96nYrMbepPqqBLrJs= + version "2.0.3" + resolved "https://registry.yarnpkg.com/esutils/-/esutils-2.0.3.tgz#74d2eb4de0b8da1293711910d50775b9b710ef64" + integrity sha512-kVscqXk4OCp68SZ0dkgEKVi6/8ij300KBWTJq32P/dYeWTSwK41WyTxalN1eRmA5Z9UU/LX9D7FWSmV9SAYx6g== events@^2.0.0: version "2.1.0" @@ -1279,6 +1965,11 @@ evp_bytestokey@^1.0.0, evp_bytestokey@^1.0.3: md5.js "^1.3.4" safe-buffer "^5.1.1" +exec-sh@^0.3.2: + version "0.3.2" + resolved "https://registry.yarnpkg.com/exec-sh/-/exec-sh-0.3.2.tgz#6738de2eb7c8e671d0366aea0b0db8c6f7d7391b" + integrity sha512-9sLAvzhI5nc8TpuQUh4ahMdCrWT00wPWz7j47/emR5+2qEfoZP5zzUXvx+vdx+H6ohhnsYC31iX04QLYJK8zTg== + execa@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/execa/-/execa-1.0.0.tgz#c6236a5bb4df6d6f15e88e7f017798216749ddd8" @@ -1292,6 +1983,11 @@ execa@^1.0.0: signal-exit "^3.0.0" strip-eof "^1.0.0" +exit@^0.1.2: + version "0.1.2" + resolved "https://registry.yarnpkg.com/exit/-/exit-0.1.2.tgz#0632638f8d877cc82107d30a0fff1a17cba1cd0c" + integrity sha1-BjJjj42HfMghB9MKD/8aF8uhzQw= + expand-brackets@^2.1.4: version "2.1.4" resolved "https://registry.yarnpkg.com/expand-brackets/-/expand-brackets-2.1.4.tgz#b77735e315ce30f6b6eff0f83b04151a22449622" @@ -1305,6 +2001,18 @@ expand-brackets@^2.1.4: snapdragon "^0.8.1" to-regex "^3.0.1" +expect@^24.9.0: + version "24.9.0" + resolved "https://registry.yarnpkg.com/expect/-/expect-24.9.0.tgz#b75165b4817074fa4a157794f46fe9f1ba15b6ca" + integrity sha512-wvVAx8XIol3Z5m9zvZXiyZOQ+sRJqNTIm6sGjdWlaZIeupQGO3WbYI+15D/AmEwZywL6wtJkbAbJtzkOfBuR0Q== + dependencies: + "@jest/types" "^24.9.0" + ansi-styles "^3.2.0" + jest-get-type "^24.9.0" + jest-matcher-utils "^24.9.0" + jest-message-util "^24.9.0" + jest-regex-util "^24.9.0" + extend-shallow@^2.0.1: version "2.0.1" resolved "https://registry.yarnpkg.com/extend-shallow/-/extend-shallow-2.0.1.tgz#51af7d614ad9a9f610ea1bafbb989d6b1c56890f" @@ -1363,6 +2071,11 @@ fast-deep-equal@^2.0.1: resolved "https://registry.yarnpkg.com/fast-deep-equal/-/fast-deep-equal-2.0.1.tgz#7b05218ddf9667bf7f370bf7fdb2cb15fdd0aa49" integrity sha1-ewUhjd+WZ79/Nwv3/bLLFf3Qqkk= +fast-diff@^1.1.2: + version "1.2.0" + resolved "https://registry.yarnpkg.com/fast-diff/-/fast-diff-1.2.0.tgz#73ee11982d86caaf7959828d519cfe927fac5f03" + integrity sha512-xJuoT5+L99XlZ8twedaRf6Ax2TgQVxvgZOYoPKqZufmJib0tL2tegPBOZb1pVNgIhlqDlA0eO0c3wBvQcmzx4w== + fast-glob@^2.2.6: version "2.2.7" resolved "https://registry.yarnpkg.com/fast-glob/-/fast-glob-2.2.7.tgz#6953857c3afa475fff92ee6015d52da70a4cd39d" @@ -1383,7 +2096,7 @@ fast-html-parser@^1.0.1: apollojs "^1.3.0" entities "^1.1.1" -fast-json-stable-stringify@^2.0.0: +fast-json-stable-stringify@2.x, fast-json-stable-stringify@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/fast-json-stable-stringify/-/fast-json-stable-stringify-2.0.0.tgz#d5142c0caee6b1189f87d3a76111064f86c8bbf2" integrity sha1-1RQsDK7msRifh9OnYREGT4bIu/I= @@ -1393,6 +2106,13 @@ fast-levenshtein@~2.0.4: resolved "https://registry.yarnpkg.com/fast-levenshtein/-/fast-levenshtein-2.0.6.tgz#3d8a5c66883a16a30ca8643e851f19baa7797917" integrity sha1-PYpcZog6FqMMqGQ+hR8Zuqd5eRc= +fb-watchman@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/fb-watchman/-/fb-watchman-2.0.0.tgz#54e9abf7dfa2f26cd9b1636c588c1afc05de5d58" + integrity sha1-VOmr99+i8mzZsWNsWIwa/AXeXVg= + dependencies: + bser "^2.0.0" + figures@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/figures/-/figures-2.0.0.tgz#3ab1a2d2a62c8bfb431a0c94cb797a2fce27c962" @@ -1417,6 +2137,13 @@ fill-range@^4.0.0: repeat-string "^1.6.1" to-regex-range "^2.1.0" +find-up@^2.0.0, find-up@^2.1.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/find-up/-/find-up-2.1.0.tgz#45d1b7e506c717ddd482775a2b77920a3c0c57a7" + integrity sha1-RdG35QbHF93UgndaK3eSCjwMV6c= + dependencies: + locate-path "^2.0.0" + find-up@^3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/find-up/-/find-up-3.0.0.tgz#49169f1d7993430646da61ecc5ae355c21c97b73" @@ -1474,11 +2201,11 @@ fs-extra@^7.0.0: universalify "^0.1.0" fs-minipass@^1.2.5: - version "1.2.6" - resolved "https://registry.yarnpkg.com/fs-minipass/-/fs-minipass-1.2.6.tgz#2c5cc30ded81282bfe8a0d7c7c1853ddeb102c07" - integrity sha512-crhvyXcMejjv3Z5d2Fa9sf5xLYVCF5O1c71QxbVnbLsmYMBEvDAftewesN/HhY03YRoA7zOMxjNGrF5svGaaeQ== + version "1.2.7" + resolved "https://registry.yarnpkg.com/fs-minipass/-/fs-minipass-1.2.7.tgz#ccff8570841e7fe4265693da88936c55aed7f7c7" + integrity sha512-GWSSJGFy4e9GUeCcbIkED+bgAoFyj7XF1mV8rma3QW4NIqX9Kyx79N/PF61H5udOV3aY1IaMLs6pGbH71nlCTA== dependencies: - minipass "^2.2.1" + minipass "^2.6.0" fs.realpath@^1.0.0: version "1.0.0" @@ -1527,6 +2254,11 @@ get-caller-file@^1.0.1: resolved "https://registry.yarnpkg.com/get-caller-file/-/get-caller-file-1.0.3.tgz#f978fa4c90d1dfe7ff2d6beda2a515e713bdcf4a" integrity sha512-3t6rVToeoZfYSGd8YoLFR2DJkiQrIiUrGcjvFX2mDw3bn6k2OtwHN0TNCLbBO+w8qTvimhDkv+LSscbJY1vE6w== +get-caller-file@^2.0.1: + version "2.0.5" + resolved "https://registry.yarnpkg.com/get-caller-file/-/get-caller-file-2.0.5.tgz#4f94412a82db32f36e3b0b9741f8a97feb031f7e" + integrity sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg== + get-stdin@^6.0.0: version "6.0.0" resolved "https://registry.yarnpkg.com/get-stdin/-/get-stdin-6.0.0.tgz#9e09bf712b360ab9225e812048f71fde9c89657b" @@ -1559,6 +2291,13 @@ glob-parent@^3.1.0: is-glob "^3.1.0" path-dirname "^1.0.0" +glob-parent@^5.0.0: + version "5.1.0" + resolved "https://registry.yarnpkg.com/glob-parent/-/glob-parent-5.1.0.tgz#5f4c1d1e748d30cd73ad2944b3577a81b081e8c2" + integrity sha512-qjtRgnIVmOfnKUE3NJAQEdk+lKrxfw8t5ke7SXtfMTHcjsBfOfWXCQfdb30zfDoZQ2IRSIiidmjtbHZPZ++Ihw== + dependencies: + is-glob "^4.0.1" + glob-to-regexp@^0.3.0: version "0.3.0" resolved "https://registry.yarnpkg.com/glob-to-regexp/-/glob-to-regexp-0.3.0.tgz#8c5a1494d2066c570cc3bfe4496175acc4d502ab" @@ -1576,7 +2315,7 @@ glob@7.1.2: once "^1.3.0" path-is-absolute "^1.0.0" -glob@7.x, glob@^7.1.0, glob@^7.1.2, glob@^7.1.3: +glob@7.x, glob@^7.1.0, glob@^7.1.1, glob@^7.1.2, glob@^7.1.3: version "7.1.4" resolved "https://registry.yarnpkg.com/glob/-/glob-7.1.4.tgz#aa608a2f6c577ad357e1ae5a5c26d9a8d1969255" integrity sha512-hkLPepehmnKk41pUGm3sYxoFs/umurYfYJCerbXEyFIWcAzvpipAgVkBqqT9RBKMGjnq6kMuyYwha6csxbiM1A== @@ -1588,18 +2327,7 @@ glob@7.x, glob@^7.1.0, glob@^7.1.2, glob@^7.1.3: once "^1.3.0" path-is-absolute "^1.0.0" -glob@^5.0.15: - version "5.0.15" - resolved "https://registry.yarnpkg.com/glob/-/glob-5.0.15.tgz#1bc936b9e02f4a603fcc222ecf7633d30b8b93b1" - integrity sha1-G8k2ueAvSmA/zCIuz3Yz0wuLk7E= - dependencies: - inflight "^1.0.4" - inherits "2" - minimatch "2 || 3" - once "^1.3.0" - path-is-absolute "^1.0.0" - -globals@^11.7.0: +globals@^11.1.0, globals@^11.7.0: version "11.12.0" resolved "https://registry.yarnpkg.com/globals/-/globals-11.12.0.tgz#ab8795338868a0babd8525758018c2a7eb95c42e" integrity sha512-WOBp/EEGUiIsJSp7wcv/y6MO+lV9UoncWqxuFfm8eBwzWNgyfBd6Gz+IeKQ9jCmyhoH99g15M3T+QaVHFjizVA== @@ -1618,20 +2346,25 @@ globby@^9.0.0: pify "^4.0.1" slash "^2.0.0" -graceful-fs@^4.1.11, graceful-fs@^4.1.2, graceful-fs@^4.1.6: - version "4.2.0" - resolved "https://registry.yarnpkg.com/graceful-fs/-/graceful-fs-4.2.0.tgz#8d8fdc73977cb04104721cb53666c1ca64cd328b" - integrity sha512-jpSvDPV4Cq/bgtpndIWbI5hmYxhQGHPC4d4cqBPb4DLniCfhJokdXhwhaDuLBGLQdvvRum/UiX6ECVIPvDXqdg== +graceful-fs@^4.1.11, graceful-fs@^4.1.15, graceful-fs@^4.1.2, graceful-fs@^4.1.6: + version "4.2.2" + resolved "https://registry.yarnpkg.com/graceful-fs/-/graceful-fs-4.2.2.tgz#6f0952605d0140c1cfdb138ed005775b92d67b02" + integrity sha512-IItsdsea19BoLC7ELy13q1iJFNmd7ofZH5+X/pJr90/nRoPEX0DJo1dHDbgtYWOhJhcCgMDTOw84RZ72q6lB+Q== growl@1.10.5: version "1.10.5" resolved "https://registry.yarnpkg.com/growl/-/growl-1.10.5.tgz#f2735dc2283674fa67478b10181059355c369e5e" integrity sha512-qBr4OuELkhPenW6goKVXiv47US3clb3/IbuWF9KNKEijAy9oeHxU9IgzjvJhHkUzhaj7rOUD7+YGWqUjLp5oSA== -handlebars@^4.0.1: - version "4.1.2" - resolved "https://registry.yarnpkg.com/handlebars/-/handlebars-4.1.2.tgz#b6b37c1ced0306b221e094fc7aca3ec23b131b67" - integrity sha512-nvfrjqvt9xQ8Z/w0ijewdD/vvWDTOweBUm96NTr66Wfvo1mJenBLwcYmPs3TIBP5ruzYGD7Hx/DaM9RmhroGPw== +growly@^1.3.0: + version "1.3.0" + resolved "https://registry.yarnpkg.com/growly/-/growly-1.3.0.tgz#f10748cbe76af964b7c96c93c6bcc28af120c081" + integrity sha1-8QdIy+dq+WS3yWyTxrzCivEgwIE= + +handlebars@^4.1.2: + version "4.4.2" + resolved "https://registry.yarnpkg.com/handlebars/-/handlebars-4.4.2.tgz#8810a9821a9d6d52cb2f57d326d6ce7c3dfe741d" + integrity sha512-cIv17+GhL8pHHnRJzGu2wwcthL5sb8uDKBHvZ2Dtu5s1YNt0ljbzKbamnc+gr69y7bzwQiBdr5+hOpRd5pnOdg== dependencies: neo-async "^2.6.0" optimist "^0.6.1" @@ -1652,16 +2385,16 @@ har-validator@~5.1.0: ajv "^6.5.5" har-schema "^2.0.0" -has-flag@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/has-flag/-/has-flag-1.0.0.tgz#9d9e793165ce017a00f00418c43f942a7b1d11fa" - integrity sha1-nZ55MWXOAXoA8AQYxD+UKnsdEfo= - has-flag@^3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/has-flag/-/has-flag-3.0.0.tgz#b5d454dc2199ae225699f3467e5a07f3b955bafd" integrity sha1-tdRU3CGZriJWmfNGfloH87lVuv0= +has-symbols@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/has-symbols/-/has-symbols-1.0.0.tgz#ba1a8f1af2a0fc39650f5c850367704122063b44" + integrity sha1-uhqPGvKg/DllD1yFA2dwQSIGO0Q= + has-unicode@^2.0.0: version "2.0.1" resolved "https://registry.yarnpkg.com/has-unicode/-/has-unicode-2.0.1.tgz#e0e6fe6a28cf51138855e086d1691e771de2a8b9" @@ -1698,7 +2431,7 @@ has-values@^1.0.0: is-number "^3.0.0" kind-of "^4.0.0" -has@^1.0.0: +has@^1.0.0, has@^1.0.1, has@^1.0.3: version "1.0.3" resolved "https://registry.yarnpkg.com/has/-/has-1.0.3.tgz#722d7cbfc1f6aa8241f16dd814e011e1f41e8796" integrity sha512-f2dvO0VU6Oej7RkWJGrehjbzMAjFp5/VKPp5tTpWIV4JHHZK1/BxbFRtf/siA2SWTe09caDmVtYYzWEIbBS4zw== @@ -1753,6 +2486,18 @@ hogan.js@^3.0.2: mkdirp "0.3.0" nopt "1.0.10" +hosted-git-info@^2.1.4: + version "2.8.4" + resolved "https://registry.yarnpkg.com/hosted-git-info/-/hosted-git-info-2.8.4.tgz#44119abaf4bc64692a16ace34700fed9c03e2546" + integrity sha512-pzXIvANXEFrc5oFFXRMkbLPQ2rXRoDERwDLyrcUxGhaZhgP54BBSl9Oheh7Vv0T090cszWBxPjkQQ5Sq1PbBRQ== + +html-encoding-sniffer@^1.0.2: + version "1.0.2" + resolved "https://registry.yarnpkg.com/html-encoding-sniffer/-/html-encoding-sniffer-1.0.2.tgz#e70d84b94da53aa375e11fe3a351be6642ca46f8" + integrity sha512-71lZziiDnsuabfdYiUeWdCVyKuqwWi23L8YeIgV9jSSZHCtb6wB1BKWooH7L3tn4/FuZJMVWyNaIDr4RGmaSYw== + dependencies: + whatwg-encoding "^1.0.1" + htmlescape@^1.1.0: version "1.1.1" resolved "https://registry.yarnpkg.com/htmlescape/-/htmlescape-1.1.1.tgz#3a03edc2214bca3b66424a3e7959349509cb0351" @@ -1772,7 +2517,7 @@ https-browserify@^1.0.0: resolved "https://registry.yarnpkg.com/https-browserify/-/https-browserify-1.0.0.tgz#ec06c10e0a34c0f2faf199f7fd7fc78fffd03c73" integrity sha1-7AbBDgo0wPL68Zn3/X/Hj//QPHM= -iconv-lite@^0.4.24, iconv-lite@^0.4.4: +iconv-lite@0.4.24, iconv-lite@^0.4.24, iconv-lite@^0.4.4: version "0.4.24" resolved "https://registry.yarnpkg.com/iconv-lite/-/iconv-lite-0.4.24.tgz#2022b4b25fbddc21d2f524974a474aafe733908b" integrity sha512-v3MXnZAcvnywkTUEZomIActle7RXXeedOR31wwl7VlyoXO4Qi9arvSenNQWne1TcRwhCL1HwLI21bEqdpj8/rA== @@ -1785,9 +2530,9 @@ ieee754@^1.1.4: integrity sha512-4vf7I2LYV/HaWerSo3XmlMkp5eZ83i+/CDluXi/IGTs/O1sejBNhTtnxzmRZfvOUqj7lZjqHkeTvpgSFDlWZTg== ignore-walk@^3.0.1: - version "3.0.1" - resolved "https://registry.yarnpkg.com/ignore-walk/-/ignore-walk-3.0.1.tgz#a83e62e7d272ac0e3b551aaa82831a19b69f82f8" - integrity sha512-DTVlMx3IYPe0/JJcYP7Gxg7ttZZu3IInhuEhbchuqneY9wWe5Ojy2mXLBaQFUQmo0AW2r3qG7m1mg86js+gnlQ== + version "3.0.2" + resolved "https://registry.yarnpkg.com/ignore-walk/-/ignore-walk-3.0.2.tgz#99d83a246c196ea5c93ef9315ad7b0819c35069b" + integrity sha512-EXyErtpHbn75ZTsOADsfx6J/FPo6/5cjev46PXrcTpd8z3BoRkXgYu9/JVqrI7tusjmwCZutGeRJeU0Wo1e4Cw== dependencies: minimatch "^3.0.4" @@ -1796,6 +2541,11 @@ ignore@^4.0.3, ignore@^4.0.6: resolved "https://registry.yarnpkg.com/ignore/-/ignore-4.0.6.tgz#750e3db5862087b4737ebac8207ffd1ef27b25fc" integrity sha512-cyFDKrqc/YdcWFniJhzI42+AzS+gNwmUzOSFcRCQYwySuBBBy/KjuxWLZ/FHEH6Moq1NizMOBWyTcv8O4OZIMg== +ignore@^5.1.1: + version "5.1.4" + resolved "https://registry.yarnpkg.com/ignore/-/ignore-5.1.4.tgz#84b7b3dbe64552b6ef0eca99f6743dbec6d97adf" + integrity sha512-MzbUSahkTW1u7JpKKjY7LCARd1fU5W2rLdxlM4kdkayuCwZImjkpluF9CM1aLewYJguPDqewLam18Y6AU69A8A== + import-cwd@^2.0.0: version "2.1.0" resolved "https://registry.yarnpkg.com/import-cwd/-/import-cwd-2.1.0.tgz#aa6cf36e722761285cb371ec6519f53e2435b0a9" @@ -1826,6 +2576,14 @@ import-from@^2.1.0: dependencies: resolve-from "^3.0.0" +import-local@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/import-local/-/import-local-2.0.0.tgz#55070be38a5993cf18ef6db7e961f5bee5c5a09d" + integrity sha512-b6s04m3O+s3CGSbqDIyP4R6aAwAeYlVq9+WUWep6iHa8ETRf9yei1U48C5MmfJmV9AiLYYBKPMq/W+/WRpQmCQ== + dependencies: + pkg-dir "^3.0.0" + resolve-cwd "^2.0.0" + imurmurhash@^0.1.4: version "0.1.4" resolved "https://registry.yarnpkg.com/imurmurhash/-/imurmurhash-0.1.4.tgz#9218b9b2b928a238b13dc4fb6b6d576f231453ea" @@ -1866,10 +2624,10 @@ inline-source-map@~0.6.0: dependencies: source-map "~0.5.3" -inquirer@^6.2.2: - version "6.5.0" - resolved "https://registry.yarnpkg.com/inquirer/-/inquirer-6.5.0.tgz#2303317efc9a4ea7ec2e2df6f86569b734accf42" - integrity sha512-scfHejeG/lVZSpvCXpsB4j/wQNPM5JC8kiElOI0OUTwmc1RTpXr4H32/HOlQHcZiYl2z2VElwuCVDRG8vFmbnA== +inquirer@^6.4.1: + version "6.5.2" + resolved "https://registry.yarnpkg.com/inquirer/-/inquirer-6.5.2.tgz#ad50942375d036d327ff528c08bd5fab089928ca" + integrity sha512-cntlB5ghuB0iuO65Ovoi8ogLHiWGs/5yNrtUcKjFhSSiVeAIVpD7koaSU9RM8mpXw5YDi9RdYXGQMaOURB7ycQ== dependencies: ansi-escapes "^3.2.0" chalk "^2.4.2" @@ -1901,6 +2659,13 @@ insert-module-globals@^7.0.0: undeclared-identifiers "^1.1.2" xtend "^4.0.0" +invariant@^2.2.4: + version "2.2.4" + resolved "https://registry.yarnpkg.com/invariant/-/invariant-2.2.4.tgz#610f3c92c9359ce1db616e538008d23ff35158e6" + integrity sha512-phJfQVBuaJM5raOpJjSfkiD6BpbCE4Ns//LaXl6wGYtUBY83nWS6Rf9tXm2e8VaK60JEjYldbPif/A2B1C2gNA== + dependencies: + loose-envify "^1.0.0" + invert-kv@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/invert-kv/-/invert-kv-2.0.0.tgz#7393f5afa59ec9ff5f67a27620d11c226e3eec02" @@ -1937,6 +2702,18 @@ is-buffer@^1.1.0, is-buffer@^1.1.5: resolved "https://registry.yarnpkg.com/is-buffer/-/is-buffer-1.1.6.tgz#efaa2ea9daa0d7ab2ea13a97b2b8ad51fefbe8be" integrity sha512-NcdALwpXkTm5Zvvbk7owOUSvVvBKDgKP5/ewfXEznmQFfs4ZRmanOeKBTjRVjka3QFoN6XJ+9F3USqfHqTaU5w== +is-callable@^1.1.4: + version "1.1.4" + resolved "https://registry.yarnpkg.com/is-callable/-/is-callable-1.1.4.tgz#1e1adf219e1eeb684d691f9d6a05ff0d30a24d75" + integrity sha512-r5p9sxJjYnArLjObpjA4xu5EKI3CuKHkJXMhT7kwbpUyIFD1n5PMAsoPvWnvtZiNz7LjkYDRZhd7FlI0eMijEA== + +is-ci@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/is-ci/-/is-ci-2.0.0.tgz#6bc6334181810e04b5c22b3d589fdca55026404c" + integrity sha512-YfJT7rkpQB0updsdHLGWrvhBJfcfzNNawYDNIyQXJz0IViGf75O8EBPKSdvw2rF+LGCsX4FZ8tcr3b19LcZq4w== + dependencies: + ci-info "^2.0.0" + is-data-descriptor@^0.1.4: version "0.1.4" resolved "https://registry.yarnpkg.com/is-data-descriptor/-/is-data-descriptor-0.1.4.tgz#0b5ee648388e2c860282e793f1856fec3f301b56" @@ -1951,6 +2728,11 @@ is-data-descriptor@^1.0.0: dependencies: kind-of "^6.0.0" +is-date-object@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/is-date-object/-/is-date-object-1.0.1.tgz#9aa20eb6aeebbff77fbd33e74ca01b33581d3a16" + integrity sha1-mqIOtq7rv/d/vTPnTKAbM1gdOhY= + is-descriptor@^0.1.0: version "0.1.6" resolved "https://registry.yarnpkg.com/is-descriptor/-/is-descriptor-0.1.6.tgz#366d8240dde487ca51823b1ab9f07a10a78251ca" @@ -2003,6 +2785,11 @@ is-fullwidth-code-point@^2.0.0: resolved "https://registry.yarnpkg.com/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz#a3b30a5c4f199183167aaab93beefae3ddfb654f" integrity sha1-o7MKXE8ZkYMWeqq5O+764937ZU8= +is-generator-fn@^2.0.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/is-generator-fn/-/is-generator-fn-2.1.0.tgz#7d140adc389aaf3011a8f2a2a4cfa6faadffb118" + integrity sha512-cTIB4yPYL/Grw0EaSzASzg6bBy9gqCofvWN8okThAYIxKJZC+udlRAmGbM0XLeniEJSs8uEgHPGuHSe1XsOLSQ== + is-glob@^3.1.0: version "3.1.0" resolved "https://registry.yarnpkg.com/is-glob/-/is-glob-3.1.0.tgz#7ba5ae24217804ac70707b96922567486cc3e84a" @@ -2010,7 +2797,7 @@ is-glob@^3.1.0: dependencies: is-extglob "^2.1.0" -is-glob@^4.0.0: +is-glob@^4.0.0, is-glob@^4.0.1: version "4.0.1" resolved "https://registry.yarnpkg.com/is-glob/-/is-glob-4.0.1.tgz#7567dbe9f2f5e2467bc77ab83c4a29482407a5dc" integrity sha512-5G0tKtBTFImOqDnLB2hG6Bp2qcKEFduo4tZu9MT/H6NQv/ghhy30o55ufafxJ/LdH79LLs2Kfrn85TLKyA7BUg== @@ -2036,11 +2823,25 @@ is-promise@^2.1.0: resolved "https://registry.yarnpkg.com/is-promise/-/is-promise-2.1.0.tgz#79a2a9ece7f096e80f36d2b2f3bc16c1ff4bf3fa" integrity sha1-eaKp7OfwlugPNtKy87wWwf9L8/o= +is-regex@^1.0.4: + version "1.0.4" + resolved "https://registry.yarnpkg.com/is-regex/-/is-regex-1.0.4.tgz#5517489b547091b0930e095654ced25ee97e9491" + integrity sha1-VRdIm1RwkbCTDglWVM7SXul+lJE= + dependencies: + has "^1.0.1" + is-stream@^1.1.0: version "1.1.0" resolved "https://registry.yarnpkg.com/is-stream/-/is-stream-1.1.0.tgz#12d4a3dd4e68e0b79ceb8dbc84173ae80d91ca44" integrity sha1-EtSj3U5o4Lec6428hBc66A2RykQ= +is-symbol@^1.0.2: + version "1.0.2" + resolved "https://registry.yarnpkg.com/is-symbol/-/is-symbol-1.0.2.tgz#a055f6ae57192caee329e7a860118b497a950f38" + integrity sha512-HS8bZ9ox60yCJLH9snBpIwv9pYUAkcuLhSA1oero1UB5y9aiQpRA8y2ex945AOtCZL1lJDeIk3G5LthswI46Lw== + dependencies: + has-symbols "^1.0.0" + is-typedarray@~1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/is-typedarray/-/is-typedarray-1.0.0.tgz#e479c80858df0c1b11ddda6940f96011fcda4a9a" @@ -2051,7 +2852,12 @@ is-windows@^1.0.2: resolved "https://registry.yarnpkg.com/is-windows/-/is-windows-1.0.2.tgz#d1850eb9791ecd18e6182ce12a30f396634bb19d" integrity sha512-eXK1UInq2bPmjyX6e3VHIzMLobc4J94i4AWn+Hpq3OU5KkrRC96OAcR3PRJ/pGu6m8TRnBHP9dkXQVsT/COVIA== -isarray@1.0.0, isarray@~1.0.0: +is-wsl@^1.1.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/is-wsl/-/is-wsl-1.1.0.tgz#1f16e4aa22b04d1336b66188a66af3c600c3a66d" + integrity sha1-HxbkqiKwTRM2tmGIpmrzxgDDpm0= + +isarray@1.0.0, isarray@^1.0.0, isarray@~1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/isarray/-/isarray-1.0.0.tgz#bb935d48582cba168c06834957a54a3e07124f11" integrity sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE= @@ -2085,25 +2891,50 @@ isstream@~0.1.2: resolved "https://registry.yarnpkg.com/isstream/-/isstream-0.1.2.tgz#47e63f7af55afa6f92e1500e690eb8b8529c099a" integrity sha1-R+Y/evVa+m+S4VAOaQ64uFKcCZo= -istanbul@^0.4.5: - version "0.4.5" - resolved "https://registry.yarnpkg.com/istanbul/-/istanbul-0.4.5.tgz#65c7d73d4c4da84d4f3ac310b918fb0b8033733b" - integrity sha1-ZcfXPUxNqE1POsMQuRj7C4Azczs= +istanbul-lib-coverage@^2.0.2, istanbul-lib-coverage@^2.0.5: + version "2.0.5" + resolved "https://registry.yarnpkg.com/istanbul-lib-coverage/-/istanbul-lib-coverage-2.0.5.tgz#675f0ab69503fad4b1d849f736baaca803344f49" + integrity sha512-8aXznuEPCJvGnMSRft4udDRDtb1V3pkQkMMI5LI+6HuQz5oQ4J2UFn1H82raA3qJtyOLkkwVqICBQkjnGtn5mA== + +istanbul-lib-instrument@^3.0.1, istanbul-lib-instrument@^3.3.0: + version "3.3.0" + resolved "https://registry.yarnpkg.com/istanbul-lib-instrument/-/istanbul-lib-instrument-3.3.0.tgz#a5f63d91f0bbc0c3e479ef4c5de027335ec6d630" + integrity sha512-5nnIN4vo5xQZHdXno/YDXJ0G+I3dAm4XgzfSVTPLQpj/zAV2dV6Juy0yaf10/zrJOJeHoN3fraFe+XRq2bFVZA== dependencies: - abbrev "1.0.x" - async "1.x" - escodegen "1.8.x" - esprima "2.7.x" - glob "^5.0.15" - handlebars "^4.0.1" - js-yaml "3.x" - mkdirp "0.5.x" - nopt "3.x" - once "1.x" - resolve "1.1.x" - supports-color "^3.1.0" - which "^1.1.1" - wordwrap "^1.0.0" + "@babel/generator" "^7.4.0" + "@babel/parser" "^7.4.3" + "@babel/template" "^7.4.0" + "@babel/traverse" "^7.4.3" + "@babel/types" "^7.4.0" + istanbul-lib-coverage "^2.0.5" + semver "^6.0.0" + +istanbul-lib-report@^2.0.4: + version "2.0.8" + resolved "https://registry.yarnpkg.com/istanbul-lib-report/-/istanbul-lib-report-2.0.8.tgz#5a8113cd746d43c4889eba36ab10e7d50c9b4f33" + integrity sha512-fHBeG573EIihhAblwgxrSenp0Dby6tJMFR/HvlerBsrCTD5bkUuoNtn3gVh29ZCS824cGGBPn7Sg7cNk+2xUsQ== + dependencies: + istanbul-lib-coverage "^2.0.5" + make-dir "^2.1.0" + supports-color "^6.1.0" + +istanbul-lib-source-maps@^3.0.1: + version "3.0.6" + resolved "https://registry.yarnpkg.com/istanbul-lib-source-maps/-/istanbul-lib-source-maps-3.0.6.tgz#284997c48211752ec486253da97e3879defba8c8" + integrity sha512-R47KzMtDJH6X4/YW9XTx+jrLnZnscW4VpNN+1PViSYTejLVPWv7oov+Duf8YQSPyVRUvueQqz1TcsC6mooZTXw== + dependencies: + debug "^4.1.1" + istanbul-lib-coverage "^2.0.5" + make-dir "^2.1.0" + rimraf "^2.6.3" + source-map "^0.6.1" + +istanbul-reports@^2.2.6: + version "2.2.6" + resolved "https://registry.yarnpkg.com/istanbul-reports/-/istanbul-reports-2.2.6.tgz#7b4f2660d82b29303a8fe6091f8ca4bf058da1af" + integrity sha512-SKi4rnMyLBKe0Jy2uUdx28h8oG7ph2PPuQPvIAh31d+Ci+lSiEu4C+h3oBPuJ9+mPKhOyW0M8gY4U5NM1WLeXA== + dependencies: + handlebars "^4.1.2" jacoco-parse@^2.x: version "2.0.1" @@ -2113,6 +2944,360 @@ jacoco-parse@^2.x: mocha "^5.2.0" xml2js "^0.4.9" +jest-changed-files@^24.9.0: + version "24.9.0" + resolved "https://registry.yarnpkg.com/jest-changed-files/-/jest-changed-files-24.9.0.tgz#08d8c15eb79a7fa3fc98269bc14b451ee82f8039" + integrity sha512-6aTWpe2mHF0DhL28WjdkO8LyGjs3zItPET4bMSeXU6T3ub4FPMw+mcOcbdGXQOAfmLcxofD23/5Bl9Z4AkFwqg== + dependencies: + "@jest/types" "^24.9.0" + execa "^1.0.0" + throat "^4.0.0" + +jest-cli@^24.9.0: + version "24.9.0" + resolved "https://registry.yarnpkg.com/jest-cli/-/jest-cli-24.9.0.tgz#ad2de62d07472d419c6abc301fc432b98b10d2af" + integrity sha512-+VLRKyitT3BWoMeSUIHRxV/2g8y9gw91Jh5z2UmXZzkZKpbC08CSehVxgHUwTpy+HwGcns/tqafQDJW7imYvGg== + dependencies: + "@jest/core" "^24.9.0" + "@jest/test-result" "^24.9.0" + "@jest/types" "^24.9.0" + chalk "^2.0.1" + exit "^0.1.2" + import-local "^2.0.0" + is-ci "^2.0.0" + jest-config "^24.9.0" + jest-util "^24.9.0" + jest-validate "^24.9.0" + prompts "^2.0.1" + realpath-native "^1.1.0" + yargs "^13.3.0" + +jest-config@^24.9.0: + version "24.9.0" + resolved "https://registry.yarnpkg.com/jest-config/-/jest-config-24.9.0.tgz#fb1bbc60c73a46af03590719efa4825e6e4dd1b5" + integrity sha512-RATtQJtVYQrp7fvWg6f5y3pEFj9I+H8sWw4aKxnDZ96mob5i5SD6ZEGWgMLXQ4LE8UurrjbdlLWdUeo+28QpfQ== + dependencies: + "@babel/core" "^7.1.0" + "@jest/test-sequencer" "^24.9.0" + "@jest/types" "^24.9.0" + babel-jest "^24.9.0" + chalk "^2.0.1" + glob "^7.1.1" + jest-environment-jsdom "^24.9.0" + jest-environment-node "^24.9.0" + jest-get-type "^24.9.0" + jest-jasmine2 "^24.9.0" + jest-regex-util "^24.3.0" + jest-resolve "^24.9.0" + jest-util "^24.9.0" + jest-validate "^24.9.0" + micromatch "^3.1.10" + pretty-format "^24.9.0" + realpath-native "^1.1.0" + +jest-diff@^24.9.0: + version "24.9.0" + resolved "https://registry.yarnpkg.com/jest-diff/-/jest-diff-24.9.0.tgz#931b7d0d5778a1baf7452cb816e325e3724055da" + integrity sha512-qMfrTs8AdJE2iqrTp0hzh7kTd2PQWrsFyj9tORoKmu32xjPjeE4NyjVRDz8ybYwqS2ik8N4hsIpiVTyFeo2lBQ== + dependencies: + chalk "^2.0.1" + diff-sequences "^24.9.0" + jest-get-type "^24.9.0" + pretty-format "^24.9.0" + +jest-docblock@^24.3.0: + version "24.9.0" + resolved "https://registry.yarnpkg.com/jest-docblock/-/jest-docblock-24.9.0.tgz#7970201802ba560e1c4092cc25cbedf5af5a8ce2" + integrity sha512-F1DjdpDMJMA1cN6He0FNYNZlo3yYmOtRUnktrT9Q37njYzC5WEaDdmbynIgy0L/IvXvvgsG8OsqhLPXTpfmZAA== + dependencies: + detect-newline "^2.1.0" + +jest-each@^24.9.0: + version "24.9.0" + resolved "https://registry.yarnpkg.com/jest-each/-/jest-each-24.9.0.tgz#eb2da602e2a610898dbc5f1f6df3ba86b55f8b05" + integrity sha512-ONi0R4BvW45cw8s2Lrx8YgbeXL1oCQ/wIDwmsM3CqM/nlblNCPmnC3IPQlMbRFZu3wKdQ2U8BqM6lh3LJ5Bsog== + dependencies: + "@jest/types" "^24.9.0" + chalk "^2.0.1" + jest-get-type "^24.9.0" + jest-util "^24.9.0" + pretty-format "^24.9.0" + +jest-environment-jsdom@^24.9.0: + version "24.9.0" + resolved "https://registry.yarnpkg.com/jest-environment-jsdom/-/jest-environment-jsdom-24.9.0.tgz#4b0806c7fc94f95edb369a69cc2778eec2b7375b" + integrity sha512-Zv9FV9NBRzLuALXjvRijO2351DRQeLYXtpD4xNvfoVFw21IOKNhZAEUKcbiEtjTkm2GsJ3boMVgkaR7rN8qetA== + dependencies: + "@jest/environment" "^24.9.0" + "@jest/fake-timers" "^24.9.0" + "@jest/types" "^24.9.0" + jest-mock "^24.9.0" + jest-util "^24.9.0" + jsdom "^11.5.1" + +jest-environment-node@^24.9.0: + version "24.9.0" + resolved "https://registry.yarnpkg.com/jest-environment-node/-/jest-environment-node-24.9.0.tgz#333d2d2796f9687f2aeebf0742b519f33c1cbfd3" + integrity sha512-6d4V2f4nxzIzwendo27Tr0aFm+IXWa0XEUnaH6nU0FMaozxovt+sfRvh4J47wL1OvF83I3SSTu0XK+i4Bqe7uA== + dependencies: + "@jest/environment" "^24.9.0" + "@jest/fake-timers" "^24.9.0" + "@jest/types" "^24.9.0" + jest-mock "^24.9.0" + jest-util "^24.9.0" + +jest-get-type@^24.9.0: + version "24.9.0" + resolved "https://registry.yarnpkg.com/jest-get-type/-/jest-get-type-24.9.0.tgz#1684a0c8a50f2e4901b6644ae861f579eed2ef0e" + integrity sha512-lUseMzAley4LhIcpSP9Jf+fTrQ4a1yHQwLNeeVa2cEmbCGeoZAtYPOIv8JaxLD/sUpKxetKGP+gsHl8f8TSj8Q== + +jest-haste-map@^24.9.0: + version "24.9.0" + resolved "https://registry.yarnpkg.com/jest-haste-map/-/jest-haste-map-24.9.0.tgz#b38a5d64274934e21fa417ae9a9fbeb77ceaac7d" + integrity sha512-kfVFmsuWui2Sj1Rp1AJ4D9HqJwE4uwTlS/vO+eRUaMmd54BFpli2XhMQnPC2k4cHFVbB2Q2C+jtI1AGLgEnCjQ== + dependencies: + "@jest/types" "^24.9.0" + anymatch "^2.0.0" + fb-watchman "^2.0.0" + graceful-fs "^4.1.15" + invariant "^2.2.4" + jest-serializer "^24.9.0" + jest-util "^24.9.0" + jest-worker "^24.9.0" + micromatch "^3.1.10" + sane "^4.0.3" + walker "^1.0.7" + optionalDependencies: + fsevents "^1.2.7" + +jest-jasmine2@^24.9.0: + version "24.9.0" + resolved "https://registry.yarnpkg.com/jest-jasmine2/-/jest-jasmine2-24.9.0.tgz#1f7b1bd3242c1774e62acabb3646d96afc3be6a0" + integrity sha512-Cq7vkAgaYKp+PsX+2/JbTarrk0DmNhsEtqBXNwUHkdlbrTBLtMJINADf2mf5FkowNsq8evbPc07/qFO0AdKTzw== + dependencies: + "@babel/traverse" "^7.1.0" + "@jest/environment" "^24.9.0" + "@jest/test-result" "^24.9.0" + "@jest/types" "^24.9.0" + chalk "^2.0.1" + co "^4.6.0" + expect "^24.9.0" + is-generator-fn "^2.0.0" + jest-each "^24.9.0" + jest-matcher-utils "^24.9.0" + jest-message-util "^24.9.0" + jest-runtime "^24.9.0" + jest-snapshot "^24.9.0" + jest-util "^24.9.0" + pretty-format "^24.9.0" + throat "^4.0.0" + +jest-leak-detector@^24.9.0: + version "24.9.0" + resolved "https://registry.yarnpkg.com/jest-leak-detector/-/jest-leak-detector-24.9.0.tgz#b665dea7c77100c5c4f7dfcb153b65cf07dcf96a" + integrity sha512-tYkFIDsiKTGwb2FG1w8hX9V0aUb2ot8zY/2nFg087dUageonw1zrLMP4W6zsRO59dPkTSKie+D4rhMuP9nRmrA== + dependencies: + jest-get-type "^24.9.0" + pretty-format "^24.9.0" + +jest-matcher-utils@^24.9.0: + version "24.9.0" + resolved "https://registry.yarnpkg.com/jest-matcher-utils/-/jest-matcher-utils-24.9.0.tgz#f5b3661d5e628dffe6dd65251dfdae0e87c3a073" + integrity sha512-OZz2IXsu6eaiMAwe67c1T+5tUAtQyQx27/EMEkbFAGiw52tB9em+uGbzpcgYVpA8wl0hlxKPZxrly4CXU/GjHA== + dependencies: + chalk "^2.0.1" + jest-diff "^24.9.0" + jest-get-type "^24.9.0" + pretty-format "^24.9.0" + +jest-message-util@^24.9.0: + version "24.9.0" + resolved "https://registry.yarnpkg.com/jest-message-util/-/jest-message-util-24.9.0.tgz#527f54a1e380f5e202a8d1149b0ec872f43119e3" + integrity sha512-oCj8FiZ3U0hTP4aSui87P4L4jC37BtQwUMqk+zk/b11FR19BJDeZsZAvIHutWnmtw7r85UmR3CEWZ0HWU2mAlw== + dependencies: + "@babel/code-frame" "^7.0.0" + "@jest/test-result" "^24.9.0" + "@jest/types" "^24.9.0" + "@types/stack-utils" "^1.0.1" + chalk "^2.0.1" + micromatch "^3.1.10" + slash "^2.0.0" + stack-utils "^1.0.1" + +jest-mock@^24.9.0: + version "24.9.0" + resolved "https://registry.yarnpkg.com/jest-mock/-/jest-mock-24.9.0.tgz#c22835541ee379b908673ad51087a2185c13f1c6" + integrity sha512-3BEYN5WbSq9wd+SyLDES7AHnjH9A/ROBwmz7l2y+ol+NtSFO8DYiEBzoO1CeFc9a8DYy10EO4dDFVv/wN3zl1w== + dependencies: + "@jest/types" "^24.9.0" + +jest-pnp-resolver@^1.2.1: + version "1.2.1" + resolved "https://registry.yarnpkg.com/jest-pnp-resolver/-/jest-pnp-resolver-1.2.1.tgz#ecdae604c077a7fbc70defb6d517c3c1c898923a" + integrity sha512-pgFw2tm54fzgYvc/OHrnysABEObZCUNFnhjoRjaVOCN8NYc032/gVjPaHD4Aq6ApkSieWtfKAFQtmDKAmhupnQ== + +jest-regex-util@^24.3.0, jest-regex-util@^24.9.0: + version "24.9.0" + resolved "https://registry.yarnpkg.com/jest-regex-util/-/jest-regex-util-24.9.0.tgz#c13fb3380bde22bf6575432c493ea8fe37965636" + integrity sha512-05Cmb6CuxaA+Ys6fjr3PhvV3bGQmO+2p2La4hFbU+W5uOc479f7FdLXUWXw4pYMAhhSZIuKHwSXSu6CsSBAXQA== + +jest-resolve-dependencies@^24.9.0: + version "24.9.0" + resolved "https://registry.yarnpkg.com/jest-resolve-dependencies/-/jest-resolve-dependencies-24.9.0.tgz#ad055198959c4cfba8a4f066c673a3f0786507ab" + integrity sha512-Fm7b6AlWnYhT0BXy4hXpactHIqER7erNgIsIozDXWl5dVm+k8XdGVe1oTg1JyaFnOxarMEbax3wyRJqGP2Pq+g== + dependencies: + "@jest/types" "^24.9.0" + jest-regex-util "^24.3.0" + jest-snapshot "^24.9.0" + +jest-resolve@^24.9.0: + version "24.9.0" + resolved "https://registry.yarnpkg.com/jest-resolve/-/jest-resolve-24.9.0.tgz#dff04c7687af34c4dd7e524892d9cf77e5d17321" + integrity sha512-TaLeLVL1l08YFZAt3zaPtjiVvyy4oSA6CRe+0AFPPVX3Q/VI0giIWWoAvoS5L96vj9Dqxj4fB5p2qrHCmTU/MQ== + dependencies: + "@jest/types" "^24.9.0" + browser-resolve "^1.11.3" + chalk "^2.0.1" + jest-pnp-resolver "^1.2.1" + realpath-native "^1.1.0" + +jest-runner@^24.9.0: + version "24.9.0" + resolved "https://registry.yarnpkg.com/jest-runner/-/jest-runner-24.9.0.tgz#574fafdbd54455c2b34b4bdf4365a23857fcdf42" + integrity sha512-KksJQyI3/0mhcfspnxxEOBueGrd5E4vV7ADQLT9ESaCzz02WnbdbKWIf5Mkaucoaj7obQckYPVX6JJhgUcoWWg== + dependencies: + "@jest/console" "^24.7.1" + "@jest/environment" "^24.9.0" + "@jest/test-result" "^24.9.0" + "@jest/types" "^24.9.0" + chalk "^2.4.2" + exit "^0.1.2" + graceful-fs "^4.1.15" + jest-config "^24.9.0" + jest-docblock "^24.3.0" + jest-haste-map "^24.9.0" + jest-jasmine2 "^24.9.0" + jest-leak-detector "^24.9.0" + jest-message-util "^24.9.0" + jest-resolve "^24.9.0" + jest-runtime "^24.9.0" + jest-util "^24.9.0" + jest-worker "^24.6.0" + source-map-support "^0.5.6" + throat "^4.0.0" + +jest-runtime@^24.9.0: + version "24.9.0" + resolved "https://registry.yarnpkg.com/jest-runtime/-/jest-runtime-24.9.0.tgz#9f14583af6a4f7314a6a9d9f0226e1a781c8e4ac" + integrity sha512-8oNqgnmF3v2J6PVRM2Jfuj8oX3syKmaynlDMMKQ4iyzbQzIG6th5ub/lM2bCMTmoTKM3ykcUYI2Pw9xwNtjMnw== + dependencies: + "@jest/console" "^24.7.1" + "@jest/environment" "^24.9.0" + "@jest/source-map" "^24.3.0" + "@jest/transform" "^24.9.0" + "@jest/types" "^24.9.0" + "@types/yargs" "^13.0.0" + chalk "^2.0.1" + exit "^0.1.2" + glob "^7.1.3" + graceful-fs "^4.1.15" + jest-config "^24.9.0" + jest-haste-map "^24.9.0" + jest-message-util "^24.9.0" + jest-mock "^24.9.0" + jest-regex-util "^24.3.0" + jest-resolve "^24.9.0" + jest-snapshot "^24.9.0" + jest-util "^24.9.0" + jest-validate "^24.9.0" + realpath-native "^1.1.0" + slash "^2.0.0" + strip-bom "^3.0.0" + yargs "^13.3.0" + +jest-serializer@^24.9.0: + version "24.9.0" + resolved "https://registry.yarnpkg.com/jest-serializer/-/jest-serializer-24.9.0.tgz#e6d7d7ef96d31e8b9079a714754c5d5c58288e73" + integrity sha512-DxYipDr8OvfrKH3Kel6NdED3OXxjvxXZ1uIY2I9OFbGg+vUkkg7AGvi65qbhbWNPvDckXmzMPbK3u3HaDO49bQ== + +jest-snapshot@^24.9.0: + version "24.9.0" + resolved "https://registry.yarnpkg.com/jest-snapshot/-/jest-snapshot-24.9.0.tgz#ec8e9ca4f2ec0c5c87ae8f925cf97497b0e951ba" + integrity sha512-uI/rszGSs73xCM0l+up7O7a40o90cnrk429LOiK3aeTvfC0HHmldbd81/B7Ix81KSFe1lwkbl7GnBGG4UfuDew== + dependencies: + "@babel/types" "^7.0.0" + "@jest/types" "^24.9.0" + chalk "^2.0.1" + expect "^24.9.0" + jest-diff "^24.9.0" + jest-get-type "^24.9.0" + jest-matcher-utils "^24.9.0" + jest-message-util "^24.9.0" + jest-resolve "^24.9.0" + mkdirp "^0.5.1" + natural-compare "^1.4.0" + pretty-format "^24.9.0" + semver "^6.2.0" + +jest-util@^24.9.0: + version "24.9.0" + resolved "https://registry.yarnpkg.com/jest-util/-/jest-util-24.9.0.tgz#7396814e48536d2e85a37de3e4c431d7cb140162" + integrity sha512-x+cZU8VRmOJxbA1K5oDBdxQmdq0OIdADarLxk0Mq+3XS4jgvhG/oKGWcIDCtPG0HgjxOYvF+ilPJQsAyXfbNOg== + dependencies: + "@jest/console" "^24.9.0" + "@jest/fake-timers" "^24.9.0" + "@jest/source-map" "^24.9.0" + "@jest/test-result" "^24.9.0" + "@jest/types" "^24.9.0" + callsites "^3.0.0" + chalk "^2.0.1" + graceful-fs "^4.1.15" + is-ci "^2.0.0" + mkdirp "^0.5.1" + slash "^2.0.0" + source-map "^0.6.0" + +jest-validate@^24.9.0: + version "24.9.0" + resolved "https://registry.yarnpkg.com/jest-validate/-/jest-validate-24.9.0.tgz#0775c55360d173cd854e40180756d4ff52def8ab" + integrity sha512-HPIt6C5ACwiqSiwi+OfSSHbK8sG7akG8eATl+IPKaeIjtPOeBUd/g3J7DghugzxrGjI93qS/+RPKe1H6PqvhRQ== + dependencies: + "@jest/types" "^24.9.0" + camelcase "^5.3.1" + chalk "^2.0.1" + jest-get-type "^24.9.0" + leven "^3.1.0" + pretty-format "^24.9.0" + +jest-watcher@^24.9.0: + version "24.9.0" + resolved "https://registry.yarnpkg.com/jest-watcher/-/jest-watcher-24.9.0.tgz#4b56e5d1ceff005f5b88e528dc9afc8dd4ed2b3b" + integrity sha512-+/fLOfKPXXYJDYlks62/4R4GoT+GU1tYZed99JSCOsmzkkF7727RqKrjNAxtfO4YpGv11wybgRvCjR73lK2GZw== + dependencies: + "@jest/test-result" "^24.9.0" + "@jest/types" "^24.9.0" + "@types/yargs" "^13.0.0" + ansi-escapes "^3.0.0" + chalk "^2.0.1" + jest-util "^24.9.0" + string-length "^2.0.0" + +jest-worker@^24.6.0, jest-worker@^24.9.0: + version "24.9.0" + resolved "https://registry.yarnpkg.com/jest-worker/-/jest-worker-24.9.0.tgz#5dbfdb5b2d322e98567898238a9697bcce67b3e5" + integrity sha512-51PE4haMSXcHohnSMdM42anbvZANYTqMrr52tVKPqqsPJMzoP6FYYDVqahX/HrAoKEKz3uUPzSvKs9A3qR4iVw== + dependencies: + merge-stream "^2.0.0" + supports-color "^6.1.0" + +jest@24.9.0: + version "24.9.0" + resolved "https://registry.yarnpkg.com/jest/-/jest-24.9.0.tgz#987d290c05a08b52c56188c1002e368edb007171" + integrity sha512-YvkBL1Zm7d2B1+h5fHEOdyjCG+sGMz4f8D86/0HiqJ6MB4MnDc8FgP5vdWsGnemOQro7lnYo8UakZ3+5A0jxGw== + dependencies: + import-local "^2.0.0" + jest-cli "^24.9.0" + joi@^13.x: version "13.7.0" resolved "https://registry.yarnpkg.com/joi/-/joi-13.7.0.tgz#cfd85ebfe67e8a1900432400b4d03bbd93fb879f" @@ -2122,12 +3307,12 @@ joi@^13.x: isemail "3.x.x" topo "3.x.x" -js-tokens@^4.0.0: +"js-tokens@^3.0.0 || ^4.0.0", js-tokens@^4.0.0: version "4.0.0" resolved "https://registry.yarnpkg.com/js-tokens/-/js-tokens-4.0.0.tgz#19203fb59991df98e3a287050d4647cdeaf32499" integrity sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ== -js-yaml@3.x, js-yaml@^3.13.0, js-yaml@^3.13.1: +js-yaml@^3.13.1: version "3.13.1" resolved "https://registry.yarnpkg.com/js-yaml/-/js-yaml-3.13.1.tgz#aff151b30bfdfa8e49e05da22e7415e9dfa37847" integrity sha512-YfbcO7jXDdyj0DGxYVSlSeQNHbD7XPWvrVWeVUujrQEoZzWJIRrCPoyk6kL6IAjAG2IolMK4T0hNUe0HOUs5Jw== @@ -2140,6 +3325,43 @@ jsbn@~0.1.0: resolved "https://registry.yarnpkg.com/jsbn/-/jsbn-0.1.1.tgz#a5e654c2e5a2deb5f201d96cefbca80c0ef2f513" integrity sha1-peZUwuWi3rXyAdls77yoDA7y9RM= +jsdom@^11.5.1: + version "11.12.0" + resolved "https://registry.yarnpkg.com/jsdom/-/jsdom-11.12.0.tgz#1a80d40ddd378a1de59656e9e6dc5a3ba8657bc8" + integrity sha512-y8Px43oyiBM13Zc1z780FrfNLJCXTL40EWlty/LXUtcjykRBNgLlCjWXpfSPBl2iv+N7koQN+dvqszHZgT/Fjw== + dependencies: + abab "^2.0.0" + acorn "^5.5.3" + acorn-globals "^4.1.0" + array-equal "^1.0.0" + cssom ">= 0.3.2 < 0.4.0" + cssstyle "^1.0.0" + data-urls "^1.0.0" + domexception "^1.0.1" + escodegen "^1.9.1" + html-encoding-sniffer "^1.0.2" + left-pad "^1.3.0" + nwsapi "^2.0.7" + parse5 "4.0.0" + pn "^1.1.0" + request "^2.87.0" + request-promise-native "^1.0.5" + sax "^1.2.4" + symbol-tree "^3.2.2" + tough-cookie "^2.3.4" + w3c-hr-time "^1.0.1" + webidl-conversions "^4.0.2" + whatwg-encoding "^1.0.3" + whatwg-mimetype "^2.1.0" + whatwg-url "^6.4.1" + ws "^5.2.0" + xml-name-validator "^3.0.0" + +jsesc@^2.5.1: + version "2.5.2" + resolved "https://registry.yarnpkg.com/jsesc/-/jsesc-2.5.2.tgz#80564d2e483dacf6e8ef209650a67df3f0c283a4" + integrity sha512-OYu7XEzjkCQ3C5Ps3QIZsQfNpqoJyZZA99wd9aWd05NCtC5pWOkShK2mkL6HXQR6/Cy2lbNdPlZBpuQHXE63gA== + json-parse-better-errors@^1.0.1: version "1.0.2" resolved "https://registry.yarnpkg.com/json-parse-better-errors/-/json-parse-better-errors-1.0.2.tgz#bb867cfb3450e69107c131d1c514bab3dc8bcaa9" @@ -2172,6 +3394,13 @@ json-stringify-safe@~5.0.1: resolved "https://registry.yarnpkg.com/json-stringify-safe/-/json-stringify-safe-5.0.1.tgz#1296a2d58fd45f19a0f6ce01d65701e2c735b6eb" integrity sha1-Epai1Y/UXxmg9s4B1lcB4sc1tus= +json5@2.x, json5@^2.1.0: + version "2.1.1" + resolved "https://registry.yarnpkg.com/json5/-/json5-2.1.1.tgz#81b6cb04e9ba496f1c7005d07b4368a2638f90b6" + integrity sha512-l+3HXD0GEI3huGq1njuqtzYK8OYJyXMkOLtQ53pjWh89tvWS2h6l+1zMkYWqlb57+SiQodKZyvMEFb2X+KrFhQ== + dependencies: + minimist "^1.2.0" + jsonfile@^4.0.0: version "4.0.0" resolved "https://registry.yarnpkg.com/jsonfile/-/jsonfile-4.0.0.tgz#8771aae0799b64076b76640fca058f9c10e33ecb" @@ -2223,6 +3452,11 @@ kind-of@^6.0.0, kind-of@^6.0.2: resolved "https://registry.yarnpkg.com/kind-of/-/kind-of-6.0.2.tgz#01146b36a6218e64e58f3a8d66de5d7fc6f6d051" integrity sha512-s5kLOcnH0XqDO+FvuaLX8DDjZ18CGFk7VygH40QoKPUQhW4e2rvM0rwUq0t8IQDOwYSeLK01U90OjzBTme2QqA== +kleur@^3.0.3: + version "3.0.3" + resolved "https://registry.yarnpkg.com/kleur/-/kleur-3.0.3.tgz#a79c9ecc86ee1ce3fa6206d1216c501f147fc07e" + integrity sha512-eTIzlVOSUR+JxdDFepEYcBMtZ9Qqdef+rnzWdRZuMbOywu5tO2w2N7rqjoANZ5k9vywhL6Br1VRjUIgTQx4E8w== + labeled-stream-splicer@^2.0.0: version "2.0.2" resolved "https://registry.yarnpkg.com/labeled-stream-splicer/-/labeled-stream-splicer-2.0.2.tgz#42a41a16abcd46fd046306cf4f2c3576fffb1c21" @@ -2243,6 +3477,16 @@ lcov-parse@^1.x: resolved "https://registry.yarnpkg.com/lcov-parse/-/lcov-parse-1.0.0.tgz#eb0d46b54111ebc561acb4c408ef9363bdc8f7e0" integrity sha1-6w1GtUER68VhrLTECO+TY73I9+A= +left-pad@^1.3.0: + version "1.3.0" + resolved "https://registry.yarnpkg.com/left-pad/-/left-pad-1.3.0.tgz#5b8a3a7765dfe001261dde915589e782f8c94d1e" + integrity sha512-XI5MPzVNApjAyhQzphX8BkmKsKUxD4LdyK24iZeQGinBN9yTQT3bFlCBy/aVx2HrNcqQGsdot8ghrjyrvMCoEA== + +leven@^3.1.0: + version "3.1.0" + resolved "https://registry.yarnpkg.com/leven/-/leven-3.1.0.tgz#77891de834064cccba82ae7842bb6b14a13ed7f2" + integrity sha512-qsda+H8jTaUaN/x5vzW2rzc+8Rw4TAQ/4KjB46IwK5VH+IlVeeeje/EoZRpiXvIqjFgK84QffqPztGI3VBLG1A== + levn@^0.3.0, levn@~0.3.0: version "0.3.0" resolved "https://registry.yarnpkg.com/levn/-/levn-0.3.0.tgz#3b09924edf9f083c0490fdd4c0bc4421e04764ee" @@ -2251,6 +3495,34 @@ levn@^0.3.0, levn@~0.3.0: prelude-ls "~1.1.2" type-check "~0.3.2" +load-json-file@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/load-json-file/-/load-json-file-2.0.0.tgz#7947e42149af80d696cbf797bcaabcfe1fe29ca8" + integrity sha1-eUfkIUmvgNaWy/eXvKq8/h/inKg= + dependencies: + graceful-fs "^4.1.2" + parse-json "^2.2.0" + pify "^2.0.0" + strip-bom "^3.0.0" + +load-json-file@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/load-json-file/-/load-json-file-4.0.0.tgz#2f5f45ab91e33216234fd53adab668eb4ec0993b" + integrity sha1-L19Fq5HjMhYjT9U62rZo607AmTs= + dependencies: + graceful-fs "^4.1.2" + parse-json "^4.0.0" + pify "^3.0.0" + strip-bom "^3.0.0" + +locate-path@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/locate-path/-/locate-path-2.0.0.tgz#2b568b265eec944c6d9c0de9c3dbbbca0354cd8e" + integrity sha1-K1aLJl7slExtnA3pw9u7ygNUzY4= + dependencies: + p-locate "^2.0.0" + path-exists "^3.0.0" + locate-path@^3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/locate-path/-/locate-path-3.0.0.tgz#dbec3b3ab759758071b58fe59fc41871af21400e" @@ -2264,10 +3536,20 @@ lodash.memoize@~3.0.3: resolved "https://registry.yarnpkg.com/lodash.memoize/-/lodash.memoize-3.0.4.tgz#2dcbd2c287cbc0a55cc42328bd0c736150d53e3f" integrity sha1-LcvSwofLwKVcxCMovQxzYVDVPj8= -lodash@4.17.14, lodash@^4.17.11, lodash@^4.17.12, lodash@^4.17.4: - version "4.17.14" - resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.14.tgz#9ce487ae66c96254fe20b599f21b6816028078ba" - integrity sha512-mmKYbW3GLuJeX+iGP+Y7Gp1AiGHGbXHCOh/jZmrawMmsE7MS4znI3RL2FsjbqOyMayHInjOeykW7PEajUk1/xw== +lodash.sortby@^4.7.0: + version "4.7.0" + resolved "https://registry.yarnpkg.com/lodash.sortby/-/lodash.sortby-4.7.0.tgz#edd14c824e2cc9c1e0b0a1b42bb5210516a42438" + integrity sha1-7dFMgk4sycHgsKG0K7UhBRakJDg= + +lodash.unescape@4.0.1: + version "4.0.1" + resolved "https://registry.yarnpkg.com/lodash.unescape/-/lodash.unescape-4.0.1.tgz#bf2249886ce514cda112fae9218cdc065211fc9c" + integrity sha1-vyJJiGzlFM2hEvrpIYzcBlIR/Jw= + +lodash@4.17.15, lodash@^4.17.11, lodash@^4.17.12, lodash@^4.17.13, lodash@^4.17.14, lodash@^4.17.4: + version "4.17.15" + resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.15.tgz#b447f6670a0455bbfeedd11392eff330ea097548" + integrity sha512-8xOcRHvCjnocdS5cpwXQXVzmmh5e5+saE2QGoeQmbKmRS6J3VQppPOIt0MnmE+4xlZoumy0GPG0D0MVIQbNA1A== log-driver@^1.x: version "1.2.7" @@ -2281,6 +3563,33 @@ log-symbols@^2.2.0: dependencies: chalk "^2.0.1" +loose-envify@^1.0.0: + version "1.4.0" + resolved "https://registry.yarnpkg.com/loose-envify/-/loose-envify-1.4.0.tgz#71ee51fa7be4caec1a63839f7e682d8132d30caf" + integrity sha512-lyuxPGr/Wfhrlem2CL/UcnUc1zcqKAImBDzukY7Y5F/yQiNdko6+fRLevlw1HgMySw7f611UIY408EtxRSoK3Q== + dependencies: + js-tokens "^3.0.0 || ^4.0.0" + +make-dir@^2.1.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/make-dir/-/make-dir-2.1.0.tgz#5f0310e18b8be898cc07009295a30ae41e91e6f5" + integrity sha512-LS9X+dc8KLxXCb8dni79fLIIUA5VyZoyjSMCwTluaXA0o27cCK0bhXkpgw+sTXVpPy/lSO57ilRixqk0vDmtRA== + dependencies: + pify "^4.0.1" + semver "^5.6.0" + +make-error@1.x: + version "1.3.5" + resolved "https://registry.yarnpkg.com/make-error/-/make-error-1.3.5.tgz#efe4e81f6db28cadd605c70f29c831b58ef776c8" + integrity sha512-c3sIjNUow0+8swNwVpqoH4YCShKNFkMaw6oH1mNS2haDZQqkeZFlHS3dhoeEbKKmJB4vXpJucU6oH75aDYeE9g== + +makeerror@1.0.x: + version "1.0.11" + resolved "https://registry.yarnpkg.com/makeerror/-/makeerror-1.0.11.tgz#e01a5c9109f2af79660e4e8b9587790184f5a96c" + integrity sha1-4BpckQnyr3lmDk6LlYd5AYT1qWw= + dependencies: + tmpl "1.0.x" + map-age-cleaner@^0.1.1: version "0.1.3" resolved "https://registry.yarnpkg.com/map-age-cleaner/-/map-age-cleaner-0.1.3.tgz#7d583a7306434c055fe474b0f45078e6e1b4b92a" @@ -2318,10 +3627,15 @@ mem@^4.0.0: mimic-fn "^2.0.0" p-is-promise "^2.0.0" +merge-stream@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/merge-stream/-/merge-stream-2.0.0.tgz#52823629a14dd00c9770fb6ad47dc6310f2c1f60" + integrity sha512-abv/qOcuPfk3URPfDzmZU1LKmuw8kT+0nIHvKrKgFrwifol/doWcdA4ZqsWQ8ENrFKkd67Mfpo/LovbIUsbt3w== + merge2@^1.2.3: - version "1.2.3" - resolved "https://registry.yarnpkg.com/merge2/-/merge2-1.2.3.tgz#7ee99dbd69bb6481689253f018488a1b902b0ed5" - integrity sha512-gdUU1Fwj5ep4kplwcmftruWofEFt6lfpkkr3h860CXbAB9c3hGb55EOL2ali0Td5oebvW0E1+3Sr+Ur7XfKpRA== + version "1.3.0" + resolved "https://registry.yarnpkg.com/merge2/-/merge2-1.3.0.tgz#5b366ee83b2f1582c48f87e47cf1a9352103ca81" + integrity sha512-2j4DAdlBOkiSZIsaXk4mTE3sRS02yBHAtfy127xRV3bQUFqXkjHCHLW6Scv7DwNRbIWNHH8zpnz9zMaKXIdvYw== merge@^1.2.1: version "1.2.1" @@ -2387,7 +3701,7 @@ minimalistic-crypto-utils@^1.0.0, minimalistic-crypto-utils@^1.0.1: resolved "https://registry.yarnpkg.com/minimalistic-crypto-utils/-/minimalistic-crypto-utils-1.0.1.tgz#f6c00c1c0b082246e5c4d99dfb8c7c083b2b582a" integrity sha1-9sAMHAsIIkblxNmd+4x8CDsrWCo= -"minimatch@2 || 3", minimatch@3.0.4, minimatch@^3.0.4: +minimatch@3.0.4, minimatch@^3.0.4: version "3.0.4" resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-3.0.4.tgz#5166e286457f03306064be5497e8dbb0c3d32083" integrity sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA== @@ -2409,20 +3723,20 @@ minimist@~0.0.1: resolved "https://registry.yarnpkg.com/minimist/-/minimist-0.0.10.tgz#de3f98543dbf96082be48ad1a0c7cda836301dcf" integrity sha1-3j+YVD2/lggr5IrRoMfNqDYwHc8= -minipass@^2.2.1, minipass@^2.3.5: - version "2.3.5" - resolved "https://registry.yarnpkg.com/minipass/-/minipass-2.3.5.tgz#cacebe492022497f656b0f0f51e2682a9ed2d848" - integrity sha512-Gi1W4k059gyRbyVUZQ4mEqLm0YIUiGYfvxhF6SIlk3ui1WVxMTGfGdQ2SInh3PDrRTVvPKgULkpJtT4RH10+VA== +minipass@^2.6.0, minipass@^2.8.6, minipass@^2.9.0: + version "2.9.0" + resolved "https://registry.yarnpkg.com/minipass/-/minipass-2.9.0.tgz#e713762e7d3e32fed803115cf93e04bca9fcc9a6" + integrity sha512-wxfUjg9WebH+CUDX/CdbRlh5SmfZiy/hpkxaRI16Y9W56Pa75sWgd/rvFilSgrauD9NyFymP/+JFV3KwzIsJeg== dependencies: safe-buffer "^5.1.2" yallist "^3.0.0" minizlib@^1.2.1: - version "1.2.1" - resolved "https://registry.yarnpkg.com/minizlib/-/minizlib-1.2.1.tgz#dd27ea6136243c7c880684e8672bb3a45fd9b614" - integrity sha512-7+4oTUOWKg7AuL3vloEWekXY2/D20cevzsrNT2kGWm+39J9hGTCBv8VI5Pm5lXZ/o3/mdR4f8rflAPhnQb8mPA== + version "1.3.3" + resolved "https://registry.yarnpkg.com/minizlib/-/minizlib-1.3.3.tgz#2290de96818a34c29551c8a8d301216bd65a861d" + integrity sha512-6ZYMOEnmVsdCeTJVE0W9ZD+pVnE8h9Hma/iOwwRDsdQoePpoX56/8B6z3P9VNwppJuBKNRuFDRNRqRWexT9G9Q== dependencies: - minipass "^2.2.1" + minipass "^2.9.0" mixin-deep@^1.2.0: version "1.3.2" @@ -2437,14 +3751,14 @@ mkdirp@0.3.0: resolved "https://registry.yarnpkg.com/mkdirp/-/mkdirp-0.3.0.tgz#1bbf5ab1ba827af23575143490426455f481fe1e" integrity sha1-G79asbqCevI1dRQ0kEJkVfSB/h4= -mkdirp@0.5.1, mkdirp@0.5.x, mkdirp@^0.5.0, mkdirp@^0.5.1: +mkdirp@0.5.1, mkdirp@0.x, mkdirp@^0.5.0, mkdirp@^0.5.1: version "0.5.1" resolved "https://registry.yarnpkg.com/mkdirp/-/mkdirp-0.5.1.tgz#30057438eac6cf7f8c4767f38648d6697d75c903" integrity sha1-MAV0OOrGz3+MR2fzhkjWaX11yQM= dependencies: minimist "0.0.8" -mocha@5.2.0, mocha@^5.2.0: +mocha@^5.2.0: version "5.2.0" resolved "https://registry.yarnpkg.com/mocha/-/mocha-5.2.0.tgz#6d8ae508f59167f940f2b5b3c4a612ae50c90ae6" integrity sha512-2IUgKDhc3J7Uug+FxMXuqIyYzH7gJjXECKe/w43IGgQHTSj3InJi+yAA7T24L9bQMRKiUEHxEX37G5JpVUGLcQ== @@ -2543,6 +3857,27 @@ nice-try@^1.0.4: resolved "https://registry.yarnpkg.com/nice-try/-/nice-try-1.0.5.tgz#a3378a7696ce7d223e88fc9b764bd7ef1089e366" integrity sha512-1nh45deeb5olNY7eX82BkPO7SSxR5SSYJiPTrTdFUVYwAl8CKMA5N9PjTYkHiRjisVcxcQ1HXdLhx2qxxJzLNQ== +node-int64@^0.4.0: + version "0.4.0" + resolved "https://registry.yarnpkg.com/node-int64/-/node-int64-0.4.0.tgz#87a9065cdb355d3182d8f94ce11188b825c68a3b" + integrity sha1-h6kGXNs1XTGC2PlM4RGIuCXGijs= + +node-modules-regexp@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/node-modules-regexp/-/node-modules-regexp-1.0.0.tgz#8d9dbe28964a4ac5712e9131642107c71e90ec40" + integrity sha1-jZ2+KJZKSsVxLpExZCEHxx6Q7EA= + +node-notifier@^5.4.2: + version "5.4.3" + resolved "https://registry.yarnpkg.com/node-notifier/-/node-notifier-5.4.3.tgz#cb72daf94c93904098e28b9c590fd866e464bd50" + integrity sha512-M4UBGcs4jeOK9CjTsYwkvH6/MzuUmGCyTW+kCY7uO+1ZVr0+FHGdPdIf5CCLqAaxnRrWidyoQlNkMIIVwbKB8Q== + dependencies: + growly "^1.3.0" + is-wsl "^1.1.0" + semver "^5.5.0" + shellwords "^0.1.1" + which "^1.3.0" + node-pre-gyp@^0.12.0: version "0.12.0" resolved "https://registry.yarnpkg.com/node-pre-gyp/-/node-pre-gyp-0.12.0.tgz#39ba4bb1439da030295f899e3b520b7785766149" @@ -2559,12 +3894,12 @@ node-pre-gyp@^0.12.0: semver "^5.3.0" tar "^4" -node-releases@^1.1.25: - version "1.1.25" - resolved "https://registry.yarnpkg.com/node-releases/-/node-releases-1.1.25.tgz#0c2d7dbc7fed30fbe02a9ee3007b8c90bf0133d3" - integrity sha512-fI5BXuk83lKEoZDdH3gRhtsNgh05/wZacuXkgbiYkceE7+QIMXOg98n9ZV7mz27B+kFHnqHcUpscZZlGRSmTpQ== +node-releases@^1.1.29: + version "1.1.34" + resolved "https://registry.yarnpkg.com/node-releases/-/node-releases-1.1.34.tgz#ced4655ee1ba9c3a2c5dcbac385e19434155fd40" + integrity sha512-fNn12JTEfniTuCqo0r9jXgl44+KxRH/huV7zM/KAGOKxDKrHr6EbT7SSs4B+DNxyBE2mks28AD+Jw6PkfY5uwA== dependencies: - semver "^5.3.0" + semver "^6.3.0" nopt@1.0.10: version "1.0.10" @@ -2573,13 +3908,6 @@ nopt@1.0.10: dependencies: abbrev "1" -nopt@3.x: - version "3.0.6" - resolved "https://registry.yarnpkg.com/nopt/-/nopt-3.0.6.tgz#c6465dbf08abcd4db359317f79ac68a646b28ff9" - integrity sha1-xkZdvwirzU2zWTF/eaxopkayj/k= - dependencies: - abbrev "1" - nopt@^4.0.1: version "4.0.1" resolved "https://registry.yarnpkg.com/nopt/-/nopt-4.0.1.tgz#d0d4685afd5415193c8c7505602d0d17cd64474d" @@ -2588,6 +3916,16 @@ nopt@^4.0.1: abbrev "1" osenv "^0.1.4" +normalize-package-data@^2.3.2: + version "2.5.0" + resolved "https://registry.yarnpkg.com/normalize-package-data/-/normalize-package-data-2.5.0.tgz#e66db1838b200c1dfc233225d12cb36520e234a8" + integrity sha512-/5CMN3T0R4XTj4DcGaexo+roZSdSFW/0AOOTROrjxzCG1wrWXEsGbRKevjlIL+ZDE4sZlJr5ED4YW0yqmkK+eA== + dependencies: + hosted-git-info "^2.1.4" + resolve "^1.10.0" + semver "2 || 3 || 4 || 5" + validate-npm-package-license "^3.0.1" + normalize-path@^2.1.1: version "2.1.1" resolved "https://registry.yarnpkg.com/normalize-path/-/normalize-path-2.1.1.tgz#1ab28b556e198363a8c1a6f7e6fa20137fe6aed9" @@ -2645,6 +3983,11 @@ number-is-nan@^1.0.0: resolved "https://registry.yarnpkg.com/number-is-nan/-/number-is-nan-1.0.1.tgz#097b602b53422a522c1afb8790318336941a011d" integrity sha1-CXtgK1NCKlIsGvuHkDGDNpQaAR0= +nwsapi@^2.0.7: + version "2.1.4" + resolved "https://registry.yarnpkg.com/nwsapi/-/nwsapi-2.1.4.tgz#e006a878db23636f8e8a67d33ca0e4edf61a842f" + integrity sha512-iGfd9Y6SFdTNldEy2L0GUhcarIutFmk+MPWIn9dmj8NMIup03G08uUF2KGbbmv/Ux4RT0VZJoP/sVbWA6d/VIw== + oauth-sign@~0.9.0: version "0.9.0" resolved "https://registry.yarnpkg.com/oauth-sign/-/oauth-sign-0.9.0.tgz#47a7b016baa68b5fa0ecf3dee08a85c679ac6455" @@ -2664,6 +4007,16 @@ object-copy@^0.1.0: define-property "^0.2.5" kind-of "^3.0.3" +object-inspect@^1.6.0: + version "1.6.0" + resolved "https://registry.yarnpkg.com/object-inspect/-/object-inspect-1.6.0.tgz#c70b6cbf72f274aab4c34c0c82f5167bf82cf15b" + integrity sha512-GJzfBZ6DgDAmnuaM3104jR4s1Myxr3Y3zfIyN4z3UdqN69oSRacNK8UhnobDdC+7J2AHCjGwxQubNJfE70SXXQ== + +object-keys@^1.0.12, object-keys@^1.1.1: + version "1.1.1" + resolved "https://registry.yarnpkg.com/object-keys/-/object-keys-1.1.1.tgz#1c47f272df277f3b1daf061677d9c82e2322c60e" + integrity sha512-NuAESUOUMrlIXOfHKzD6bpPu3tYt3xvjNdRIQ+FeT0lNb4K8WR70CaDxhuNguS2XG+GjkyMwOzsN5ZktImfhLA== + object-visit@^1.0.0: version "1.0.1" resolved "https://registry.yarnpkg.com/object-visit/-/object-visit-1.0.1.tgz#f79c4493af0c5377b59fe39d395e41042dd045bb" @@ -2671,6 +4024,14 @@ object-visit@^1.0.0: dependencies: isobject "^3.0.0" +object.getownpropertydescriptors@^2.0.3: + version "2.0.3" + resolved "https://registry.yarnpkg.com/object.getownpropertydescriptors/-/object.getownpropertydescriptors-2.0.3.tgz#8758c846f5b407adab0f236e0986f14b051caa16" + integrity sha1-h1jIRvW0B62rDyNuCYbxSwUcqhY= + dependencies: + define-properties "^1.1.2" + es-abstract "^1.5.1" + object.pick@^1.3.0: version "1.3.0" resolved "https://registry.yarnpkg.com/object.pick/-/object.pick-1.3.0.tgz#87a10ac4c1694bd2e1cbf53591a66141fb5dd747" @@ -2678,7 +4039,17 @@ object.pick@^1.3.0: dependencies: isobject "^3.0.1" -once@1.x, once@^1.3.0, once@^1.3.1, once@^1.4.0: +object.values@^1.1.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/object.values/-/object.values-1.1.0.tgz#bf6810ef5da3e5325790eaaa2be213ea84624da9" + integrity sha512-8mf0nKLAoFX6VlNVdhGj31SVYpaNFtUnuoOXWyFEstsWRgU837AK+JYM0iAxwkSzGRbwn8cbFmgbyxj1j4VbXg== + dependencies: + define-properties "^1.1.3" + es-abstract "^1.12.0" + function-bind "^1.1.1" + has "^1.0.3" + +once@^1.3.0, once@^1.3.1, once@^1.4.0: version "1.4.0" resolved "https://registry.yarnpkg.com/once/-/once-1.4.0.tgz#583b1aa775961d4b113ac17d9c50baef9dd76bd1" integrity sha1-WDsap3WWHUsROsF9nFC6753Xa9E= @@ -2749,6 +4120,13 @@ p-defer@^1.0.0: resolved "https://registry.yarnpkg.com/p-defer/-/p-defer-1.0.0.tgz#9f6eb182f6c9aa8cd743004a7d4f96b196b0fb0c" integrity sha1-n26xgvbJqozXQwBKfU+WsZaw+ww= +p-each-series@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/p-each-series/-/p-each-series-1.0.0.tgz#930f3d12dd1f50e7434457a22cd6f04ac6ad7f71" + integrity sha1-kw89Et0fUOdDRFeiLNbwSsatf3E= + dependencies: + p-reduce "^1.0.0" + p-finally@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/p-finally/-/p-finally-1.0.0.tgz#3fbcfb15b899a44123b34b6dcc18b724336a2cae" @@ -2759,13 +4137,27 @@ p-is-promise@^2.0.0: resolved "https://registry.yarnpkg.com/p-is-promise/-/p-is-promise-2.1.0.tgz#918cebaea248a62cf7ffab8e3bca8c5f882fc42e" integrity sha512-Y3W0wlRPK8ZMRbNq97l4M5otioeA5lm1z7bkNkxCka8HSPjR0xRWmpCmc9utiaLP9Jb1eD8BgeIxTW4AIF45Pg== +p-limit@^1.1.0: + version "1.3.0" + resolved "https://registry.yarnpkg.com/p-limit/-/p-limit-1.3.0.tgz#b86bd5f0c25690911c7590fcbfc2010d54b3ccb8" + integrity sha512-vvcXsLAJ9Dr5rQOPk7toZQZJApBl2K4J6dANSsEuh6QI41JYcsS/qhTGa9ErIUUgK3WNQoJYvylxvjqmiqEA9Q== + dependencies: + p-try "^1.0.0" + p-limit@^2.0.0: - version "2.2.0" - resolved "https://registry.yarnpkg.com/p-limit/-/p-limit-2.2.0.tgz#417c9941e6027a9abcba5092dd2904e255b5fbc2" - integrity sha512-pZbTJpoUsCzV48Mc9Nh51VbwO0X9cuPFE8gYwx9BTCt9SF8/b7Zljd2fVgOxhIF/HDTKgpVzs+GPhyKfjLLFRQ== + version "2.2.1" + resolved "https://registry.yarnpkg.com/p-limit/-/p-limit-2.2.1.tgz#aa07a788cc3151c939b5131f63570f0dd2009537" + integrity sha512-85Tk+90UCVWvbDavCLKPOLC9vvY8OwEX/RtKF+/1OADJMVlFfEHOiMTPVyxg7mk/dKa+ipdHm0OUkTvCpMTuwg== dependencies: p-try "^2.0.0" +p-locate@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/p-locate/-/p-locate-2.0.0.tgz#20a0103b222a70c8fd39cc2e580680f3dde5ec43" + integrity sha1-IKAQOyIqcMj9OcwuWAaA893l7EM= + dependencies: + p-limit "^1.1.0" + p-locate@^3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/p-locate/-/p-locate-3.0.0.tgz#322d69a05c0264b25997d9f40cd8a891ab0064a4" @@ -2773,6 +4165,16 @@ p-locate@^3.0.0: dependencies: p-limit "^2.0.0" +p-reduce@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/p-reduce/-/p-reduce-1.0.0.tgz#18c2b0dd936a4690a529f8231f58a0fdb6a47dfa" + integrity sha1-GMKw3ZNqRpClKfgjH1ig/bakffo= + +p-try@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/p-try/-/p-try-1.0.0.tgz#cbc79cdbaf8fd4228e13f621f2b1a237c1b207b3" + integrity sha1-y8ec26+P1CKOE/Yh8rGiN8GyB7M= + p-try@^2.0.0: version "2.2.0" resolved "https://registry.yarnpkg.com/p-try/-/p-try-2.2.0.tgz#cb2868540e313d61de58fafbe35ce9004d5540e6" @@ -2798,9 +4200,9 @@ parents@^1.0.0, parents@^1.0.1: path-platform "~0.11.15" parse-asn1@^5.0.0: - version "5.1.4" - resolved "https://registry.yarnpkg.com/parse-asn1/-/parse-asn1-5.1.4.tgz#37f6628f823fbdeb2273b4d540434a22f3ef1fcc" - integrity sha512-Qs5duJcuvNExRfFZ99HDD3z4mAi3r9Wl/FOjEOijlxwCZs7E7mW2vjTpgQ4J8LpTF8x5v+1Vn5UQFejmWT11aw== + version "5.1.5" + resolved "https://registry.yarnpkg.com/parse-asn1/-/parse-asn1-5.1.5.tgz#003271343da58dc94cace494faef3d2147ecea0e" + integrity sha512-jkMYn1dcJqF6d5CpU689bq7w/b5ALS9ROVSpQDPrZsqqesUJii9qutvoT5ltGedNXMO2e16YUWIghG9KxaViTQ== dependencies: asn1.js "^4.0.0" browserify-aes "^1.0.0" @@ -2809,6 +4211,13 @@ parse-asn1@^5.0.0: pbkdf2 "^3.0.3" safe-buffer "^5.1.1" +parse-json@^2.2.0: + version "2.2.0" + resolved "https://registry.yarnpkg.com/parse-json/-/parse-json-2.2.0.tgz#f480f40434ef80741f8469099f8dea18f55a4dc9" + integrity sha1-9ID0BDTvgHQfhGkJn43qGPVaTck= + dependencies: + error-ex "^1.2.0" + parse-json@^4.0.0: version "4.0.0" resolved "https://registry.yarnpkg.com/parse-json/-/parse-json-4.0.0.tgz#be35f5425be1f7f6c747184f98a788cb99477ee0" @@ -2817,6 +4226,11 @@ parse-json@^4.0.0: error-ex "^1.3.1" json-parse-better-errors "^1.0.1" +parse5@4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/parse5/-/parse5-4.0.0.tgz#6d78656e3da8d78b4ec0b906f7c08ef1dfe3f608" + integrity sha512-VrZ7eOd3T1Fk4XWNXMgiGBK/z0MG48BWG2uQNU4I72fkQuKUTZpl+u9k+CxEG0twMVzSmXEEz12z5Fnw1jIQFA== + pascalcase@^0.1.1: version "0.1.1" resolved "https://registry.yarnpkg.com/pascalcase/-/pascalcase-0.1.1.tgz#b363e55e8006ca6fe21784d2db22bd15d7917f14" @@ -2842,11 +4256,6 @@ path-is-absolute@^1.0.0, path-is-absolute@^1.0.1: resolved "https://registry.yarnpkg.com/path-is-absolute/-/path-is-absolute-1.0.1.tgz#174b9268735534ffbc7ace6bf53a5a9e1b5c5f5f" integrity sha1-F0uSaHNVNP+8es5r9TpanhtcX18= -path-is-inside@^1.0.2: - version "1.0.2" - resolved "https://registry.yarnpkg.com/path-is-inside/-/path-is-inside-1.0.2.tgz#365417dede44430d1c11af61027facf074bdfc53" - integrity sha1-NlQX3t5EQw0cEa9hAn+s8HS9/FM= - path-key@^2.0.0, path-key@^2.0.1: version "2.0.1" resolved "https://registry.yarnpkg.com/path-key/-/path-key-2.0.1.tgz#411cadb574c5a140d3a4b1910d40d80cc9f40b40" @@ -2862,6 +4271,13 @@ path-platform@~0.11.15: resolved "https://registry.yarnpkg.com/path-platform/-/path-platform-0.11.15.tgz#e864217f74c36850f0852b78dc7bf7d4a5721bf2" integrity sha1-6GQhf3TDaFDwhSt43Hv31KVyG/I= +path-type@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/path-type/-/path-type-2.0.0.tgz#f012ccb8415b7096fc2daa1054c3d72389594c73" + integrity sha1-8BLMuEFbcJb8LaoQVMPXI4lZTHM= + dependencies: + pify "^2.0.0" + path-type@^3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/path-type/-/path-type-3.0.0.tgz#cef31dc8e0a1a3bb0d105c0cd97cf3bf47f4e36f" @@ -2885,7 +4301,7 @@ performance-now@^2.1.0: resolved "https://registry.yarnpkg.com/performance-now/-/performance-now-2.1.0.tgz#6309f4e0e5fa913ec1c69307ae364b4b377c9e7b" integrity sha1-Ywn04OX6kT7BxpMHrjZLSzd8nns= -pify@^2.3.0: +pify@^2.0.0, pify@^2.3.0: version "2.3.0" resolved "https://registry.yarnpkg.com/pify/-/pify-2.3.0.tgz#ed141a6ac043a849ea588498e7dca8b15330e90c" integrity sha1-7RQaasBDqEnqWISY59yosVMw6Qw= @@ -2900,12 +4316,38 @@ pify@^4.0.1: resolved "https://registry.yarnpkg.com/pify/-/pify-4.0.1.tgz#4b2cd25c50d598735c50292224fd8c6df41e3231" integrity sha512-uB80kBFb/tfd68bVleG9T5GGsGPjJrLAUpR5PZIrhBnIaRTQRjqdJSsIKkOP6OAIFbj7GOrcudc5pNjZ+geV2g== +pirates@^4.0.1: + version "4.0.1" + resolved "https://registry.yarnpkg.com/pirates/-/pirates-4.0.1.tgz#643a92caf894566f91b2b986d2c66950a8e2fb87" + integrity sha512-WuNqLTbMI3tmfef2TKxlQmAiLHKtFhlsCZnPIpuv2Ow0RDVO8lfy1Opf4NUzlMXLjPl+Men7AuVdX6TA+s+uGA== + dependencies: + node-modules-regexp "^1.0.0" + +pkg-dir@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/pkg-dir/-/pkg-dir-2.0.0.tgz#f6d5d1109e19d63edf428e0bd57e12777615334b" + integrity sha1-9tXREJ4Z1j7fQo4L1X4Sd3YVM0s= + dependencies: + find-up "^2.1.0" + +pkg-dir@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/pkg-dir/-/pkg-dir-3.0.0.tgz#2749020f239ed990881b1f71210d51eb6523bea3" + integrity sha512-/E57AYkoeQ25qkxMj5PBOVgF8Kiu/h7cYS30Z5+R7WaiCCBfLq58ZI/dSeaEKb9WVJV5n/03QwrN3IeWIFllvw== + dependencies: + find-up "^3.0.0" + +pn@^1.1.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/pn/-/pn-1.1.0.tgz#e2f4cef0e219f463c179ab37463e4e1ecdccbafb" + integrity sha512-2qHaIQr2VLRFoxe2nASzsV6ef4yOOH+Fi9FBOVH6cqeSgUnoyySPZkxzLuzd+RYOQTRpROA0ztTMqxROKSb/nA== + posix-character-classes@^0.1.0: version "0.1.1" resolved "https://registry.yarnpkg.com/posix-character-classes/-/posix-character-classes-0.1.1.tgz#01eac0fe3b5af71a2a6c02feabb8c1fef7e00eab" integrity sha1-AerA/jta9xoqbAL+q7jB/vfgDqs= -postcss-cli@^6.1.2: +postcss-cli@^6.1.3: version "6.1.3" resolved "https://registry.yarnpkg.com/postcss-cli/-/postcss-cli-6.1.3.tgz#a9eec3e9cde4aaa90170546baf706f8af6f8ecec" integrity sha512-eieqJU+OR1OFc/lQqMsDmROTJpoMZFvoAQ+82utBQ8/8qGMTfH9bBSPsTdsagYA8uvNzxHw2I2cNSSJkLAGhvw== @@ -2941,15 +4383,15 @@ postcss-reporter@^6.0.0: log-symbols "^2.2.0" postcss "^7.0.7" -postcss-value-parser@^4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/postcss-value-parser/-/postcss-value-parser-4.0.0.tgz#99a983d365f7b2ad8d0f9b8c3094926eab4b936d" - integrity sha512-ESPktioptiSUchCKgggAkzdmkgzKfmp0EU8jXH+5kbIUB+unr0Y4CY9SRMvibuvYUBjNh1ACLbxqYNpdTQOteQ== +postcss-value-parser@^4.0.2: + version "4.0.2" + resolved "https://registry.yarnpkg.com/postcss-value-parser/-/postcss-value-parser-4.0.2.tgz#482282c09a42706d1fc9a069b73f44ec08391dc9" + integrity sha512-LmeoohTpp/K4UiyQCwuGWlONxXamGzCMtFxLq4W1nZVGIQLYvMCJx3yAF9qyyuFpflABI9yVdtJAqbihOsCsJQ== -postcss@^7.0.0, postcss@^7.0.17, postcss@^7.0.7: - version "7.0.17" - resolved "https://registry.yarnpkg.com/postcss/-/postcss-7.0.17.tgz#4da1bdff5322d4a0acaab4d87f3e782436bad31f" - integrity sha512-546ZowA+KZ3OasvQZHsbuEpysvwTZNGJv9EfyCQdsIDltPSWHAeTQ5fQy/Npi2ZDtLI3zs7Ps/p6wThErhm9fQ== +postcss@^7.0.0, postcss@^7.0.18, postcss@^7.0.7: + version "7.0.18" + resolved "https://registry.yarnpkg.com/postcss/-/postcss-7.0.18.tgz#4b9cda95ae6c069c67a4d933029eddd4838ac233" + integrity sha512-/7g1QXXgegpF+9GJj4iN7ChGF40sYuGYJ8WZu8DZWnmhQ/G36hfdk3q9LBJmoK+lZ+yzZ5KYpOoxq7LF1BxE8g== dependencies: chalk "^2.4.2" source-map "^0.6.1" @@ -2960,6 +4402,28 @@ prelude-ls@~1.1.2: resolved "https://registry.yarnpkg.com/prelude-ls/-/prelude-ls-1.1.2.tgz#21932a549f5e52ffd9a827f570e04be62a97da54" integrity sha1-IZMqVJ9eUv/ZqCf1cOBL5iqX2lQ= +prettier-linter-helpers@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/prettier-linter-helpers/-/prettier-linter-helpers-1.0.0.tgz#d23d41fe1375646de2d0104d3454a3008802cf7b" + integrity sha512-GbK2cP9nraSSUF9N2XwUwqfzlAFlMNYYl+ShE/V+H8a9uNl/oUqB1w2EL54Jh0OlyRSd8RfWYJ3coVS4TROP2w== + dependencies: + fast-diff "^1.1.2" + +prettier@1.18.2: + version "1.18.2" + resolved "https://registry.yarnpkg.com/prettier/-/prettier-1.18.2.tgz#6823e7c5900017b4bd3acf46fe9ac4b4d7bda9ea" + integrity sha512-OeHeMc0JhFE9idD4ZdtNibzY0+TPHSpSSb9h8FqtP+YnoZZ1sl8Vc9b1sasjfymH3SonAF4QcA2+mzHPhMvIiw== + +pretty-format@^24.9.0: + version "24.9.0" + resolved "https://registry.yarnpkg.com/pretty-format/-/pretty-format-24.9.0.tgz#12fac31b37019a4eea3c11aa9a959eb7628aa7c9" + integrity sha512-00ZMZUiHaJrNfk33guavqgvfJS30sLYf0f8+Srklv0AMPodGGHcoHgksZ3OThYnIvOd+8yMCn0YiEOogjlgsnA== + dependencies: + "@jest/types" "^24.9.0" + ansi-regex "^4.0.0" + ansi-styles "^3.2.0" + react-is "^16.8.4" + pretty-hrtime@^1.0.3: version "1.0.3" resolved "https://registry.yarnpkg.com/pretty-hrtime/-/pretty-hrtime-1.0.3.tgz#b7e3ea42435a4c9b2759d99e0f201eb195802ee1" @@ -2980,10 +4444,18 @@ progress@^2.0.0: resolved "https://registry.yarnpkg.com/progress/-/progress-2.0.3.tgz#7e8cf8d8f5b8f239c1bc68beb4eb78567d572ef8" integrity sha512-7PiHtLll5LdnKIMw100I+8xJXR5gW2QwWYkT6iJva0bXitZKa/XMrSbdmg3r2Xnaidz9Qumd0VPaMrZlF9V9sA== +prompts@^2.0.1: + version "2.2.1" + resolved "https://registry.yarnpkg.com/prompts/-/prompts-2.2.1.tgz#f901dd2a2dfee080359c0e20059b24188d75ad35" + integrity sha512-VObPvJiWPhpZI6C5m60XOzTfnYg/xc/an+r9VYymj9WJW3B/DIH+REzjpAACPf8brwPeP+7vz3bIim3S+AaMjw== + dependencies: + kleur "^3.0.3" + sisteransi "^1.0.3" + psl@^1.1.24, psl@^1.1.28: - version "1.2.0" - resolved "https://registry.yarnpkg.com/psl/-/psl-1.2.0.tgz#df12b5b1b3a30f51c329eacbdef98f3a6e136dc6" - integrity sha512-GEn74ZffufCmkDDLNcl3uuyF/aSD6exEyh1v/ZSdAomB82t6G9hzJVRx0jBmLDW+VfZqks3aScmMw9DszwUalA== + version "1.4.0" + resolved "https://registry.yarnpkg.com/psl/-/psl-1.4.0.tgz#5dd26156cdb69fa1fdb8ab1991667d3f80ced7c2" + integrity sha512-HZzqCGPecFLyoRj5HLfuDSKYTJkAfB5thKBIkRHtGjWwY7p1dAyveIbXIq4tO0KYfDF2tHqPUgY9SDnGm00uFw== public-encrypt@^4.0.0: version "4.0.3" @@ -3060,6 +4532,11 @@ rc@^1.2.7: minimist "^1.2.0" strip-json-comments "~2.0.1" +react-is@^16.8.4: + version "16.10.2" + resolved "https://registry.yarnpkg.com/react-is/-/react-is-16.10.2.tgz#984120fd4d16800e9a738208ab1fba422d23b5ab" + integrity sha512-INBT1QEgtcCCgvccr5/86CfD71fw9EPmDxgiJX4I2Ddr6ZsV6iFXsuby+qWJPtmNuMY0zByTsG4468P7nHuNWA== + read-cache@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/read-cache/-/read-cache-1.0.0.tgz#e664ef31161166c9751cdbe8dbcf86b5fb58f774" @@ -3074,7 +4551,41 @@ read-only-stream@^2.0.0: dependencies: readable-stream "^2.0.2" -readable-stream@^2.0.2, readable-stream@^2.0.6, readable-stream@^2.2.2, readable-stream@^2.3.6, readable-stream@~2.3.6: +read-pkg-up@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/read-pkg-up/-/read-pkg-up-2.0.0.tgz#6b72a8048984e0c41e79510fd5e9fa99b3b549be" + integrity sha1-a3KoBImE4MQeeVEP1en6mbO1Sb4= + dependencies: + find-up "^2.0.0" + read-pkg "^2.0.0" + +read-pkg-up@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/read-pkg-up/-/read-pkg-up-4.0.0.tgz#1b221c6088ba7799601c808f91161c66e58f8978" + integrity sha512-6etQSH7nJGsK0RbG/2TeDzZFa8shjQ1um+SwQQ5cwKy0dhSXdOncEhb1CPpvQG4h7FyOV6EB6YlV0yJvZQNAkA== + dependencies: + find-up "^3.0.0" + read-pkg "^3.0.0" + +read-pkg@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/read-pkg/-/read-pkg-2.0.0.tgz#8ef1c0623c6a6db0dc6713c4bfac46332b2368f8" + integrity sha1-jvHAYjxqbbDcZxPEv6xGMysjaPg= + dependencies: + load-json-file "^2.0.0" + normalize-package-data "^2.3.2" + path-type "^2.0.0" + +read-pkg@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/read-pkg/-/read-pkg-3.0.0.tgz#9cbc686978fee65d16c00e2b19c237fcf6e38389" + integrity sha1-nLxoaXj+5l0WwA4rGcI3/Pbjg4k= + dependencies: + load-json-file "^4.0.0" + normalize-package-data "^2.3.2" + path-type "^3.0.0" + +readable-stream@^2.0.2, readable-stream@^2.0.6, readable-stream@^2.2.2, readable-stream@~2.3.6: version "2.3.6" resolved "https://registry.yarnpkg.com/readable-stream/-/readable-stream-2.3.6.tgz#b11c27d88b8ff1fbe070643cf94b0c79ae1b0aaf" integrity sha512-tQtKA9WIAhBF3+VLAseyMqZeBjW0AHJoxOtYqSUZNJxauErmLbVm2FW1y+J/YA9dUrAC39ITejlZWhVIwawkKw== @@ -3087,6 +4598,15 @@ readable-stream@^2.0.2, readable-stream@^2.0.6, readable-stream@^2.2.2, readable string_decoder "~1.1.1" util-deprecate "~1.0.1" +readable-stream@^3.0.6: + version "3.4.0" + resolved "https://registry.yarnpkg.com/readable-stream/-/readable-stream-3.4.0.tgz#a51c26754658e0a3c21dbf59163bd45ba6f447fc" + integrity sha512-jItXPLmrSR8jmTRmRWJXCnGJsfy85mB3Wd/uINMXA65yrnFo0cPClFIUWzo2najVNSl+mx7/4W8ttlLWJe99pQ== + dependencies: + inherits "^2.0.3" + string_decoder "^1.1.1" + util-deprecate "^1.0.1" + readdirp@^2.2.1: version "2.2.1" resolved "https://registry.yarnpkg.com/readdirp/-/readdirp-2.2.1.tgz#0e87622a3325aa33e892285caf8b4e846529a525" @@ -3096,6 +4616,13 @@ readdirp@^2.2.1: micromatch "^3.1.10" readable-stream "^2.0.2" +realpath-native@^1.1.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/realpath-native/-/realpath-native-1.1.0.tgz#2003294fea23fb0672f2476ebe22fcf498a2d65c" + integrity sha512-wlgPA6cCIIg9gKz0fgAPjnzh4yR/LnXovwuo9hvyGvx3h8nX4+/iLZplfUWasXpqD8BdnGnP5njOFjkUwPzvjA== + dependencies: + util.promisify "^1.0.0" + regex-not@^1.0.0, regex-not@^1.0.2: version "1.0.2" resolved "https://registry.yarnpkg.com/regex-not/-/regex-not-1.0.2.tgz#1f4ece27e00b0b65e0247a6810e6a85d83a5752c" @@ -3131,6 +4658,15 @@ request-promise-core@1.1.2: dependencies: lodash "^4.17.11" +request-promise-native@^1.0.5: + version "1.0.7" + resolved "https://registry.yarnpkg.com/request-promise-native/-/request-promise-native-1.0.7.tgz#a49868a624bdea5069f1251d0a836e0d89aa2c59" + integrity sha512-rIMnbBdgNViL37nZ1b3L/VfPOpSi0TqVDQPAvO6U14lMzOLrt5nilxCQqtDKhZeDiW0/hkCXGoQjhgJd/tCh6w== + dependencies: + request-promise-core "1.1.2" + stealthy-require "^1.1.1" + tough-cookie "^2.3.3" + request-promise@^4.x: version "4.2.4" resolved "https://registry.yarnpkg.com/request-promise/-/request-promise-4.2.4.tgz#1c5ed0d71441e38ad58c7ce4ea4ea5b06d54b310" @@ -3141,7 +4677,7 @@ request-promise@^4.x: stealthy-require "^1.1.1" tough-cookie "^2.3.3" -request@^2.88.0: +request@^2.87.0, request@^2.88.0: version "2.88.0" resolved "https://registry.yarnpkg.com/request/-/request-2.88.0.tgz#9c2fca4f7d35b592efe57c7f0a55e81052124fef" integrity sha512-NAqBSrijGLZdM0WZNsInLJpkJokL72XYjUpnB0iwsRgxh7dB6COrHnTBNwN0E+lHDAJzu7kLAkDeY08z2/A0hg== @@ -3177,6 +4713,18 @@ require-main-filename@^1.0.1: resolved "https://registry.yarnpkg.com/require-main-filename/-/require-main-filename-1.0.1.tgz#97f717b69d48784f5f526a6c5aa8ffdda055a4d1" integrity sha1-l/cXtp1IeE9fUmpsWqj/3aBVpNE= +require-main-filename@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/require-main-filename/-/require-main-filename-2.0.0.tgz#d0b329ecc7cc0f61649f62215be69af54aa8989b" + integrity sha512-NKN5kMDylKuldxYLSUfrbo5Tuzh4hd+2E8NPPX02mZtn1VuREQToYe/ZdlJy+J3uCpfaiGF05e7B8W0iXbQHmg== + +resolve-cwd@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/resolve-cwd/-/resolve-cwd-2.0.0.tgz#00a9f7387556e27038eae232caa372a6a59b665a" + integrity sha1-AKn3OHVW4nA46uIyyqNypqWbZlo= + dependencies: + resolve-from "^3.0.0" + resolve-from@^3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/resolve-from/-/resolve-from-3.0.0.tgz#b22c7af7d9d6881bc8b6e653335eebcb0a188748" @@ -3192,15 +4740,15 @@ resolve-url@^0.2.1: resolved "https://registry.yarnpkg.com/resolve-url/-/resolve-url-0.2.1.tgz#2c637fe77c893afd2a663fe21aa9080068e2052a" integrity sha1-LGN/53yJOv0qZj/iGqkIAGjiBSo= -resolve@1.1.7, resolve@1.1.x: +resolve@1.1.7: version "1.1.7" resolved "https://registry.yarnpkg.com/resolve/-/resolve-1.1.7.tgz#203114d82ad2c5ed9e8e0411b3932875e889e97b" integrity sha1-IDEU2CrSxe2ejgQRs5ModeiJ6Xs= -resolve@^1.1.4, resolve@^1.4.0: - version "1.11.1" - resolved "https://registry.yarnpkg.com/resolve/-/resolve-1.11.1.tgz#ea10d8110376982fef578df8fc30b9ac30a07a3e" - integrity sha512-vIpgF6wfuJOZI7KKKSP+HmiKggadPQAdsp5HiC1mvqnfp0gF1vdwgBWZIdrVft9pgqoMFQN+R7BSWZiBxx+BBw== +resolve@1.x, resolve@^1.1.4, resolve@^1.10.0, resolve@^1.10.1, resolve@^1.11.0, resolve@^1.3.2, resolve@^1.4.0, resolve@^1.5.0: + version "1.12.0" + resolved "https://registry.yarnpkg.com/resolve/-/resolve-1.12.0.tgz#3fc644a35c84a48554609ff26ec52b66fa577df6" + integrity sha512-B/dOmuoAik5bKcD6s6nXDCjzUKnaDvdkRyAk6rsmsKLipWj4797iothd7jmmUhWTfinVMU+wc56rYKsit2Qy4w== dependencies: path-parse "^1.0.6" @@ -3217,13 +4765,20 @@ ret@~0.1.10: resolved "https://registry.yarnpkg.com/ret/-/ret-0.1.15.tgz#b8a4825d5bdb1fc3f6f53c2bc33f81388681c7bc" integrity sha512-TTlYpa+OL+vMMNG24xSlQGEJ3B/RzEfUlLct7b5G/ytav+wPrplCpVMFuwzXbkecJrb6IYo1iFb0S9v37754mg== -rimraf@2.6.3, rimraf@^2.6.1: +rimraf@2.6.3: version "2.6.3" resolved "https://registry.yarnpkg.com/rimraf/-/rimraf-2.6.3.tgz#b2d104fe0d8fb27cf9e0a1cda8262dd3833c6cab" integrity sha512-mwqeW5XsA2qAejG46gYdENaxXjx9onRNCfn7L0duuP4hCuTIi/QO7PDK07KJfp1d+izWPrzEJDcSqBa0OZQriA== dependencies: glob "^7.1.3" +rimraf@^2.5.4, rimraf@^2.6.1, rimraf@^2.6.3: + version "2.7.1" + resolved "https://registry.yarnpkg.com/rimraf/-/rimraf-2.7.1.tgz#35797f13a7fdadc566142c29d4f07ccad483e3ec" + integrity sha512-uWjbaKIK3T1OSVptzX7Nl6PvQ3qAGtKEtVRjRuazjfL3Bx5eI409VZSqgND+4UNnmzLVdPj9FqFJNPqBZFve4w== + dependencies: + glob "^7.1.3" + ripemd160@^2.0.0, ripemd160@^2.0.1: version "2.0.2" resolved "https://registry.yarnpkg.com/ripemd160/-/ripemd160-2.0.2.tgz#a1c1a6f624751577ba5d07914cbc92850585890c" @@ -3232,6 +4787,11 @@ ripemd160@^2.0.0, ripemd160@^2.0.1: hash-base "^3.0.0" inherits "^2.0.1" +rsvp@^4.8.4: + version "4.8.5" + resolved "https://registry.yarnpkg.com/rsvp/-/rsvp-4.8.5.tgz#c8f155311d167f68f21e168df71ec5b083113734" + integrity sha512-nfMOlASu9OnRJo1mbEk2cz0D56a1MBNrJ7orjRZQG10XDyuvwksKbuXNp6qa+kbn839HwjwhBzhFmdsaEAfauA== + run-async@^2.2.0: version "2.3.0" resolved "https://registry.yarnpkg.com/run-async/-/run-async-2.3.0.tgz#0371ab4ae0bdd720d4166d7dfda64ff7a445a6c0" @@ -3240,13 +4800,13 @@ run-async@^2.2.0: is-promise "^2.1.0" rxjs@^6.4.0: - version "6.5.2" - resolved "https://registry.yarnpkg.com/rxjs/-/rxjs-6.5.2.tgz#2e35ce815cd46d84d02a209fb4e5921e051dbec7" - integrity sha512-HUb7j3kvb7p7eCUHE3FqjoDsC1xfZQ4AHFWfTKSpZ+sAhhz5X1WX0ZuUqWbzB2QhSLp3DoLUG+hMdEDKqWo2Zg== + version "6.5.3" + resolved "https://registry.yarnpkg.com/rxjs/-/rxjs-6.5.3.tgz#510e26317f4db91a7eb1de77d9dd9ba0a4899a3a" + integrity sha512-wuYsAYYFdWTAnAaPoKGNhfpWwKZbJW+HgAJ+mImp+Epl7BG8oNWBCTyRM8gba9k4lk8BgWdoYm21Mo/RYhhbgA== dependencies: tslib "^1.9.0" -safe-buffer@^5.0.1, safe-buffer@^5.1.0, safe-buffer@^5.1.1, safe-buffer@^5.1.2: +safe-buffer@^5.0.1, safe-buffer@^5.1.0, safe-buffer@^5.1.1, safe-buffer@^5.1.2, safe-buffer@~5.2.0: version "5.2.0" resolved "https://registry.yarnpkg.com/safe-buffer/-/safe-buffer-5.2.0.tgz#b74daec49b1148f88c64b68d49b1e815c1f2f519" integrity sha512-fZEwUGbVl7kouZs1jCdMLdt95hdIv0ZeHg6L7qPeciMZhZ+/gdesW4wgTARkrFWEpspjEATAzUGPG8N2jJiwbg== @@ -3268,15 +4828,40 @@ safe-regex@^1.1.0: resolved "https://registry.yarnpkg.com/safer-buffer/-/safer-buffer-2.1.2.tgz#44fa161b0187b9549dd84bb91802f9bd8385cd6a" integrity sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg== +sane@^4.0.3: + version "4.1.0" + resolved "https://registry.yarnpkg.com/sane/-/sane-4.1.0.tgz#ed881fd922733a6c461bc189dc2b6c006f3ffded" + integrity sha512-hhbzAgTIX8O7SHfp2c8/kREfEn4qO/9q8C9beyY6+tvZ87EpoZ3i1RIEvp27YBswnNbY9mWd6paKVmKbAgLfZA== + dependencies: + "@cnakazawa/watch" "^1.0.3" + anymatch "^2.0.0" + capture-exit "^2.0.0" + exec-sh "^0.3.2" + execa "^1.0.0" + fb-watchman "^2.0.0" + micromatch "^3.1.4" + minimist "^1.1.1" + walker "~1.0.5" + sax@>=0.6.0, sax@^1.2.4: version "1.2.4" resolved "https://registry.yarnpkg.com/sax/-/sax-1.2.4.tgz#2816234e2378bddc4e5354fab5caa895df7100d9" integrity sha512-NqVDv9TpANUjFm0N8uM5GxL36UgKi9/atZw+x7YFnQ8ckwFGKrl4xX4yWtrey3UJm5nP1kUbnYgLopqWNSRhWw== -semver@^5.3.0, semver@^5.5.0, semver@^5.5.1: - version "5.7.0" - resolved "https://registry.yarnpkg.com/semver/-/semver-5.7.0.tgz#790a7cf6fea5459bac96110b29b60412dc8ff96b" - integrity sha512-Ya52jSX2u7QKghxeoFGpLwCtGlt7j0oY9DYb5apt9nPlJ42ID+ulTXESnt/qAQcoSERyZ5sl3LDIOw0nAn/5DA== +"semver@2 || 3 || 4 || 5", semver@^5.3.0, semver@^5.4.1, semver@^5.5, semver@^5.5.0, semver@^5.6.0: + version "5.7.1" + resolved "https://registry.yarnpkg.com/semver/-/semver-5.7.1.tgz#a954f931aeba508d307bbf069eff0c01c96116f7" + integrity sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ== + +semver@5.5.0: + version "5.5.0" + resolved "https://registry.yarnpkg.com/semver/-/semver-5.5.0.tgz#dc4bbc7a6ca9d916dee5d43516f0092b58f7b8ab" + integrity sha512-4SJ3dm0WAwWy/NVeioZh5AntkdJoWKxHxcmyP622fOkgHa4z3R0TdBJICINyaSDE6uNwVc8gZr+ZinwZAH4xIA== + +semver@^6.0.0, semver@^6.1.0, semver@^6.1.2, semver@^6.2.0, semver@^6.3.0: + version "6.3.0" + resolved "https://registry.yarnpkg.com/semver/-/semver-6.3.0.tgz#ee0a64c8af5e8ceea67687b133761e1becbd1d3d" + integrity sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw== set-blocking@^2.0.0, set-blocking@~2.0.0: version "2.0.0" @@ -3322,14 +4907,14 @@ shebang-regex@^1.0.0: integrity sha1-2kL0l0DAtC2yypcoVxyxkMmO/qM= shell-quote@^1.6.1: - version "1.6.1" - resolved "https://registry.yarnpkg.com/shell-quote/-/shell-quote-1.6.1.tgz#f4781949cce402697127430ea3b3c5476f481767" - integrity sha1-9HgZSczkAmlxJ0MOo7PFR29IF2c= - dependencies: - array-filter "~0.0.0" - array-map "~0.0.0" - array-reduce "~0.0.0" - jsonify "~0.0.0" + version "1.7.2" + resolved "https://registry.yarnpkg.com/shell-quote/-/shell-quote-1.7.2.tgz#67a7d02c76c9da24f99d20808fcaded0e0e04be2" + integrity sha512-mRz/m/JVscCrkMyPqHc/bczi3OQHkLTqXHEFu0zDhK/qfv3UcOA4SVmRCLmos4bhjr9ekVQubj/R7waKapmiQg== + +shellwords@^0.1.1: + version "0.1.1" + resolved "https://registry.yarnpkg.com/shellwords/-/shellwords-0.1.1.tgz#d6b9181c1a48d397324c84871efbcfc73fc0654b" + integrity sha512-vFwSUfQvqybiICwZY5+DAWIPLKsWO31Q91JSKl3UYv+K5c2QRPzn0qzec6QPu1Qc9eHYItiP3NdJqNVqetYAww== signal-exit@^3.0.0, signal-exit@^3.0.2: version "3.0.2" @@ -3341,6 +4926,11 @@ simple-concat@^1.0.0: resolved "https://registry.yarnpkg.com/simple-concat/-/simple-concat-1.0.0.tgz#7344cbb8b6e26fb27d66b2fc86f9f6d5997521c6" integrity sha1-c0TLuLbib7J9ZrL8hvn21Zl1IcY= +sisteransi@^1.0.3: + version "1.0.3" + resolved "https://registry.yarnpkg.com/sisteransi/-/sisteransi-1.0.3.tgz#98168d62b79e3a5e758e27ae63c4a053d748f4eb" + integrity sha512-SbEG75TzH8G7eVXFSN5f9EExILKfly7SUvVY5DhhYLvfhKqhDFY0OzevWa/zwak0RLRfWS5AvfMWpd9gJvr5Yg== + slash@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/slash/-/slash-2.0.0.tgz#de552851a1759df3a8f206535442f5ec4ddeab44" @@ -3396,27 +4986,54 @@ source-map-resolve@^0.5.0: source-map-url "^0.4.0" urix "^0.1.0" +source-map-support@^0.5.6, source-map-support@~0.5.12: + version "0.5.13" + resolved "https://registry.yarnpkg.com/source-map-support/-/source-map-support-0.5.13.tgz#31b24a9c2e73c2de85066c0feb7d44767ed52932" + integrity sha512-SHSKFHadjVA5oR4PPqhtAVdcBWwRYVd6g6cAXnIbRiIwc2EhPrTuKUBdSLvlEKyIP3GCf89fltvcZiP9MMFA1w== + dependencies: + buffer-from "^1.0.0" + source-map "^0.6.0" + source-map-url@^0.4.0: version "0.4.0" resolved "https://registry.yarnpkg.com/source-map-url/-/source-map-url-0.4.0.tgz#3e935d7ddd73631b97659956d55128e87b5084a3" integrity sha1-PpNdfd1zYxuXZZlW1VEo6HtQhKM= -source-map@^0.5.6, source-map@~0.5.3: +source-map@^0.5.0, source-map@^0.5.6, source-map@~0.5.3: version "0.5.7" resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.5.7.tgz#8a039d2d1021d22d1ea14c80d8ea468ba2ef3fcc" integrity sha1-igOdLRAh0i0eoUyA2OpGi6LvP8w= -source-map@^0.6.1, source-map@~0.6.0, source-map@~0.6.1: +source-map@^0.6.0, source-map@^0.6.1, source-map@~0.6.0, source-map@~0.6.1: version "0.6.1" resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.6.1.tgz#74722af32e9614e9c287a8d0bbde48b5e2f1a263" integrity sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g== -source-map@~0.2.0: - version "0.2.0" - resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.2.0.tgz#dab73fbcfc2ba819b4de03bd6f6eaa48164b3f9d" - integrity sha1-2rc/vPwrqBm03gO9b26qSBZLP50= +spdx-correct@^3.0.0: + version "3.1.0" + resolved "https://registry.yarnpkg.com/spdx-correct/-/spdx-correct-3.1.0.tgz#fb83e504445268f154b074e218c87c003cd31df4" + integrity sha512-lr2EZCctC2BNR7j7WzJ2FpDznxky1sjfxvvYEyzxNyb6lZXHODmEoJeFu4JupYlkfha1KZpJyoqiJ7pgA1qq8Q== dependencies: - amdefine ">=0.0.4" + spdx-expression-parse "^3.0.0" + spdx-license-ids "^3.0.0" + +spdx-exceptions@^2.1.0: + version "2.2.0" + resolved "https://registry.yarnpkg.com/spdx-exceptions/-/spdx-exceptions-2.2.0.tgz#2ea450aee74f2a89bfb94519c07fcd6f41322977" + integrity sha512-2XQACfElKi9SlVb1CYadKDXvoajPgBVPn/gOQLrTvHdElaVhr7ZEbqJaRnJLVNeaI4cMEAgVCeBMKF6MWRDCRA== + +spdx-expression-parse@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/spdx-expression-parse/-/spdx-expression-parse-3.0.0.tgz#99e119b7a5da00e05491c9fa338b7904823b41d0" + integrity sha512-Yg6D3XpRD4kkOmTpdgbUiEJFKghJH03fiC1OPll5h/0sO6neh2jqRDVHOQ4o/LMea0tgCkbMgea5ip/e+MkWyg== + dependencies: + spdx-exceptions "^2.1.0" + spdx-license-ids "^3.0.0" + +spdx-license-ids@^3.0.0: + version "3.0.5" + resolved "https://registry.yarnpkg.com/spdx-license-ids/-/spdx-license-ids-3.0.5.tgz#3694b5804567a458d3c8045842a6358632f62654" + integrity sha512-J+FWzZoynJEXGphVIS+XEh3kFSjZX/1i9gFBaWQcB+/tmpe2qUsSBABpcxqxnAxFdiUFEgAX1bjYGQvIZmoz9Q== split-string@^3.0.1, split-string@^3.0.2: version "3.1.0" @@ -3445,6 +5062,11 @@ sshpk@^1.7.0: safer-buffer "^2.0.2" tweetnacl "~0.14.0" +stack-utils@^1.0.1: + version "1.0.2" + resolved "https://registry.yarnpkg.com/stack-utils/-/stack-utils-1.0.2.tgz#33eba3897788558bebfc2db059dc158ec36cebb8" + integrity sha512-MTX+MeG5U994cazkjd/9KNAapsHnibjMLnfXodlkXw76JEea0UiNzrqidzo1emMwk7w5Qhc9jd4Bn9TBb1MFwA== + static-extend@^0.1.1: version "0.1.2" resolved "https://registry.yarnpkg.com/static-extend/-/static-extend-0.1.2.tgz#60809c39cbff55337226fd5e0b520f341f1fb5c6" @@ -3474,15 +5096,14 @@ stream-combiner2@^1.1.1: duplexer2 "~0.1.0" readable-stream "^2.0.2" -stream-http@^2.0.0: - version "2.8.3" - resolved "https://registry.yarnpkg.com/stream-http/-/stream-http-2.8.3.tgz#b2d242469288a5a27ec4fe8933acf623de6514fc" - integrity sha512-+TSkfINHDo4J+ZobQLWiMouQYB+UVYFttRA94FpEzzJ7ZdqcL4uUUQ7WkdkI4DSozGmgBUE/a47L+38PenXhUw== +stream-http@^3.0.0: + version "3.1.0" + resolved "https://registry.yarnpkg.com/stream-http/-/stream-http-3.1.0.tgz#22fb33fe9b4056b4eccf58bd8f400c4b993ffe57" + integrity sha512-cuB6RgO7BqC4FBYzmnvhob5Do3wIdIsXAgGycHJnW+981gHqoYcYz9lqjJrk8WXRddbwPuqPYRl+bag6mYv4lw== dependencies: builtin-status-codes "^3.0.0" inherits "^2.0.1" - readable-stream "^2.3.6" - to-arraybuffer "^1.0.0" + readable-stream "^3.0.6" xtend "^4.0.0" stream-splicer@^2.0.0: @@ -3493,6 +5114,14 @@ stream-splicer@^2.0.0: inherits "^2.0.1" readable-stream "^2.0.2" +string-length@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/string-length/-/string-length-2.0.0.tgz#d40dbb686a3ace960c1cffca562bf2c45f8363ed" + integrity sha1-1A27aGo6zpYMHP/KVivyxF+DY+0= + dependencies: + astral-regex "^1.0.0" + strip-ansi "^4.0.0" + string-width@^1.0.1: version "1.0.2" resolved "https://registry.yarnpkg.com/string-width/-/string-width-1.0.2.tgz#118bdf5b8cdc51a2a7e70d211e07e2b0b9b107d3" @@ -3510,7 +5139,7 @@ string-width@^1.0.1: is-fullwidth-code-point "^2.0.0" strip-ansi "^4.0.0" -string-width@^3.0.0: +string-width@^3.0.0, string-width@^3.1.0: version "3.1.0" resolved "https://registry.yarnpkg.com/string-width/-/string-width-3.1.0.tgz#22767be21b62af1081574306f69ac51b62203961" integrity sha512-vafcv6KjVZKSgz06oM/H6GDBrAtz8vdhQakGjFIvNrHA6y3HCF1CInLy+QLq8dTJPQ1b+KDUqDFctkdRW44e1w== @@ -3519,12 +5148,28 @@ string-width@^3.0.0: is-fullwidth-code-point "^2.0.0" strip-ansi "^5.1.0" -string_decoder@^1.1.1: - version "1.2.0" - resolved "https://registry.yarnpkg.com/string_decoder/-/string_decoder-1.2.0.tgz#fe86e738b19544afe70469243b2a1ee9240eae8d" - integrity sha512-6YqyX6ZWEYguAxgZzHGL7SsCeGx3V2TtOTqZz1xSTSWnqsbWwbptafNyvf/ACquZUXV3DANr5BDIwNYe1mN42w== +string.prototype.trimleft@^2.1.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/string.prototype.trimleft/-/string.prototype.trimleft-2.1.0.tgz#6cc47f0d7eb8d62b0f3701611715a3954591d634" + integrity sha512-FJ6b7EgdKxxbDxc79cOlok6Afd++TTs5szo+zJTUyow3ycrRfJVE2pq3vcN53XexvKZu/DJMDfeI/qMiZTrjTw== dependencies: - safe-buffer "~5.1.0" + define-properties "^1.1.3" + function-bind "^1.1.1" + +string.prototype.trimright@^2.1.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/string.prototype.trimright/-/string.prototype.trimright-2.1.0.tgz#669d164be9df9b6f7559fa8e89945b168a5a6c58" + integrity sha512-fXZTSV55dNBwv16uw+hh5jkghxSnc5oHq+5K/gXgizHwAvMetdAJlHqqoFC1FSDVPYWLkAKl2cxpUT41sV7nSg== + dependencies: + define-properties "^1.1.3" + function-bind "^1.1.1" + +string_decoder@^1.1.1: + version "1.3.0" + resolved "https://registry.yarnpkg.com/string_decoder/-/string_decoder-1.3.0.tgz#42f114594a46cf1a8e30b0a84f56c78c3edac21e" + integrity sha512-hkRX8U1WjJFd8LsDJ2yQ/wWWxaopEsABU1XfkM8A+j0+85JAGppt16cr1Whg6KIbb4okU6Mql6BOj+uup/wKeA== + dependencies: + safe-buffer "~5.2.0" string_decoder@~1.1.1: version "1.1.1" @@ -3547,19 +5192,29 @@ strip-ansi@^4.0.0: dependencies: ansi-regex "^3.0.0" -strip-ansi@^5.1.0: +strip-ansi@^5.0.0, strip-ansi@^5.1.0, strip-ansi@^5.2.0: version "5.2.0" resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-5.2.0.tgz#8c9a536feb6afc962bdfa5b104a5091c1ad9c0ae" integrity sha512-DuRs1gKbBqsMKIZlrffwlug8MHkcnpjs5VPmL1PAh+mA30U0DTotfDZ0d2UUsXpPmPmMMJ6W773MaA3J+lbiWA== dependencies: ansi-regex "^4.1.0" +strip-bom@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/strip-bom/-/strip-bom-3.0.0.tgz#2334c18e9c759f7bdd56fdef7e9ae3d588e68ed3" + integrity sha1-IzTBjpx1n3vdVv3vfprj1YjmjtM= + strip-eof@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/strip-eof/-/strip-eof-1.0.0.tgz#bb43ff5598a6eb05d89b59fcd129c983313606bf" integrity sha1-u0P/VZim6wXYm1n80SnJgzE2Br8= -strip-json-comments@^2.0.1, strip-json-comments@~2.0.1: +strip-json-comments@^3.0.1: + version "3.0.1" + resolved "https://registry.yarnpkg.com/strip-json-comments/-/strip-json-comments-3.0.1.tgz#85713975a91fb87bf1b305cca77395e40d2a64a7" + integrity sha512-VTyMAUfdm047mwKl+u79WIdrZxtFtn+nBxHeb844XBQ9uMNTuTHdx2hc5RiAJYqwTj3wc/xe5HLSdJSkJ+WfZw== + +strip-json-comments@~2.0.1: version "2.0.1" resolved "https://registry.yarnpkg.com/strip-json-comments/-/strip-json-comments-2.0.1.tgz#3c531942e908c2697c0ec344858c286c7ca0a60a" integrity sha1-PFMZQukIwml8DsNEhYwobHygpgo= @@ -3578,13 +5233,6 @@ supports-color@5.4.0: dependencies: has-flag "^3.0.0" -supports-color@^3.1.0: - version "3.2.3" - resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-3.2.3.tgz#65ac0504b3954171d8a64946b2ae3cbb8a5f54f6" - integrity sha1-ZawFBLOVQXHYpklGsq48u4pfVPY= - dependencies: - has-flag "^1.0.0" - supports-color@^5.3.0: version "5.5.0" resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-5.5.0.tgz#e2e69a44ac8772f78a1ec0b35b689df6530efc8f" @@ -3599,6 +5247,11 @@ supports-color@^6.1.0: dependencies: has-flag "^3.0.0" +symbol-tree@^3.2.2: + version "3.2.4" + resolved "https://registry.yarnpkg.com/symbol-tree/-/symbol-tree-3.2.4.tgz#430637d248ba77e078883951fb9aa0eed7c63fa2" + integrity sha512-9QNk5KwDF+Bvz+PyObkmSYjI5ksVUYtjW7AU22r2NKcfLJcXp96hkDWU3+XndOsUb+AQ9QhfzfCT2O+CNWT5Tw== + syntax-error@^1.1.1: version "1.4.0" resolved "https://registry.yarnpkg.com/syntax-error/-/syntax-error-1.4.0.tgz#2d9d4ff5c064acb711594a3e3b95054ad51d907c" @@ -3607,33 +5260,57 @@ syntax-error@^1.1.1: acorn-node "^1.2.0" table@^5.2.3: - version "5.4.1" - resolved "https://registry.yarnpkg.com/table/-/table-5.4.1.tgz#0691ae2ebe8259858efb63e550b6d5f9300171e8" - integrity sha512-E6CK1/pZe2N75rGZQotFOdmzWQ1AILtgYbMAbAjvms0S1l5IDB47zG3nCnFGB/w+7nB3vKofbLXCH7HPBo864w== + version "5.4.6" + resolved "https://registry.yarnpkg.com/table/-/table-5.4.6.tgz#1292d19500ce3f86053b05f0e8e7e4a3bb21079e" + integrity sha512-wmEc8m4fjnob4gt5riFRtTu/6+4rSe12TpAELNSqHMfF3IqnA+CH37USM6/YR3qRZv7e56kAEAtd6nKZaxe0Ug== dependencies: - ajv "^6.9.1" - lodash "^4.17.11" + ajv "^6.10.2" + lodash "^4.17.14" slice-ansi "^2.1.0" string-width "^3.0.0" tar@^4: - version "4.4.10" - resolved "https://registry.yarnpkg.com/tar/-/tar-4.4.10.tgz#946b2810b9a5e0b26140cf78bea6b0b0d689eba1" - integrity sha512-g2SVs5QIxvo6OLp0GudTqEf05maawKUxXru104iaayWA09551tFCTI8f1Asb4lPfkBr91k07iL4c11XO3/b0tA== + version "4.4.13" + resolved "https://registry.yarnpkg.com/tar/-/tar-4.4.13.tgz#43b364bc52888d555298637b10d60790254ab525" + integrity sha512-w2VwSrBoHa5BsSyH+KxEqeQBAllHhccyMFVHtGtdMpF4W7IRWfZjFiQceJPChOeTsSDVUpER2T8FA93pr0L+QA== dependencies: chownr "^1.1.1" fs-minipass "^1.2.5" - minipass "^2.3.5" + minipass "^2.8.6" minizlib "^1.2.1" mkdirp "^0.5.0" safe-buffer "^5.1.2" yallist "^3.0.3" +terser@^4.3.8: + version "4.3.8" + resolved "https://registry.yarnpkg.com/terser/-/terser-4.3.8.tgz#707f05f3f4c1c70c840e626addfdb1c158a17136" + integrity sha512-otmIRlRVmLChAWsnSFNO0Bfk6YySuBp6G9qrHiJwlLDd4mxe2ta4sjI7TzIR+W1nBMjilzrMcPOz9pSusgx3hQ== + dependencies: + commander "^2.20.0" + source-map "~0.6.1" + source-map-support "~0.5.12" + +test-exclude@^5.2.3: + version "5.2.3" + resolved "https://registry.yarnpkg.com/test-exclude/-/test-exclude-5.2.3.tgz#c3d3e1e311eb7ee405e092dac10aefd09091eac0" + integrity sha512-M+oxtseCFO3EDtAaGH7iiej3CBkzXqFMbzqYAACdzKui4eZA+pq3tZEwChvOdNfa7xxy8BfbmgJSIr43cC/+2g== + dependencies: + glob "^7.1.3" + minimatch "^3.0.4" + read-pkg-up "^4.0.0" + require-main-filename "^2.0.0" + text-table@^0.2.0: version "0.2.0" resolved "https://registry.yarnpkg.com/text-table/-/text-table-0.2.0.tgz#7f5ee823ae805207c00af2df4a84ec3fcfa570b4" integrity sha1-f17oI66AUgfACvLfSoTsP8+lcLQ= +throat@^4.0.0: + version "4.1.0" + resolved "https://registry.yarnpkg.com/throat/-/throat-4.1.0.tgz#89037cbc92c56ab18926e6ba4cbb200e15672a6a" + integrity sha1-iQN8vJLFarGJJua6TLsgDhVnKmo= + through2@^2.0.0: version "2.0.5" resolved "https://registry.yarnpkg.com/through2/-/through2-2.0.5.tgz#01c1e39eb31d07cb7d03a96a70823260b23132cd" @@ -3661,10 +5338,15 @@ tmp@^0.0.33: dependencies: os-tmpdir "~1.0.2" -to-arraybuffer@^1.0.0: - version "1.0.1" - resolved "https://registry.yarnpkg.com/to-arraybuffer/-/to-arraybuffer-1.0.1.tgz#7d229b1fcc637e466ca081180836a7aabff83f43" - integrity sha1-fSKbH8xjfkZsoIEYCDanqr/4P0M= +tmpl@1.0.x: + version "1.0.4" + resolved "https://registry.yarnpkg.com/tmpl/-/tmpl-1.0.4.tgz#23640dd7b42d00433911140820e5cf440e521dd1" + integrity sha1-I2QN17QtAEM5ERQIIOXPRA5SHdE= + +to-fast-properties@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/to-fast-properties/-/to-fast-properties-2.0.0.tgz#dc5e698cbd079265bc73e0377681a4e4e83f616e" + integrity sha1-3F5pjL0HkmW8c+A3doGk5Og/YW4= to-object-path@^0.3.0: version "0.3.0" @@ -3698,7 +5380,7 @@ topo@3.x.x: dependencies: hoek "6.x.x" -tough-cookie@^2.3.3: +tough-cookie@^2.3.3, tough-cookie@^2.3.4: version "2.5.0" resolved "https://registry.yarnpkg.com/tough-cookie/-/tough-cookie-2.5.0.tgz#cd9fb2a0aa1d5a12b473bd9fb96fa3dcff65ade2" integrity sha512-nlLsUzgm1kfLXSXfRZMc1KLAugd4hqJHDTvc2hDIwS3mZAfMEuMbc03SujMF+GEcpaX/qboeycw6iO8JwVv2+g== @@ -3714,11 +5396,40 @@ tough-cookie@~2.4.3: psl "^1.1.24" punycode "^1.4.1" -tslib@^1.9.0: +tr46@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/tr46/-/tr46-1.0.1.tgz#a8b13fd6bfd2489519674ccde55ba3693b706d09" + integrity sha1-qLE/1r/SSJUZZ0zN5VujaTtwbQk= + dependencies: + punycode "^2.1.0" + +ts-jest@24.0.2: + version "24.0.2" + resolved "https://registry.yarnpkg.com/ts-jest/-/ts-jest-24.0.2.tgz#8dde6cece97c31c03e80e474c749753ffd27194d" + integrity sha512-h6ZCZiA1EQgjczxq+uGLXQlNgeg02WWJBbeT8j6nyIBRQdglqbvzDoHahTEIiS6Eor6x8mK6PfZ7brQ9Q6tzHw== + dependencies: + bs-logger "0.x" + buffer-from "1.x" + fast-json-stable-stringify "2.x" + json5 "2.x" + make-error "1.x" + mkdirp "0.x" + resolve "1.x" + semver "^5.5" + yargs-parser "10.x" + +tslib@^1.8.1, tslib@^1.9.0: version "1.10.0" resolved "https://registry.yarnpkg.com/tslib/-/tslib-1.10.0.tgz#c3c19f95973fb0a62973fb09d90d961ee43e5c8a" integrity sha512-qOebF53frne81cf0S9B41ByenJ3/IuH8yJKngAX35CmiZySA0khhkovshKK+jGCaMnVomla7gVlIcc3EvKPbTQ== +tsutils@^3.14.0: + version "3.17.1" + resolved "https://registry.yarnpkg.com/tsutils/-/tsutils-3.17.1.tgz#ed719917f11ca0dee586272b2ac49e015a2dd759" + integrity sha512-kzeQ5B8H3w60nFY2g8cJIuH7JDpsALXySGtwGJ0p2LSjLgay3NdIpqq5SoOBe46bKDW2iq25irHCr8wjomUS2g== + dependencies: + tslib "^1.8.1" + tty-browserify@0.0.1: version "0.0.1" resolved "https://registry.yarnpkg.com/tty-browserify/-/tty-browserify-0.0.1.tgz#3f05251ee17904dfd0677546670db9651682b811" @@ -3748,7 +5459,12 @@ typedarray@^0.0.6: resolved "https://registry.yarnpkg.com/typedarray/-/typedarray-0.0.6.tgz#867ac74e3864187b1d3d47d996a78ec5c8830777" integrity sha1-hnrHTjhkGHsdPUfZlqeOxciDB3c= -uglify-js@^3.1.4, uglify-js@^3.6.0: +typescript@^3.6.3: + version "3.6.3" + resolved "https://registry.yarnpkg.com/typescript/-/typescript-3.6.3.tgz#fea942fabb20f7e1ca7164ff626f1a9f3f70b4da" + integrity sha512-N7bceJL1CtRQ2RiG0AQME13ksR7DiuQh/QehubYcghzv20tnh+MQnQIuJddTmsbqYj+dztchykemz0zFzlvdQw== + +uglify-js@^3.1.4: version "3.6.0" resolved "https://registry.yarnpkg.com/uglify-js/-/uglify-js-3.6.0.tgz#704681345c53a8b2079fb6cec294b05ead242ff5" integrity sha512-W+jrUHJr3DXKhrsS7NUVxn3zqMOFn0hL/Ei6v0anCIMoKC93TjcflTagwIHLW7SfMFfiQuktQyFVCFHGUE0+yg== @@ -3796,9 +5512,9 @@ unset-value@^1.0.0: isobject "^3.0.0" upath@^1.1.1: - version "1.1.2" - resolved "https://registry.yarnpkg.com/upath/-/upath-1.1.2.tgz#3db658600edaeeccbe6db5e684d67ee8c2acd068" - integrity sha512-kXpym8nmDmlCBr7nKdIx8P2jNBa+pBpIUFRnKJ4dr8htyYGJFokkr2ZvERRtUN+9SY+JqXouNgUPtv6JQva/2Q== + version "1.2.0" + resolved "https://registry.yarnpkg.com/upath/-/upath-1.2.0.tgz#8f66dbcd55a883acdae4408af8b035a5044c1894" + integrity sha512-aZwGpamFO61g3OlfT7OQCHqhGnW43ieH9WZeP7QxN/G/jS4jfqUkZxoryvJgVPEcrl5NL/ggHsSmLMHuH64Lhg== uri-js@^4.2.2: version "4.2.2" @@ -3825,11 +5541,19 @@ use@^3.1.0: resolved "https://registry.yarnpkg.com/use/-/use-3.1.1.tgz#d50c8cac79a19fbc20f2911f56eb973f4e10070f" integrity sha512-cwESVXlO3url9YWlFW/TA9cshCEhtu7IKJ/p5soJ/gGpj7vbvFrAY/eIioQ6Dw23KjZhYgiIo8HOs1nQ2vr/oQ== -util-deprecate@~1.0.1: +util-deprecate@^1.0.1, util-deprecate@~1.0.1: version "1.0.2" resolved "https://registry.yarnpkg.com/util-deprecate/-/util-deprecate-1.0.2.tgz#450d4dc9fa70de732762fbd2d4a28981419a0ccf" integrity sha1-RQ1Nyfpw3nMnYvvS1KKJgUGaDM8= +util.promisify@^1.0.0, util.promisify@~1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/util.promisify/-/util.promisify-1.0.0.tgz#440f7165a459c9a16dc145eb8e72f35687097030" + integrity sha512-i+6qA2MPhvoKLuxnJNpXAGhg7HphQOSUq2LKMZD0m15EiskXUkMvKdF4Uui0WYeCUGea+o2cw/ZuwehtfsrNkA== + dependencies: + define-properties "^1.1.2" + object.getownpropertydescriptors "^2.0.3" + util@0.10.3: version "0.10.3" resolved "https://registry.yarnpkg.com/util/-/util-0.10.3.tgz#7afb1afe50805246489e3db7fe0ed379336ac0f9" @@ -3845,9 +5569,22 @@ util@~0.10.1: inherits "2.0.3" uuid@^3.3.2: - version "3.3.2" - resolved "https://registry.yarnpkg.com/uuid/-/uuid-3.3.2.tgz#1b4af4955eb3077c501c23872fc6513811587131" - integrity sha512-yXJmeNaw3DnnKAOKJE51sL/ZaYfWJRl1pK9dr19YFCu0ObS231AB1/LbqTKRAQ5kw8A90rA6fr4riOUpTZvQZA== + version "3.3.3" + resolved "https://registry.yarnpkg.com/uuid/-/uuid-3.3.3.tgz#4568f0216e78760ee1dbf3a4d2cf53e224112866" + integrity sha512-pW0No1RGHgzlpHJO1nsVrHKpOEIxkGg1xB+v0ZmdNH5OAeAwzAVrCnI2/6Mtx+Uys6iaylxa+D3g4j63IKKjSQ== + +v8-compile-cache@^2.0.3: + version "2.1.0" + resolved "https://registry.yarnpkg.com/v8-compile-cache/-/v8-compile-cache-2.1.0.tgz#e14de37b31a6d194f5690d67efc4e7f6fc6ab30e" + integrity sha512-usZBT3PW+LOjM25wbqIlZwPeJV+3OSz3M1k1Ws8snlW39dZyYL9lOGC5FgPVHfk0jKmjiDV8Z0mIbVQPiwFs7g== + +validate-npm-package-license@^3.0.1: + version "3.0.4" + resolved "https://registry.yarnpkg.com/validate-npm-package-license/-/validate-npm-package-license-3.0.4.tgz#fc91f6b9c7ba15c857f4cb2c5defeec39d4f410a" + integrity sha512-DpKm2Ui/xN7/HQKCtpZxoRWBhZ9Z0kqtygG8XCgNQ8ZlDnxuQmWhj566j8fN4Cu3/JmbhsDo7fcAJq4s9h27Ew== + dependencies: + spdx-correct "^3.0.0" + spdx-expression-parse "^3.0.0" verror@1.10.0: version "1.10.0" @@ -3863,17 +5600,66 @@ vm-browserify@^1.0.0: resolved "https://registry.yarnpkg.com/vm-browserify/-/vm-browserify-1.1.0.tgz#bd76d6a23323e2ca8ffa12028dc04559c75f9019" integrity sha512-iq+S7vZJE60yejDYM0ek6zg308+UZsdtPExWP9VZoCFCz1zkJoXFnAX7aZfd/ZwrkidzdUZL0C/ryW+JwAiIGw== +w3c-hr-time@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/w3c-hr-time/-/w3c-hr-time-1.0.1.tgz#82ac2bff63d950ea9e3189a58a65625fedf19045" + integrity sha1-gqwr/2PZUOqeMYmlimViX+3xkEU= + dependencies: + browser-process-hrtime "^0.1.2" + +walker@^1.0.7, walker@~1.0.5: + version "1.0.7" + resolved "https://registry.yarnpkg.com/walker/-/walker-1.0.7.tgz#2f7f9b8fd10d677262b18a884e28d19618e028fb" + integrity sha1-L3+bj9ENZ3JisYqITijRlhjgKPs= + dependencies: + makeerror "1.0.x" + +webidl-conversions@^4.0.2: + version "4.0.2" + resolved "https://registry.yarnpkg.com/webidl-conversions/-/webidl-conversions-4.0.2.tgz#a855980b1f0b6b359ba1d5d9fb39ae941faa63ad" + integrity sha512-YQ+BmxuTgd6UXZW3+ICGfyqRyHXVlD5GtQr5+qjiNW7bF0cqrzX500HVXPBOvgXb5YnzDd+h0zqyv61KUD7+Sg== + +whatwg-encoding@^1.0.1, whatwg-encoding@^1.0.3: + version "1.0.5" + resolved "https://registry.yarnpkg.com/whatwg-encoding/-/whatwg-encoding-1.0.5.tgz#5abacf777c32166a51d085d6b4f3e7d27113ddb0" + integrity sha512-b5lim54JOPN9HtzvK9HFXvBma/rnfFeqsic0hSpjtDbVxR3dJKLc+KB4V6GgiGOvl7CY/KNh8rxSo9DKQrnUEw== + dependencies: + iconv-lite "0.4.24" + whatwg-fetch@^3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/whatwg-fetch/-/whatwg-fetch-3.0.0.tgz#fc804e458cc460009b1a2b966bc8817d2578aefb" integrity sha512-9GSJUgz1D4MfyKU7KRqwOjXCXTqWdFNvEr7eUBYchQiVc744mqK/MzXPNR2WsPkmkOa4ywfg8C2n8h+13Bey1Q== +whatwg-mimetype@^2.1.0, whatwg-mimetype@^2.2.0: + version "2.3.0" + resolved "https://registry.yarnpkg.com/whatwg-mimetype/-/whatwg-mimetype-2.3.0.tgz#3d4b1e0312d2079879f826aff18dbeeca5960fbf" + integrity sha512-M4yMwr6mAnQz76TbJm914+gPpB/nCwvZbJU28cUD6dR004SAxDLOOSUaB1JDRqLtaOV/vi0IC5lEAGFgrjGv/g== + +whatwg-url@^6.4.1: + version "6.5.0" + resolved "https://registry.yarnpkg.com/whatwg-url/-/whatwg-url-6.5.0.tgz#f2df02bff176fd65070df74ad5ccbb5a199965a8" + integrity sha512-rhRZRqx/TLJQWUpQ6bmrt2UV4f0HCQ463yQuONJqC6fO2VoEb1pTYddbe59SkYq87aoM5A3bdhMZiUiVws+fzQ== + dependencies: + lodash.sortby "^4.7.0" + tr46 "^1.0.1" + webidl-conversions "^4.0.2" + +whatwg-url@^7.0.0: + version "7.0.0" + resolved "https://registry.yarnpkg.com/whatwg-url/-/whatwg-url-7.0.0.tgz#fde926fa54a599f3adf82dff25a9f7be02dc6edd" + integrity sha512-37GeVSIJ3kn1JgKyjiYNmSLP1yzbpb29jdmwBSgkD9h40/hyrR/OifpVUndji3tmwGgD8qpw7iQu3RSbCrBpsQ== + dependencies: + lodash.sortby "^4.7.0" + tr46 "^1.0.1" + webidl-conversions "^4.0.2" + which-module@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/which-module/-/which-module-2.0.0.tgz#d9ef07dce77b9902b8a3a8fa4b31c3e3f7e6e87a" integrity sha1-2e8H3Od7mQK4o6j6SzHD4/fm6Ho= -which@^1.1.1, which@^1.2.9: +which@^1.2.9, which@^1.3.0: version "1.3.1" resolved "https://registry.yarnpkg.com/which/-/which-1.3.1.tgz#a45043d54f5805316da8d62f9f50918d3da70b0a" integrity sha512-HxJdYWq1MTIQbJ3nw0cqssHoTNU267KlrDuGZ1WYlxDStUtKUhOaJmh112/TZmHxxUfuJqPXSOm7tDyas0OSIQ== @@ -3887,16 +5673,16 @@ wide-align@^1.1.0: dependencies: string-width "^1.0.2 || 2" -wordwrap@^1.0.0, wordwrap@~1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/wordwrap/-/wordwrap-1.0.0.tgz#27584810891456a4171c8d0226441ade90cbcaeb" - integrity sha1-J1hIEIkUVqQXHI0CJkQa3pDLyus= - wordwrap@~0.0.2: version "0.0.3" resolved "https://registry.yarnpkg.com/wordwrap/-/wordwrap-0.0.3.tgz#a3d5da6cd5c0bc0008d37234bbaf1bed63059107" integrity sha1-o9XabNXAvAAI03I0u68b7WMFkQc= +wordwrap@~1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/wordwrap/-/wordwrap-1.0.0.tgz#27584810891456a4171c8d0226441ade90cbcaeb" + integrity sha1-J1hIEIkUVqQXHI0CJkQa3pDLyus= + wrap-ansi@^2.0.0: version "2.1.0" resolved "https://registry.yarnpkg.com/wrap-ansi/-/wrap-ansi-2.1.0.tgz#d8fc3d284dd05794fe84973caecdd1cf824fdd85" @@ -3905,11 +5691,29 @@ wrap-ansi@^2.0.0: string-width "^1.0.1" strip-ansi "^3.0.1" +wrap-ansi@^5.1.0: + version "5.1.0" + resolved "https://registry.yarnpkg.com/wrap-ansi/-/wrap-ansi-5.1.0.tgz#1fd1f67235d5b6d0fee781056001bfb694c03b09" + integrity sha512-QC1/iN/2/RPVJ5jYK8BGttj5z83LmSKmvbvrXPNCLZSEb32KKVDJDl/MOt2N01qU2H/FkzEa9PKto1BqDjtd7Q== + dependencies: + ansi-styles "^3.2.0" + string-width "^3.0.0" + strip-ansi "^5.0.0" + wrappy@1: version "1.0.2" resolved "https://registry.yarnpkg.com/wrappy/-/wrappy-1.0.2.tgz#b5243d8f3ec1aa35f1364605bc0d1036e30ab69f" integrity sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8= +write-file-atomic@2.4.1: + version "2.4.1" + resolved "https://registry.yarnpkg.com/write-file-atomic/-/write-file-atomic-2.4.1.tgz#d0b05463c188ae804396fd5ab2a370062af87529" + integrity sha512-TGHFeZEZMnv+gBFRfjAcxL5bPHrsGKtnb4qsFAws7/vlh+QfwAaySIw4AXP9ZskTTh5GWu3FLuJhsWVdiJPGvg== + dependencies: + graceful-fs "^4.1.11" + imurmurhash "^0.1.4" + signal-exit "^3.0.2" + write@1.0.3: version "1.0.3" resolved "https://registry.yarnpkg.com/write/-/write-1.0.3.tgz#0800e14523b923a387e415123c865616aae0f5c3" @@ -3917,33 +5721,53 @@ write@1.0.3: dependencies: mkdirp "^0.5.1" +ws@^5.2.0: + version "5.2.2" + resolved "https://registry.yarnpkg.com/ws/-/ws-5.2.2.tgz#dffef14866b8e8dc9133582514d1befaf96e980f" + integrity sha512-jaHFD6PFv6UgoIVda6qZllptQsMlDEJkTQcybzzXDYM1XO9Y8em691FGMPmM46WGyLU4z9KMgQN+qrux/nhlHA== + dependencies: + async-limiter "~1.0.0" + +xml-name-validator@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/xml-name-validator/-/xml-name-validator-3.0.0.tgz#6ae73e06de4d8c6e47f9fb181f78d648ad457c6a" + integrity sha512-A5CUptxDsvxKJEU3yO6DuWBSJz/qizqzJKOMIfUJHETbBw/sFaDxgd6fxm1ewUaM0jZ444Fc5vC5ROYurg/4Pw== + xml2js@^0.4.9: - version "0.4.19" - resolved "https://registry.yarnpkg.com/xml2js/-/xml2js-0.4.19.tgz#686c20f213209e94abf0d1bcf1efaa291c7827a7" - integrity sha512-esZnJZJOiJR9wWKMyuvSE1y6Dq5LCuJanqhxslH2bxM6duahNZ+HMpCLhBQGZkbX6xRf8x1Y2eJlgt2q3qo49Q== + version "0.4.22" + resolved "https://registry.yarnpkg.com/xml2js/-/xml2js-0.4.22.tgz#4fa2d846ec803237de86f30aa9b5f70b6600de02" + integrity sha512-MWTbxAQqclRSTnehWWe5nMKzI3VmJ8ltiJEco8akcC6j3miOhjjfzKum5sId+CWhfxdOs/1xauYr8/ZDBtQiRw== dependencies: sax ">=0.6.0" - xmlbuilder "~9.0.1" + util.promisify "~1.0.0" + xmlbuilder "~11.0.0" -xmlbuilder@~9.0.1: - version "9.0.7" - resolved "https://registry.yarnpkg.com/xmlbuilder/-/xmlbuilder-9.0.7.tgz#132ee63d2ec5565c557e20f4c22df9aca686b10d" - integrity sha1-Ey7mPS7FVlxVfiD0wi35rKaGsQ0= +xmlbuilder@~11.0.0: + version "11.0.1" + resolved "https://registry.yarnpkg.com/xmlbuilder/-/xmlbuilder-11.0.1.tgz#be9bae1c8a046e76b31127726347d0ad7002beb3" + integrity sha512-fDlsI/kFEx7gLvbecc0/ohLG50fugQp8ryHzMTuW9vSa1GJ0XYWKnhsUx7oie3G98+r56aTQIUB4kht42R3JvA== -xtend@^4.0.0, xtend@^4.0.1, xtend@~4.0.1: +xtend@^4.0.0, xtend@^4.0.1, xtend@^4.0.2, xtend@~4.0.1: version "4.0.2" resolved "https://registry.yarnpkg.com/xtend/-/xtend-4.0.2.tgz#bb72779f5fa465186b1f438f674fa347fdb5db54" integrity sha512-LKYU1iAXJXUgAXn9URjiu+MWhyUXHsvfp7mcuYm9dSUKK0/CjtrUwFAxD82/mCWbtLsGjFIad0wIsod4zrTAEQ== -"y18n@^3.2.1 || ^4.0.0": +"y18n@^3.2.1 || ^4.0.0", y18n@^4.0.0: version "4.0.0" resolved "https://registry.yarnpkg.com/y18n/-/y18n-4.0.0.tgz#95ef94f85ecc81d007c264e190a120f0a3c8566b" integrity sha512-r9S/ZyXu/Xu9q1tYlpsLIsa3EeLXXk0VwlxqTcFRfg9EhMW+17kbt9G0NrgCmhGb5vT2hyhJZLfDGx+7+5Uj/w== yallist@^3.0.0, yallist@^3.0.3: - version "3.0.3" - resolved "https://registry.yarnpkg.com/yallist/-/yallist-3.0.3.tgz#b4b049e314be545e3ce802236d6cd22cd91c3de9" - integrity sha512-S+Zk8DEWE6oKpV+vI3qWkaK+jSbIK86pCwe2IF/xwIpQ8jEuxpw9NyaGjmp9+BoJv5FV2piqCDcoCtStppiq2A== + version "3.1.1" + resolved "https://registry.yarnpkg.com/yallist/-/yallist-3.1.1.tgz#dbb7daf9bfd8bac9ab45ebf602b8cbad0d5d08fd" + integrity sha512-a4UGQaWPH59mOXUYnAG2ewncQS4i4F43Tv3JoAM+s2VDAmS9NsK8GpDMLrCHPksFT7h3K6TOoUNn2pb7RoXx4g== + +yargs-parser@10.x: + version "10.1.0" + resolved "https://registry.yarnpkg.com/yargs-parser/-/yargs-parser-10.1.0.tgz#7202265b89f7e9e9f2e5765e0fe735a905edbaa8" + integrity sha512-VCIyR1wJoEBZUqk5PA+oOBF6ypbwh5aNB3I50guxAL/quggdfs4TtNHQrSazFA3fYZ+tEqfs0zIGlv0c/rgjbQ== + dependencies: + camelcase "^4.1.0" yargs-parser@^11.1.1: version "11.1.1" @@ -3953,6 +5777,14 @@ yargs-parser@^11.1.1: camelcase "^5.0.0" decamelize "^1.2.0" +yargs-parser@^13.1.1: + version "13.1.1" + resolved "https://registry.yarnpkg.com/yargs-parser/-/yargs-parser-13.1.1.tgz#d26058532aa06d365fe091f6a1fc06b2f7e5eca0" + integrity sha512-oVAVsHz6uFrg3XQheFII8ESO2ssAf9luWuAd6Wexsu4F3OtIW0o8IribPXYrD4WC24LWtPrJlGy87y5udK+dxQ== + dependencies: + camelcase "^5.0.0" + decamelize "^1.2.0" + yargs@^12.0.1: version "12.0.5" resolved "https://registry.yarnpkg.com/yargs/-/yargs-12.0.5.tgz#05f5997b609647b64f66b81e3b4b10a368e7ad13" @@ -3970,3 +5802,19 @@ yargs@^12.0.1: which-module "^2.0.0" y18n "^3.2.1 || ^4.0.0" yargs-parser "^11.1.1" + +yargs@^13.3.0: + version "13.3.0" + resolved "https://registry.yarnpkg.com/yargs/-/yargs-13.3.0.tgz#4c657a55e07e5f2cf947f8a366567c04a0dedc83" + integrity sha512-2eehun/8ALW8TLoIl7MVaRUrg+yCnenu8B4kBlRxj3GJGDKU1Og7sMXPNm1BYyM1DOJmTZ4YeN/Nwxv+8XJsUA== + dependencies: + cliui "^5.0.0" + find-up "^3.0.0" + get-caller-file "^2.0.1" + require-directory "^2.1.1" + require-main-filename "^2.0.0" + set-blocking "^2.0.0" + string-width "^3.0.0" + which-module "^2.0.0" + y18n "^4.0.0" + yargs-parser "^13.1.1"