Moved to https://gist.github.com/VitorLuizC/958361b6c218360e00f712499eb8160d.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const path = require('path'); | |
const ExtractTextPlugin = require('extract-text-webpack-plugin'); | |
module.exports = { | |
// ... | |
module: { | |
rules: [ | |
{ | |
test: /\.html$/, | |
use: ExtractTextPlugin.extract({ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Show hidden characters
{ | |
"presets": [ | |
[ | |
"env", | |
{ | |
"modules": false, | |
"browsers": ["IE >= 9", "> 1%"] | |
} | |
], | |
"stage-2" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Get all element's parent. | |
* @param {Element} element | |
* @returns {Element[]} | |
*/ | |
const getParents = (element) => { | |
const parent = element.parentElement; | |
const parents = parent ? [ parent, ...getParents(parent) ] : []; | |
return parents; | |
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<template> | |
<fieldset> | |
<div class="field"> | |
<label>Rua</label> | |
<input type="text" :value="data.street" @change="event => $emit('input', { street: street })" /> | |
</div> | |
... | |
</fieldset> | |
</template> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const divide = (...values) => { | |
divide.before(...values) | |
try { | |
const result = values.reduce((a, b) => a / b, 0) | |
divide.success(result, ...values) | |
divide.after(...values) | |
return result | |
} catch (error) { | |
divide.failure(error, ...values) | |
divide.after(...values) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* @typedef {function(T, number, T[]):boolean} Filter | |
* @template T | |
*/ | |
/** | |
* @param {T} value | |
* @returns {T} | |
* @template T | |
*/ |