diff --git a/.eslintrc b/.eslintrc index 8a7d0de..c230f84 100644 --- a/.eslintrc +++ b/.eslintrc @@ -26,10 +26,7 @@ "no-with": 2, "semi-spacing": 2, "space-before-blocks": 2, - "space-before-function-paren": [ - 2, - { "anonymous": "always", "named": "never" } - ], + "space-before-function-paren": [0, { "anonymous": "always", "named": "always" }], "space-in-parens": 0, "space-infix-ops": 2, "space-unary-ops": 2, @@ -59,11 +56,8 @@ "sonarjs/no-duplicate-string": 0, "sonarjs/prefer-object-literal": 0, "sonarjs/no-identical-functions": 0, - "max-lines-per-function": [ - "warn", - { "max": 300, "skipBlankLines": true, "skipComments": true } - ], - "max-len": ["error", 165], + "max-lines-per-function": ["warn", { "max": 300, "skipBlankLines": true, "skipComments": true }], + "max-len": ["error", 220], "max-statements-per-line": ["error", { "max": 3 }] }, "env": { diff --git a/.size-snapshot.json b/.size-snapshot.json index f4a2192..714ac4b 100644 --- a/.size-snapshot.json +++ b/.size-snapshot.json @@ -5,8 +5,8 @@ "gzipped": 2075 }, "valyrian.min.js": { - "bundled": 13481, - "minified": 5030, - "gzipped": 2068 + "bundled": 12907, + "minified": 5021, + "gzipped": 2077 } } diff --git a/dist/valyrian.min.js b/dist/valyrian.min.js index 548020c..03bed80 100644 --- a/dist/valyrian.min.js +++ b/dist/valyrian.min.js @@ -1 +1 @@ -!function(){"use strict";function e(){let e,n,o,t=void 0,d="oncreate",r="onupdate",i="onremove",l="onbeforeupdate",s="function",p="v-once",c=Array.isArray,m={};function a(e,n,o){this.props=n||{},this.children=o,this.name=e}function u(e){this.dom=e}u.prototype={props:{},children:[]};let f=new u;function h(e,n){return n?document.createElementNS("http://www.w3.org/2000/svg",e):document.createElement(e)}function v(e,n,o){if(e.props[n])return e.props[n](e,o)}function g(e){if(e instanceof a){for(let n=0,o=e.children.length;n{if(3===e.nodeType)return new u(e);if(1===e.nodeType){let n={};[].forEach.call(e.attributes,e=>n[e.nodeName]=e.nodeValue);let o=new a(e.nodeName,n,[]);o.dom=e;for(let n=0,t=e.childNodes.length;n{let n=h("div");return n.innerHTML=e.trim(),[].map.call(n.childNodes,e=>y.domToVnode(e))};let V=new Map;y.usePlugin=(e,n)=>!V.has(e)&&V.set(e,!0)&&e(y,n),y.reservedWords=["key",p,d,l,r,i,"data"];let N={};function w(e){let n=e.target,o="__on"+e.type;for(;n;){if(n[o])return n[o](e,n),void(e.defaultPrevented||y.update());n=n.parentNode}}function C(e,n){for(let o in e.props)y.updateProperty(o,e,n)}function S(e,n){for(let o in n.props)-1===y.reservedWords.indexOf(o)&&o in e.props==!1&&typeof n.props[o]!==s&&(o in e.dom?e.dom[o]=t:e.dom.removeAttribute(o))}function T(e,n,o){e!==o&&(o?n.replaceChild(e,o):n.appendChild(e))}function x(e){g(e),e.dom&&e.dom.parentNode&&e.dom.parentNode.removeChild(e.dom)}function M(e,n,o,t){let i=e.childNodes[t];o.dom?(n.dom=o.dom,n.props[p]||!1===v(n,l,o)?(n.children=o.children,T(n.dom,e,i)):(S(n,o),C(n,o),T(n.dom,e,i),v(n,y.isMounted?r:d,o),P(n,o))):(n.dom=h(n.name,n.isSVG),C(n),T(n.dom,e,i),v(n,d),P(n,f))}y.updateProperty=(e,n,o)=>{if(e in n.props){let t=n.props[e];-1!==y.reservedWords.indexOf(e)?m[e]&&m[e](t,n,o):typeof t===s?(N[e="__"+e]||(document.addEventListener(e.slice(4),w),N[e]=!0),n.dom[e]=t):e in n.dom&&!n.isSVG?n.dom[e]!==t&&(n.dom[e]=t):o&&t===o.props[e]||n.dom.setAttribute(e,t)}};let G=[];function P(e,n){let o=c(e.children)?e.children:[e.children],i=n.children;y.current.parentVnode=e,y.current.oldParentVnode=n;for(let n=0;n0){let n=i.length;for(;n--;)g(i[n]);e.dom.textContent=""}}else if(i.length&&o[0]instanceof a&&o[0].props.key){let n=i.map(e=>e.props.key),d=o.map(e=>e.props.key);for(let r=0,l=d.length;r=n.length?t:r;-1!==o?(i[o].processed=!0,M(e.dom,s,i[o],d)):M(e.dom,s,f,d)}}let r=i.length;for(;r--;)!i[r].processed&&x(i[r])}else{let n=i.length,t=o.length;for(;n-- >t;)x(i[n]);for(n=0;n{let n=y.current.parentVnode;n.onCleanup||(n.onCleanup=[]),n.onCleanup.push(e),-1===G.indexOf(n)&&G.push(n)},y.current={parentVnode:t,oldParentVnode:t,component:t},y.update=(t,...d)=>{if(e)return o&&(!function(){for(let e=G.length;e--;)for(let n of G[e].onCleanup)n();G=[]}(),n=e,e=new a(e.name,e.props,[y(o,t,...d)]),e.dom=n.dom,e.isSVG="svg"===e.name,P(e,n),y.isMounted=!0),y.isNode&&e.dom.innerHTML},y.mount=(n,t,d,...r)=>{let i=y.isNode?h("div"):"string"==typeof n?document.querySelectorAll(n)[0]:n;return e=y.domToVnode(i),o=t,y.update(d,...r)},y.unMount=()=>{o=()=>"";let e=y.update();return o=t,y.isMounted=!1,e},y.directive=(e,n)=>{let o="v-"+e;-1===y.reservedWords.indexOf(o)&&(y.reservedWords.push(o),m[o]=n)};let b=e=>(n,o,t)=>{if(e?n:!n){let e=document.createTextNode("");t&&t.dom&&t.dom.parentNode&&(g(t),t.dom.parentNode.replaceChild(e,t.dom)),o.name="",o.children=[],o.props={},o.dom=e}};return y.directive("if",b(!1)),y.directive("unless",b(!0)),y.directive("for",(e,n)=>n.children=e.map(n.children[0])),y.directive("show",(e,n)=>n.dom.style.display=e?"":"none"),y.directive("class",(e,n)=>{for(let o in e)n.dom.classList.toggle(o,e[o])}),y.directive("html",(e,n)=>n.children=y.trust(e)),y}const n=e();n.newInstance=e,(n.isNode?global:window).v=n}(); \ No newline at end of file +!function(){"use strict";function e(){let e,n,o,t,d=void 0,r="oncreate",i="onupdate",l="onremove",s="onbeforeupdate",p="function",c="v-once",m=Array.isArray,a={};function u(e,n,o){this.props=n||{},this.children=o,this.name=e}function f(e){this.dom=e}f.prototype={props:{},children:[]};let h=new f;function v(e,n){return n?document.createElementNS("http://www.w3.org/2000/svg",e):document.createElement(e)}function g(e,n,o){if(e.props[n])return e.props[n](e,o)}function y(e){if(e instanceof u){for(let n=0,o=e.children.length;n{if(3===e.nodeType)return new f(e);if(1===e.nodeType){let n={};[].forEach.call(e.attributes,e=>n[e.nodeName]=e.nodeValue);let o=new u(e.nodeName,n,[]);o.dom=e;for(let n=0,t=e.childNodes.length;n{let n=v("div");return n.innerHTML=e.trim(),[].map.call(n.childNodes,e=>V.domToVnode(e))};let N=new Map;V.usePlugin=(e,n)=>!N.has(e)&&N.set(e,!0)&&e(V,n),V.reservedWords=["key",c,r,s,i,l,"data"];let w={};function C(e){let n=e.target,o="__on"+e.type;for(;n;){if(n[o])return n[o](e,n),void(e.defaultPrevented||V.update());n=n.parentNode}}function S(e,n){for(let o in e.props)V.updateProperty(o,e,n)}function T(e,n){for(let o in n.props)-1===V.reservedWords.indexOf(o)&&o in e.props==!1&&typeof n.props[o]!==p&&(o in e.dom?e.dom[o]=d:e.dom.removeAttribute(o))}function x(e,n,o){e!==o&&(o?n.replaceChild(e,o):n.appendChild(e))}function M(e){y(e),e.dom&&e.dom.parentNode&&e.dom.parentNode.removeChild(e.dom)}function G(e,n,o,t){let d=e.childNodes[t];o.dom?(n.dom=o.dom,n.props[c]||!1===g(n,s,o)?(n.children=o.children,x(n.dom,e,d)):(T(n,o),S(n,o),x(n.dom,e,d),g(n,V.isMounted?i:r,o),b(n,o))):(n.dom=v(n.name,n.isSVG),S(n),x(n.dom,e,d),g(n,r),b(n,h))}V.updateProperty=(e,n,o)=>{if(e in n.props){let d=n.props[e];-1!==V.reservedWords.indexOf(e)?a[e]&&a[e](d,n,o):typeof d===p?(w[e="__"+e]||(t.addEventListener(e.slice(4),C),w[e]=!0),n.dom[e]=d):e in n.dom&&!n.isSVG?n.dom[e]!==d&&(n.dom[e]=d):o&&d===o.props[e]||n.dom.setAttribute(e,d)}};let P=[];function b(e,n){let o=m(e.children)?e.children:[e.children],t=n.children;V.current.parentVnode=e,V.current.oldParentVnode=n;for(let n=0;n0){let n=t.length;for(;n--;)y(t[n]);e.dom.textContent=""}}else if(t.length&&o[0]instanceof u&&o[0].props.key){let n=t.map(e=>e.props.key),r=o.map(e=>e.props.key);for(let i=0,l=r.length;i=n.length?d:i;-1!==o?(t[o].processed=!0,G(e.dom,s,t[o],r)):G(e.dom,s,h,r)}}let i=t.length;for(;i--;)!t[i].processed&&M(t[i])}else{let n=t.length,d=o.length;for(;n-- >d;)M(t[n]);for(n=0;n{let n=V.current.parentVnode;n.onCleanup||(n.onCleanup=[]),n.onCleanup.push(e),-1===P.indexOf(n)&&P.push(n)},V.current={parentVnode:d,oldParentVnode:d,component:d},V.update=(t,...d)=>{if(e)return o&&(!function(){for(let e=P.length;e--;)for(let n of P[e].onCleanup)n();P=[]}(),n=e,e=new u(e.name,e.props,[V(o,t,...d)]),e.dom=n.dom,e.isSVG="svg"===e.name,b(e,n),V.isMounted=!0),V.isNode&&e.dom.innerHTML},V.mount=(n,d,r,...i)=>(t=V.isNode?v("div"):"string"==typeof n?document.querySelectorAll(n)[0]:n,e=V.domToVnode(t),o=d,V.update(r,...i)),V.unMount=()=>{t=null,o=()=>"";let e=V.update();return o=d,V.isMounted=!1,e},V.directive=(e,n)=>{let o="v-"+e;-1===V.reservedWords.indexOf(o)&&(V.reservedWords.push(o),a[o]=n)};let A=e=>(n,o,t)=>{if(e?n:!n){let e=document.createTextNode("");t&&t.dom&&t.dom.parentNode&&(y(t),t.dom.parentNode.replaceChild(e,t.dom)),o.name="",o.children=[],o.props={},o.dom=e}};return V.directive("if",A(!1)),V.directive("unless",A(!0)),V.directive("for",(e,n)=>n.children=e.map(n.children[0])),V.directive("show",(e,n)=>n.dom.style.display=e?"":"none"),V.directive("class",(e,n)=>{for(let o in e)n.dom.classList.toggle(o,e[o])}),V.directive("html",(e,n)=>n.children=V.trust(e)),V}const n=e();n.newInstance=e,(n.isNode?global:window).v=n}(); \ No newline at end of file diff --git a/lib/index.js b/lib/index.js index 4c9ded6..75d48eb 100644 --- a/lib/index.js +++ b/lib/index.js @@ -12,6 +12,7 @@ function valyrian() { let oldMainNode; let mountedComponent; let directives = {}; + let mainContainer; function Vnode(name, props, children) { this.props = props || {}; @@ -30,9 +31,7 @@ function valyrian() { let emptyNode = new TextVnode(); function createElement(tag, isSVG) { - return isSVG - ? document.createElementNS("http://www.w3.org/2000/svg", tag) - : document.createElement(tag); + return isSVG ? document.createElementNS("http://www.w3.org/2000/svg", tag) : document.createElement(tag); } function lifecycleCall(vnode, methodName, oldNode) { @@ -65,10 +64,7 @@ function valyrian() { if (dom.nodeType === 1) { let props = {}; - [].forEach.call( - dom.attributes, - (prop) => (props[prop.nodeName] = prop.nodeValue) - ); + [].forEach.call(dom.attributes, (prop) => (props[prop.nodeName] = prop.nodeValue)); let vnode = new Vnode(dom.nodeName, props, []); vnode.dom = dom; @@ -90,18 +86,9 @@ function valyrian() { // Plugin system let plugins = new Map(); - v.usePlugin = (plugin, options) => - !plugins.has(plugin) && plugins.set(plugin, true) && plugin(v, options); - - v.reservedWords = [ - "key", - once, - oncreate, - onbeforeupdate, - onupdate, - onremove, - "data" - ]; + v.usePlugin = (plugin, options) => !plugins.has(plugin) && plugins.set(plugin, true) && plugin(v, options); + + v.reservedWords = ["key", once, oncreate, onbeforeupdate, onupdate, onremove, "data"]; let attachedListeners = {}; function eventListener(e) { @@ -129,7 +116,7 @@ function valyrian() { } else if (typeof value === functionstr) { name = `__${name}`; if (!attachedListeners[name]) { - document.addEventListener(name.slice(4), eventListener); + mainContainer.addEventListener(name.slice(4), eventListener); attachedListeners[name] = true; } newNode.dom[name] = value; @@ -151,11 +138,7 @@ function valyrian() { function removeProps(newNode, oldNode) { for (let name in oldNode.props) { - if ( - v.reservedWords.indexOf(name) === -1 && - name in newNode.props === false && - typeof oldNode.props[name] !== functionstr - ) { + if (v.reservedWords.indexOf(name) === -1 && name in newNode.props === false && typeof oldNode.props[name] !== functionstr) { if (name in newNode.dom) { newNode.dom[name] = UND; } else { @@ -173,9 +156,7 @@ function valyrian() { function removeVnode(vnode) { callRemove(vnode); - vnode.dom && - vnode.dom.parentNode && - vnode.dom.parentNode.removeChild(vnode.dom); + vnode.dom && vnode.dom.parentNode && vnode.dom.parentNode.removeChild(vnode.dom); } function updateKeyedNode($parent, newNode, compareNode, newIndex) { @@ -183,10 +164,7 @@ function valyrian() { // Moved or updated if (compareNode.dom) { newNode.dom = compareNode.dom; - if ( - newNode.props[once] || - lifecycleCall(newNode, onbeforeupdate, compareNode) === false - ) { + if (newNode.props[once] || lifecycleCall(newNode, onbeforeupdate, compareNode) === false) { newNode.children = compareNode.children; moveDom(newNode.dom, $parent, oldDom); } else { @@ -237,9 +215,7 @@ function valyrian() { // eslint-disable-next-line complexity,sonarjs/cognitive-complexity function patch(parentNode, oldParentNode) { - let newTree = isArray(parentNode.children) - ? parentNode.children - : [parentNode.children]; + let newTree = isArray(parentNode.children) ? parentNode.children : [parentNode.children]; let oldTree = oldParentNode.children; v.current.parentVnode = parentNode; v.current.oldParentVnode = oldParentNode; @@ -255,17 +231,7 @@ function valyrian() { childVnode.isSVG = parentNode.isSVG || childVnode.name === "svg"; } else { v.current.component = childVnode; - newTree.splice( - i--, - 1, - ...[ - (childVnode.name.view || childVnode.name).call( - childVnode.name, - childVnode.props, - ...childVnode.children - ) - ] - ); + newTree.splice(i--, 1, ...[(childVnode.name.view || childVnode.name).call(childVnode.name, childVnode.props, ...childVnode.children)]); } } else if (childVnode === null || childVnode === UND) { newTree.splice(i--, 1); @@ -282,11 +248,7 @@ function valyrian() { } // Is keyed list - } else if ( - oldTree.length && - newTree[0] instanceof Vnode && - newTree[0].props.key - ) { + } else if (oldTree.length && newTree[0] instanceof Vnode && newTree[0].props.key) { let oldKeys = oldTree.map((vnode) => vnode.props.key); let newKeys = newTree.map((vnode) => vnode.props.key); @@ -305,12 +267,7 @@ function valyrian() { // Moved: Key exists in old keys if (oldIndex !== -1) { oldTree[oldIndex].processed = true; - updateKeyedNode( - parentNode.dom, - newNode, - oldTree[oldIndex], - newIndex - ); + updateKeyedNode(parentNode.dom, newNode, oldTree[oldIndex], newIndex); // Added: Key does not exists in old keys } else { updateKeyedNode(parentNode.dom, newNode, emptyNode, newIndex); @@ -349,29 +306,19 @@ function valyrian() { } else { if (newNode.name === oldNode.name) { newNode.dom = oldNode.dom; - if ( - newNode.props[once] || - lifecycleCall(newNode, onbeforeupdate, oldNode) === false - ) { + if (newNode.props[once] || lifecycleCall(newNode, onbeforeupdate, oldNode) === false) { newNode.children = oldNode.children; } else { removeProps(newNode, oldNode); updateProps(newNode, oldNode); - lifecycleCall( - newNode, - v.isMounted ? onupdate : oncreate, - oldNode - ); + lifecycleCall(newNode, v.isMounted ? onupdate : oncreate, oldNode); patch(newNode, oldNode); } } else { callRemove(oldNode); newNode.dom = createElement(newNode.name, newNode.isSVG); updateProps(newNode); - parentNode.dom.replaceChild( - newNode.dom, - parentNode.dom.childNodes[i] - ); + parentNode.dom.replaceChild(newNode.dom, parentNode.dom.childNodes[i]); lifecycleCall(newNode, oncreate); patch(newNode, emptyNode); } @@ -409,9 +356,7 @@ function valyrian() { if (mountedComponent) { cleanupVnodes(); oldMainNode = mainNode; - mainNode = new Vnode(mainNode.name, mainNode.props, [ - v(mountedComponent, props, ...children) - ]); + mainNode = new Vnode(mainNode.name, mainNode.props, [v(mountedComponent, props, ...children)]); mainNode.dom = oldMainNode.dom; mainNode.isSVG = mainNode.name === "svg"; patch(mainNode, oldMainNode); @@ -423,11 +368,7 @@ function valyrian() { }; v.mount = (container, component, props, ...children) => { - let mainContainer = v.isNode - ? createElement("div") - : typeof container === "string" - ? document.querySelectorAll(container)[0] - : container; + mainContainer = v.isNode ? createElement("div") : typeof container === "string" ? document.querySelectorAll(container)[0] : container; mainNode = v.domToVnode(mainContainer); mountedComponent = component; @@ -436,6 +377,7 @@ function valyrian() { }; v.unMount = () => { + mainContainer = null; mountedComponent = () => ""; let result = v.update(); mountedComponent = UND; @@ -468,14 +410,8 @@ function valyrian() { v.directive("if", hideDirective(false)); v.directive("unless", hideDirective(true)); - v.directive( - "for", - (set, vnode) => (vnode.children = set.map(vnode.children[0])) - ); - v.directive( - "show", - (bool, vnode) => (vnode.dom.style.display = bool ? "" : "none") - ); + v.directive("for", (set, vnode) => (vnode.children = set.map(vnode.children[0]))); + v.directive("show", (bool, vnode) => (vnode.dom.style.display = bool ? "" : "none")); v.directive("class", (classes, vnode) => { for (let name in classes) { vnode.dom.classList.toggle(name, classes[name]); diff --git a/package.json b/package.json index eccfabb..3736874 100644 --- a/package.json +++ b/package.json @@ -70,8 +70,7 @@ "eslint-plugin-sonarjs": "^0.5.0", "expect": "^26.4.2", "faker": "^5.1.0", - "micro": "^9.3.4", - "micro-ex-router": "^1.7.2", + "fastify": "^3.5.0", "mocha": "^8.1.3", "node-dev": "^5.2.0", "nyc": "^15.1.0", diff --git a/plugins/request.js b/plugins/request.js index f87bdf3..f6f9110 100644 --- a/plugins/request.js +++ b/plugins/request.js @@ -1,60 +1,84 @@ -let plugin = function (v) { - let Request = function (baseUrl = "", options = {}) { - let url = baseUrl.replace(/\/$/gi, "").trim(), - opts = Object.assign( - { - methods: ["get", "post", "put", "patch", "delete"] - }, - options - ), - parseUrl; - - function serialize(obj, prefix) { - let e = encodeURIComponent; - return Object.keys(obj) - .map((p) => { - let k = prefix ? prefix + "[" + p + "]" : p; - - if (typeof obj[p] === "object") { - return serialize(obj[p], k); - } +function serialize(obj, prefix) { + return Object.keys(obj) + .map((p) => { + let k = prefix ? `${prefix}[${p}]` : p; + return typeof obj[p] === "object" ? serialize(obj[p], k) : `${encodeURIComponent(k)}=${encodeURIComponent(obj[p])}`; + }) + .join("&"); +} + +function parseUrl(url, options = {}) { + let u = /^https?/gi.test(url) ? url : options.urls.base + url; + + let parts = u.split("?"); + u = parts[0] + .trim() + .replace(/^\/\//, "/") + .replace(/\/$/, "") + .trim(); + + if (parts[1]) { + u += `?${parts[1]}`; + } + + if (v.isNode && typeof options.urls.node === "string") { + options.urls.node = options.urls.node; + + if (typeof options.urls.api === "string") { + options.urls.api = options.urls.api.replace(/\/$/gi, "").trim(); + u = u.replace(options.urls.api, options.urls.node); + } - return e(k) + "=" + e(obj[p]); - }) - .join("&"); + if (!/^https?/gi.test(u)) { + u = options.urls.node + u; } + } + + return u; +} + +let plugin = function(v) { + function Request(baseUrl = "", options = {}) { + let url = baseUrl.replace(/\/$/gi, "").trim(); + options.urls = options.urls || {}; + let opts = { + methods: ["get", "post", "put", "patch", "delete"], + ...options, + urls: { + node: options.urls.node || null, + api: options.urls.api || null, + base: options.urls.base ? options.urls.base + url : url + } + }; async function request(method, url, data, options = {}) { - let opts = Object.assign( - { - method: method.toLowerCase(), - headers: {}, - resolveWithFullResponse: false - }, - request.options, - options - ); - - if (!opts.headers.Accept) { - opts.headers.Accept = "application/json"; + let innerOptions = { + method: method.toLowerCase(), + headers: {}, + resolveWithFullResponse: false, + ...opts, + ...options + }; + + if (!innerOptions.headers.Accept) { + innerOptions.headers.Accept = "application/json"; } - let acceptType = opts.headers.Accept; - let contentType = - opts.headers["Content-Type"] || opts.headers["content-type"] || ""; + let acceptType = innerOptions.headers.Accept; + let contentType = innerOptions.headers["Content-Type"] || innerOptions.headers["content-type"] || ""; - if (opts.methods.indexOf(method) === -1) { + if (innerOptions.methods.indexOf(method) === -1) { throw new Error("Method not allowed"); } if (data) { - if (opts.method === "get" && typeof data === "object") { - url += "?" + serialize(data); + if (innerOptions.method === "get" && typeof data === "object") { + url += `?${serialize(data)}`; } - if (opts.method !== "get") { + if (innerOptions.method !== "get") { if (/json/gi.test(contentType)) { - opts.body = JSON.stringify(data); + innerOptions.body = JSON.stringify(data); } else { let formData; if (data instanceof FormData) { @@ -65,12 +89,12 @@ let plugin = function (v) { formData.append(i, data[i]); } } - opts.body = formData; + innerOptions.body = formData; } } } - let response = await fetch(parseUrl(url), opts); + let response = await fetch(parseUrl(url, opts), innerOptions); if (!response.ok) { let err = new Error(response.statusText); @@ -78,12 +102,12 @@ let plugin = function (v) { throw err; } - if (opts.resolveWithFullResponse) { + if (innerOptions.resolveWithFullResponse) { return response; } if (/text/gi.test(acceptType)) { - response.text(); + return response.text(); } if (/json/gi.test(acceptType)) { @@ -93,45 +117,46 @@ let plugin = function (v) { return response; } - parseUrl = function (url) { - let u = /^https?/gi.test(url) - ? url - : (request.urls.base + url).trim().replace(/^\/\//gi, "/").trim(); + request.new = (baseUrl, options) => Request(baseUrl, { ...opts, ...options }); + + request.options = (key, value) => { + let result = opts; + + if (typeof key === "undefined") { + return result; + } + + let parsed = key.split("."); + let next; - if (v.isNode && typeof request.urls.node === "string") { - request.urls.node = request.urls.node.replace(/\/$/gi, "").trim(); + while (parsed.length) { + next = parsed.shift(); - if (typeof request.urls.api === "string") { - request.urls.api = request.urls.api.replace(/\/$/gi, "").trim(); - u = u.replace(request.urls.api, request.urls.node); + let nextIsArray = next.indexOf("[") > -1; + if (nextIsArray) { + let idx = next.replace(/\D/gi, ""); + next = next.split("[")[0]; + parsed.unshift(idx); } - if (!/^https?/gi.test(u)) { - u = request.urls.node + u; + if (parsed.length > 0 && typeof result[next] !== "object") { + result[next] = nextIsArray ? [] : {}; } - } - return u; - }; + if (parsed.length === 0 && typeof value !== "undefined") { + result[next] = value; + } - request.new = function (baseUrl, options) { - return Request(baseUrl, options); - }; + result = result[next]; + } - request.urls = {}; - request.urls.api = undefined; - request.urls.node = undefined; - request.urls.base = url; - request.options = opts; + return result; + }; - opts.methods.forEach( - (method) => - (request[method] = (url, data, options) => - request(method, url, data, options)) - ); + opts.methods.forEach((method) => (request[method] = (url, data, options) => request(method, url, data, options))); return request; - }; + } v.request = Request(); }; diff --git a/plugins/router.js b/plugins/router.js index 92bbfc8..81d7239 100644 --- a/plugins/router.js +++ b/plugins/router.js @@ -1,4 +1,4 @@ -let plugin = function (v) { +let plugin = function(v) { function flat(array) { return Array.isArray(array) ? array.flat(Infinity) : [array]; } @@ -118,7 +118,7 @@ let plugin = function (v) { return item; } - v.Router = function () { + v.Router = function() { const router = { paths: [], get(path, ...args) { @@ -197,7 +197,7 @@ let plugin = function (v) { return v.mount.apply(v, args); } - v.routes = function (elementContainer, router) { + v.routes = function(elementContainer, router) { if (elementContainer && router) { mainRouter = router; RoutesContainer = elementContainer; @@ -218,7 +218,7 @@ let plugin = function (v) { v.routes.path = ""; v.routes.matches = []; - v.routes.go = function (...args) { + v.routes.go = function(...args) { let parentComponent; let url; @@ -242,7 +242,7 @@ let plugin = function (v) { return runRoute(parentComponent, url, args); }; - v.routes.get = function () { + v.routes.get = function() { let routes = []; mainRouter.paths.forEach((path) => { if (path.method === "get") { @@ -257,7 +257,10 @@ let plugin = function (v) { vnode.props.onclick = (e) => { if (typeof url === "string" && url.length > 0) { if (url.charAt(0) !== "/") { - let current = v.routes.current.split("?", 2).shift().split("/"); + let current = v.routes.current + .split("?", 2) + .shift() + .split("/"); current.pop(); url = `${current.join("/")}/${url}`; } diff --git a/test/hyperscript_test.js b/test/hyperscript_test.js index a506ea5..40be3ea 100644 --- a/test/hyperscript_test.js +++ b/test/hyperscript_test.js @@ -51,9 +51,7 @@ describe("Hyperscript", () => { }); it("should create a div element with mixed array of children and comma separated children", () => { - expect( - v("div", null, ["Hello ", "world"], v("span", null, "Whats up")) - ).toEqual({ + expect(v("div", null, ["Hello ", "world"], v("span", null, "Whats up"))).toEqual({ name: "div", props: {}, children: [ @@ -68,9 +66,7 @@ describe("Hyperscript", () => { }); it("should create a div element with mixed nested arrays of children ", () => { - expect( - v("div", null, ["Hello ", "world", ["Only", ["for", "this", ["time"]]]]) - ).toEqual({ + expect(v("div", null, ["Hello ", "world", ["Only", ["for", "this", ["time"]]]])).toEqual({ name: "div", props: {}, children: [["Hello ", "world", ["Only", ["for", "this", ["time"]]]]] @@ -89,32 +85,26 @@ describe("Hyperscript", () => { }); it("should create a div element from string", () => { - expect(v.trust('
Hola mundo
')).toEqual( - [ - { - name: "div", - props: { - id: "unique", - class: "unique" - }, - children: [{ dom: expect.anything() }], - dom: expect.anything() - } - ] - ); + expect(v.trust('
Hola mundo
')).toEqual([ + { + name: "div", + props: { + id: "unique", + class: "unique" + }, + children: [{ dom: expect.anything() }], + dom: expect.anything() + } + ]); }); it("should handle different types of data", () => { let date = new Date(); - expect( - v("div", null, [null, "Hello", , 1, date, { hello: "world" }, ["Hello"]]) - ).toEqual({ + expect(v("div", null, [null, "Hello", , 1, date, { hello: "world" }, ["Hello"]])).toEqual({ name: "div", props: {}, - children: [ - [null, "Hello", undefined, 1, date, { hello: "world" }, ["Hello"]] - ] + children: [[null, "Hello", undefined, 1, date, { hello: "world" }, ["Hello"]]] }); }); }); diff --git a/test/request_test.js b/test/request_test.js index cd2bd71..95cd553 100644 --- a/test/request_test.js +++ b/test/request_test.js @@ -1,31 +1,69 @@ import expect from "expect"; +import fastify from "fastify"; import "../lib"; import nodePlugin from "../plugins/node"; import requestPlugin from "../plugins/request"; v.usePlugin(nodePlugin); v.usePlugin(requestPlugin); +let posts = []; +for (let i = 10; i--; ) { + posts.push({ + userId: 1, + id: i, + title: "sunt aut facere repellat provident occaecati excepturi optio reprehenderit", + body: "quia et suscipit\n" + "suscipit recusandae consequuntur expedita et cum\n" + "reprehenderit molestiae ut ut quas totam\n" + "nostrum rerum est autem sunt rem eveniet architecto" + }); +} + +let createServer = async () => { + let server = fastify(); + server + .get("/posts", (req, res) => res.send(JSON.stringify(posts))) + .get("/posts/:id", (req, res) => { + let post = posts[0]; + post.id = parseInt(req.params.id, 10); + res.send(JSON.stringify(post)); + }) + .post("/posts", (req, res) => { + let post = req.body; + post.id = 101; + res.send(JSON.stringify(post)); + }) + .put("/posts/:id", (req, res) => res.send(JSON.stringify(req.body))) + .patch("/posts/:id", (req, res) => + res.send( + JSON.stringify({ + ...posts[0], + ...req.body + }) + ) + ) + .delete("/posts/:id", (req, res) => res.send(JSON.stringify({}))) + .get("/hello", (req, res) => res.send("Hello world")); + + await server.listen(3000); + + return server; +}; + describe("Request", () => { it("should get", async () => { - let res = await v.request.get( - "https://jsonplaceholder.typicode.com/posts/1" - ); + let server = await createServer(); + let res = await v.request.get("http://localhost:3000/posts/1"); expect(res).toEqual({ userId: 1, id: 1, - title: - "sunt aut facere repellat provident occaecati excepturi optio reprehenderit", - body: - "quia et suscipit\n" + - "suscipit recusandae consequuntur expedita et cum\n" + - "reprehenderit molestiae ut ut quas totam\n" + - "nostrum rerum est autem sunt rem eveniet architecto" + title: "sunt aut facere repellat provident occaecati excepturi optio reprehenderit", + body: "quia et suscipit\n" + "suscipit recusandae consequuntur expedita et cum\n" + "reprehenderit molestiae ut ut quas totam\n" + "nostrum rerum est autem sunt rem eveniet architecto" }); + await server.close(); }); it("should post", async () => { + let server = await createServer(); let res = await v.request.post( - "https://jsonplaceholder.typicode.com/posts", + "http://localhost:3000/posts", { title: "foo", body: "bar", @@ -43,11 +81,13 @@ describe("Request", () => { title: "foo", body: "bar" }); + await server.close(); }); it("should put", async () => { + let server = await createServer(); let res = await v.request.put( - "https://jsonplaceholder.typicode.com/posts/1", + "http://localhost:3000/posts/1", { id: 1, title: "foo", @@ -67,26 +107,14 @@ describe("Request", () => { title: "foo", body: "bar" }); + await server.close(); }); it("should patch", async () => { + let server = await createServer(); let res = await v.request.patch( - "https://jsonplaceholder.typicode.com/posts/1", - { - body: "bar" - }, - { - headers: { - "Content-Type": "application/json; charset=UTF-8" - } - } - ); - expect(res).toEqual( + "http://localhost:3000/posts/1", { - userId: 1, - id: 1, - title: - "sunt aut facere repellat provident occaecati excepturi optio reprehenderit", body: "bar" }, { @@ -95,40 +123,189 @@ describe("Request", () => { } } ); + expect(res).toEqual({ + userId: 1, + id: 1, + title: "sunt aut facere repellat provident occaecati excepturi optio reprehenderit", + body: "bar" + }); + await server.close(); }); it("should delete", async () => { - let res = await v.request.delete( - "https://jsonplaceholder.typicode.com/posts/1" - ); + let server = await createServer(); + let res = await v.request.delete("http://localhost:3000/posts/1"); expect(res).toEqual({}); + await server.close(); }); it("should serialize data", async () => { - let res = await v.request.get( - "https://jsonplaceholder.typicode.com/posts/", - { - userId: 1 - } - ); + let server = await createServer(); + let res = await v.request.get("http://localhost:3000/posts/", { + userId: 1 + }); expect(res).toEqual(expect.any(Array)); expect(res.length).toEqual(10); + await server.close(); }); it("should resolve with full response", async () => { - let res = await v.request.get( - "https://jsonplaceholder.typicode.com/posts/1", - null, - { resolveWithFullResponse: true } - ); + let server = await createServer(); + let res = await v.request.get("http://localhost:3000/posts/1", null, { resolveWithFullResponse: true }); expect(res).toEqual( expect.objectContaining({ body: expect.any(Object), - url: "https://jsonplaceholder.typicode.com/posts/1", + url: "http://localhost:3000/posts/1", status: 200, statusText: "OK", headers: expect.any(Object) }) ); + await server.close(); + }); + + it("should create a scoped request", async () => { + let server = await createServer(); + let request = v.request.new("http://localhost:3000/"); + let res = await request.get("/posts", { + userId: 1 + }); + expect(res).toEqual(expect.any(Array)); + expect(res.length).toEqual(10); + await server.close(); + }); + + it("should create a scoped request with allowed methods", async () => { + let server = await createServer(); + let request = v.request.new("http://localhost:3000/", { methods: ["get"] }); + let res = await request.get("/posts", { + userId: 1 + }); + expect(res).toEqual(expect.any(Array)); + expect(res.length).toEqual(10); + + expect(request.post).toBeUndefined(); + await server.close(); + }); + + it("should create a child scoped request", async () => { + let server = await createServer(); + let request = v.request.new("http://localhost:3000/"); + let requestChild = request.new("/posts"); + let res = await requestChild.get("/", { + userId: 1 + }); + expect(res).toEqual(expect.any(Array)); + expect(res.length).toEqual(10); + await server.close(); + }); + + it("should create a child scoped request with allowed methods", async () => { + let server = await createServer(); + let request = v.request.new("http://localhost:3000/", { methods: ["get"] }); + let requestChild = request.new("/posts"); + let res = await requestChild.get("/", { + userId: 1 + }); + expect(res).toEqual(expect.any(Array)); + expect(res.length).toEqual(10); + + expect(requestChild.post).toBeUndefined(); + await server.close(); + }); + + it("should work with server side rendering of local requests", async () => { + let server = await createServer(); + v.request.options("urls.node", "http://localhost:3000"); + + let res = await v.request.get("/hello", null, { headers: { Accept: "text/html" } }); + + expect(res).toEqual("Hello world"); + + await server.close(); + }); + + it("should work with server side rendering of api requests", async () => { + let server = await createServer(); + v.request.options("urls.node", "http://localhost:3000"); + v.request.options("urls.api", "http://example.com/api"); + + let res = await v.request.get("http://example.com/api/hello", null, { headers: { Accept: "text/html" } }); + + expect(res).toEqual("Hello world"); + + await server.close(); + }); + + it("should work with server side rendering of local requests with scoped request", async () => { + let server = await createServer(); + let request = v.request.new("/", { + urls: { + node: "http://localhost:3000" + } + }); + + let res = await request.get("/hello", null, { headers: { Accept: "text/html" } }); + + expect(res).toEqual("Hello world"); + + await server.close(); + }); + + it("should work with server side rendering of api requests with scoped request", async () => { + let server = await createServer(); + let request = v.request.new("/", { + urls: { + node: "http://localhost:3000", + api: "http://example.com/api" + } + }); + + let res = await request.get("http://example.com/api/hello", null, { headers: { Accept: "text/html" } }); + + expect(res).toEqual("Hello world"); + + await server.close(); + }); + + it("should work with server side rendering of local requests with child scoped request", async () => { + let server = await createServer(); + let request = v.request.new("/", { + urls: { + node: "http://localhost:3000" + }, + methods: ["get"] + }); + + let childRequest = request.new("/hello"); + + let res = await childRequest.get("/", null, { headers: { Accept: "text/html" } }); + + expect(res).toEqual("Hello world"); + + expect(childRequest.post).toBeUndefined(); + + await server.close(); + }); + + it("should work with server side rendering of api requests with child scoped request", async () => { + let server = await createServer(); + let request = v.request.new("/", { + urls: { + node: "http://localhost:3000", + api: "http://example.com/api" + }, + methods: ["get"] + }); + + let childRequest = request.new("http://example.com/api/hello"); + + let res = await childRequest.get("/", null, { headers: { Accept: "text/html" } }); + + expect(res).toEqual("Hello world"); + + expect(childRequest.post).toBeUndefined(); + + await server.close(); }); }); diff --git a/test/router_test.js b/test/router_test.js index 506f891..29c3f8d 100644 --- a/test/router_test.js +++ b/test/router_test.js @@ -11,62 +11,32 @@ describe("Router", () => { let Component = () =>
Hello world
; let router = v.Router(); router - .get( - "/", - () => console.log("Hello 1"), - () => Component - ) + .get("/", () => console.log("Hello 1"), () => Component) .get("/hello", [() => console.log("Hello 2"), () => Component]) .get("/hello/", [() => console.log("Hello 3"), () => Component]) .get("/:hello", [() => console.log("Hello 4"), () => Component]) .get("/hello/(.*)", [() => console.log("Hello 5"), () => Component]) - .get( - "/:hello/world", - () => console.log("Hello 6"), - [() => console.log("Hello 6")], - () => Component - ) - .get( - "/hello/:world", - [() => console.log("Hello 7"), () => Component], - () => console.log("Hello 7") - ); + .get("/:hello/world", () => console.log("Hello 6"), [() => console.log("Hello 6")], () => Component) + .get("/hello/:world", [() => console.log("Hello 7"), () => Component], () => console.log("Hello 7")); let subrouter = v.Router(); subrouter - .get( - "/", - () => console.log("Hello 1"), - () => Component - ) + .get("/", () => console.log("Hello 1"), () => Component) .get("/hello", [() => console.log("Hello 2"), () => Component]) .get("/hello/", [() => console.log("Hello 3"), () => Component]) .get("/:hello", [() => console.log("Hello 4"), () => Component]) .get("/hello/(.*)", [() => console.log("Hello 5"), () => Component]) - .get( - "/:hello/world", - () => console.log("Hello 6"), - [() => console.log("Hello 6")], - () => Component - ) - .get( - "/hello/:world", - [() => console.log("Hello 7"), () => Component], - () => console.log("Hello 7") - ) + .get("/:hello/world", () => console.log("Hello 6"), [() => console.log("Hello 6")], () => Component) + .get("/hello/:world", [() => console.log("Hello 7"), () => Component], () => console.log("Hello 7")) .use(() => () => "Not ok"); router.use("/ok", subrouter); router.use(() => () => "Not found"); v.routes("body", router); - expect(await v.routes.go("/ok/not/found/url?hello=world")).toEqual( - "Not ok" - ); - expect(await v.routes.go("/not/found/url?hello=world")).toEqual( - "Not found" - ); + expect(await v.routes.go("/ok/not/found/url?hello=world")).toEqual("Not ok"); + expect(await v.routes.go("/not/found/url?hello=world")).toEqual("Not found"); }); it("Mount and update with POJO component", async () => { @@ -97,7 +67,7 @@ describe("Router", () => { }); it("Mount and update with functional stateful component", async () => { - let Component = function () { + let Component = function() { return
Hello {this.world}
; }; @@ -128,7 +98,7 @@ describe("Router", () => { world: "World", id: "example" }; - let Component = function () { + let Component = function() { return ; }; @@ -200,7 +170,7 @@ describe("Router", () => { world: "world", up: "up" }; - let Hello = function () { + let Hello = function() { return (
Hello {this.world}, what's {this.up} @@ -209,15 +179,8 @@ describe("Router", () => { }; let router = v.Router(); - router.get( - "/hello", - () => Object.assign(Hello, Store), - () => Hello - ); - router.get("/hello/:world/whats/:up", [ - ({ params }) => Object.assign(Hello, params), - () => Hello - ]); + router.get("/hello", () => Object.assign(Hello, Store), () => Hello); + router.get("/hello/:world/whats/:up", [({ params }) => Object.assign(Hello, params), () => Hello]); v.routes("body", router); @@ -242,12 +205,7 @@ describe("Router", () => { [ () => middlewares.push("Middleware 1.1"), () => middlewares.push("Middleware 1.2"), - [ - () => middlewares.push("Middleware 1.2.1"), - () => middlewares.push("Middleware 1.2.2"), - () => middlewares.push("Middleware 1.2.3"), - () => middlewares.push("Middleware 1.2.4") - ] + [() => middlewares.push("Middleware 1.2.1"), () => middlewares.push("Middleware 1.2.2"), () => middlewares.push("Middleware 1.2.3"), () => middlewares.push("Middleware 1.2.4")] ], () => middlewares.push("Middleware 2"), // This is the final response @@ -258,20 +216,11 @@ describe("Router", () => { let result = await v.routes.go("/"); expect(result).toEqual("
Hello World
"); - expect(middlewares).toEqual([ - "Middleware 1", - "Middleware 1.1", - "Middleware 1.2", - "Middleware 1.2.1", - "Middleware 1.2.2", - "Middleware 1.2.3", - "Middleware 1.2.4", - "Middleware 2" - ]); + expect(middlewares).toEqual(["Middleware 1", "Middleware 1.1", "Middleware 1.2", "Middleware 1.2.1", "Middleware 1.2.2", "Middleware 1.2.3", "Middleware 1.2.4", "Middleware 2"]); }); it("Test subrouter", async () => { - let Component = function () { + let Component = function() { return (
Hello {this.world}, from {this.country} @@ -368,10 +317,6 @@ describe("Router", () => { v.routes("body", router); - expect(v.routes.get()).toEqual([ - "/hello/:world/from/:country", - "/hello/:world", - "/" - ]); + expect(v.routes.get()).toEqual(["/hello/:world/from/:country", "/hello/:world", "/"]); }); }); diff --git a/yarn.lock b/yarn.lock index fba4ce0..0ac9d77 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1835,6 +1835,11 @@ abbrev@1: resolved "https://registry.yarnpkg.com/abbrev/-/abbrev-1.1.1.tgz#f8f2c887ad10bf67f634f005b6987fed3179aac8" integrity sha512-nne9/IiQ/hzIhY6pdDnbBtz7DjPTKrY00P/zvPSm5pOFkl6xuGrGnXn/VtTNNfNtAfZ9/1RtehkszU9qcTii0Q== +abstract-logging@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/abstract-logging/-/abstract-logging-2.0.0.tgz#08a85814946c98ef06f4256ad470aba1886d4490" + integrity sha512-/oA9z7JszpIioo6J6dB79LVUgJ3eD3cxkAmdCkvWWS+Y9tPtALs1rLqOekLUXUbYqM2fB9TTK0ibAyZJJOP/CA== + accepts@~1.3.5: version "1.3.7" resolved "https://registry.yarnpkg.com/accepts/-/accepts-1.3.7.tgz#531bc726517a3b2b41f850021c6cc15eaab507cd" @@ -1907,7 +1912,7 @@ ajv-keywords@^3.1.0, ajv-keywords@^3.4.1: resolved "https://registry.yarnpkg.com/ajv-keywords/-/ajv-keywords-3.5.2.tgz#31f29da5ab6e00d1c2d329acf7b5929614d5014d" integrity sha512-5p6WTN0DdTGVQk6VjcEju19IgaHudalcfabD7yhDGeA6bcQnmL+CpveLJq/3hvfwd1aof6L386Ougkx6RfyMIQ== -ajv@^6.1.0, ajv@^6.10.0, ajv@^6.10.2, ajv@^6.12.3, ajv@^6.12.4: +ajv@^6.1.0, ajv@^6.10.0, ajv@^6.10.2, ajv@^6.11.0, ajv@^6.12.2, ajv@^6.12.3, ajv@^6.12.4: version "6.12.5" resolved "https://registry.yarnpkg.com/ajv/-/ajv-6.12.5.tgz#19b0e8bae8f476e5ba666300387775fb1a00a4da" integrity sha512-lRF8RORchjpKG50/WFf8xmg7sgCLFiYNNnqdKflk63whMQcWR5ngGjiSXkL9bjxy6B2npOK2HSMN49jEBMSkag== @@ -2022,11 +2027,6 @@ are-we-there-yet@~1.1.2: delegates "^1.0.0" readable-stream "^2.0.6" -arg@4.1.0: - version "4.1.0" - resolved "https://registry.yarnpkg.com/arg/-/arg-4.1.0.tgz#583c518199419e0037abb74062c37f8519e575f0" - integrity sha512-ZWc51jO3qegGkVh8Hwpv636EkbesNV5ZNQPCtRa+0qytRYPEs9IYT9qITY9buezqUH5uqyzlWLcufrzU2rffdg== - argparse@^1.0.7: version "1.0.10" resolved "https://registry.yarnpkg.com/argparse/-/argparse-1.0.10.tgz#bcd6791ea5ae09725e17e5ad988134cd40b3d911" @@ -2160,6 +2160,21 @@ atob@^2.1.2: resolved "https://registry.yarnpkg.com/atob/-/atob-2.1.2.tgz#6d9517eb9e030d2436666651e86bd9f6f13533c9" integrity sha512-Wm6ukoaOGJi/73p/cl2GvLjTI5JM1k/O14isD73YML8StrH/7/lRFgmg8nICZgD3bZZvjwCGxtMOD3wWNAu8cg== +atomic-sleep@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/atomic-sleep/-/atomic-sleep-1.0.0.tgz#eb85b77a601fc932cfe432c5acd364a9e2c9075b" + integrity sha512-kNOjDqAh7px0XWNI+4QbzoiR/nTkHAWNud2uvnJquD1/x5a7EQZMJT0AczqK0Qn67oY/TTQ1LbUKajZpp3I9tQ== + +avvio@^7.1.2: + version "7.2.0" + resolved "https://registry.yarnpkg.com/avvio/-/avvio-7.2.0.tgz#b4bf4eaf4a0207a4e6a58a7859207250793cc81b" + integrity sha512-KtC63UyZARidAoIV8wXutAZnDIbZcXBqLjTAhZOX+mdMZBQCh5il/15MvCvma1178nhTwvN2D0TOAdiKG1MpUA== + dependencies: + archy "^1.0.0" + debug "^4.0.0" + fastq "^1.6.1" + queue-microtask "^1.1.2" + aws-sign2@~0.7.0: version "0.7.0" resolved "https://registry.yarnpkg.com/aws-sign2/-/aws-sign2-0.7.0.tgz#b46e890934a9591f2d2f6f86d7e6a9f1b3fe76a8" @@ -2532,7 +2547,7 @@ bytes@3.0.0: resolved "https://registry.yarnpkg.com/bytes/-/bytes-3.0.0.tgz#d32815404d689699f85a4ea4fa8755dd13a96048" integrity sha1-0ygVQE1olpn4Wk6k+odV3ROpYEg= -bytes@3.1.0, bytes@^3.1.0: +bytes@^3.1.0: version "3.1.0" resolved "https://registry.yarnpkg.com/bytes/-/bytes-3.1.0.tgz#f6cf7933a360e0588fa9fde85651cdc7f805d1f6" integrity sha512-zauLjrfCG+xvoyaqLoV8bLVXXNGC4JqlxFCutSDWA6fJrTo2ZuvLYTqZ7aHBLZSMOopbzwv8f+wZcVzfVTI2Dg== @@ -3126,11 +3141,6 @@ constants-browserify@^1.0.0: resolved "https://registry.yarnpkg.com/constants-browserify/-/constants-browserify-1.0.0.tgz#c20b96d8c617748aaf1c16021760cd27fcb8cb75" integrity sha1-wguW2MYXdIqvHBYCF2DNJ/y4y3U= -content-type@1.0.4: - version "1.0.4" - resolved "https://registry.yarnpkg.com/content-type/-/content-type-1.0.4.tgz#e138cc75e040c727b1966fe5e5f8c9aee256fe3b" - integrity sha512-hIP3EEPs8tB9AT1L+NUqtwOAps4mk2Zob89MWXMHjHWg9milF/j4osnnQLXBCBFBk/tvIG/tUc9mOUJiPBhPXA== - conventional-changelog-angular@^5.0.11: version "5.0.11" resolved "https://registry.yarnpkg.com/conventional-changelog-angular/-/conventional-changelog-angular-5.0.11.tgz#99a3ca16e4a5305e0c2c2fae3ef74fd7631fc3fb" @@ -3304,6 +3314,11 @@ convert-source-map@^1.7.0: dependencies: safe-buffer "~5.1.1" +cookie@^0.4.0: + version "0.4.1" + resolved "https://registry.yarnpkg.com/cookie/-/cookie-0.4.1.tgz#afd713fe26ebd21ba95ceb61f9a8116e50a537d1" + integrity sha512-ZwrFkGJxUR3EIoXtO+yVE69Eb7KlixbaeAWfBQB9vVsNn/o+Yw69gBWSSDK825hQNdN+wF8zELf3dFNl/kxkUA== + copy-concurrently@^1.0.0: version "1.0.5" resolved "https://registry.yarnpkg.com/copy-concurrently/-/copy-concurrently-1.0.5.tgz#92297398cae34937fcafd6ec8139c18051f0b5e0" @@ -3641,12 +3656,7 @@ delegates@^1.0.0: resolved "https://registry.yarnpkg.com/delegates/-/delegates-1.0.0.tgz#84c6e159b81904fdca59a0ef44cd870d31250f9a" integrity sha1-hMbhWbgZBP3KWaDvRM2HDTElD5o= -depd@1.1.1: - version "1.1.1" - resolved "https://registry.yarnpkg.com/depd/-/depd-1.1.1.tgz#5783b4e1c459f06fa5ca27f991f3d06e7a310359" - integrity sha1-V4O04cRZ8G+lyif5kfPQbnoxA1k= - -depd@^1.1.2, depd@~1.1.2: +depd@^1.1.2: version "1.1.2" resolved "https://registry.yarnpkg.com/depd/-/depd-1.1.2.tgz#9bcd52e14c097763e749b274c4346ed2e560b5a9" integrity sha1-m81S4UwJd2PnSbJ0xDRu0uVgtak= @@ -4246,6 +4256,11 @@ faker@^5.1.0: resolved "https://registry.yarnpkg.com/faker/-/faker-5.1.0.tgz#e10fa1dec4502551aee0eb771617a7e7b94692e8" integrity sha512-RrWKFSSA/aNLP0g3o2WW1Zez7/MnMr7xkiZmoCfAGZmdkDQZ6l2KtuXHN5XjdvpRjDl8+3vf+Rrtl06Z352+Mw== +fast-decode-uri-component@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/fast-decode-uri-component/-/fast-decode-uri-component-1.0.1.tgz#46f8b6c22b30ff7a81357d4f59abfae938202543" + integrity sha512-WKgKWg5eUxvRZGwW8FvfbaH7AXSh2cL+3j5fMGzUMCxWBJ3dV3a7Wz8y2f/uQ0e3B6WmodD3oS54jTQ9HVTIIg== + fast-deep-equal@^3.1.1: version "3.1.3" resolved "https://registry.yarnpkg.com/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz#3a7d56b559d6cbc3eb512325244e619a65c6c525" @@ -4268,12 +4283,63 @@ fast-json-stable-stringify@^2.0.0: resolved "https://registry.yarnpkg.com/fast-json-stable-stringify/-/fast-json-stable-stringify-2.1.0.tgz#874bf69c6f404c2b5d99c481341399fd55892633" integrity sha512-lhd/wF+Lk98HZoTCtlVraHtfh5XYijIjalXck7saUtuanSDyLMxnHhSXEDJqHxD7msR8D0uCmqlkwjCV8xvwHw== +fast-json-stringify@^2.2.1: + version "2.2.7" + resolved "https://registry.yarnpkg.com/fast-json-stringify/-/fast-json-stringify-2.2.7.tgz#3dba170451bfdfbe144f7a408f2c4f1bf413126a" + integrity sha512-XVCR/dQ6unMP7c39XUdnPoYPPnf1RqTZGL2mAnmrXDIkyF5MRJYd87nfCEmxrqhj7k61Yi35Aaeb2QlJlZU9fg== + dependencies: + ajv "^6.11.0" + deepmerge "^4.2.2" + string-similarity "^4.0.1" + fast-levenshtein@^2.0.6: version "2.0.6" resolved "https://registry.yarnpkg.com/fast-levenshtein/-/fast-levenshtein-2.0.6.tgz#3d8a5c66883a16a30ca8643e851f19baa7797917" integrity sha1-PYpcZog6FqMMqGQ+hR8Zuqd5eRc= -fastq@^1.6.0: +fast-redact@^2.0.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/fast-redact/-/fast-redact-2.1.0.tgz#dfe3c1ca69367fb226f110aa4ec10ec85462ffdf" + integrity sha512-0LkHpTLyadJavq9sRzzyqIoMZemWli77K2/MGOkafrR64B9ItrvZ9aT+jluvNDsv0YEHjSNhlMBtbokuoqii4A== + +fast-safe-stringify@^2.0.7: + version "2.0.7" + resolved "https://registry.yarnpkg.com/fast-safe-stringify/-/fast-safe-stringify-2.0.7.tgz#124aa885899261f68aedb42a7c080de9da608743" + integrity sha512-Utm6CdzT+6xsDk2m8S6uL8VHxNwI6Jub+e9NYTcAms28T84pTa25GJQV9j0CY0N1rM8hK4x6grpF2BQf+2qwVA== + +fastify-error@^0.2.0: + version "0.2.0" + resolved "https://registry.yarnpkg.com/fastify-error/-/fastify-error-0.2.0.tgz#9a1c28d4f42b6259e7a549671c8e5e2d85660634" + integrity sha512-zabxsBatj59ROG0fhP36zNdc5Q1/eYeH9oSF9uvfrurZf8/JKfrJbMcIGrLpLWcf89rS6L91RHWm20A/X85hcA== + +fastify-warning@^0.2.0: + version "0.2.0" + resolved "https://registry.yarnpkg.com/fastify-warning/-/fastify-warning-0.2.0.tgz#e717776026a4493dc9a2befa44db6d17f618008f" + integrity sha512-s1EQguBw/9qtc1p/WTY4eq9WMRIACkj+HTcOIK1in4MV5aFaQC9ZCIt0dJ7pr5bIf4lPpHvAtP2ywpTNgs7hqw== + +fastify@^3.5.0: + version "3.5.0" + resolved "https://registry.yarnpkg.com/fastify/-/fastify-3.5.0.tgz#4e46de69e9ac51c80474a08b20b23fbf9e1176aa" + integrity sha512-wTd2l3Ndz8LSHBJG4zIwroJfgBdwHN/nilqraDy0GOnhWaCAbtTHaHb8xE6+wn1zPRDnYvmfn1/jStjqTU6UfA== + dependencies: + abstract-logging "^2.0.0" + ajv "^6.12.2" + avvio "^7.1.2" + fast-json-stringify "^2.2.1" + fastify-error "^0.2.0" + fastify-warning "^0.2.0" + find-my-way "^3.0.0" + flatstr "^1.0.12" + light-my-request "^4.0.2" + pino "^6.2.1" + proxy-addr "^2.0.5" + readable-stream "^3.4.0" + rfdc "^1.1.4" + secure-json-parse "^2.0.0" + semver "^7.3.2" + tiny-lru "^7.0.0" + +fastq@^1.6.0, fastq@^1.6.1: version "1.8.0" resolved "https://registry.yarnpkg.com/fastq/-/fastq-1.8.0.tgz#550e1f9f59bbc65fe185cb6a9b4d95357107f481" integrity sha512-SMIZoZdLh/fgofivvIkmknUXyPnvxRE3DhtZ5Me3Mrsk5gyPL42F0xr51TdRXskBxHfMp+07bcYzfsYEsSQA9Q== @@ -4394,6 +4460,15 @@ find-cache-dir@^3.2.0: make-dir "^3.0.2" pkg-dir "^4.1.0" +find-my-way@^3.0.0: + version "3.0.4" + resolved "https://registry.yarnpkg.com/find-my-way/-/find-my-way-3.0.4.tgz#a485973d1a3fdafd989ac9f12fd2d88e83cda268" + integrity sha512-Trl/mNAVvTgCpo9ox6yixkwiZUvecKYUQZoAuMCBACsgGqv+FbWe+jE5sBA5+U8LIWrJk/cw8zPV53GPrjTnsw== + dependencies: + fast-decode-uri-component "^1.0.1" + safe-regex2 "^2.0.0" + semver-store "^0.3.0" + find-node-modules@2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/find-node-modules/-/find-node-modules-2.0.0.tgz#5db1fb9e668a3d451db3d618cd167cdd59e41b69" @@ -4476,6 +4551,11 @@ flat@^5.0.2: resolved "https://registry.yarnpkg.com/flat/-/flat-5.0.2.tgz#8ca6fe332069ffa9d324c327198c598259ceb241" integrity sha512-b6suED+5/3rTpUBdG1gupIl8MPFCAMA0QXwmljLhvCUKcUvdE4gWky9zpuGCcXHOsz4J9wPGNWq6OKpmIzz3hQ== +flatstr@^1.0.12: + version "1.0.12" + resolved "https://registry.yarnpkg.com/flatstr/-/flatstr-1.0.12.tgz#c2ba6a08173edbb6c9640e3055b95e287ceb5931" + integrity sha512-4zPxDyhCyiN2wIAtSLI6gc82/EjqZc1onI4Mz/l0pWrAlsSfYH/2ZIcU+e3oA2wDwbzIWNKwa23F8rh6+DRWkw== + flatted@^2.0.0: version "2.0.2" resolved "https://registry.yarnpkg.com/flatted/-/flatted-2.0.2.tgz#4575b21e2bcee7434aa9be662f4b7b5f9c2b5138" @@ -4530,6 +4610,11 @@ format@^0.2.0: resolved "https://registry.yarnpkg.com/format/-/format-0.2.2.tgz#d6170107e9efdc4ed30c9dc39016df942b5cb58b" integrity sha1-1hcBB+nv3E7TDJ3DkBbflCtctYs= +forwarded@~0.1.2: + version "0.1.2" + resolved "https://registry.yarnpkg.com/forwarded/-/forwarded-0.1.2.tgz#98c23dab1175657b8c0573e8ceccd91b0ff18c84" + integrity sha1-mMI9qxF1ZXuMBXPozszZGw/xjIQ= + fragment-cache@^0.2.1: version "0.2.1" resolved "https://registry.yarnpkg.com/fragment-cache/-/fragment-cache-0.2.1.tgz#4290fad27f13e89be7f33799c6bc5a0abfff0d19" @@ -5072,27 +5157,6 @@ http-cache-semantics@^4.0.0, http-cache-semantics@^4.0.4: resolved "https://registry.yarnpkg.com/http-cache-semantics/-/http-cache-semantics-4.1.0.tgz#49e91c5cbf36c9b94bcfcd71c23d5249ec74e390" integrity sha512-carPklcUh7ROWRK7Cv27RPtdhYhUsela/ue5/jKzjegVvXDqM2ILE9Q2BGn9JZJh1g87cp56su/FgQSzcWS8cQ== -http-errors@1.6.2: - version "1.6.2" - resolved "https://registry.yarnpkg.com/http-errors/-/http-errors-1.6.2.tgz#0a002cc85707192a7e7946ceedc11155f60ec736" - integrity sha1-CgAsyFcHGSp+eUbO7cERVfYOxzY= - dependencies: - depd "1.1.1" - inherits "2.0.3" - setprototypeof "1.0.3" - statuses ">= 1.3.1 < 2" - -http-errors@1.7.3: - version "1.7.3" - resolved "https://registry.yarnpkg.com/http-errors/-/http-errors-1.7.3.tgz#6c619e4f9c60308c38519498c14fbb10aacebb06" - integrity sha512-ZTTX0MWrsQ2ZAhA1cejAwDLycFsd7I7nVtnkT3Ol0aqodaKW+0CTZDQ1uBv5whptCnc8e8HeRRJxRs0kmm/Qfw== - dependencies: - depd "~1.1.2" - inherits "2.0.4" - setprototypeof "1.1.1" - statuses ">= 1.5.0 < 2" - toidentifier "1.0.0" - http-proxy-agent@^4.0.1: version "4.0.1" resolved "https://registry.yarnpkg.com/http-proxy-agent/-/http-proxy-agent-4.0.1.tgz#8a8c8ef7f5932ccf953c296ca8291b95aa74aa3a" @@ -5144,12 +5208,7 @@ humanize-ms@^1.2.1: dependencies: ms "^2.0.0" -iconv-lite@0.4.19: - version "0.4.19" - resolved "https://registry.yarnpkg.com/iconv-lite/-/iconv-lite-0.4.19.tgz#f7468f60135f5e5dad3399c0a81be9a1603a082b" - integrity sha512-oTZqweIP51xaGPI4uPa56/Pri/480R+mo7SeU+YETByQNhDG55ycFyNLIgta9vXhILrxXDmF7ZGhqZIcuN0gJQ== - -iconv-lite@0.4.24, iconv-lite@^0.4.24: +iconv-lite@^0.4.24: version "0.4.24" resolved "https://registry.yarnpkg.com/iconv-lite/-/iconv-lite-0.4.24.tgz#2022b4b25fbddc21d2f524974a474aafe733908b" integrity sha512-v3MXnZAcvnywkTUEZomIActle7RXXeedOR31wwl7VlyoXO4Qi9arvSenNQWne1TcRwhCL1HwLI21bEqdpj8/rA== @@ -5269,7 +5328,7 @@ inflight@^1.0.4: once "^1.3.0" wrappy "1" -inherits@2, inherits@2.0.4, inherits@^2.0.0, inherits@^2.0.1, inherits@^2.0.3, inherits@^2.0.4, inherits@~2.0.1, inherits@~2.0.3: +inherits@2, inherits@^2.0.0, inherits@^2.0.1, inherits@^2.0.3, inherits@^2.0.4, inherits@~2.0.1, inherits@~2.0.3: version "2.0.4" resolved "https://registry.yarnpkg.com/inherits/-/inherits-2.0.4.tgz#0fa2c64f932917c3433a0ded55363aae37416b7c" integrity sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ== @@ -5349,6 +5408,11 @@ ip@^1.1.5: resolved "https://registry.yarnpkg.com/ip/-/ip-1.1.5.tgz#bdded70114290828c0a039e72ef25f5aaec4354a" integrity sha1-vd7XARQpCCjAoDnnLvJfWq7ENUo= +ipaddr.js@1.9.1: + version "1.9.1" + resolved "https://registry.yarnpkg.com/ipaddr.js/-/ipaddr.js-1.9.1.tgz#bff38543eeb8984825079ff3a2a8e6cbd46781b3" + integrity sha512-0KI/607xoxSToH7GjN1FfSbLoU0+btTicjsQSWQlh/hZykN8KpmMf7uYwPW3R+akZ6R/w18ZlXSHBYXiYUPO3g== + is-accessor-descriptor@^0.1.6: version "0.1.6" resolved "https://registry.yarnpkg.com/is-accessor-descriptor/-/is-accessor-descriptor-0.1.6.tgz#a9e12cb3ae8d876727eeef3843f8a0897b5c98d6" @@ -5650,11 +5714,6 @@ is-ssh@^1.3.0: dependencies: protocols "^1.1.0" -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-stream@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/is-stream/-/is-stream-2.0.0.tgz#bde9c32680d6fae04129d6ac9d921ce7815f78e3" @@ -6105,6 +6164,17 @@ libnpmconfig@^1.0.0: find-up "^3.0.0" ini "^1.3.5" +light-my-request@^4.0.2: + version "4.1.0" + resolved "https://registry.yarnpkg.com/light-my-request/-/light-my-request-4.1.0.tgz#77a2230fb9bdb4c559832c7ee74acef7154ac20f" + integrity sha512-MweHfXZh1olI/7orXZ19WL1cpm7TyrKtvgSeBAC2jojJlMEqaDxb0VgvZ3azUHVqVVLffgdai43ty/E0Nhdgvw== + dependencies: + ajv "^6.12.2" + cookie "^0.4.0" + fastify-warning "^0.2.0" + readable-stream "^3.6.0" + set-cookie-parser "^2.4.1" + lines-and-columns@^1.1.6: version "1.1.6" resolved "https://registry.yarnpkg.com/lines-and-columns/-/lines-and-columns-1.1.6.tgz#1c00c743b433cd0a4e80758f7b64a57440d9ff00" @@ -6431,11 +6501,6 @@ mdast-util-toc@^5.0.0: unist-util-is "^4.0.0" unist-util-visit "^2.0.0" -media-typer@^0.3.0: - version "0.3.0" - resolved "https://registry.yarnpkg.com/media-typer/-/media-typer-0.3.0.tgz#8710d7af0aa626f8fffa1ce00168545263255748" - integrity sha1-hxDXrwqmJvj/+hzgAWhUUmMlV0g= - memory-fs@^0.4.1: version "0.4.1" resolved "https://registry.yarnpkg.com/memory-fs/-/memory-fs-0.4.1.tgz#3a9a20b8462523e447cfbc7e8bb80ed667bfc552" @@ -6515,25 +6580,6 @@ merge@^1.2.1: resolved "https://registry.yarnpkg.com/merge/-/merge-1.2.1.tgz#38bebf80c3220a8a487b6fcfb3941bb11720c145" integrity sha512-VjFo4P5Whtj4vsLzsYBu5ayHhoHJ0UqNm7ibvShmbmoz7tGi0vXaoJbGdB+GmDMLUdg8DpQXEIeVDAe8MaABvQ== -micro-ex-router@^1.7.2: - version "1.7.2" - resolved "https://registry.yarnpkg.com/micro-ex-router/-/micro-ex-router-1.7.2.tgz#ec7990c416d6b7d1873d57fd640a500e6f1478ab" - integrity sha512-gzJThcoH+XrLGfe/6nmEyrqsQ3KzPe2TF51IZo5iA9TP9whA/YKRIJZvhI4dYgIehuBHf2ndIrOfHOV2rpuc1Q== - dependencies: - micro "^9.3.4" - recursive-readdir "^2.2.2" - urlencoded-body-parser "^3.0.0" - -micro@^9.3.4: - version "9.3.4" - resolved "https://registry.yarnpkg.com/micro/-/micro-9.3.4.tgz#745a494e53c8916f64fb6a729f8cbf2a506b35ad" - integrity sha512-smz9naZwTG7qaFnEZ2vn248YZq9XR+XoOH3auieZbkhDL4xLOxiE+KqG8qqnBeKfXA9c1uEFGCxPN1D+nT6N7w== - dependencies: - arg "4.1.0" - content-type "1.0.4" - is-stream "1.1.0" - raw-body "2.3.2" - micromatch@^3.0.4, micromatch@^3.1.10, micromatch@^3.1.4: version "3.1.10" resolved "https://registry.yarnpkg.com/micromatch/-/micromatch-3.1.10.tgz#70859bc95c9840952f359a068a3fc49f9ecfac23" @@ -7682,6 +7728,23 @@ pinkie@^2.0.0: resolved "https://registry.yarnpkg.com/pinkie/-/pinkie-2.0.4.tgz#72556b80cfa0d48a974e80e77248e80ed4f7f870" integrity sha1-clVrgM+g1IqXToDnckjoDtT3+HA= +pino-std-serializers@^2.4.2: + version "2.5.0" + resolved "https://registry.yarnpkg.com/pino-std-serializers/-/pino-std-serializers-2.5.0.tgz#40ead781c65a0ce7ecd9c1c33f409d31fe712315" + integrity sha512-wXqbqSrIhE58TdrxxlfLwU9eDhrzppQDvGhBEr1gYbzzM4KKo3Y63gSjiDXRKLVS2UOXdPNR2v+KnQgNrs+xUg== + +pino@^6.2.1: + version "6.6.1" + resolved "https://registry.yarnpkg.com/pino/-/pino-6.6.1.tgz#3fe8ec300dadb2c30017df39106b056b87dffca8" + integrity sha512-DOgm7rn6ctBkBYemHXSLj7+j3o3U1q1FWBXbHcprur8mA93QcJSycEkEqhqKiFB9Mx/3Qld2FGr6+9yfQza0kA== + dependencies: + fast-redact "^2.0.0" + fast-safe-stringify "^2.0.7" + flatstr "^1.0.12" + pino-std-serializers "^2.4.2" + quick-format-unescaped "^4.0.1" + sonic-boom "^1.0.2" + pirates@^3.0.2: version "3.0.2" resolved "https://registry.yarnpkg.com/pirates/-/pirates-3.0.2.tgz#7e6f85413fd9161ab4e12b539b06010d85954bb9" @@ -7856,6 +7919,14 @@ protocols@^1.1.0, protocols@^1.4.0: resolved "https://registry.yarnpkg.com/protocols/-/protocols-1.4.8.tgz#48eea2d8f58d9644a4a32caae5d5db290a075ce8" integrity sha512-IgjKyaUSjsROSO8/D49Ab7hP8mJgTYcqApOqdPhLoPxAplXmkp+zRvsrSQjFn5by0rhm4VH0GAUELIPpx7B1yg== +proxy-addr@^2.0.5: + version "2.0.6" + resolved "https://registry.yarnpkg.com/proxy-addr/-/proxy-addr-2.0.6.tgz#fdc2336505447d3f2f2c638ed272caf614bbb2bf" + integrity sha512-dh/frvCBVmSsDYzw6n926jv974gddhkFPfiN8hPOi30Wax25QZyZEGveluCgliBnqmuM+UJmBErbAUFIoDbjOw== + dependencies: + forwarded "~0.1.2" + ipaddr.js "1.9.1" + prr@~1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/prr/-/prr-1.0.1.tgz#d3fc114ba06995a45ec6893f484ceb1d78f5f476" @@ -7940,11 +8011,6 @@ q@^1.5.1: resolved "https://registry.yarnpkg.com/q/-/q-1.5.1.tgz#7e32f75b41381291d04611f1bf14109ac00651d7" integrity sha1-fjL3W0E4EpHQRhHxvxQQmsAGUdc= -qs@^6.2.1: - version "6.9.4" - resolved "https://registry.yarnpkg.com/qs/-/qs-6.9.4.tgz#9090b290d1f91728d3c22e54843ca44aea5ab687" - integrity sha512-A1kFqHekCTM7cz0udomYUoYNWjBebHm/5wzU/XqrBRBNWectVH0QIiN+NEcZ0Dte5hvzHwbr8+XQmguPhJ6WdQ== - qs@~6.5.2: version "6.5.2" resolved "https://registry.yarnpkg.com/qs/-/qs-6.5.2.tgz#cb3ae806e8740444584ef154ce8ee98d403f3e36" @@ -7960,6 +8026,11 @@ querystring@0.2.0: resolved "https://registry.yarnpkg.com/querystring/-/querystring-0.2.0.tgz#b209849203bb25df820da756e747005878521620" integrity sha1-sgmEkgO7Jd+CDadW50cAWHhSFiA= +queue-microtask@^1.1.2: + version "1.1.4" + resolved "https://registry.yarnpkg.com/queue-microtask/-/queue-microtask-1.1.4.tgz#40841ace4356b48b35b5ea61a2e1fe0a23c59ce1" + integrity sha512-eY/4Obve9cE5FK8YvC1cJsm5cr7XvAurul8UtBDJ2PR1p5NmAwHtvAt5ftcLtwYRCUKNhxCneZZlxmUDFoSeKA== + queue@6.0.1: version "6.0.1" resolved "https://registry.yarnpkg.com/queue/-/queue-6.0.1.tgz#abd5a5b0376912f070a25729e0b6a7d565683791" @@ -7967,6 +8038,11 @@ queue@6.0.1: dependencies: inherits "~2.0.3" +quick-format-unescaped@^4.0.1: + version "4.0.1" + resolved "https://registry.yarnpkg.com/quick-format-unescaped/-/quick-format-unescaped-4.0.1.tgz#437a5ea1a0b61deb7605f8ab6a8fd3858dbeb701" + integrity sha512-RyYpQ6Q5/drsJyOhrWHYMWTedvjTIat+FTwv0K4yoUxzvekw2aRHMQJLlnvt8UantkZg2++bEzD9EdxXqkWf4A== + quick-lru@^1.0.0: version "1.1.0" resolved "https://registry.yarnpkg.com/quick-lru/-/quick-lru-1.1.0.tgz#4360b17c61136ad38078397ff11416e186dcfbb8" @@ -7997,26 +8073,6 @@ randomfill@^1.0.3: randombytes "^2.0.5" safe-buffer "^5.1.0" -raw-body@2.3.2: - version "2.3.2" - resolved "https://registry.yarnpkg.com/raw-body/-/raw-body-2.3.2.tgz#bcd60c77d3eb93cde0050295c3f379389bc88f89" - integrity sha1-vNYMd9Prk83gBQKVw/N5OJvIj4k= - dependencies: - bytes "3.0.0" - http-errors "1.6.2" - iconv-lite "0.4.19" - unpipe "1.0.0" - -raw-body@^2.1.7: - version "2.4.1" - resolved "https://registry.yarnpkg.com/raw-body/-/raw-body-2.4.1.tgz#30ac82f98bb5ae8c152e67149dac8d55153b168c" - integrity sha512-9WmIKF6mkvA0SLmA2Knm9+qj89e+j1zqgyn8aXGd7+nAduPoqgI9lO57SAZNn/Byzo5P7JhXTyg9PzaJbH73bA== - dependencies: - bytes "3.1.0" - http-errors "1.7.3" - iconv-lite "0.4.24" - unpipe "1.0.0" - rc@^1.2.7, rc@^1.2.8: version "1.2.8" resolved "https://registry.yarnpkg.com/rc/-/rc-1.2.8.tgz#cd924bf5200a075b83c188cd6b9e211b7fc0d3ed" @@ -8153,13 +8209,6 @@ rechoir@^0.6.2: dependencies: resolve "^1.1.6" -recursive-readdir@^2.2.2: - version "2.2.2" - resolved "https://registry.yarnpkg.com/recursive-readdir/-/recursive-readdir-2.2.2.tgz#9946fb3274e1628de6e36b2f6714953b4845094f" - integrity sha512-nRCcW9Sj7NuZwa2XvH9co8NPeXUBhZP7CRKJtU+cS6PW9FpCIFoI5ib0NT1ZrbNuPoRy0ylyCaUL8Gih4LSyFg== - dependencies: - minimatch "3.0.4" - redent@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/redent/-/redent-1.0.0.tgz#cf916ab1fd5f1f16dfb20822dd6ec7f730c2afde" @@ -8537,6 +8586,11 @@ ret@~0.1.10: resolved "https://registry.yarnpkg.com/ret/-/ret-0.1.15.tgz#b8a4825d5bdb1fc3f6f53c2bc33f81388681c7bc" integrity sha512-TTlYpa+OL+vMMNG24xSlQGEJ3B/RzEfUlLct7b5G/ytav+wPrplCpVMFuwzXbkecJrb6IYo1iFb0S9v37754mg== +ret@~0.2.0: + version "0.2.2" + resolved "https://registry.yarnpkg.com/ret/-/ret-0.2.2.tgz#b6861782a1f4762dce43402a71eb7a283f44573c" + integrity sha512-M0b3YWQs7R3Z917WRQy1HHA7Ba7D8hvZg6UE5mLykJxQVE2ju0IXbGlaHPPlkY+WN7wFP+wUMXmBFA0aV6vYGQ== + retry@0.12.0: version "0.12.0" resolved "https://registry.yarnpkg.com/retry/-/retry-0.12.0.tgz#1b42a6266a21f07421d1b0b54b7dc167b01c013b" @@ -8552,6 +8606,11 @@ reusify@^1.0.4: resolved "https://registry.yarnpkg.com/reusify/-/reusify-1.0.4.tgz#90da382b1e126efc02146e90845a88db12925d76" integrity sha512-U9nH88a3fc/ekCF1l0/UP1IosiuIjyTh7hBvXVMHYgVcfGvt897Xguj2UOLDeI5BG2m7/uwyaLVT6fbtCwTyzw== +rfdc@^1.1.4: + version "1.1.4" + resolved "https://registry.yarnpkg.com/rfdc/-/rfdc-1.1.4.tgz#ba72cc1367a0ccd9cf81a870b3b58bd3ad07f8c2" + integrity sha512-5C9HXdzK8EAqN7JDif30jqsBzavB7wLpaubisuQIGHWf2gUXSpzy6ArX/+Da8RjFpagWsCn+pIgxTMAmKw9Zug== + rimraf@2.6.3: version "2.6.3" resolved "https://registry.yarnpkg.com/rimraf/-/rimraf-2.6.3.tgz#b2d104fe0d8fb27cf9e0a1cda8262dd3833c6cab" @@ -8723,6 +8782,13 @@ safe-buffer@^5.0.1, safe-buffer@^5.1.0, safe-buffer@^5.1.1, safe-buffer@^5.1.2, resolved "https://registry.yarnpkg.com/safe-buffer/-/safe-buffer-5.2.1.tgz#1eaf9fa9bdb1fdd4ec75f58f9cdb4e6b7827eec6" integrity sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ== +safe-regex2@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/safe-regex2/-/safe-regex2-2.0.0.tgz#b287524c397c7a2994470367e0185e1916b1f5b9" + integrity sha512-PaUSFsUaNNuKwkBijoAPHAK6/eM6VirvyPWlZ7BAQy4D+hCvh4B6lIG+nPdhbFfIbP+gTGBcrdsOaUs0F+ZBOQ== + dependencies: + ret "~0.2.0" + safe-regex@^1.1.0: version "1.1.0" resolved "https://registry.yarnpkg.com/safe-regex/-/safe-regex-1.1.0.tgz#40a3669f3b077d1e943d44629e157dd48023bf2e" @@ -8749,6 +8815,11 @@ schema-utils@^1.0.0: ajv-errors "^1.0.0" ajv-keywords "^3.1.0" +secure-json-parse@^2.0.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/secure-json-parse/-/secure-json-parse-2.1.0.tgz#ae76f5624256b5c497af887090a5d9e156c9fb20" + integrity sha512-GckO+MS/wT4UogDyoI/H/S1L0MCcKS1XX/vp48wfmU7Nw4woBmb8mIpu4zPBQjKlRT88/bt9xdoV4111jPpNJA== + semver-diff@^3.1.1: version "3.1.1" resolved "https://registry.yarnpkg.com/semver-diff/-/semver-diff-3.1.1.tgz#05f77ce59f325e00e2706afd67bb506ddb1ca32b" @@ -8756,6 +8827,11 @@ semver-diff@^3.1.1: dependencies: semver "^6.3.0" +semver-store@^0.3.0: + version "0.3.0" + resolved "https://registry.yarnpkg.com/semver-store/-/semver-store-0.3.0.tgz#ce602ff07df37080ec9f4fb40b29576547befbe9" + integrity sha512-TcZvGMMy9vodEFSse30lWinkj+JgOBvPn8wRItpQRSayhc+4ssDs335uklkfvQQJgL/WvmHLVj4Ycv2s7QCQMg== + "semver@2 || 3 || 4 || 5", semver@^5.4.1, semver@^5.5.0, semver@^5.6.0: version "5.7.1" resolved "https://registry.yarnpkg.com/semver/-/semver-5.7.1.tgz#a954f931aeba508d307bbf069eff0c01c96116f7" @@ -8788,6 +8864,11 @@ set-blocking@^2.0.0, set-blocking@~2.0.0: resolved "https://registry.yarnpkg.com/set-blocking/-/set-blocking-2.0.0.tgz#045f9782d011ae9a6803ddd382b24392b3d890f7" integrity sha1-BF+XgtARrppoA93TgrJDkrPYkPc= +set-cookie-parser@^2.4.1: + version "2.4.6" + resolved "https://registry.yarnpkg.com/set-cookie-parser/-/set-cookie-parser-2.4.6.tgz#43bdea028b9e6f176474ee5298e758b4a44799c3" + integrity sha512-mNCnTUF0OYPwYzSHbdRdCfNNHqrne+HS5tS5xNb6yJbdP9wInV0q5xPLE0EyfV/Q3tImo3y/OXpD8Jn0Jtnjrg== + set-value@^2.0.0, set-value@^2.0.1: version "2.0.1" resolved "https://registry.yarnpkg.com/set-value/-/set-value-2.0.1.tgz#a18d40530e6f07de4228c7defe4227af8cad005b" @@ -8803,16 +8884,6 @@ setimmediate@^1.0.4: resolved "https://registry.yarnpkg.com/setimmediate/-/setimmediate-1.0.5.tgz#290cbb232e306942d7d7ea9b83732ab7856f8285" integrity sha1-KQy7Iy4waULX1+qbg3Mqt4VvgoU= -setprototypeof@1.0.3: - version "1.0.3" - resolved "https://registry.yarnpkg.com/setprototypeof/-/setprototypeof-1.0.3.tgz#66567e37043eeb4f04d91bd658c0cbefb55b8e04" - integrity sha1-ZlZ+NwQ+608E2RvWWMDL77VbjgQ= - -setprototypeof@1.1.1: - version "1.1.1" - resolved "https://registry.yarnpkg.com/setprototypeof/-/setprototypeof-1.1.1.tgz#7e95acb24aa92f5885e0abef5ba131330d4ae683" - integrity sha512-JvdAWfbXeIGaZ9cILp38HntZSFSo3mWg6xGcJJsd+d4aRMOqauag1C63dJfDw7OaMYwEbHMOxEZ1lqVRYP2OAw== - sha.js@^2.4.0, sha.js@^2.4.8: version "2.4.11" resolved "https://registry.yarnpkg.com/sha.js/-/sha.js-2.4.11.tgz#37a5cf0b81ecbc6943de109ba2960d1b26584ae7" @@ -8963,6 +9034,14 @@ socks@^2.3.3: ip "^1.1.5" smart-buffer "^4.1.0" +sonic-boom@^1.0.2: + version "1.3.0" + resolved "https://registry.yarnpkg.com/sonic-boom/-/sonic-boom-1.3.0.tgz#5c77c846ce6c395dddf2eb8e8e65f9cc576f2e76" + integrity sha512-4nX6OYvOYr6R76xfQKi6cZpTO3YSWe/vd+QdIfoH0lBy0MnPkeAbb2rRWgmgADkXUeCKPwO1FZAKlAVWAadELw== + dependencies: + atomic-sleep "^1.0.0" + flatstr "^1.0.12" + source-list-map@^2.0.0: version "2.0.1" resolved "https://registry.yarnpkg.com/source-list-map/-/source-list-map-2.0.1.tgz#3993bd873bfc48479cca9ea3a547835c7c154b34" @@ -9128,11 +9207,6 @@ static-extend@^0.1.1: define-property "^0.2.5" object-copy "^0.1.0" -"statuses@>= 1.3.1 < 2", "statuses@>= 1.5.0 < 2": - version "1.5.0" - resolved "https://registry.yarnpkg.com/statuses/-/statuses-1.5.0.tgz#161c7dac177659fd9811f43771fa99381478628c" - integrity sha1-Fhx9rBd2Wf2YEfQ3cfqZOBR4Yow= - stream-browserify@^2.0.1: version "2.0.2" resolved "https://registry.yarnpkg.com/stream-browserify/-/stream-browserify-2.0.2.tgz#87521d38a44aa7ee91ce1cd2a47df0cb49dd660b" @@ -9177,6 +9251,11 @@ stream-to@~0.2.0: resolved "https://registry.yarnpkg.com/stream-to/-/stream-to-0.2.2.tgz#84306098d85fdb990b9fa300b1b3ccf55e8ef01d" integrity sha1-hDBgmNhf25kLn6MAsbPM9V6O8B0= +string-similarity@^4.0.1: + version "4.0.2" + resolved "https://registry.yarnpkg.com/string-similarity/-/string-similarity-4.0.2.tgz#1dc29518d0e92e50509499ce2974368f77bbb1b1" + integrity sha512-eCsPPyoQBgY4TMpVD6DVfO7pLrimUONriaO4Xjp3WPUW0YnNLqdHgRj23xotLlqrL90eJhBeq3zdAJf2mQgfBQ== + string-width@^1.0.1: version "1.0.2" resolved "https://registry.yarnpkg.com/string-width/-/string-width-1.0.2.tgz#118bdf5b8cdc51a2a7e70d211e07e2b0b9b107d3" @@ -9519,6 +9598,11 @@ timm@^1.6.1: resolved "https://registry.yarnpkg.com/timm/-/timm-1.7.1.tgz#96bab60c7d45b5a10a8a4d0f0117c6b7e5aff76f" integrity sha512-IjZc9KIotudix8bMaBW6QvMuq64BrJWFs1+4V0lXwWGQZwH+LnX87doAYhem4caOEusRP9/g6jVDQmZ8XOk1nw== +tiny-lru@^7.0.0: + version "7.0.6" + resolved "https://registry.yarnpkg.com/tiny-lru/-/tiny-lru-7.0.6.tgz#b0c3cdede1e5882aa2d1ae21cb2ceccf2a331f24" + integrity sha512-zNYO0Kvgn5rXzWpL0y3RS09sMK67eGaQj9805jlK9G6pSadfriTczzLHFXa/xcW4mIRfmlB9HyQ/+SgL0V1uow== + tinycolor2@^1.1.2, tinycolor2@^1.4.1: version "1.4.1" resolved "https://registry.yarnpkg.com/tinycolor2/-/tinycolor2-1.4.1.tgz#f4fad333447bc0b07d4dc8e9209d8f39a8ac77e8" @@ -9597,11 +9681,6 @@ to-vfile@^6.0.0: is-buffer "^2.0.0" vfile "^4.0.0" -toidentifier@1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/toidentifier/-/toidentifier-1.0.0.tgz#7e1be3470f1e77948bc43d94a3c8f4d7752ba553" - integrity sha512-yaOH/Pk/VEhBWWTlhI+qXxDFXlejDGcQipMlyxda9nthulaxLZUNcUqFxokp0vcYnvteJln5FNQDRrxj3YcbVw== - tough-cookie@~2.5.0: version "2.5.0" resolved "https://registry.yarnpkg.com/tough-cookie/-/tough-cookie-2.5.0.tgz#cd9fb2a0aa1d5a12b473bd9fb96fa3dcff65ade2" @@ -9880,11 +9959,6 @@ universalify@^0.1.0: resolved "https://registry.yarnpkg.com/universalify/-/universalify-0.1.2.tgz#b646f69be3942dabcecc9d6639c80dc105efaa66" integrity sha512-rBJeI5CXAlmy1pV+617WB9J63U6XcazHHF2f2dbJix4XzpUF0RS3Zbj0FGIOCAva5P/d/GBOYaACQ1w+0azUkg== -unpipe@1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/unpipe/-/unpipe-1.0.0.tgz#b2bf4ee8514aae6165b4817829d21b2ef49904ec" - integrity sha1-sr9O6FFKrmFltIF4KdIbLvSZBOw= - unset-value@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/unset-value/-/unset-value-1.0.0.tgz#8376873f7d2335179ffb1e6fc3a8ed0dfc8ab559" @@ -9956,15 +10030,6 @@ url@^0.11.0: punycode "1.3.2" querystring "0.2.0" -urlencoded-body-parser@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/urlencoded-body-parser/-/urlencoded-body-parser-3.0.0.tgz#e55329c6feccb2ede0fd0c027d8c105c063ba5e0" - integrity sha512-Wv99/IIj6mZTawqmG2BOSgGYCRi3P/oW3LHNjTW+UWrDQ3sqRrONJ1Yed5REmUqI3E5uH3WCdLyOiq2JxrWwfw== - dependencies: - media-typer "^0.3.0" - qs "^6.2.1" - raw-body "^2.1.7" - use@^3.1.0: version "3.1.1" resolved "https://registry.yarnpkg.com/use/-/use-3.1.1.tgz#d50c8cac79a19fbc20f2911f56eb973f4e10070f"