Skip to content

Commit

Permalink
add minification
Browse files Browse the repository at this point in the history
  • Loading branch information
JoeHart committed Jun 17, 2020
1 parent c762651 commit b5bf276
Show file tree
Hide file tree
Showing 4 changed files with 203 additions and 14 deletions.
2 changes: 1 addition & 1 deletion .babelrc
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"env": {
"build": {
"presets": ["@babel/preset-env"],
"presets": ["minify"],
"plugins": ["@babel/transform-flow-strip-types"],
"ignore": ["**/*.test.js"]
},
Expand Down
13 changes: 1 addition & 12 deletions lib/index.js
Original file line number Diff line number Diff line change
@@ -1,12 +1 @@
"use strict";

Object.defineProperty(exports, "__esModule", {
value: true
});
exports["default"] = filterNulls;

function filterNulls(array) {
return array.filter(function (item) {
return item != null;
}).filter(Boolean);
}
export default function filterNulls(a){return a.filter(a=>null!=a).filter(Boolean)}
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
"@babel/preset-env": "^7.10.2",
"babel-jest": "^26.0.1",
"babel-preset-es2015": "^6.24.1",
"babel-preset-minify": "^0.5.1",
"flow-bin": "^0.127.0",
"flow-copy-source": "^2.0.9",
"flow-typed": "^3.1.0",
Expand Down
201 changes: 200 additions & 1 deletion yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -1491,6 +1491,16 @@ babel-helper-define-map@^6.24.1:
babel-types "^6.26.0"
lodash "^4.17.4"

babel-helper-evaluate-path@^0.5.0:
version "0.5.0"
resolved "https://registry.yarnpkg.com/babel-helper-evaluate-path/-/babel-helper-evaluate-path-0.5.0.tgz#a62fa9c4e64ff7ea5cea9353174ef023a900a67c"
integrity sha512-mUh0UhS607bGh5wUMAQfOpt2JX2ThXMtppHRdRU1kL7ZLRWIXxoV2UIV1r2cAeeNeU1M5SB5/RSUgUxrK8yOkA==

babel-helper-flip-expressions@^0.4.3:
version "0.4.3"
resolved "https://registry.yarnpkg.com/babel-helper-flip-expressions/-/babel-helper-flip-expressions-0.4.3.tgz#3696736a128ac18bc25254b5f40a22ceb3c1d3fd"
integrity sha1-NpZzahKKwYvCUlS19AoizrPB0/0=

babel-helper-function-name@^6.24.1:
version "6.24.1"
resolved "https://registry.yarnpkg.com/babel-helper-function-name/-/babel-helper-function-name-6.24.1.tgz#d3475b8c03ed98242a25b48351ab18399d3580a9"
Expand Down Expand Up @@ -1518,6 +1528,21 @@ babel-helper-hoist-variables@^6.24.1:
babel-runtime "^6.22.0"
babel-types "^6.24.1"

babel-helper-is-nodes-equiv@^0.0.1:
version "0.0.1"
resolved "https://registry.yarnpkg.com/babel-helper-is-nodes-equiv/-/babel-helper-is-nodes-equiv-0.0.1.tgz#34e9b300b1479ddd98ec77ea0bbe9342dfe39684"
integrity sha1-NOmzALFHnd2Y7HfqC76TQt/jloQ=

babel-helper-is-void-0@^0.4.3:
version "0.4.3"
resolved "https://registry.yarnpkg.com/babel-helper-is-void-0/-/babel-helper-is-void-0-0.4.3.tgz#7d9c01b4561e7b95dbda0f6eee48f5b60e67313e"
integrity sha1-fZwBtFYee5Xb2g9u7kj1tg5nMT4=

babel-helper-mark-eval-scopes@^0.4.3:
version "0.4.3"
resolved "https://registry.yarnpkg.com/babel-helper-mark-eval-scopes/-/babel-helper-mark-eval-scopes-0.4.3.tgz#d244a3bef9844872603ffb46e22ce8acdf551562"
integrity sha1-0kSjvvmESHJgP/tG4izorN9VFWI=

babel-helper-optimise-call-expression@^6.24.1:
version "6.24.1"
resolved "https://registry.yarnpkg.com/babel-helper-optimise-call-expression/-/babel-helper-optimise-call-expression-6.24.1.tgz#f7a13427ba9f73f8f4fa993c54a97882d1244257"
Expand All @@ -1535,6 +1560,11 @@ babel-helper-regex@^6.24.1:
babel-types "^6.26.0"
lodash "^4.17.4"

babel-helper-remove-or-void@^0.4.3:
version "0.4.3"
resolved "https://registry.yarnpkg.com/babel-helper-remove-or-void/-/babel-helper-remove-or-void-0.4.3.tgz#a4f03b40077a0ffe88e45d07010dee241ff5ae60"
integrity sha1-pPA7QAd6D/6I5F0HAQ3uJB/1rmA=

babel-helper-replace-supers@^6.24.1:
version "6.24.1"
resolved "https://registry.yarnpkg.com/babel-helper-replace-supers/-/babel-helper-replace-supers-6.24.1.tgz#bf6dbfe43938d17369a213ca8a8bf74b6a90ab1a"
Expand All @@ -1547,6 +1577,11 @@ babel-helper-replace-supers@^6.24.1:
babel-traverse "^6.24.1"
babel-types "^6.24.1"

babel-helper-to-multiple-sequence-expressions@^0.5.0:
version "0.5.0"
resolved "https://registry.yarnpkg.com/babel-helper-to-multiple-sequence-expressions/-/babel-helper-to-multiple-sequence-expressions-0.5.0.tgz#a3f924e3561882d42fcf48907aa98f7979a4588d"
integrity sha512-m2CvfDW4+1qfDdsrtf4dwOslQC3yhbgyBFptncp4wvtdrDHqueW7slsYv4gArie056phvQFhT2nRcGS4bnm6mA==

babel-jest@^26.0.1:
version "26.0.1"
resolved "https://registry.yarnpkg.com/babel-jest/-/babel-jest-26.0.1.tgz#450139ce4b6c17174b136425bda91885c397bc46"
Expand Down Expand Up @@ -1602,6 +1637,82 @@ babel-plugin-jest-hoist@^26.0.0:
"@babel/types" "^7.3.3"
"@types/babel__traverse" "^7.0.6"

babel-plugin-minify-builtins@^0.5.0:
version "0.5.0"
resolved "https://registry.yarnpkg.com/babel-plugin-minify-builtins/-/babel-plugin-minify-builtins-0.5.0.tgz#31eb82ed1a0d0efdc31312f93b6e4741ce82c36b"
integrity sha512-wpqbN7Ov5hsNwGdzuzvFcjgRlzbIeVv1gMIlICbPj0xkexnfoIDe7q+AZHMkQmAE/F9R5jkrB6TLfTegImlXag==

babel-plugin-minify-constant-folding@^0.5.0:
version "0.5.0"
resolved "https://registry.yarnpkg.com/babel-plugin-minify-constant-folding/-/babel-plugin-minify-constant-folding-0.5.0.tgz#f84bc8dbf6a561e5e350ff95ae216b0ad5515b6e"
integrity sha512-Vj97CTn/lE9hR1D+jKUeHfNy+m1baNiJ1wJvoGyOBUx7F7kJqDZxr9nCHjO/Ad+irbR3HzR6jABpSSA29QsrXQ==
dependencies:
babel-helper-evaluate-path "^0.5.0"

babel-plugin-minify-dead-code-elimination@^0.5.1:
version "0.5.1"
resolved "https://registry.yarnpkg.com/babel-plugin-minify-dead-code-elimination/-/babel-plugin-minify-dead-code-elimination-0.5.1.tgz#1a0c68e44be30de4976ca69ffc535e08be13683f"
integrity sha512-x8OJOZIrRmQBcSqxBcLbMIK8uPmTvNWPXH2bh5MDCW1latEqYiRMuUkPImKcfpo59pTUB2FT7HfcgtG8ZlR5Qg==
dependencies:
babel-helper-evaluate-path "^0.5.0"
babel-helper-mark-eval-scopes "^0.4.3"
babel-helper-remove-or-void "^0.4.3"
lodash "^4.17.11"

babel-plugin-minify-flip-comparisons@^0.4.3:
version "0.4.3"
resolved "https://registry.yarnpkg.com/babel-plugin-minify-flip-comparisons/-/babel-plugin-minify-flip-comparisons-0.4.3.tgz#00ca870cb8f13b45c038b3c1ebc0f227293c965a"
integrity sha1-AMqHDLjxO0XAOLPB68DyJyk8llo=
dependencies:
babel-helper-is-void-0 "^0.4.3"

babel-plugin-minify-guarded-expressions@^0.4.4:
version "0.4.4"
resolved "https://registry.yarnpkg.com/babel-plugin-minify-guarded-expressions/-/babel-plugin-minify-guarded-expressions-0.4.4.tgz#818960f64cc08aee9d6c75bec6da974c4d621135"
integrity sha512-RMv0tM72YuPPfLT9QLr3ix9nwUIq+sHT6z8Iu3sLbqldzC1Dls8DPCywzUIzkTx9Zh1hWX4q/m9BPoPed9GOfA==
dependencies:
babel-helper-evaluate-path "^0.5.0"
babel-helper-flip-expressions "^0.4.3"

babel-plugin-minify-infinity@^0.4.3:
version "0.4.3"
resolved "https://registry.yarnpkg.com/babel-plugin-minify-infinity/-/babel-plugin-minify-infinity-0.4.3.tgz#dfb876a1b08a06576384ef3f92e653ba607b39ca"
integrity sha1-37h2obCKBldjhO8/kuZTumB7Oco=

babel-plugin-minify-mangle-names@^0.5.0:
version "0.5.0"
resolved "https://registry.yarnpkg.com/babel-plugin-minify-mangle-names/-/babel-plugin-minify-mangle-names-0.5.0.tgz#bcddb507c91d2c99e138bd6b17a19c3c271e3fd3"
integrity sha512-3jdNv6hCAw6fsX1p2wBGPfWuK69sfOjfd3zjUXkbq8McbohWy23tpXfy5RnToYWggvqzuMOwlId1PhyHOfgnGw==
dependencies:
babel-helper-mark-eval-scopes "^0.4.3"

babel-plugin-minify-numeric-literals@^0.4.3:
version "0.4.3"
resolved "https://registry.yarnpkg.com/babel-plugin-minify-numeric-literals/-/babel-plugin-minify-numeric-literals-0.4.3.tgz#8e4fd561c79f7801286ff60e8c5fd9deee93c0bc"
integrity sha1-jk/VYcefeAEob/YOjF/Z3u6TwLw=

babel-plugin-minify-replace@^0.5.0:
version "0.5.0"
resolved "https://registry.yarnpkg.com/babel-plugin-minify-replace/-/babel-plugin-minify-replace-0.5.0.tgz#d3e2c9946c9096c070efc96761ce288ec5c3f71c"
integrity sha512-aXZiaqWDNUbyNNNpWs/8NyST+oU7QTpK7J9zFEFSA0eOmtUNMU3fczlTTTlnCxHmq/jYNFEmkkSG3DDBtW3Y4Q==

babel-plugin-minify-simplify@^0.5.1:
version "0.5.1"
resolved "https://registry.yarnpkg.com/babel-plugin-minify-simplify/-/babel-plugin-minify-simplify-0.5.1.tgz#f21613c8b95af3450a2ca71502fdbd91793c8d6a"
integrity sha512-OSYDSnoCxP2cYDMk9gxNAed6uJDiDz65zgL6h8d3tm8qXIagWGMLWhqysT6DY3Vs7Fgq7YUDcjOomhVUb+xX6A==
dependencies:
babel-helper-evaluate-path "^0.5.0"
babel-helper-flip-expressions "^0.4.3"
babel-helper-is-nodes-equiv "^0.0.1"
babel-helper-to-multiple-sequence-expressions "^0.5.0"

babel-plugin-minify-type-constructors@^0.4.3:
version "0.4.3"
resolved "https://registry.yarnpkg.com/babel-plugin-minify-type-constructors/-/babel-plugin-minify-type-constructors-0.4.3.tgz#1bc6f15b87f7ab1085d42b330b717657a2156500"
integrity sha1-G8bxW4f3qxCF1CszC3F2V6IVZQA=
dependencies:
babel-helper-is-void-0 "^0.4.3"

babel-plugin-transform-es2015-arrow-functions@^6.22.0:
version "6.22.0"
resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-arrow-functions/-/babel-plugin-transform-es2015-arrow-functions-6.22.0.tgz#452692cb711d5f79dc7f85e440ce41b9f244d221"
Expand Down Expand Up @@ -1792,13 +1903,67 @@ babel-plugin-transform-es2015-unicode-regex@^6.24.1:
babel-runtime "^6.22.0"
regexpu-core "^2.0.0"

babel-plugin-transform-inline-consecutive-adds@^0.4.3:
version "0.4.3"
resolved "https://registry.yarnpkg.com/babel-plugin-transform-inline-consecutive-adds/-/babel-plugin-transform-inline-consecutive-adds-0.4.3.tgz#323d47a3ea63a83a7ac3c811ae8e6941faf2b0d1"
integrity sha1-Mj1Ho+pjqDp6w8gRro5pQfrysNE=

babel-plugin-transform-member-expression-literals@^6.9.4:
version "6.9.4"
resolved "https://registry.yarnpkg.com/babel-plugin-transform-member-expression-literals/-/babel-plugin-transform-member-expression-literals-6.9.4.tgz#37039c9a0c3313a39495faac2ff3a6b5b9d038bf"
integrity sha1-NwOcmgwzE6OUlfqsL/OmtbnQOL8=

babel-plugin-transform-merge-sibling-variables@^6.9.4:
version "6.9.4"
resolved "https://registry.yarnpkg.com/babel-plugin-transform-merge-sibling-variables/-/babel-plugin-transform-merge-sibling-variables-6.9.4.tgz#85b422fc3377b449c9d1cde44087203532401dae"
integrity sha1-hbQi/DN3tEnJ0c3kQIcgNTJAHa4=

babel-plugin-transform-minify-booleans@^6.9.4:
version "6.9.4"
resolved "https://registry.yarnpkg.com/babel-plugin-transform-minify-booleans/-/babel-plugin-transform-minify-booleans-6.9.4.tgz#acbb3e56a3555dd23928e4b582d285162dd2b198"
integrity sha1-rLs+VqNVXdI5KOS1gtKFFi3SsZg=

babel-plugin-transform-property-literals@^6.9.4:
version "6.9.4"
resolved "https://registry.yarnpkg.com/babel-plugin-transform-property-literals/-/babel-plugin-transform-property-literals-6.9.4.tgz#98c1d21e255736573f93ece54459f6ce24985d39"
integrity sha1-mMHSHiVXNlc/k+zlRFn2ziSYXTk=
dependencies:
esutils "^2.0.2"

babel-plugin-transform-regenerator@^6.24.1:
version "6.26.0"
resolved "https://registry.yarnpkg.com/babel-plugin-transform-regenerator/-/babel-plugin-transform-regenerator-6.26.0.tgz#e0703696fbde27f0a3efcacf8b4dca2f7b3a8f2f"
integrity sha1-4HA2lvveJ/Cj78rPi03KL3s6jy8=
dependencies:
regenerator-transform "^0.10.0"

babel-plugin-transform-regexp-constructors@^0.4.3:
version "0.4.3"
resolved "https://registry.yarnpkg.com/babel-plugin-transform-regexp-constructors/-/babel-plugin-transform-regexp-constructors-0.4.3.tgz#58b7775b63afcf33328fae9a5f88fbd4fb0b4965"
integrity sha1-WLd3W2OvzzMyj66aX4j71PsLSWU=

babel-plugin-transform-remove-console@^6.9.4:
version "6.9.4"
resolved "https://registry.yarnpkg.com/babel-plugin-transform-remove-console/-/babel-plugin-transform-remove-console-6.9.4.tgz#b980360c067384e24b357a588d807d3c83527780"
integrity sha1-uYA2DAZzhOJLNXpYjYB9PINSd4A=

babel-plugin-transform-remove-debugger@^6.9.4:
version "6.9.4"
resolved "https://registry.yarnpkg.com/babel-plugin-transform-remove-debugger/-/babel-plugin-transform-remove-debugger-6.9.4.tgz#42b727631c97978e1eb2d199a7aec84a18339ef2"
integrity sha1-QrcnYxyXl44estGZp67IShgznvI=

babel-plugin-transform-remove-undefined@^0.5.0:
version "0.5.0"
resolved "https://registry.yarnpkg.com/babel-plugin-transform-remove-undefined/-/babel-plugin-transform-remove-undefined-0.5.0.tgz#80208b31225766c630c97fa2d288952056ea22dd"
integrity sha512-+M7fJYFaEE/M9CXa0/IRkDbiV3wRELzA1kKQFCJ4ifhrzLKn/9VCCgj9OFmYWwBd8IB48YdgPkHYtbYq+4vtHQ==
dependencies:
babel-helper-evaluate-path "^0.5.0"

babel-plugin-transform-simplify-comparison-operators@^6.9.4:
version "6.9.4"
resolved "https://registry.yarnpkg.com/babel-plugin-transform-simplify-comparison-operators/-/babel-plugin-transform-simplify-comparison-operators-6.9.4.tgz#f62afe096cab0e1f68a2d753fdf283888471ceb9"
integrity sha1-9ir+CWyrDh9ootdT/fKDiIRxzrk=

babel-plugin-transform-strict-mode@^6.24.1:
version "6.24.1"
resolved "https://registry.yarnpkg.com/babel-plugin-transform-strict-mode/-/babel-plugin-transform-strict-mode-6.24.1.tgz#d5faf7aa578a65bbe591cf5edae04a0c67020758"
Expand All @@ -1807,6 +1972,11 @@ babel-plugin-transform-strict-mode@^6.24.1:
babel-runtime "^6.22.0"
babel-types "^6.24.1"

babel-plugin-transform-undefined-to-void@^6.9.4:
version "6.9.4"
resolved "https://registry.yarnpkg.com/babel-plugin-transform-undefined-to-void/-/babel-plugin-transform-undefined-to-void-6.9.4.tgz#be241ca81404030678b748717322b89d0c8fe280"
integrity sha1-viQcqBQEAwZ4t0hxcyK4nQyP4oA=

babel-preset-current-node-syntax@^0.1.2:
version "0.1.3"
resolved "https://registry.yarnpkg.com/babel-preset-current-node-syntax/-/babel-preset-current-node-syntax-0.1.3.tgz#b4b547acddbf963cba555ba9f9cbbb70bfd044da"
Expand Down Expand Up @@ -1862,6 +2032,35 @@ babel-preset-jest@^26.0.0:
babel-plugin-jest-hoist "^26.0.0"
babel-preset-current-node-syntax "^0.1.2"

babel-preset-minify@^0.5.1:
version "0.5.1"
resolved "https://registry.yarnpkg.com/babel-preset-minify/-/babel-preset-minify-0.5.1.tgz#25f5d0bce36ec818be80338d0e594106e21eaa9f"
integrity sha512-1IajDumYOAPYImkHbrKeiN5AKKP9iOmRoO2IPbIuVp0j2iuCcj0n7P260z38siKMZZ+85d3mJZdtW8IgOv+Tzg==
dependencies:
babel-plugin-minify-builtins "^0.5.0"
babel-plugin-minify-constant-folding "^0.5.0"
babel-plugin-minify-dead-code-elimination "^0.5.1"
babel-plugin-minify-flip-comparisons "^0.4.3"
babel-plugin-minify-guarded-expressions "^0.4.4"
babel-plugin-minify-infinity "^0.4.3"
babel-plugin-minify-mangle-names "^0.5.0"
babel-plugin-minify-numeric-literals "^0.4.3"
babel-plugin-minify-replace "^0.5.0"
babel-plugin-minify-simplify "^0.5.1"
babel-plugin-minify-type-constructors "^0.4.3"
babel-plugin-transform-inline-consecutive-adds "^0.4.3"
babel-plugin-transform-member-expression-literals "^6.9.4"
babel-plugin-transform-merge-sibling-variables "^6.9.4"
babel-plugin-transform-minify-booleans "^6.9.4"
babel-plugin-transform-property-literals "^6.9.4"
babel-plugin-transform-regexp-constructors "^0.4.3"
babel-plugin-transform-remove-console "^6.9.4"
babel-plugin-transform-remove-debugger "^6.9.4"
babel-plugin-transform-remove-undefined "^0.5.0"
babel-plugin-transform-simplify-comparison-operators "^6.9.4"
babel-plugin-transform-undefined-to-void "^6.9.4"
lodash "^4.17.11"

babel-runtime@^6.18.0, babel-runtime@^6.22.0, babel-runtime@^6.26.0:
version "6.26.0"
resolved "https://registry.yarnpkg.com/babel-runtime/-/babel-runtime-6.26.0.tgz#965c7058668e82b55d7bfe04ff2337bc8b5647fe"
Expand Down Expand Up @@ -3973,7 +4172,7 @@ lodash.uniq@^4.5.0:
resolved "https://registry.yarnpkg.com/lodash.uniq/-/lodash.uniq-4.5.0.tgz#d0225373aeb652adc1bc82e4945339a842754773"
integrity sha1-0CJTc662Uq3BvILklFM5qEJ1R3M=

lodash@^4.17.13, lodash@^4.17.14, lodash@^4.17.15, lodash@^4.17.4:
lodash@^4.17.11, lodash@^4.17.13, lodash@^4.17.14, lodash@^4.17.15, lodash@^4.17.4:
version "4.17.15"
resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.15.tgz#b447f6670a0455bbfeedd11392eff330ea097548"
integrity sha512-8xOcRHvCjnocdS5cpwXQXVzmmh5e5+saE2QGoeQmbKmRS6J3VQppPOIt0MnmE+4xlZoumy0GPG0D0MVIQbNA1A==
Expand Down

0 comments on commit b5bf276

Please sign in to comment.