diff --git a/exercises/16 - Debugging/debugging.html b/exercises/16 - Debugging/debugging.html index 57f9812a5..f7dcff894 100644 --- a/exercises/16 - Debugging/debugging.html +++ b/exercises/16 - Debugging/debugging.html @@ -1,16 +1,14 @@ + + + + + + - - - - - - - - - - - - + + + + diff --git a/exercises/16 - Debugging/debugging.js b/exercises/16 - Debugging/debugging.js new file mode 100644 index 000000000..f36269610 --- /dev/null +++ b/exercises/16 - Debugging/debugging.js @@ -0,0 +1,101 @@ +const people = [ + { name: 'Wes', cool: true, country: 'Canada' }, + { name: 'Scott', cool: true, country: 'Merica' }, + { name: 'Snickers', cool: false, country: 'Dog Country' }, +]; + +/* + * Breakpoints + * + * Pauses devtools, lets you step through and look at different pieces of data + */ +people.forEach((person, index) => { + // debugger; + console.log(person.name); +}); + +/* + * Console Methods + */ + +// Group console logs in a collapsed accordion +// people.forEach((person, index) => { +// console.groupCollapsed(`${person.name}`); +// console.log(`country is ${person.country}`); +// console.log(`cool is ${person.cool}`); +// console.log('DONE!'); +// console.groupEnd(`${person.name}`); +// }); + +/* + * Grabbing Elements + * + * In devtools > select an element > console tab + * $0 - get all of the markup for that element + * $0.value - return the value of an input you are inspecting + * + * $0 = the last thing that was clicked + * $1 = the 2nd last thing clicked... + * $('p') = find the first paragraph in the code + * $$('p') = find all paragraphs in the code + */ + +// Scope + +/* + * Network Requests + * + * Tells you what files are used css, html, js + * Tells you how long requests take (Network > Timing) + */ + +/* + * Break On Attribute + * + * Throw in breakpoints where you want to step through the code and slow it down + * Figure out what happens when - on click, on XHR or fetch for API calls + */ + +function doctorize(name) { + // console.count(`running Doctorize for ${name}`); + return `Dr. ${name}`; +} + +// Callstack, Stack Trace +function greet(name) { + doesntExist(); // this will error, it doesn't exist + return `Hello ${name}`; +} + +// Calls the function doctorize and greet +function go() { + const name = doctorize(greet('Wes')); + console.log(name); +} + +// Calls the function go +function shoelace() { + console.log('Starting the app!'); + go(); +} + +// shoelace(); + +const button = document.querySelector('.bigger'); +button.addEventListener('click', function(e) { + const newFontSize = + parseFloat(getComputedStyle(e.currentTarget).fontSize) + 1; + e.currentTarget.style.fontSize = `${newFontSize}px`; +}); + +// A Dad joke fetch +async function fetchDadJoke() { + const res = await fetch('https://icanhazdadjoke.com/', { + headers: { + Accept: 'text/plain', + }, + }); + const joke = await res.text(); + console.log(joke); + return joke; +} diff --git a/exercises/20 - The DOM/DOM-Cardio.html b/exercises/20 - The DOM/DOM-Cardio.html index 9849fb5b1..d7f08f9ad 100644 --- a/exercises/20 - The DOM/DOM-Cardio.html +++ b/exercises/20 - The DOM/DOM-Cardio.html @@ -1,33 +1,44 @@ + + + + Dom Cardio + + - - - - Dom Cardio - - + + - - + - + .warning { + color: tomato; + } + button { + transition: all 0.25s; + } + + button:hover { + cursor: pointer; + opacity: 0.5; + } + + diff --git a/exercises/20 - The DOM/DOM-Cardio.js b/exercises/20 - The DOM/DOM-Cardio.js index 3ca90e523..1b279e0da 100644 --- a/exercises/20 - The DOM/DOM-Cardio.js +++ b/exercises/20 - The DOM/DOM-Cardio.js @@ -1,27 +1,71 @@ // Make a div +const div = document.createElement('div'); // add a class of wrapper to it +div.classList.add('wrapper'); // put it into the body +document.body.appendChild(div); // make an unordered list +const list = document.createElement('ul'); +list.classList.add('list'); // add three list items with the words "one, two three" in them +const item1 = document.createElement('li'); +list.insertAdjacentElement('beforeEnd', item1); +item1.textContent = 'one'; + +const item2 = document.createElement('li'); +list.insertAdjacentElement('beforeEnd', item2); +item2.textContent = 'two'; + +const item3 = document.createElement('li'); +list.insertAdjacentElement('beforeEnd', item3); +item3.textContent = 'three'; + // put that list into the above wrapper +div.insertAdjacentElement('beforeEnd', list); // create an image +const image = document.createElement('img'); // set the source to an image +image.src = 'http://picsum.photos/500'; + // set the width to 250 +image.width = 250; + // add a class of cute +image.classList.add('cute'); + // add an alt of Cute Puppy +image.alt = 'Stunning photo'; + // Append that image to the wrapper +div.insertAdjacentElement('beforeEnd', image); // with HTML string, make a div, with two paragraphs inside of it +const textWrapper = document.createElement('div'); + +const p1 = document.createElement('p'); +textWrapper.insertAdjacentElement('beforeEnd', p1); +p1.textContent = + 'Spring 1936. In the thick jungle of the South American continent, a renowned archeologist and expert on the occult is studying fragments of a map, when one of his exploration party pulls a gun. The archeologist pulls out a bullwhip and with such disarms the turncoat, sending him running - thus does Dr. Henry "Indiana" Jones stay alive.'; + +const p2 = document.createElement('p'); +textWrapper.insertAdjacentElement('beforeEnd', p2); +p2.textContent = + "He and a guide enter a dank and oppressively vast cave that contains several traps created by the ancient race which hid inside a famous handheld statue; Indy barely escapes such traps but is cornered by native tribesmen served by Belloq, an old enemy who arrogantly makes off with the statue, while Indy must flee for his life and escape on a friend's seaplane. Back in the US two agents from US Army intelligence tell him of Nazi German activities in archeology, including a gigantic excavation site in Egypt - a site that an intercepted cable indicates to Indy is the location of the Ark of the Covenant, the powerful chest bearing the Ten Commandments, that the Nazis can use to obliterate any enemy. Indy must recruit a former girlfriend (the daughter of his old professor) and an old chum in Cairo to infiltrate the Nazi site and make off with the Ark, but along the way Indy gets involved in a series of fights, chases, and traps, before the Nazis learn the full power of the Ark."; + // put this div before the unordered list from above +list.insertAdjacentElement('beforeBegin', textWrapper); // add a class to the second paragraph called warning +textWrapper.lastElementChild.classList.add('warning'); + // remove the first paragraph +textWrapper.firstElementChild.remove(); // create a function called generatePlayerCard that takes in three arguments: name, age, and height @@ -30,15 +74,45 @@ //

NAME — AGE

//

They are HEIGHT and AGE years old. In Dog years this person would be AGEINDOGYEARS. That would be a tall dog!

// +function generatePlayerCard(name, age, height) { + const cardsHTML = ` +
+

${name} — ${age}

+

Their height is ${height} and ${age} years old. In Dog years this person would be ${age * + 7}. That would be a tall dog!

+ +
+ `; + return cardsHTML; +} + +// TODO convert cm to in new function // make a new div with a class of cards +const cards = document.createElement('div'); +cards.classList.add('cards'); -// Have that function make 4 cards +let cardsHTML = generatePlayerCard('Josie', 6, 36); +cardsHTML += generatePlayerCard('Eddie', 10, 48); +cardsHTML += generatePlayerCard('Gracie', 9, 52); +cardsHTML += generatePlayerCard('Betti', 8, 75); // append those cards to the div +cards.innerHTML = cardsHTML; + // put the div into the DOM just before the wrapper element +div.insertAdjacentElement('beforebegin', cards); + // Bonus, put a delete Button on each card so when you click it, the whole card is removed // select all the buttons! +const buttons = document.querySelectorAll('.delete'); + // make out delete function +function deleteCard() { + const selectedButton = event.currentTarget; + selectedButton.closest('.playerCard').remove(); + console.log(event.currentTarget); +} // loop over them and attach a listener +buttons.forEach(button => button.addEventListener('click', deleteCard)); diff --git a/exercises/20 - The DOM/creating-FINISHED.js b/exercises/20 - The DOM/creating-FINISHED.js index 50a072da8..1d97481e5 100644 --- a/exercises/20 - The DOM/creating-FINISHED.js +++ b/exercises/20 - The DOM/creating-FINISHED.js @@ -1,56 +1,60 @@ -console.log('it works!'); - const myParagraph = document.createElement('p'); -myParagraph.textContent = 'I am a P'; -myParagraph.classList.add('special'); -console.log(myParagraph); +myParagraph.textContent = 'I am a descriptive paragraph'; +myParagraph.classList.add('fancy'); +// console.log(myParagraph); const myImage = document.createElement('img'); -myImage.src = 'https://picsum.photos/500'; -myImage.alt = 'Nice photo'; +myImage.src = 'http://picsum.photos/500'; +myImage.alt = 'Stunning photo'; const myDiv = document.createElement('div'); myDiv.classList.add('wrapper'); -console.log(myDiv); +// console.log(myDiv); +// appendChild first myDiv.appendChild(myParagraph); myDiv.appendChild(myImage); +// Add to the page document.body.appendChild(myDiv); -// oh shoot! we need to add somethint to the top. like a heading! +// Note: Use appendChild over append due to poor support + +// Add a heading above myDiv with insertAdjacentElement const heading = document.createElement('h2'); -heading.textContent = 'Cool Things'; +heading.textContent = 'Award Winning Photographs'; -myDiv.insertAdjacentElement('beforebegin', heading); +myDiv.insertAdjacentElement('afterbegin', heading); -// +// Create a list with 5 items +const myList = document.createElement('ul'); +myList.classList.add('grocery-list'); -const list = document.createElement('ul'); -const li = document.createElement('li'); -li.textContent = 'three'; -list.appendChild(li); +// Add the third item to the ul +const list3 = document.createElement('li'); +list3.textContent = 'Three'; +myList.appendChild(list3); -document.body.insertAdjacentElement('afterbegin', list); +// Add the ul to the page +document.body.insertAdjacentElement('afterbegin', myList); +// Add the rest of the list items 1, 2, 4, 5 const li5 = document.createElement('li'); li5.textContent = 'Five'; -list.append(li5); +myList.append(li5); const li1 = li5.cloneNode(true); -li1.textContent = 'one'; -list.insertAdjacentElement('afterbegin', li1); +li1.textContent = 'One'; +myList.insertAdjacentElement('afterbegin', li1); const li4 = document.createElement('li'); -li4.textContent = 'four'; +li4.textContent = 'Four'; li5.insertAdjacentElement('beforebegin', li4); const li2 = document.createElement('li'); -li2.textContent = 'two'; +li2.textContent = 'Two'; li1.insertAdjacentElement('afterend', li2); + +myList.insertAdjacentElement('afterbegin', li1); +li2.insertAdjacentElement('afterbegin', li1); +console.log(myList.outerHTML); diff --git a/exercises/20 - The DOM/creating-with-strings.js b/exercises/20 - The DOM/creating-with-strings.js new file mode 100644 index 000000000..83b6cddb7 --- /dev/null +++ b/exercises/20 - The DOM/creating-with-strings.js @@ -0,0 +1,35 @@ +// console.log("It's Alive!"); + +// Add basic HTML to the page +item.innerHTML = ` +
+

Hello and Good Morning

+
+`; +// console.log(item.innerHTML); + +const item = document.querySelector('.item'); + +const width = 800; +const src = `https://picsum.photos/${width}`; +const desc = 'Adorable boxer puppy'; +const title = 'Cute Dog'; +const myHTML = ` +
+

${title}

+ ${desc} +
+`; + +// turn a string into a DOM element we can access easily +const myFragment = document.createRange().createContextualFragment(myHTML); + +console.log(myFragment.querySelector('img')); + +document.body.appendChild(myFragment); + +/* + * XSS - cross site scripting + * There are security issues when you collect data + * Scrub HTML for security vulnerabilities - later module + */ diff --git a/exercises/20 - The DOM/index.html b/exercises/20 - The DOM/index.html index 897ceb790..5b028c4e3 100644 --- a/exercises/20 - The DOM/index.html +++ b/exercises/20 - The DOM/index.html @@ -1,57 +1,71 @@ + + + + The DOM + + - - - - The DOM - - - - - -

I am Wes, I love to bbq and Make websites!

- - -
-
- - - - -

Hi I'm a item

-
-
- -

- I am a heading - I am hidden! -

-

Hi I'm a item

-
-
-

Im an article

-

This is how many pizzas I ate! 🍕

-
-
- - - - - + +

I am Erik, I love to read and Make websites!

+ + +
+
+ + + + +

Hi I'm a item

+
+
+ +

+ I am a heading + I am hidden! +

+

Hi I'm a item

+
+
+

Im an article

+

This is how many pizzas I ate! 🍕

+
+
+ + + + + + diff --git a/exercises/20 - The DOM/the-dom.js b/exercises/20 - The DOM/the-dom.js index e69de29bb..7d284fd57 100644 --- a/exercises/20 - The DOM/the-dom.js +++ b/exercises/20 - The DOM/the-dom.js @@ -0,0 +1,76 @@ +/* + * The DOM + * + * window - has browser information like viewport width + * + * document - has info about everything between html tags + * + * navigator - has info about the device: battery level, gps coordinates + * + * Use querySelector for classes and elements - it replaces getElementsByClassName... + * Use getElementById for # + */ + +const p = document.querySelector('p'); +const imgs = document.querySelectorAll('.item img'); +const item2 = document.querySelector('.item2'); +const item2Image = item2.querySelector('img'); // look inside of .item2 +const heading = document.querySelector('h2'); + +console.log(heading.textContent); +console.log(heading.innerText); + +// set the textContent property of heading +// heading.textContent = 'Josie is adorable'; +// console.log(heading.textContent); +console.log(heading.innerHTML); +console.log(heading.outerHTML); + +// Append pizza emoji +const pizzaList = document.querySelector('.pizza'); +// pizzaList.textContent = `${pizzaList.textContent} 🍕`; + +// This is faster than textContent +pizzaList.insertAdjacentText('beforeend', '🍕'); + +const pic = document.querySelector('.nice'); +pic.classList.add('open'); +pic.classList.remove('cool'); +pic.classList.add('round'); +console.log(pic.classList); + +// Add the class .round on click +// classList gives you some nice utilities over addClass +function toggleRound() { + pic.classList.toggle('round'); +} + +// Listen for a click then fire the function +pic.addEventListener('click', toggleRound); + +/* + * GET and SET attributes (don't do this) + */ +// SET image attributes +// Add alt text to an image +pic.setAttribute('alt', 'Adorable puppy'); +pic.setAttribute('width', 500); + +// GET pic attribute values +console.log(pic.getAttribute('alt')); + +// Get the width of the image after it loads +// get works with naturalWidth, you can't set it though +pic.addEventListener('load', function() { + console.log(pic.naturalWidth); // width of actual pixels - run after image downloads +}); + +/* + * GET and SET data-attributes (reccomended) + */ +const custom = document.querySelector('.custom'); +console.log(custom.dataset); + +custom.addEventListener('click', function() { + alert(`Welcome ${custom.dataset.name} ${custom.dataset.last}`); +}); diff --git a/exercises/20 - The DOM/traversing.js b/exercises/20 - The DOM/traversing.js index e69de29bb..be4033d5d 100644 --- a/exercises/20 - The DOM/traversing.js +++ b/exercises/20 - The DOM/traversing.js @@ -0,0 +1,36 @@ +// console.log('it works'); +const list = document.querySelector('.li3'); +console.log(list); + +/* + * Nodes vs. Elements + * + * Node - any object in the DOM: document, document.body, ,

,

  • tags... + * + * Element - a specific type of node that can have a class or id + */ + +// Get all of the child elements +console.log(`children are ${list.children}`); + +// Looks at the fitst and last children +console.log(`firstElementChild is ${list.firstElementChild}`); +console.log(`lastElementChild is ${list.lastElementChild}`); + +// Looks at the element before (previous) and after (next) in the markup +console.log(`previousElementSibling is ${list.previousElementSibling}`); +console.log(`nextElementSibling is ${list.nextElementSibling}`); + +// Looks at the parent +// parentElement can be chained to keep going up the DOM +// ex. - variable.parentElement.parentElement.parentElement +console.log(`parentElement is ${list.parentElement}`); + +/* + * REMOVING + * Removed elements can still be added again after removal, and can show up in console.log + */ +const welcomeMessage = document.createElement('p'); +welcomeMessage.textContent = 'Welcome and hello.'; +document.body.appendChild(welcomeMessage); +welcomeMessage.remove(); diff --git a/exercises/29 - Events/events.html b/exercises/29 - Events/events.html index a7b3ee2b1..f68377918 100644 --- a/exercises/29 - Events/events.html +++ b/exercises/29 - Events/events.html @@ -1,32 +1,30 @@ + + + + JavaScript Events + + - - - - JavaScript Events - - + + + - - - +

    Buy Buttons!

    + + + + + + + + + + -

    Buy Buttons!

    - - - - - - - - - - - - Nice - - - + Nice + + diff --git a/exercises/29 - Events/events.js b/exercises/29 - Events/events.js index 768e5e7ce..bf725122a 100644 --- a/exercises/29 - Events/events.js +++ b/exercises/29 - Events/events.js @@ -5,49 +5,50 @@ function handleClick() { console.log('🐛 IT GOT CLICKED!!!'); } -const hooray = () => console.log('HOORAY!'); - -butts.addEventListener('click', function() { - console.log('Im an anon!'); -}); -coolButton.addEventListener('click', hooray); - +// Click events +butts.addEventListener('click', handleClick); +coolButton.addEventListener('click', handleClick); + +/* + * Anonymous functions cannot be removed + * The function must have a name to reference + * The code below unbinds an event from a function + */ butts.removeEventListener('click', handleClick); -// Listen on multiple items +// Listen to events on multiple items const buyButtons = document.querySelectorAll('button.buy'); +// function buyItem() { +// console.log('Buying item'); +// } + +// Use forEach to loop over all buyButton instances +// The parameter "buyButton" can be anything, it's a placeholder +// function handleBuyButtonClick(buyButton) { +// console.log('Binding the buy button'); +// buyButton.addEventListener('click', buyItem); +// } + +/* + * target - what was clicked + * dataset - data attribute + * event.target - the thing that actually was clicked, could be HTML tag inside of a button like span or strong + * event.currentTarget - the thing that fires the event listener + */ function handleBuyButtonClick(event) { - console.log('You clicked a button!'); - const button = event.target; - // console.log(button.textContent); + // console.log('You are buying it!'); // console.log(parseFloat(event.target.dataset.price)); - console.log(event.target); console.log(event.currentTarget); - console.log(event.target === event.currentTarget); - // Stop this event from bubbling up - // event.stopPropagation(); + // stop this event from bubbling up + event.stopPropogation(); } +// Use forEach to loop over all buyButton instances buyButtons.forEach(function(buyButton) { buyButton.addEventListener('click', handleBuyButtonClick); }); -window.addEventListener( - 'click', - function(event) { - console.log('YOU CLICKED THE WINDOW'); - console.log(event.target); - console.log(event.type); - // event.stopPropagation(); - console.log(event.bubbles); - }, - { capture: true } -); - -const photoEl = document.querySelector('.photo'); - -photoEl.addEventListener('mouseenter', e => { - console.log(e.currentTarget); - console.log(this); +window.addEventListener('click', function() { + console.log('You clicked somewhere in the window'); }); diff --git a/exercises/29 - Events/forms.html b/exercises/29 - Events/forms.html index 95ca5ede3..19ce87ed9 100644 --- a/exercises/29 - Events/forms.html +++ b/exercises/29 - Events/forms.html @@ -1,30 +1,44 @@ + + + + HTML Forms + + - - - - HTML Forms - - + +
    + +
    I can be clicked
    - -
    - Wes Bos -
    - - - - - - -
    - -
    -
    + + + + Wes Bos +
    + + + + + + +
    + + + + +
    +
    - - - + + diff --git a/exercises/29 - Events/forms.js b/exercises/29 - Events/forms.js index e69de29bb..2bebb1e91 100644 --- a/exercises/29 - Events/forms.js +++ b/exercises/29 - Events/forms.js @@ -0,0 +1,48 @@ +// console.log('it works'); + +// On form submission show a prompt + +const wes = document.querySelector('.wes'); + +wes.addEventListener('click', function(event) { + const shouldPageChange = confirm( + 'This website might be malicious. Do you want to proceed?' + ); + // If cancel is selected from the prompt don't follow the link + if (!shouldPageChange) { + event.preventDefault(); + } +}); + +const signupForm = document.querySelector('[name="signup"]'); + +signupForm.addEventListener('submit', function(event) { + const name = event.currentTarget.name.value; + if (name.includes('Chad')) { + alert('No Chads are allowed'); + event.preventDefault(); + } +}); + +function logEvent(event) { + console.log(event.type); + console.log(event.currentTarget.value); +} + +// Other event types besides click +signupForm.name.addEventListener('keyup', logEvent); +signupForm.name.addEventListener('keydown', logEvent); +signupForm.name.addEventListener('focus', logEvent); +signupForm.name.addEventListener('blur', logEvent); + +const photo = document.querySelector('.photo'); + +// Handle clicks and tabindex + enter +function handlePhotoClick(event) { + if (event.type === 'click' || event.key === 'Enter') { + console.log('You selected the photo'); + } +} + +photo.addEventListener('click', handlePhotoClick); +photo.addEventListener('keyup', handlePhotoClick); diff --git a/package-lock.json b/package-lock.json index 60451c0dd..1a18bd457 100644 --- a/package-lock.json +++ b/package-lock.json @@ -5,60 +5,59 @@ "requires": true, "dependencies": { "@babel/code-frame": { - "version": "7.0.0", - "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.0.0.tgz", - "integrity": "sha512-OfC2uemaknXr87bdLUkWog7nYuliM9Ij5HUcajsVcMCpQrcLmtxRbVFTIqmcSkSeYRBFBRxs2FiUqFJDLdiebA==", + "version": "7.5.5", + "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.5.5.tgz", + "integrity": "sha512-27d4lZoomVyo51VegxI20xZPuSHusqbQag/ztrBC7wegWoQ1nLREPVSKSW8byhTlzTKyNE4ifaTA6lCp7JjpFw==", "dev": true, "requires": { "@babel/highlight": "^7.0.0" } }, "@babel/generator": { - "version": "7.4.4", - "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.4.4.tgz", - "integrity": "sha512-53UOLK6TVNqKxf7RUh8NE851EHRxOOeVXKbK2bivdb+iziMyk03Sr4eaE9OELCbyZAAafAKPDwF2TPUES5QbxQ==", + "version": "7.7.4", + "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.7.4.tgz", + "integrity": "sha512-m5qo2WgdOJeyYngKImbkyQrnUN1mPceaG5BV+G0E3gWsa4l/jCSryWJdM2x8OuGAOyh+3d5pVYfZWCiNFtynxg==", "dev": true, "requires": { - "@babel/types": "^7.4.4", + "@babel/types": "^7.7.4", "jsesc": "^2.5.1", - "lodash": "^4.17.11", - "source-map": "^0.5.0", - "trim-right": "^1.0.1" + "lodash": "^4.17.13", + "source-map": "^0.5.0" } }, "@babel/helper-function-name": { - "version": "7.1.0", - "resolved": "https://registry.npmjs.org/@babel/helper-function-name/-/helper-function-name-7.1.0.tgz", - "integrity": "sha512-A95XEoCpb3TO+KZzJ4S/5uW5fNe26DjBGqf1o9ucyLyCmi1dXq/B3c8iaWTfBk3VvetUxl16e8tIrd5teOCfGw==", + "version": "7.7.4", + "resolved": "https://registry.npmjs.org/@babel/helper-function-name/-/helper-function-name-7.7.4.tgz", + "integrity": "sha512-AnkGIdiBhEuiwdoMnKm7jfPfqItZhgRaZfMg1XX3bS25INOnLPjPG1Ppnajh8eqgt5kPJnfqrRHqFqmjKDZLzQ==", "dev": true, "requires": { - "@babel/helper-get-function-arity": "^7.0.0", - "@babel/template": "^7.1.0", - "@babel/types": "^7.0.0" + "@babel/helper-get-function-arity": "^7.7.4", + "@babel/template": "^7.7.4", + "@babel/types": "^7.7.4" } }, "@babel/helper-get-function-arity": { - "version": "7.0.0", - "resolved": "https://registry.npmjs.org/@babel/helper-get-function-arity/-/helper-get-function-arity-7.0.0.tgz", - "integrity": "sha512-r2DbJeg4svYvt3HOS74U4eWKsUAMRH01Z1ds1zx8KNTPtpTL5JAsdFv8BNyOpVqdFhHkkRDIg5B4AsxmkjAlmQ==", + "version": "7.7.4", + "resolved": "https://registry.npmjs.org/@babel/helper-get-function-arity/-/helper-get-function-arity-7.7.4.tgz", + "integrity": "sha512-QTGKEdCkjgzgfJ3bAyRwF4yyT3pg+vDgan8DSivq1eS0gwi+KGKE5x8kRcbeFTb/673mkO5SN1IZfmCfA5o+EA==", "dev": true, "requires": { - "@babel/types": "^7.0.0" + "@babel/types": "^7.7.4" } }, "@babel/helper-split-export-declaration": { - "version": "7.4.4", - "resolved": "https://registry.npmjs.org/@babel/helper-split-export-declaration/-/helper-split-export-declaration-7.4.4.tgz", - "integrity": "sha512-Ro/XkzLf3JFITkW6b+hNxzZ1n5OQ80NvIUdmHspih1XAhtN3vPTuUFT4eQnela+2MaZ5ulH+iyP513KJrxbN7Q==", + "version": "7.7.4", + "resolved": "https://registry.npmjs.org/@babel/helper-split-export-declaration/-/helper-split-export-declaration-7.7.4.tgz", + "integrity": "sha512-guAg1SXFcVr04Guk9eq0S4/rWS++sbmyqosJzVs8+1fH5NI+ZcmkaSkc7dmtAFbHFva6yRJnjW3yAcGxjueDug==", "dev": true, "requires": { - "@babel/types": "^7.4.4" + "@babel/types": "^7.7.4" } }, "@babel/highlight": { - "version": "7.0.0", - "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.0.0.tgz", - "integrity": "sha512-UFMC4ZeFC48Tpvj7C8UgLvtkaUuovQX+5xNWrsIoMG8o2z+XFKjKaN9iVmS84dPwVN00W4wPmqvYoZF3EGAsfw==", + "version": "7.5.0", + "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.5.0.tgz", + "integrity": "sha512-7dV4eu9gBxoM0dAnj/BCFDW9LFU0zvTrkq0ugM7pnHEgguOEeOz1so2ZghEdzviYzQEED0r4EAgpsBChKy1TRQ==", "dev": true, "requires": { "chalk": "^2.0.0", @@ -67,47 +66,66 @@ } }, "@babel/parser": { - "version": "7.4.5", - "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.4.5.tgz", - "integrity": "sha512-9mUqkL1FF5T7f0WDFfAoDdiMVPWsdD1gZYzSnaXsxUCUqzuch/8of9G3VUSNiZmMBoRxT3neyVsqeiL/ZPcjew==", + "version": "7.7.4", + "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.7.4.tgz", + "integrity": "sha512-jIwvLO0zCL+O/LmEJQjWA75MQTWwx3c3u2JOTDK5D3/9egrWRRA0/0hk9XXywYnXZVVpzrBYeIQTmhwUaePI9g==", "dev": true }, + "@babel/runtime": { + "version": "7.7.4", + "resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.7.4.tgz", + "integrity": "sha512-r24eVUUr0QqNZa+qrImUk8fn5SPhHq+IfYvIoIMg0do3GdK9sMdiLKP3GYVVaxpPKORgm8KRKaNTEhAjgIpLMw==", + "dev": true, + "requires": { + "regenerator-runtime": "^0.13.2" + } + }, + "@babel/runtime-corejs3": { + "version": "7.7.4", + "resolved": "https://registry.npmjs.org/@babel/runtime-corejs3/-/runtime-corejs3-7.7.4.tgz", + "integrity": "sha512-BBIEhzk8McXDcB3IbOi8zQPzzINUp4zcLesVlBSOcyGhzPUU8Xezk5GAG7Sy5GVhGmAO0zGd2qRSeY2g4Obqxw==", + "dev": true, + "requires": { + "core-js-pure": "^3.0.0", + "regenerator-runtime": "^0.13.2" + } + }, "@babel/template": { - "version": "7.4.4", - "resolved": "https://registry.npmjs.org/@babel/template/-/template-7.4.4.tgz", - "integrity": "sha512-CiGzLN9KgAvgZsnivND7rkA+AeJ9JB0ciPOD4U59GKbQP2iQl+olF1l76kJOupqidozfZ32ghwBEJDhnk9MEcw==", + "version": "7.7.4", + "resolved": "https://registry.npmjs.org/@babel/template/-/template-7.7.4.tgz", + "integrity": "sha512-qUzihgVPguAzXCK7WXw8pqs6cEwi54s3E+HrejlkuWO6ivMKx9hZl3Y2fSXp9i5HgyWmj7RKP+ulaYnKM4yYxw==", "dev": true, "requires": { "@babel/code-frame": "^7.0.0", - "@babel/parser": "^7.4.4", - "@babel/types": "^7.4.4" + "@babel/parser": "^7.7.4", + "@babel/types": "^7.7.4" } }, "@babel/traverse": { - "version": "7.4.5", - "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.4.5.tgz", - "integrity": "sha512-Vc+qjynwkjRmIFGxy0KYoPj4FdVDxLej89kMHFsWScq999uX+pwcX4v9mWRjW0KcAYTPAuVQl2LKP1wEVLsp+A==", + "version": "7.7.4", + "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.7.4.tgz", + "integrity": "sha512-P1L58hQyupn8+ezVA2z5KBm4/Zr4lCC8dwKCMYzsa5jFMDMQAzaBNy9W5VjB+KAmBjb40U7a/H6ao+Xo+9saIw==", "dev": true, "requires": { - "@babel/code-frame": "^7.0.0", - "@babel/generator": "^7.4.4", - "@babel/helper-function-name": "^7.1.0", - "@babel/helper-split-export-declaration": "^7.4.4", - "@babel/parser": "^7.4.5", - "@babel/types": "^7.4.4", + "@babel/code-frame": "^7.5.5", + "@babel/generator": "^7.7.4", + "@babel/helper-function-name": "^7.7.4", + "@babel/helper-split-export-declaration": "^7.7.4", + "@babel/parser": "^7.7.4", + "@babel/types": "^7.7.4", "debug": "^4.1.0", "globals": "^11.1.0", - "lodash": "^4.17.11" + "lodash": "^4.17.13" } }, "@babel/types": { - "version": "7.4.4", - "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.4.4.tgz", - "integrity": "sha512-dOllgYdnEFOebhkKCjzSVFqw/PmmB8pH6RGOWkY4GsboQNd47b1fBThBSwlHAq9alF9vc1M3+6oqR47R50L0tQ==", + "version": "7.7.4", + "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.7.4.tgz", + "integrity": "sha512-cz5Ji23KCi4T+YIE/BolWosrJuSmoZeN1EFnRtBwF+KKLi8GG/Z2c2hOJJeCXPk4mwk4QFvTmwIodJowXgttRA==", "dev": true, "requires": { "esutils": "^2.0.2", - "lodash": "^4.17.11", + "lodash": "^4.17.13", "to-fast-properties": "^2.0.0" } }, @@ -118,21 +136,21 @@ "dev": true }, "acorn": { - "version": "6.1.1", - "resolved": "https://registry.npmjs.org/acorn/-/acorn-6.1.1.tgz", - "integrity": "sha512-jPTiwtOxaHNaAPg/dmrJ/beuzLRnXtB0kQPQ8JpotKJgTB6rX6c8mlf315941pyjBSaPg8NHXS9fhP4u17DpGA==", + "version": "6.4.0", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-6.4.0.tgz", + "integrity": "sha512-gac8OEcQ2Li1dxIEWGZzsp2BitJxwkwcOm0zHAJLcPJaVvm58FRnk6RkuLRpU1EujipU2ZFODv2P9DLMfnV8mw==", "dev": true }, "acorn-jsx": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/acorn-jsx/-/acorn-jsx-5.0.1.tgz", - "integrity": "sha512-HJ7CfNHrfJLlNTzIEUTj43LNWGkqpRLxm3YjAlcD0ACydk9XynzYsCBHxut+iqt+1aBXkx9UP/w/ZqMr13XIzg==", + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/acorn-jsx/-/acorn-jsx-5.1.0.tgz", + "integrity": "sha512-tMUqwBWfLFbJbizRmEcWSLw6HnFzfdJs2sOJEOwwtVPMoH/0Ay+E703oZz78VSXZiiDcZrQ5XKjPIUQixhmgVw==", "dev": true }, "ajv": { - "version": "6.10.0", - "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.10.0.tgz", - "integrity": "sha512-nffhOpkymDECQyR0mnsUtoCE8RlX38G0rYP+wgLWFyZuUyuuojSSvi/+euOiQBIn63whYwYVIIH1TvE3tu4OEg==", + "version": "6.10.2", + "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.10.2.tgz", + "integrity": "sha512-TXtUUEYHuaTEbLZWIKUr5pmBuhDLy+8KYtPYdcV8qC+pOZL+NKqYwvWSRrVXHn+ZmRRAu8vJTAznH7Oag6RVRw==", "dev": true, "requires": { "fast-deep-equal": "^2.0.1", @@ -210,12 +228,13 @@ "dev": true }, "axobject-query": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/axobject-query/-/axobject-query-2.0.2.tgz", - "integrity": "sha512-MCeek8ZH7hKyO1rWUbKNQBbl4l2eY0ntk7OGi+q0RlafrCnfPxC06WZA+uebCfmYp4mNU9jRBP1AhGyf8+W3ww==", + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/axobject-query/-/axobject-query-2.1.1.tgz", + "integrity": "sha512-lF98xa/yvy6j3fBHAgQXIYl+J4eZadOSqsPojemUqClzNbBV38wWGpUbQbVEyf4eUF5yF7eHmGgGA2JiHyjeqw==", "dev": true, "requires": { - "ast-types-flow": "0.0.7" + "@babel/runtime": "^7.7.4", + "@babel/runtime-corejs3": "^7.7.4" } }, "babel-eslint": { @@ -394,9 +413,9 @@ } }, "commander": { - "version": "2.20.0", - "resolved": "https://registry.npmjs.org/commander/-/commander-2.20.0.tgz", - "integrity": "sha512-7j2y+40w61zy6YC2iRNpUe/NwhNyoXrYpHMrSunaMG64nRnaf96zO/KMQR4OyN/UnE5KLyEBnKHd4aG3rskjpQ==", + "version": "2.20.3", + "resolved": "https://registry.npmjs.org/commander/-/commander-2.20.3.tgz", + "integrity": "sha512-GpVkmM8vF2vQUkj2LvZmD35JxeJOLCwJ9cUkugyk2nuhbv3+mJvpLYYt+0+USMxE+oj+ey/lJEnhZw75x/OMcQ==", "dev": true }, "concat-map": { @@ -405,12 +424,24 @@ "integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=", "dev": true }, + "confusing-browser-globals": { + "version": "1.0.9", + "resolved": "https://registry.npmjs.org/confusing-browser-globals/-/confusing-browser-globals-1.0.9.tgz", + "integrity": "sha512-KbS1Y0jMtyPgIxjO7ZzMAuUpAKMt1SzCL9fsrKsX6b0zJPTaT0SiSPmewwVZg9UAO83HVIlEhZF84LIjZ0lmAw==", + "dev": true + }, "contains-path": { "version": "0.1.0", "resolved": "https://registry.npmjs.org/contains-path/-/contains-path-0.1.0.tgz", "integrity": "sha1-/ozxhP9mcLa67wGp1IYaXL7EEgo=", "dev": true }, + "core-js-pure": { + "version": "3.4.7", + "resolved": "https://registry.npmjs.org/core-js-pure/-/core-js-pure-3.4.7.tgz", + "integrity": "sha512-Am3uRS8WCdTFA3lP7LtKR0PxgqYzjAMGKXaZKSNSC/8sqU0Wfq8R/YzoRs2rqtOVEunfgH+0q3O0BKOg0AvjPw==", + "dev": true + }, "cosmiconfig": { "version": "5.2.1", "resolved": "https://registry.npmjs.org/cosmiconfig/-/cosmiconfig-5.2.1.tgz", @@ -818,25 +849,25 @@ } }, "eslint-config-airbnb": { - "version": "17.1.0", - "resolved": "https://registry.npmjs.org/eslint-config-airbnb/-/eslint-config-airbnb-17.1.0.tgz", - "integrity": "sha512-R9jw28hFfEQnpPau01NO5K/JWMGLi6aymiF6RsnMURjTk+MqZKllCqGK/0tOvHkPi/NWSSOU2Ced/GX++YxLnw==", + "version": "17.1.1", + "resolved": "https://registry.npmjs.org/eslint-config-airbnb/-/eslint-config-airbnb-17.1.1.tgz", + "integrity": "sha512-xCu//8a/aWqagKljt+1/qAM62BYZeNq04HmdevG5yUGWpja0I/xhqd6GdLRch5oetEGFiJAnvtGuTEAese53Qg==", "dev": true, "requires": { - "eslint-config-airbnb-base": "^13.1.0", + "eslint-config-airbnb-base": "^13.2.0", "object.assign": "^4.1.0", - "object.entries": "^1.0.4" + "object.entries": "^1.1.0" } }, "eslint-config-airbnb-base": { - "version": "13.1.0", - "resolved": "https://registry.npmjs.org/eslint-config-airbnb-base/-/eslint-config-airbnb-base-13.1.0.tgz", - "integrity": "sha512-XWwQtf3U3zIoKO1BbHh6aUhJZQweOwSt4c2JrPDg9FP3Ltv3+YfEv7jIDB8275tVnO/qOHbfuYg3kzw6Je7uWw==", + "version": "13.2.0", + "resolved": "https://registry.npmjs.org/eslint-config-airbnb-base/-/eslint-config-airbnb-base-13.2.0.tgz", + "integrity": "sha512-1mg/7eoB4AUeB0X1c/ho4vb2gYkNH8Trr/EgCT/aGmKhhG+F6vF5s8+iRBlWAzFIAphxIdp3YfEKgEl0f9Xg+w==", "dev": true, "requires": { - "eslint-restricted-globals": "^0.1.1", + "confusing-browser-globals": "^1.0.5", "object.assign": "^4.1.0", - "object.entries": "^1.0.4" + "object.entries": "^1.1.0" } }, "eslint-config-prettier": { @@ -882,9 +913,9 @@ } }, "eslint-module-utils": { - "version": "2.4.0", - "resolved": "https://registry.npmjs.org/eslint-module-utils/-/eslint-module-utils-2.4.0.tgz", - "integrity": "sha512-14tltLm38Eu3zS+mt0KvILC3q8jyIAH518MlG+HO0p+yK885Lb1UHTY/UgR91eOyGdmxAPb+OLoW4znqIT6Ndw==", + "version": "2.4.1", + "resolved": "https://registry.npmjs.org/eslint-module-utils/-/eslint-module-utils-2.4.1.tgz", + "integrity": "sha512-H6DOj+ejw7Tesdgbfs4jeS4YMFrT8uI8xwd1gtQqXssaR0EQ26L+2O/w6wkYFy2MymON0fTwHmXBvvfLNZVZEw==", "dev": true, "requires": { "debug": "^2.6.8", @@ -908,6 +939,12 @@ } } }, + "eslint-plugin-eslint-plugin": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/eslint-plugin-eslint-plugin/-/eslint-plugin-eslint-plugin-2.1.0.tgz", + "integrity": "sha512-kT3A/ZJftt28gbl/Cv04qezb/NQ1dwYIbi8lyf806XMxkus7DvOVCLIfTXMrorp322Pnoez7+zabXH29tADIDg==", + "dev": true + }, "eslint-plugin-html": { "version": "5.0.5", "resolved": "https://registry.npmjs.org/eslint-plugin-html/-/eslint-plugin-html-5.0.5.tgz", @@ -918,9 +955,9 @@ } }, "eslint-plugin-import": { - "version": "2.17.3", - "resolved": "https://registry.npmjs.org/eslint-plugin-import/-/eslint-plugin-import-2.17.3.tgz", - "integrity": "sha512-qeVf/UwXFJbeyLbxuY8RgqDyEKCkqV7YC+E5S5uOjAp4tOc8zj01JP3ucoBM8JcEqd1qRasJSg6LLlisirfy0Q==", + "version": "2.18.2", + "resolved": "https://registry.npmjs.org/eslint-plugin-import/-/eslint-plugin-import-2.18.2.tgz", + "integrity": "sha512-5ohpsHAiUBRNaBWAF08izwUGlbrJoJJ+W9/TBwsGoR1MnlgfwMIKrFeSjWbt6moabiXW9xNvtFz+97KHRfI4HQ==", "dev": true, "requires": { "array-includes": "^3.0.3", @@ -930,8 +967,8 @@ "eslint-import-resolver-node": "^0.3.2", "eslint-module-utils": "^2.4.0", "has": "^1.0.3", - "lodash": "^4.17.11", "minimatch": "^3.0.4", + "object.values": "^1.1.0", "read-pkg-up": "^2.0.0", "resolve": "^1.11.0" }, @@ -964,11 +1001,12 @@ } }, "eslint-plugin-jsx-a11y": { - "version": "6.2.1", - "resolved": "https://registry.npmjs.org/eslint-plugin-jsx-a11y/-/eslint-plugin-jsx-a11y-6.2.1.tgz", - "integrity": "sha512-cjN2ObWrRz0TTw7vEcGQrx+YltMvZoOEx4hWU8eEERDnBIU00OTq7Vr+jA7DFKxiwLNv4tTh5Pq2GUNEa8b6+w==", + "version": "6.2.3", + "resolved": "https://registry.npmjs.org/eslint-plugin-jsx-a11y/-/eslint-plugin-jsx-a11y-6.2.3.tgz", + "integrity": "sha512-CawzfGt9w83tyuVekn0GDPU9ytYtxyxyFZ3aSWROmnRRFQFT2BiPJd7jvRdzNDi6oLWaS2asMeYSNMjWTV4eNg==", "dev": true, "requires": { + "@babel/runtime": "^7.4.5", "aria-query": "^3.0.0", "array-includes": "^3.0.3", "ast-types-flow": "^0.0.7", @@ -976,31 +1014,34 @@ "damerau-levenshtein": "^1.0.4", "emoji-regex": "^7.0.2", "has": "^1.0.3", - "jsx-ast-utils": "^2.0.1" + "jsx-ast-utils": "^2.2.1" } }, "eslint-plugin-prettier": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/eslint-plugin-prettier/-/eslint-plugin-prettier-3.1.0.tgz", - "integrity": "sha512-XWX2yVuwVNLOUhQijAkXz+rMPPoCr7WFiAl8ig6I7Xn+pPVhDhzg4DxHpmbeb0iqjO9UronEA3Tb09ChnFVHHA==", + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/eslint-plugin-prettier/-/eslint-plugin-prettier-3.1.1.tgz", + "integrity": "sha512-A+TZuHZ0KU0cnn56/9mfR7/KjUJ9QNVXUhwvRFSR7PGPe0zQR6PTkmyqg1AtUUEOzTqeRsUwyKFh0oVZKVCrtA==", "dev": true, "requires": { "prettier-linter-helpers": "^1.0.0" } }, "eslint-plugin-react": { - "version": "7.13.0", - "resolved": "https://registry.npmjs.org/eslint-plugin-react/-/eslint-plugin-react-7.13.0.tgz", - "integrity": "sha512-uA5LrHylu8lW/eAH3bEQe9YdzpPaFd9yAJTwTi/i/BKTD7j6aQMKVAdGM/ML72zD6womuSK7EiGtMKuK06lWjQ==", + "version": "7.17.0", + "resolved": "https://registry.npmjs.org/eslint-plugin-react/-/eslint-plugin-react-7.17.0.tgz", + "integrity": "sha512-ODB7yg6lxhBVMeiH1c7E95FLD4E/TwmFjltiU+ethv7KPdCwgiFuOZg9zNRHyufStTDLl/dEFqI2Q1VPmCd78A==", "dev": true, "requires": { "array-includes": "^3.0.3", "doctrine": "^2.1.0", + "eslint-plugin-eslint-plugin": "^2.1.0", "has": "^1.0.3", - "jsx-ast-utils": "^2.1.0", - "object.fromentries": "^2.0.0", + "jsx-ast-utils": "^2.2.3", + "object.entries": "^1.1.0", + "object.fromentries": "^2.0.1", + "object.values": "^1.1.0", "prop-types": "^15.7.2", - "resolve": "^1.10.1" + "resolve": "^1.13.1" }, "dependencies": { "doctrine": { @@ -1015,15 +1056,9 @@ } }, "eslint-plugin-react-hooks": { - "version": "1.6.0", - "resolved": "https://registry.npmjs.org/eslint-plugin-react-hooks/-/eslint-plugin-react-hooks-1.6.0.tgz", - "integrity": "sha512-lHBVRIaz5ibnIgNG07JNiAuBUeKhEf8l4etNx5vfAEwqQ5tcuK3jV9yjmopPgQDagQb7HwIuQVsE3IVcGrRnag==", - "dev": true - }, - "eslint-restricted-globals": { - "version": "0.1.1", - "resolved": "https://registry.npmjs.org/eslint-restricted-globals/-/eslint-restricted-globals-0.1.1.tgz", - "integrity": "sha1-NfDVy8ZMLj7WLpO0saevBbp+1Nc=", + "version": "1.7.0", + "resolved": "https://registry.npmjs.org/eslint-plugin-react-hooks/-/eslint-plugin-react-hooks-1.7.0.tgz", + "integrity": "sha512-iXTCFcOmlWvw4+TOE8CLWj6yX1GwzT0Y6cUfHHZqWnSk144VmVIRcVGtUAzrLES7C798lmvnt02C7rxaOX1HNA==", "dev": true }, "eslint-scope": { @@ -1043,20 +1078,12 @@ "dev": true, "requires": { "eslint-visitor-keys": "^1.1.0" - }, - "dependencies": { - "eslint-visitor-keys": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-1.1.0.tgz", - "integrity": "sha512-8y9YjtM1JBJU/A9Kc+SbaOV4y29sSWckBwMHa+FGtVj5gN/sbnKDf6xJUl+8g7FAij9LVaP8C24DUiH/f/2Z9A==", - "dev": true - } } }, "eslint-visitor-keys": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-1.0.0.tgz", - "integrity": "sha512-qzm/XxIbxm/FHyH341ZrbnMUpe+5Bocte9xkmFMzPMjRaZMcXww+MpBptFvtU+79L362nqiLhekCxCxDPaUMBQ==", + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-1.1.0.tgz", + "integrity": "sha512-8y9YjtM1JBJU/A9Kc+SbaOV4y29sSWckBwMHa+FGtVj5gN/sbnKDf6xJUl+8g7FAij9LVaP8C24DUiH/f/2Z9A==", "dev": true }, "espree": { @@ -1095,21 +1122,21 @@ } }, "estraverse": { - "version": "4.2.0", - "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-4.2.0.tgz", - "integrity": "sha1-De4/7TH81GlhjOc0IJn8GvoL2xM=", + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-4.3.0.tgz", + "integrity": "sha512-39nnKffWz8xN1BU/2c79n9nB9HDzo0niYUqx6xyqUnyoAnQyyWpOTdZEeiCch8BBu515t4wp9ZmgVfVhn9EBpw==", "dev": true }, "esutils": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/esutils/-/esutils-2.0.2.tgz", - "integrity": "sha1-Cr9PHKpbyx96nYrMbepPqqBLrJs=", + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/esutils/-/esutils-2.0.3.tgz", + "integrity": "sha512-kVscqXk4OCp68SZ0dkgEKVi6/8ij300KBWTJq32P/dYeWTSwK41WyTxalN1eRmA5Z9UU/LX9D7FWSmV9SAYx6g==", "dev": true }, "external-editor": { - "version": "3.0.3", - "resolved": "https://registry.npmjs.org/external-editor/-/external-editor-3.0.3.tgz", - "integrity": "sha512-bn71H9+qWoOQKyZDo25mOMVpSmXROAsTJVVVYzrrtol3d4y+AsKjf4Iwl2Q+IuT0kFSQ1qo166UuIwqYq7mGnA==", + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/external-editor/-/external-editor-3.1.0.tgz", + "integrity": "sha512-hMQ4CX1p1izmuLYyZqLMO/qGNw10wSv9QDCPfzXfyFrOaCSSoRfqE1Kf1s5an66J5JZC62NewG+mK49jOCtQew==", "dev": true, "requires": { "chardet": "^0.7.0", @@ -1180,9 +1207,9 @@ } }, "flatted": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/flatted/-/flatted-2.0.0.tgz", - "integrity": "sha512-R+H8IZclI8AAkSBRQJLVOsxwAoHd6WC40b4QTNWIjzAa6BXOBfQcM587MXDTVPeYaopFNWHUFLx7eNmHDSxMWg==", + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/flatted/-/flatted-2.0.1.tgz", + "integrity": "sha512-a1hQMktqW9Nmqr5aktAux3JMNqaucxGcjtjWnZLHX7yyPCmlSV3M54nGYbqT8K+0GhF3NBgmJCc3ma+WOgX8Jg==", "dev": true }, "fs.realpath": { @@ -1210,9 +1237,9 @@ "dev": true }, "glob": { - "version": "7.1.4", - "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.4.tgz", - "integrity": "sha512-hkLPepehmnKk41pUGm3sYxoFs/umurYfYJCerbXEyFIWcAzvpipAgVkBqqT9RBKMGjnq6kMuyYwha6csxbiM1A==", + "version": "7.1.6", + "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.6.tgz", + "integrity": "sha512-LwaxwyZ72Lk7vZINtNNrywX0ZuLyStrdDtabefZKAY5ZGJhVtgdznluResxNmPitE0SAO+O26sWTHeKSI2wMBA==", "dev": true, "requires": { "fs.realpath": "^1.0.0", @@ -1230,9 +1257,9 @@ "dev": true }, "graceful-fs": { - "version": "4.1.15", - "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.1.15.tgz", - "integrity": "sha512-6uHUhOPEBgQ24HM+r6b/QwWfZq+yiFcipKFrOFiBEnWdy5sdzYoi+pJeQaPI5qOLRFqWmAXUPQNsielzdLoecA==", + "version": "4.2.3", + "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.3.tgz", + "integrity": "sha512-a30VEBm4PEdx1dRB7MFK7BejejvCvBronbLjht+sHuGYj8PHs7M/5Z+rt5lw551vZ7yfTCj4Vuyy3mSJytDWRQ==", "dev": true }, "has": { @@ -1263,9 +1290,9 @@ "dev": true }, "hosted-git-info": { - "version": "2.7.1", - "resolved": "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-2.7.1.tgz", - "integrity": "sha512-7T/BxH19zbcCTa8XkMlbK5lTo1WtgkFi3GvdWEyNuc4Vex7/9Dqbnpsf4JMydcfj9HCg4zUWFTL3Za6lapg5/w==", + "version": "2.8.5", + "resolved": "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-2.8.5.tgz", + "integrity": "sha512-kssjab8CvdXfcXMXVcvsXum4Hwdq9XGtRD3TteMEvEbq0LXyiNQr6AprqKqfeaDXze7SxWvRxdpwE6ku7ikLkg==", "dev": true }, "hsl-regex": { @@ -1316,9 +1343,9 @@ "dev": true }, "import-fresh": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/import-fresh/-/import-fresh-3.0.0.tgz", - "integrity": "sha512-pOnA9tfM3Uwics+SaBLCNyZZZbK+4PTu0OPZtLlMIrv17EdBoC15S9Kn8ckJ9TZTyKb3ywNE5y1yeDxxGA7nTQ==", + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/import-fresh/-/import-fresh-3.2.1.tgz", + "integrity": "sha512-6e1q1cnWP2RXD9/keSkxHScg508CdXqXWgWBaETNhyuBFz+kUZlKboh+ISK+bU++DmbHimVBrOz/zzPe0sZ3sQ==", "dev": true, "requires": { "parent-module": "^1.0.0", @@ -1348,15 +1375,15 @@ } }, "inherits": { - "version": "2.0.3", - "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.3.tgz", - "integrity": "sha1-Yzwsg+PaQqUC9SRmAiSA9CCCYd4=", + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", + "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==", "dev": true }, "inquirer": { - "version": "6.3.1", - "resolved": "https://registry.npmjs.org/inquirer/-/inquirer-6.3.1.tgz", - "integrity": "sha512-MmL624rfkFt4TG9y/Jvmt8vdmOo836U7Y0Hxr2aFk3RelZEGX4Igk0KabWrcaaZaTv9uzglOqWh1Vly+FAWAXA==", + "version": "6.5.2", + "resolved": "https://registry.npmjs.org/inquirer/-/inquirer-6.5.2.tgz", + "integrity": "sha512-cntlB5ghuB0iuO65Ovoi8ogLHiWGs/5yNrtUcKjFhSSiVeAIVpD7koaSU9RM8mpXw5YDi9RdYXGQMaOURB7ycQ==", "dev": true, "requires": { "ansi-escapes": "^3.2.0", @@ -1365,7 +1392,7 @@ "cli-width": "^2.0.0", "external-editor": "^3.0.3", "figures": "^2.0.0", - "lodash": "^4.17.11", + "lodash": "^4.17.12", "mute-stream": "0.0.7", "run-async": "^2.2.0", "rxjs": "^6.4.0", @@ -1539,12 +1566,13 @@ "dev": true }, "jsx-ast-utils": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/jsx-ast-utils/-/jsx-ast-utils-2.1.0.tgz", - "integrity": "sha512-yDGDG2DS4JcqhA6blsuYbtsT09xL8AoLuUR2Gb5exrw7UEM19sBcOTq+YBBhrNbl0PUC4R4LnFu+dHg2HKeVvA==", + "version": "2.2.3", + "resolved": "https://registry.npmjs.org/jsx-ast-utils/-/jsx-ast-utils-2.2.3.tgz", + "integrity": "sha512-EdIHFMm+1BPynpKOpdPqiOsvnIrInRGJD7bzPZdPkjitQEqpdpUuFpq4T0npZFKTiB3RhWFdGN+oqOJIdhDhQA==", "dev": true, "requires": { - "array-includes": "^3.0.3" + "array-includes": "^3.0.3", + "object.assign": "^4.1.0" } }, "levn": { @@ -1643,9 +1671,9 @@ } }, "ms": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.1.tgz", - "integrity": "sha512-tgp+dl5cGk28utYktBsrFqA7HKgrhgPsg6Z/EfhWI4gl1Hwq8B/GmY/0oXZ6nF8hDVesS/FpnYaD/kOWhYQvyg==", + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", + "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", "dev": true }, "mute-stream": { @@ -1716,6 +1744,12 @@ "integrity": "sha1-IQmtx5ZYh8/AXLvUQsrIv7s2CGM=", "dev": true }, + "object-inspect": { + "version": "1.7.0", + "resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.7.0.tgz", + "integrity": "sha512-a7pEHdh1xKIAgTySUGgLMx/xwDZskN1Ud6egYYN3EdRW4ZMPNEDUTF+hwy2LUC+Bl+SyLXANnwz/jyh/qutKUw==", + "dev": true + }, "object-keys": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/object-keys/-/object-keys-1.1.1.tgz", @@ -1747,15 +1781,52 @@ } }, "object.fromentries": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/object.fromentries/-/object.fromentries-2.0.0.tgz", - "integrity": "sha512-9iLiI6H083uiqUuvzyY6qrlmc/Gz8hLQFOcb/Ri/0xXFkSNS3ctV+CbE6yM2+AnkYfOB3dGjdzC0wrMLIhQICA==", + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/object.fromentries/-/object.fromentries-2.0.1.tgz", + "integrity": "sha512-PUQv8Hbg3j2QX0IQYv3iAGCbGcu4yY4KQ92/dhA4sFSixBmSmp13UpDLs6jGK8rBtbmhNNIK99LD2k293jpiGA==", "dev": true, "requires": { - "define-properties": "^1.1.2", - "es-abstract": "^1.11.0", + "define-properties": "^1.1.3", + "es-abstract": "^1.15.0", "function-bind": "^1.1.1", - "has": "^1.0.1" + "has": "^1.0.3" + }, + "dependencies": { + "es-abstract": { + "version": "1.16.2", + "resolved": "https://registry.npmjs.org/es-abstract/-/es-abstract-1.16.2.tgz", + "integrity": "sha512-jYo/J8XU2emLXl3OLwfwtuFfuF2w6DYPs+xy9ZfVyPkDcrauu6LYrw/q2TyCtrbc/KUdCiC5e9UajRhgNkVopA==", + "dev": true, + "requires": { + "es-to-primitive": "^1.2.1", + "function-bind": "^1.1.1", + "has": "^1.0.3", + "has-symbols": "^1.0.1", + "is-callable": "^1.1.4", + "is-regex": "^1.0.4", + "object-inspect": "^1.7.0", + "object-keys": "^1.1.1", + "string.prototype.trimleft": "^2.1.0", + "string.prototype.trimright": "^2.1.0" + } + }, + "es-to-primitive": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/es-to-primitive/-/es-to-primitive-1.2.1.tgz", + "integrity": "sha512-QCOllgZJtaUo9miYBcLChTUaHNjJF3PYs1VidD7AwiEj1kYxKeQTctLAezAOH5ZKRH0g2IgPn6KwB4IT8iRpvA==", + "dev": true, + "requires": { + "is-callable": "^1.1.4", + "is-date-object": "^1.0.1", + "is-symbol": "^1.0.2" + } + }, + "has-symbols": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.0.1.tgz", + "integrity": "sha512-PLcsoqu++dmEIZB+6totNFKq/7Do+Z0u4oT0zKOJNl3lYK6vGwwu2hjHs+68OEZbTjiUE9bgOABXbP/GvrS0Kg==", + "dev": true + } } }, "object.getownpropertydescriptors": { @@ -1799,17 +1870,17 @@ } }, "optionator": { - "version": "0.8.2", - "resolved": "https://registry.npmjs.org/optionator/-/optionator-0.8.2.tgz", - "integrity": "sha1-NkxeQJ0/TWMB1sC0wFu6UBgK62Q=", + "version": "0.8.3", + "resolved": "https://registry.npmjs.org/optionator/-/optionator-0.8.3.tgz", + "integrity": "sha512-+IW9pACdk3XWmmTXG8m3upGUJst5XRGzxMRjXzAuJ1XnIFNvfhjjIuYkDvysnPQ7qzqVzLt78BCruntqRhWQbA==", "dev": true, "requires": { "deep-is": "~0.1.3", - "fast-levenshtein": "~2.0.4", + "fast-levenshtein": "~2.0.6", "levn": "~0.3.0", "prelude-ls": "~1.1.2", "type-check": "~0.3.2", - "wordwrap": "~1.0.0" + "word-wrap": "~1.2.3" } }, "os-tmpdir": { @@ -2294,9 +2365,9 @@ "dev": true }, "prettier": { - "version": "1.17.1", - "resolved": "https://registry.npmjs.org/prettier/-/prettier-1.17.1.tgz", - "integrity": "sha512-TzGRNvuUSmPgwivDqkZ9tM/qTGW9hqDKWOE9YHiyQdixlKbv7kvEqsmDPrcHJTKwthU774TQwZXVtaQ/mMsvjg==", + "version": "1.19.1", + "resolved": "https://registry.npmjs.org/prettier/-/prettier-1.19.1.tgz", + "integrity": "sha512-s7PoyDv/II1ObgQunCbB9PdLmUcBZcnWOcxDh7O0N/UwDEsHyqkW+Qh28jW+mVuCdx7gLB0BotYI1Y6uI9iyew==", "dev": true }, "prettier-linter-helpers": { @@ -2338,9 +2409,9 @@ "dev": true }, "react-is": { - "version": "16.8.6", - "resolved": "https://registry.npmjs.org/react-is/-/react-is-16.8.6.tgz", - "integrity": "sha512-aUk3bHfZ2bRSVFFbbeVS4i+lNPZr3/WM5jT2J5omUVV1zzcs1nAaf3l51ctA5FFvCRbhrH0bdAsRRQddFJZPtA==", + "version": "16.12.0", + "resolved": "https://registry.npmjs.org/react-is/-/react-is-16.12.0.tgz", + "integrity": "sha512-rPCkf/mWBtKc97aLL9/txD8DZdemK0vkA3JMLShjlJB3Pj3s+lpf1KaBzMfQrAmhMQB0n1cU/SUGgKKBCe837Q==", "dev": true }, "read-pkg": { @@ -2375,6 +2446,12 @@ "util-deprecate": "^1.0.1" } }, + "regenerator-runtime": { + "version": "0.13.3", + "resolved": "https://registry.npmjs.org/regenerator-runtime/-/regenerator-runtime-0.13.3.tgz", + "integrity": "sha512-naKIZz2GQ8JWh///G7L3X6LaQUAMp2lvb1rvwwsURe/VXwD6VMfr+/1NuNw3ag8v2kY1aQ/go5SNn79O9JU7yw==", + "dev": true + }, "regexpp": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/regexpp/-/regexpp-2.0.1.tgz", @@ -2382,9 +2459,9 @@ "dev": true }, "resolve": { - "version": "1.11.1", - "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.11.1.tgz", - "integrity": "sha512-vIpgF6wfuJOZI7KKKSP+HmiKggadPQAdsp5HiC1mvqnfp0gF1vdwgBWZIdrVft9pgqoMFQN+R7BSWZiBxx+BBw==", + "version": "1.13.1", + "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.13.1.tgz", + "integrity": "sha512-CxqObCX8K8YtAhOBRg+lrcdn+LK+WYOS8tSjqSFbjtrI5PnS63QPhZl4+yKfrU9tdsbMu9Anr/amegT87M9Z6w==", "dev": true, "requires": { "path-parse": "^1.0.6" @@ -2437,18 +2514,18 @@ } }, "rxjs": { - "version": "6.5.2", - "resolved": "https://registry.npmjs.org/rxjs/-/rxjs-6.5.2.tgz", - "integrity": "sha512-HUb7j3kvb7p7eCUHE3FqjoDsC1xfZQ4AHFWfTKSpZ+sAhhz5X1WX0ZuUqWbzB2QhSLp3DoLUG+hMdEDKqWo2Zg==", + "version": "6.5.3", + "resolved": "https://registry.npmjs.org/rxjs/-/rxjs-6.5.3.tgz", + "integrity": "sha512-wuYsAYYFdWTAnAaPoKGNhfpWwKZbJW+HgAJ+mImp+Epl7BG8oNWBCTyRM8gba9k4lk8BgWdoYm21Mo/RYhhbgA==", "dev": true, "requires": { "tslib": "^1.9.0" } }, "safe-buffer": { - "version": "5.1.2", - "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", - "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==", + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.0.tgz", + "integrity": "sha512-fZEwUGbVl7kouZs1jCdMLdt95hdIv0ZeHg6L7qPeciMZhZ+/gdesW4wgTARkrFWEpspjEATAzUGPG8N2jJiwbg==", "dev": true }, "safer-buffer": { @@ -2464,9 +2541,9 @@ "dev": true }, "semver": { - "version": "5.7.0", - "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.0.tgz", - "integrity": "sha512-Ya52jSX2u7QKghxeoFGpLwCtGlt7j0oY9DYb5apt9nPlJ42ID+ulTXESnt/qAQcoSERyZ5sl3LDIOw0nAn/5DA==", + "version": "5.7.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz", + "integrity": "sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==", "dev": true }, "shebang-command": { @@ -2551,9 +2628,9 @@ } }, "spdx-license-ids": { - "version": "3.0.4", - "resolved": "https://registry.npmjs.org/spdx-license-ids/-/spdx-license-ids-3.0.4.tgz", - "integrity": "sha512-7j8LYJLeY/Yb6ACbQ7F76qy5jHkp0U6jgBfJsk97bwWlVUnUWsAgpyaCvo17h0/RQGnQ036tVDomiwoI4pDkQA==", + "version": "3.0.5", + "resolved": "https://registry.npmjs.org/spdx-license-ids/-/spdx-license-ids-3.0.5.tgz", + "integrity": "sha512-J+FWzZoynJEXGphVIS+XEh3kFSjZX/1i9gFBaWQcB+/tmpe2qUsSBABpcxqxnAxFdiUFEgAX1bjYGQvIZmoz9Q==", "dev": true }, "sprintf-js": { @@ -2578,13 +2655,33 @@ "strip-ansi": "^4.0.0" } }, + "string.prototype.trimleft": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/string.prototype.trimleft/-/string.prototype.trimleft-2.1.0.tgz", + "integrity": "sha512-FJ6b7EgdKxxbDxc79cOlok6Afd++TTs5szo+zJTUyow3ycrRfJVE2pq3vcN53XexvKZu/DJMDfeI/qMiZTrjTw==", + "dev": true, + "requires": { + "define-properties": "^1.1.3", + "function-bind": "^1.1.1" + } + }, + "string.prototype.trimright": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/string.prototype.trimright/-/string.prototype.trimright-2.1.0.tgz", + "integrity": "sha512-fXZTSV55dNBwv16uw+hh5jkghxSnc5oHq+5K/gXgizHwAvMetdAJlHqqoFC1FSDVPYWLkAKl2cxpUT41sV7nSg==", + "dev": true, + "requires": { + "define-properties": "^1.1.3", + "function-bind": "^1.1.1" + } + }, "string_decoder": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.2.0.tgz", - "integrity": "sha512-6YqyX6ZWEYguAxgZzHGL7SsCeGx3V2TtOTqZz1xSTSWnqsbWwbptafNyvf/ACquZUXV3DANr5BDIwNYe1mN42w==", + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.3.0.tgz", + "integrity": "sha512-hkRX8U1WjJFd8LsDJ2yQ/wWWxaopEsABU1XfkM8A+j0+85JAGppt16cr1Whg6KIbb4okU6Mql6BOj+uup/wKeA==", "dev": true, "requires": { - "safe-buffer": "~5.1.0" + "safe-buffer": "~5.2.0" } }, "strip-ansi": { @@ -2663,13 +2760,13 @@ } }, "table": { - "version": "5.4.0", - "resolved": "https://registry.npmjs.org/table/-/table-5.4.0.tgz", - "integrity": "sha512-nHFDrxmbrkU7JAFKqKbDJXfzrX2UBsWmrieXFTGxiI5e4ncg3VqsZeI4EzNmX0ncp4XNGVeoxIWJXfCIXwrsvw==", + "version": "5.4.6", + "resolved": "https://registry.npmjs.org/table/-/table-5.4.6.tgz", + "integrity": "sha512-wmEc8m4fjnob4gt5riFRtTu/6+4rSe12TpAELNSqHMfF3IqnA+CH37USM6/YR3qRZv7e56kAEAtd6nKZaxe0Ug==", "dev": true, "requires": { - "ajv": "^6.9.1", - "lodash": "^4.17.11", + "ajv": "^6.10.2", + "lodash": "^4.17.14", "slice-ansi": "^2.1.0", "string-width": "^3.0.0" }, @@ -2735,16 +2832,10 @@ "integrity": "sha1-3F5pjL0HkmW8c+A3doGk5Og/YW4=", "dev": true }, - "trim-right": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/trim-right/-/trim-right-1.0.1.tgz", - "integrity": "sha1-yy4SAwZ+DI3h9hQJS5/kVwTqYAM=", - "dev": true - }, "tslib": { - "version": "1.9.3", - "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.9.3.tgz", - "integrity": "sha512-4krF8scpejhaOgqzBEcGM7yDIEfi0/8+8zDRZhNZZ2kjmHJ4hv3zCbQWxoJGz1iw5U0Jl0nma13xzHXcncMavQ==", + "version": "1.10.0", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.10.0.tgz", + "integrity": "sha512-qOebF53frne81cf0S9B41ByenJ3/IuH8yJKngAX35CmiZySA0khhkovshKK+jGCaMnVomla7gVlIcc3EvKPbTQ==", "dev": true }, "type-check": { @@ -2824,10 +2915,10 @@ "isexe": "^2.0.0" } }, - "wordwrap": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/wordwrap/-/wordwrap-1.0.0.tgz", - "integrity": "sha1-J1hIEIkUVqQXHI0CJkQa3pDLyus=", + "word-wrap": { + "version": "1.2.3", + "resolved": "https://registry.npmjs.org/word-wrap/-/word-wrap-1.2.3.tgz", + "integrity": "sha512-Hz/mrNwitNRh/HUAtM/VT/5VH+ygD6DV7mYKZAtHOrbs8U7lvPS6xf7EJKMF0uW1KJCl0H701g3ZGus+muE5vQ==", "dev": true }, "wrappy": { diff --git a/package.json b/package.json index e7462d5ea..3ae66e01c 100644 --- a/package.json +++ b/package.json @@ -20,15 +20,15 @@ "babel-eslint": "^9.0.0", "cssnano": "^4.1.10", "eslint": "^5.16.0", - "eslint-config-airbnb": "^17.1.0", + "eslint-config-airbnb": "^17.1.1", "eslint-config-prettier": "^4.3.0", "eslint-config-wesbos": "0.0.19", "eslint-plugin-html": "^5.0.5", - "eslint-plugin-import": "^2.17.3", - "eslint-plugin-jsx-a11y": "^6.2.1", - "eslint-plugin-prettier": "^3.1.0", - "eslint-plugin-react": "^7.13.0", - "eslint-plugin-react-hooks": "^1.6.0", - "prettier": "^1.17.1" + "eslint-plugin-import": "^2.18.2", + "eslint-plugin-jsx-a11y": "^6.2.3", + "eslint-plugin-prettier": "^3.1.1", + "eslint-plugin-react": "^7.17.0", + "eslint-plugin-react-hooks": "^1.7.0", + "prettier": "^1.19.1" } } diff --git a/playground/closures.html b/playground/closures.html index a51c038ce..8f95f08e8 100644 --- a/playground/closures.html +++ b/playground/closures.html @@ -1,55 +1,57 @@ - - - - - - - - - - - - + + + + + + + + + + diff --git a/playground/custom-functions/cf.js b/playground/custom-functions/cf.js index a465ae844..e261ebcd0 100644 --- a/playground/custom-functions/cf.js +++ b/playground/custom-functions/cf.js @@ -1,31 +1,38 @@ -// Function Definition -function calculateBill(billAmount, taxRate = 0.13, tipRate = 0.15) { +/* + * Functions - group together a set of instructions, then often return a value + */ + +// Define a function with placeholder parameters, use a default value for taxRate +function calculateBill(billAmount, taxRate = 0.13, tipPercent = 0.2) { // this is the function body - console.log('Running Calculate Bill!!'); - const total = billAmount + billAmount * taxRate + billAmount * tipRate; - return total; + const total = billAmount + billAmount * taxRate + billAmount * tipPercent; // these variables are temporary and scoped to only exist in THIS function + return total; // allows you to capture and access the variable outside the function } -// Function Call. Or **Run** -const wesTotal = 500; -const wesTaxRate = 0.3; -// const myTotal = calculateBill(wesTotal, wesTaxRate); +// Call, run, or invoke a function and use arguments to pass in parameters +const myTotal1 = calculateBill(127); // use default tax rate +const myTotal2 = calculateBill(14, 0.15); // override default tax rate +console.log(`Bill total 1 = ${myTotal1}, Bill total 2 = ${myTotal2}`); -// Function Definition -function sayHiTo(firstName) { +// Define greeting function +function sayHelloTo(firstName) { return `Hello ${firstName}`; } -// const greeting = sayHiTo('Wes'); +// const greeting = sayHelloTo('Mando'); // console.log(greeting); function doctorize(name) { return `Dr. ${name}`; } -function yell(name = 'Silly Goose') { +function yell(name = 'Shania') { return `HEY ${name.toUpperCase()}`; } +// Functions call call other functions - here yell uses doctorize +const yellName = yell(doctorize('rosenrosen')); +// console.log(yellName); + const myBill4 = calculateBill(100, undefined, 0.2); -console.log(myBill4); +console.log(`Bill total 4 = ${myBill4}`); diff --git a/playground/custom-functions/index.html b/playground/custom-functions/index.html index 28cb63763..29284358e 100644 --- a/playground/custom-functions/index.html +++ b/playground/custom-functions/index.html @@ -1,16 +1,15 @@ + + + + + + - - - - - - - - - - - - + + + + + diff --git a/playground/custom-functions/ways-to-make-a-function.js b/playground/custom-functions/ways-to-make-a-function.js index f189e137c..794436ab1 100644 --- a/playground/custom-functions/ways-to-make-a-function.js +++ b/playground/custom-functions/ways-to-make-a-function.js @@ -1,78 +1,149 @@ -// function doctorize(firstName) { -// return `Dr. ${firstName}`; -// } +/* + * DIFFERENT WAYS TO WRITE FUNCTIONS + */ + +// Because functions like doctorize1 are hoisted I can call it before it is defined in the code +console.log(doctorize1('Shania')); + +/* + * Custom Functions + * How are these different from anonymous functions? + * JavaScript hoists these functions to the top, so they can be called anywhere in the code + * Even before they have been defined + */ +function doctorize1(firstName) { + return `Dr. ${firstName}`; +} -// Anon Function +// Anon Function (has no name) // function (firstName) { // return `Dr. ${firstName}`; // } -// Function Expression -// const doctorize = function(firstName) { -// return `Dr. ${firstName}`; -// }; +// Function Expression - anonymous function inside of a variable +// +const doctorize2 = function(firstName) { + return `Dr. ${firstName}`; +}; /* eslint-disable */ -const inchToCM = inches => inches * 2.54; -// function add(a, b = 3) { -// const total = a + b; -// return total; -// } +/* + * Arrow Functions (ES6) - these are anon functions + * More compact - fat arrow replaces function, return isn't needed + * Different scope + * + * function = '=>' + * If there's only one argument you don't need ( ) around them + */ + +// This right arrow function is the same as... +const inchesToCentimeters1 = inches => inches * 2.54; + +// ...This +function inchesToCentimeters2(inches) { + return inches * 2.54; +} -// const add = (a, b = 3) => a + b; +// ...Also this +function inchesToCentimeters3(inches) { + const cm = inches * 2.54; + return cm; +} + +console.log(inchesToCentimeters1(3)); +console.log(inchesToCentimeters2(3)); +console.log(inchesToCentimeters3(3)); -// returning an object -// function makeABaby(first, last) { -// const baby = { -// name: `${first} ${last}`, -// age: 0 -// } -// return baby; -// } -const makeABaby = (first, last) => ({ name: `${first} ${last}`, age: 0 }); +// Another example of an arrow function - this is the same as... +const add1 = (a, b = 3) => a + b; + +// This +function add2(a, b = 3) { + const total = a + b; + return total; +} +console.log(add1(1)); +console.log(add2(1)); -// IIFE -// Immediately Invoked Function Expression +/* + * HOW DO YOU RETURN AN OBJECT? + * This can be more concise, but this is easier to read + */ +function makeABaby1(first, last) { + const baby = { + name: `${first} ${last}`, + age: 0 + } + return baby; + +} + +// Return an object as an => function +// This is hard to read +const makeABaby2 = (first, last) => ({ name: `${first} ${last}`, age: 0 }); + +console.log(makeABaby1('Josie', 'Wallace')); +console.log(makeABaby2('Eddie', 'Wallace')); + + +/* + * IIFE + * These are invoked immediately because they are wrapped in ( ) + * Things wrapped in ( ) are run first + */ (function(age) { return `You are cool and age ${age}`; -})(10); +})(40); + -// Methods!!! +/* + * METHODS + * Functions that live inside of an object - ex. console.log + * log is a method - method is a function living inside of the object console. + */ const wes = { - name: 'Westopher Bos', + name: 'Josie Wallace', // Method! - sayHi: function() { + sayHello: function() { console.log(`Hey ${this.name}`); return 'Hey Wes'; }, - // Short hand Method - yellHi() { - console.log('HEY WESSSSS'); + // Short hand Method (most common way) + yellHello() { + console.log('HEY JOSIE'); }, // Arrow function - wisperHi: () => { - console.log('hii wesss im a mouse'); + whisperHello: () => { + console.log('hii josie I\'m a mouse'); } } -// Callback Functions -// Click Callback + +/* + * CALLBACK FUNCTIONS + * Run a function when something is done - ex. after a button is clicked + */ const button = document.querySelector('.clickMe'); +// Callback function option 1 function handleClick() { - console.log('Great Clicking!!'); + console.log('Nice job clicking, I\'m proud of you!'); } +// Callback function option 2 button.addEventListener('click', function() { - console.log('NIce Job!!!'); + console.log('Nice job clicking!'); }); -// Timer Callback -setTimeout(() => { - console.log('DONE! Time to eat!'); -}, 1000); + +/* + * TIMER CALLBACK + */ +setTimeout(function() { + console.log('Done! Time to eat!'); +}, 1000); \ No newline at end of file diff --git a/playground/functions.html b/playground/functions.html index a0a4b39ee..4c159e067 100644 --- a/playground/functions.html +++ b/playground/functions.html @@ -1,75 +1,118 @@ + + + + Functions!! + + - - - - Functions!! - - - - -

    Hey How ya doin?

    -

    Lorem ipsum dolor sit amet consectetur adipisicing elit. Doloribus, in? Labore ipsa earum aliquid esse amet! Quasi - necessitatibus soluta optio modi consectetur velit magni dolorem at blanditiis aut, et iste eum minima quo quis enim - tempore quod, alias sapiente magnam totam? Dolorum vitae reiciendis, quisquam repudiandae voluptatibus sapiente illo - molestiae doloremque magnam, repellendus beatae veritatis, sequi laborum! Perspiciatis numquam quisquam officia - ratione harum totam magnam velit unde architecto, consectetur necessitatibus amet voluptatem placeat? Commodi - aperiam, magnam architecto quidem blanditiis dolorem consequatur autem numquam repellat, omnis, aspernatur unde - minus officiis doloribus rerum dicta ex. Enim repudiandae, labore non et, aperiam totam veritatis nostrum a quos - incidunt animi voluptatum! Provident eaque natus eligendi nihil asperiores unde aliquid dignissimos tenetur maxime - quisquam veniam officiis, ducimus cumque impedit voluptas. Velit iste ratione corrupti blanditiis eos vitae soluta - perspiciatis iusto eaque explicabo amet id impedit atque numquam reprehenderit veritatis totam dolor dolores maiores - libero, nemo magni, et esse excepturi. Cupiditate nisi quae amet voluptas, esse sequi corporis! Numquam, nemo quae - accusamus unde enim laborum aspernatur at magni quo ad recusandae placeat nostrum tenetur eos, dolor dolorem - consequatur sequi quasi facere possimus autem nam repudiandae porro totam. Deleniti perferendis officiis vel - inventore ad laborum, repellat et nostrum laboriosam consequuntur ab recusandae magni iure hic, quo quia corporis id - laudantium, veniam blanditiis tempora minima? Laboriosam voluptas rerum, tempore officia ab modi natus vero enim - quae culpa, doloremque nostrum consequuntur quod pariatur, beatae facilis eaque cupiditate perspiciatis aut laborum - accusantium voluptate omnis? Mollitia et illum odit, earum voluptatibus quisquam totam nisi enim beatae cupiditate - quia harum dolores esse sapiente? Facere eligendi omnis magni voluptate quae, doloribus accusantium dolorem? - Officiis perferendis, necessitatibus voluptatum illum aut pariatur eum nobis ea consequuntur repudiandae nam vitae - numquam? Mollitia nulla suscipit totam asperiores labore eius impedit in amet tenetur accusamus accusantium, - obcaecati assumenda quibusdam temporibus odit molestias voluptatum veritatis. Nobis similique fugit error illum - dolorem laudantium, dolores sint ad ab nostrum, hic doloribus in tempore quaerat dolore! Perspiciatis suscipit, nisi - doloribus incidunt obcaecati, a veritatis assumenda ipsum tempore temporibus maiores quas fugiat distinctio corrupti - quasi accusamus. In nesciunt, repellat magnam illo quos, quo dicta dolorem consequuntur perspiciatis maiores dolorum - porro nobis excepturi temporibus. Vitae, minus placeat ex molestias consectetur eligendi atque. Veritatis doloribus - delectus, corporis, necessitatibus ab nulla repellendus illo dolor nemo incidunt dolorum aut rerum vero quis totam - odit, libero nesciunt reprehenderit hic. Recusandae animi unde blanditiis commodi est voluptates pariatur, debitis - quisquam aspernatur inventore vitae dolorum ad asperiores odio molestiae, tempora esse facilis, veniam architecto - exercitationem! Quas, suscipit optio asperiores, aliquam ut in unde porro atque est, perferendis labore? Hic - nesciunt, recusandae nemo fugiat sit, voluptas explicabo necessitatibus animi aut tempora fuga distinctio adipisci - laudantium? Quia exercitationem iure laborum rerum numquam voluptates quam, aliquam vitae? Saepe, adipisci iste! - Illo natus, nihil nisi architecto saepe reprehenderit quo repudiandae quos odit quis! Quidem nesciunt incidunt nihil - totam! Impedit fuga eum quasi vel totam dolorem praesentium iure eveniet neque aliquam veritatis voluptas corporis - cupiditate quam pariatur ea labore repellendus, ipsam in facere eligendi nihil!

    - -

    Lorem ipsum dolor, sit amet consectetur adipisicing elit. Impedit porro maxime culpa nostrum reiciendis quasi rem - sint ipsa rerum officiis sequi repellat voluptate iure, voluptatem corporis laborum fuga ratione voluptatum corrupti - ut! Quibusdam laboriosam soluta quaerat totam dolor numquam iste sunt, necessitatibus rerum animi sit maiores - consequuntur deleniti quas officia recusandae repellendus voluptas nesciunt in amet facilis molestias tempore! - Deserunt, ipsum facere quis minima quidem voluptate doloremque excepturi labore quam laboriosam blanditiis rem - itaque! Quod sint dolores rem ea, voluptatibus nulla sequi omnis cumque est voluptatem aut maxime aliquam, ratione - at corrupti libero ipsum? Deleniti tempora sapiente maxime? Ex excepturi repudiandae libero animi illo corrupti, - tenetur beatae enim tempore repellat delectus cumque necessitatibus eaque. Exercitationem, doloribus id non modi - saepe illo! Enim dicta in eligendi! Veritatis, ex exercitationem saepe hic recusandae placeat eum odit numquam, - eaque ab totam unde ipsa sequi! Velit libero autem dolore quaerat ut nam exercitationem pariatur iusto voluptatem - magni voluptas architecto, cumque quisquam deserunt quidem accusamus assumenda dolores neque aspernatur nostrum! - Minus corrupti hic asperiores! At fuga, eveniet animi labore praesentium beatae eum libero possimus velit aspernatur - voluptatem dolore expedita corporis ratione inventore! Possimus quisquam amet fugit, vero delectus modi libero illum - odio illo deleniti iste?

    -

    Lorem, ipsum dolor sit amet consectetur adipisicing elit. Blanditiis similique fuga odio, obcaecati ex esse - perferendis voluptatum doloribus dolorem facilis numquam incidunt illum quasi nemo, inventore ut voluptate eligendi - saepe! Id omnis ea ducimus exercitationem qui blanditiis optio tenetur in soluta molestias ullam sed beatae - aspernatur nobis libero atque, dolore nihil nesciunt, fugiat reprehenderit repellendus odit aperiam corrupti rem! - Aliquam nisi labore maiores et unde. Quasi expedita molestiae ex quod culpa. Voluptates omnis minus adipisci - voluptatibus odit nobis earum harum architecto maiores veniam, libero rem et quos dolores illum hic. Nobis - blanditiis odio dolores reprehenderit ipsum. Deleniti aliquam maxime culpa?

    - - + +

    Hey Sailor!

    +

    + Spring 1936. In the thick jungle of the South American continent, a renowned + archeologist and expert on the occult is studying fragments of a map, when one of his + exploration party pulls a gun. The archeologist pulls out a bullwhip and with such + disarms the turncoat, sending him running - thus does Dr. Henry "Indiana" Jones stay + alive. He and a guide enter a dank and oppressively vast cave that contains several + traps created by the ancient race which hid inside a famous handheld statue; Indy barely + escapes such traps but is cornered by native tribesmen served by Belloq, an old enemy + who arrogantly makes off with the statue, while Indy must flee for his life and escape + on a friend's seaplane. Back in the US two agents from US Army intelligence tell him of + Nazi German activities in archeology, including a gigantic excavation site in Egypt - a + site that an intercepted cable indicates to Indy is the location of the Ark of the + Covenant, the powerful chest bearing the Ten Commandments, that the Nazis can use to + obliterate any enemy. Indy must recruit a former girlfriend (the daughter of his old + professor) and an old chum in Cairo to infiltrate the Nazi site and make off with the + Ark, but along the way Indy gets involved in a series of fights, chases, and traps, + before the Nazis learn the full power of the Ark. +

    +

    + Indy must recruit a former girlfriend (the daughter of his old professor) and an old + chum in Cairo to infiltrate the Nazi site and make off with the Ark, but along the way + Indy gets involved in a series of fights, chases, and traps, before the Nazis learn the + full power of the Ark. +

    +

    + Spring 1936. In the thick jungle of the South American continent, a renowned + archeologist and expert on the occult is studying fragments of a map, when one of his + exploration party pulls a gun. The archeologist pulls out a bullwhip and with such + disarms the turncoat, sending him running - thus does Dr. Henry "Indiana" Jones stay + alive. He and a guide enter a dank and oppressively vast cave that contains several + traps created by the ancient race which hid inside a famous handheld statue; Indy barely + escapes such traps but is cornered by native tribesmen served by Belloq, an old enemy + who arrogantly makes off with the statue, while Indy must flee for his life and escape + on a friend's seaplane. Back in the US two agents from US Army intelligence tell him of + Nazi German activities in archeology, including a gigantic excavation site in Egypt - a + site that an intercepted cable indicates to Indy is the location of the Ark of the + Covenant, the powerful chest bearing the Ten Commandments, that the Nazis can use to + obliterate any enemy. Indy must recruit a former girlfriend (the daughter of his old + professor) and an old chum in Cairo to infiltrate the Nazi site and make off with the + Ark, but along the way Indy gets involved in a series of fights, chases, and traps, + before the Nazis learn the full power of the Ark. Back in the US two agents from US Army + intelligence tell him of Nazi German activities in archeology, including a gigantic + excavation site in Egypt - a site that an intercepted cable indicates to Indy is the + location of the Ark of the Covenant, the powerful chest bearing the Ten Commandments, + that the Nazis can use to obliterate any enemy. Indy must recruit a former girlfriend + (the daughter of his old professor) and an old chum in Cairo to infiltrate the Nazi site + and make off with the Ark, but along the way Indy gets involved in a series of fights, + chases, and traps, before the Nazis learn the full power of the Ark. +

    +

    + Spring 1936. In the thick jungle of the South American continent, a renowned + archeologist and expert on the occult is studying fragments of a map, when one of his + exploration party pulls a gun. The archeologist pulls out a bullwhip and with such + disarms the turncoat, sending him running - thus does Dr. Henry "Indiana" Jones stay + alive. He and a guide enter a dank and oppressively vast cave that contains several + traps created by the ancient race which hid inside a famous handheld statue; Indy barely + escapes such traps but is cornered by native tribesmen served by Belloq, an old enemy + who arrogantly makes off with the statue, while Indy must flee for his life and escape + on a friend's seaplane. Back in the US two agents from US Army intelligence tell him of + Nazi German activities in archeology, including a gigantic excavation site in Egypt - a + site that an intercepted cable indicates to Indy is the location of the Ark of the + Covenant, the powerful chest bearing the Ten Commandments, that the Nazis can use to + obliterate any enemy. Indy must recruit a former girlfriend (the daughter of his old + professor) and an old chum in Cairo to infiltrate the Nazi site and make off with the + Ark, but along the way Indy gets involved in a series of fights, chases, and traps, + before the Nazis learn the full power of the Ark. +

    +

    + Indy must recruit a former girlfriend (the daughter of his old professor) and an old + chum in Cairo to infiltrate the Nazi site and make off with the Ark, but along the way + Indy gets involved in a series of fights, chases, and traps, before the Nazis learn the + full power of the Ark. +

    +

    + Spring 1936. In the thick jungle of the South American continent, a renowned + archeologist and expert on the occult is studying fragments of a map, when one of his + exploration party pulls a gun. The archeologist pulls out a bullwhip and with such + disarms the turncoat, sending him running - thus does Dr. Henry "Indiana" Jones stay + alive. He and a guide enter a dank and oppressively vast cave that contains several + traps created by the ancient race which hid inside a famous handheld statue; Indy barely + escapes such traps but is cornered by native tribesmen served by Belloq, an old enemy + who arrogantly makes off with the statue, while Indy must flee for his life and escape + on a friend's seaplane. Back in the US two agents from US Army intelligence tell him of + Nazi German activities in archeology, including a gigantic excavation site in Egypt - a + site that an intercepted cable indicates to Indy is the location of the Ark of the + Covenant, the powerful chest bearing the Ten Commandments, that the Nazis can use to + obliterate any enemy. Indy must recruit a former girlfriend (the daughter of his old + professor) and an old chum in Cairo to infiltrate the Nazi site and make off with the + Ark, but along the way Indy gets involved in a series of fights, chases, and traps, + before the Nazis learn the full power of the Ark. Back in the US two agents from US Army + intelligence tell him of Nazi German activities in archeology, including a gigantic + excavation site in Egypt - a site that an intercepted cable indicates to Indy is the + location of the Ark of the Covenant, the powerful chest bearing the Ten Commandments, + that the Nazis can use to obliterate any enemy. Indy must recruit a former girlfriend + (the daughter of his old professor) and an old chum in Cairo to infiltrate the Nazi site + and make off with the Ark, but along the way Indy gets involved in a series of fights, + chases, and traps, before the Nazis learn the full power of the Ark. +

    + + diff --git a/playground/hoisting.js b/playground/hoisting.js index 2f058bf23..541d11adc 100644 --- a/playground/hoisting.js +++ b/playground/hoisting.js @@ -1,15 +1,53 @@ -/* esline-disable */ +/* + * HOISTING + * + * Allows you to access functions and variables before they have been created + * The example below works because of hoisting + * When JavaScript compiles functions and variables are hoisted to the top of the script + * + * Variable declarations are hoisted to the top, but not the values - this is confusing + */ + +/* eslint-disable */ + +// Hoisting Functions +sayHello(); + +function sayHello() { + console.log('Ahoy'); + console.log(add(10, 42)); +} + +function add(a, b) { + return a + b; +} + +/* + * Hoisting Variables + * + * The example below will be undefined, the variable age will be hoisted to the top - NOT the value + */ let age; -console.log(age); -age = 10; +console.log(`Person age is ${age}`); + +/* + * Organization! A good use for hoisting + * + */ -/* What does this file do? */ -sayHi(); + // At the top of the file list the functions that are used + checkLogin(); + checkPermissions(); + checkModules(); + + function checkLogin() { + console.log('Checking log in'); +} -/* How does this file do it? */ -function sayHi() { - console.log('hey!'); - console.log(add(10, 2)); +function checkPermissions() { + console.log('Checking permissions'); } -const add = (a, b) => a + b; +function checkModules() { + console.log('Check what modiles are used'); +} \ No newline at end of file diff --git a/playground/node-example.js b/playground/node-example.js index 525307168..ac6c416be 100644 --- a/playground/node-example.js +++ b/playground/node-example.js @@ -1 +1 @@ -console.log('IM from node'); +console.log('I am a console log from Node'); \ No newline at end of file diff --git a/playground/running-js.html b/playground/running-js.html index 99ffb7d72..fddcb2943 100644 --- a/playground/running-js.html +++ b/playground/running-js.html @@ -1,15 +1,19 @@ - - - - Document + + + Running JS + - -

    Hey

    +

    Spring 1936. In the thick jungle of the South American continent, a renowned archeologist and expert on the occult is studying fragments of a map, when one of his exploration party pulls a gun. The archeologist pulls out a bullwhip and with such disarms the turncoat, sending him running - thus does Dr. Henry "Indiana" Jones stay alive. He and a guide enter a dank and oppressively vast cave that contains several traps created by the ancient race which hid inside a famous handheld statue; Indy barely escapes such traps but is cornered by native tribesmen served by Belloq, an old enemy who arrogantly makes off with the statue, while Indy must flee for his life and escape on a friend's seaplane.

    +

    Back in the US two agents from US Army intelligence tell him of Nazi German activities in archeology, including a gigantic excavation site in Egypt - a site that an intercepted cable indicates to Indy is the location of the Ark of the Covenant, the powerful chest bearing the Ten Commandments, that the Nazis can use to obliterate any enemy.

    + + - - + \ No newline at end of file diff --git a/playground/scope.js b/playground/scope.js index c59d64532..a2bfb2ede 100644 --- a/playground/scope.js +++ b/playground/scope.js @@ -1,50 +1,97 @@ -// const age = 100; +/* + * BEST PRACTICES + * + * Limit use of global variables + * Use unique, descriptive names + */ -// function go() { -// const myAge = 200; -// const hair = 'blonde'; -// console.log(age); -// console.log(myAge); -// console.log(hair); -// } +/* eslint-disable */ + +/* + * Global Variables + * + * Can be accessed everywhere + * Use sparingly, they can cause issues with variables with the same name + */ + +// not attached to window +const firstName = 'Josie'; + +// not attached to window +let lastName = 'Wallace'; + +// IS attached to window - ex. window.age +// Be careful with var, they are NOT block scoped +var age = 6; + +/* + * Variables in functions are NOT available outside the function + * Variables can only be accessed in a function if they are returned + */ +function go() { + const hairColor = 'brown'; + const eyeColor = 'blue'; +} // go(); -/* eslint-disable*/ -// function isCool(name) { -// if (name === 'wes') { -// var cool = true; -// } -// console.log(cool); -// return cool; -// } +/* + * Block scoped variables + * + * How do you access a variable inside { block }? + * Declare it outside, then set it inside the block + * Nice because these keep variables from leaking into other code + */ +let cool; +if (1 === 1) { + cool = true; +} -// for(let i = 0; i < 10; i++) { -// console.log(i); -// } +console.log(cool); +/* + * Function scoped variable + * This is a solid example - this will be the pattern used most often + * Best practice - access allow declare it before and return it + */ +function allowAccess(name) { + let allow; + if (name === 'admin') { + allow = true; + } + console.log(allow); + return allow; +} -const dog = 'snickers'; +/* + * Scope Lookup + * JavaScript - Lexical or static scope + * JS looks at where functions are defined, not run + */ +const dog = 'Josie'; function logDog(dog) { console.log(dog); } -function go() { - const dog = 'sunny'; - logDog('sunny'); +function getDogName() { + const dog = 'Eddie'; + logDog('Jackson Colt'); } -go(); +getDogName(); -function yell() { - console.log(name.toUpperCase()) -} -function sayHi(name) { +/* + * Function Scoping - functions inside of a parent will only be accessible to the parent + * That is an example of a closure + */ +function sayHello(name) { + function yell() { + console.log(name.toUpperCase()) + } yell(); } - -yell(); +yell(); \ No newline at end of file diff --git a/playground/some.js b/playground/some.js index 873d3fc81..015b447eb 100644 --- a/playground/some.js +++ b/playground/some.js @@ -1,5 +1,3 @@ -const p = document.querySelector('p'); -console.log('im in another file'); - -const age = 100; -console.log(p, age); +const pExternal = document.querySelector('p'); +console.log(pExternal); +console.log('I am a console log in another file.'); diff --git a/playground/types.js b/playground/types.js index 0551889bf..19e2e8c3b 100644 --- a/playground/types.js +++ b/playground/types.js @@ -1,26 +1,50 @@ /* eslint-disable */ + + + /* -const name = 'wes'; -const middle = "topher"; -const last = `bos`; + * STRINGS + * + */ + +console.log('I am a string, and can be surrounded by single quotes, double quotes and backticks'); + +// Strings can be surrounded with single quotes, double quotes and backticks +const firstName = 'Josie'; +const middleName = "The Brownie"; +const lastName = `Wallace`; +const fullName = `${firstName} ${middleName} ${lastName}`; +const greeting = `hello my name is ${fullName}`; + +// Concatenate strings together +console.log(firstName + ' ' + middleName + ' ' + lastName); + +// Using backticks is easier for concatenating +console.log(`${greeting}`) -const sentence = "shes's so \"cool\""; -const sentence2 = `shes's so "cool"`; +// This is why single quotes can be a pain in the ass, you have to escape apostrophes +const sentence1 = 'she\'s so cool'; -const song = `Ohhh +// This is easier and works +const sentence2 = "she's so cool"; -ya +// Using backticks is the easiest way to do this - backticks are rare and can be escaped +const sentence3 = `she's so cool`; + +// Use backticks for multistring lines - without backticks you have to use forward slashes for new lines +const song = `Ohh + +yeah I like -pizza`; -const hello = 'hello my name is ' + name + ". Nice to meet you"; +pizza`; -let hello2 = 'hello my name is '; -hello2 = hello2 + name; -hello2 = hello2 + ' Nice to meet you'; +// Practical Example +const name = `Rutheford`; -const hello = `hello my name is ${name}. Nice to meet you. I am ${1 + 100} years old`; +// Interpolate - if you use backticks you can easily add a variable or statement with ${variableName} +const hello = `Hello my name is ${name}. Nice to meet you. I am ${1 + 39} years old`; const html = `
    @@ -31,44 +55,75 @@ const html = ` document.body.innerHTML = html; -*/ -// const age = 100.5; -// const name = 'wes'; -// const a = 10; -// const b = 20; /* + * NUMBERS + * + */ + +const personAge = 100.5; +const personName = 'wes'; + +const a = 10; +const b = 20; + +// Helper methods +const round1 = Math.round(20.65); +const round2 = Math.round(1.17); +const floor1 = Math.floor(personAge); +const floor2 = Math.floor(20.99999999999999); +const ceil1 = Math.floor(20.99999999999999); +const random = Math.random(); // get a random number between 0 and 1 + +// Modulo operator % - gives you a remainder const smarties = 20; const kids = 3; const eachKidGets = Math.floor(smarties / kids); const dadGets = smarties % kids; console.log(`Each kids gets ${eachKidGets}`); +console.log(`Dad gets ${dadGets}`); + +// Floating point math - computers navtively use integers +const price = 1034 // use cents to store prices so you can work in whole numbers + +// Powers +const age1 = (10 ** 4); +const age2 = (1000 ** 200) // Large numbers that can't be calculated will return as Infinity + +console.log(age2); -const price = 1034; -*/ /* + * OBJECTS + * + */ const person = { - first: 'wes', - last: 'bos', - age: 100 + first: 'Josie', + last: 'Wallace', + age: 6 }; -let dog; -console.log(dog); -dog = 'snickers'; +/* + * UNDEFINED AND NULL + * + */ +let dog; +console.log(dog); // variable has been created but is has no value so it is undefined +dog = 'Josie'; let somethingUndefined; const somethingNull = null; +// Cher has no last name, which is undefined const cher = { first: 'cher' }; +// Teller changed his first name to his last name, it did have a value and then was changed to nothing (null) const teller = { first: 'Raymond', last: 'Teller' @@ -77,12 +132,23 @@ const teller = { teller.first = 'Teller'; teller.last = null; -*/ -let isDrawing = false; -let age = 18; -const ofAge = age > 19; -console.log(ofAge); -age = 100; -let age2 = 100; +/* + * BOOLEANS + * + */ +const userAge1 = 18; +const ageVerification = userAge1 > 21; +console.log(`Age verfication pass ${ageVerification}`); + +let userAge2 = 18; + +// TRIPLE EQUALS - checks for VALUE and TYPE +/* +10 === 10 (true) +"10" === 10 (false) + +// DOUBLE EQUALS - checks just VALUE +"10" == 10 (true) +*/ \ No newline at end of file diff --git a/playground/variables.html b/playground/variables.html index 3426fbb6b..afc1b78ce 100644 --- a/playground/variables.html +++ b/playground/variables.html @@ -4,29 +4,42 @@ - Variables! + Fun with Variables! diff --git a/readme.md b/readme.md index 0cb9e57af..62e51f8d8 100644 --- a/readme.md +++ b/readme.md @@ -6,3 +6,34 @@ These are the starter files and solutions to the [Beginner JavaScript](https://B More to come... + +## Notes + +### VS Code + +1. Open the command palette with `⌘` or `Ctrl` + `P` +2. Type `>configure user snippets` and run the found command +3. Select `html.json` from the list +4. Paste the contents of `htmlbase.json` into the `{ }` of the file + +*** + +### Firefox + +- Open devtools - command + shift + c +- Open console - command + shift + j + +*** + +### Terminal + +- ls -l (list all directories) +- pwd (tells us where we are) +- cd .. (go up a level) + +*** + +### Node + +- control c (go back to command line) +- command k (clear out console) \ No newline at end of file diff --git a/snippets/README.md b/snippets/README.md index bc6b13114..40c789706 100644 --- a/snippets/README.md +++ b/snippets/README.md @@ -4,11 +4,4 @@ This is the base HTML I use for many of the playground and exercises. I've included it as straight html for you to copy+paste, or as a VS Code snippet as well. -Please PR this repo adding in other editor snippets as well. - -## VS Code - -1. Open the command palette with `⌘` or `Ctrl` + `P` -2. Type `>configure user snippets` and run the found command -3. Select `html.json` from the list -4. Paste the contents of `htmlbase.json` into the `{ }` of the file +Please PR this repo adding in other editor snippets as well. \ No newline at end of file diff --git a/snippets/htmlbase.html b/snippets/htmlbase.html index f2d08c0e6..e7afd4139 100644 --- a/snippets/htmlbase.html +++ b/snippets/htmlbase.html @@ -1,15 +1,12 @@ - - - - HTML Base - + + + + - - - + \ No newline at end of file