Skip to content

Instantly share code, notes, and snippets.

View pnavarrc's full-sized avatar

Pablo Navarro pnavarrc

  • Act Now Coalition
  • Vancouver, Canada
  • 07:23 (UTC -07:00)
View GitHub Profile

Sep 22, 2020

From https://txdshs.maps.arcgis.com/apps/opsdashboard/index.html#/ed483ecd702b4298ab01e8b9cafc8b83

2,078 older case recently reported by labs were included in the statewide total but excluded from statewide and Bexar County new confirmed cases (103).

3 older cases recently reported by labs were included in the statewide total but excluded from statewide and Collin County new confirmed cases (42)

306 older case recently reported by labs were included in the statewide total but excluded from statewide and Dallas County new confirmed cases (465). >

const createMergeExpression = (a, b) =>
t.objectExpression([
t.spreadElement(a),
t.spreadElement(b)
]);
{
type: "ObjectExpression",
properties: [
{
type: "SpreadProperty",
argument: {
type: "Identifier",
name: "a"
}
},
const isUselessRamdaMerge = node =>
t.isCallExpression(node) &&
isRamdaMerge(node.callee) &&
node.arguments.length === 2;
const isRamdaMerge = node =>
t.isMemberExpression(node) &&
t.isIdentifier(node.object, { name: "R" }) &&
t.isIdentifier(node.property, { name: "merge" });
{
type: "CallExpression",
callee: {
type: "MemberExpression",
object: {
type: "Identifier",
name: "R"
},
property: {
type: "Identifier",
export default plugin(babel) {
return {
name: "plugin-name",
ArrowFunctionExpression(path) {
const { node } = path;
// transform the node here
}
}
}
// Out
{
type: "FunctionExpression",
params: [
{
type: "Identifier",
name: "n"
}
],
body: {
{
type: "VariableDeclaration",
declarators: [
{
type: "VariableDeclarator",
id: {
type: "Identifier",
name: "square"
},
init: {
@pnavarrc
pnavarrc / writing-a-babel-plugin-01.js
Last active July 11, 2019 15:21
writing-a-babel-plugin-1
// In
[1, 2, 3].map(n => n * n);
// Out
[1, 2, 3].map(function(n) { return n * n; });