diff --git a/snippet_data/archivedSnippets.json b/snippet_data/archivedSnippets.json index 36eada409..b333ac1e4 100644 --- a/snippet_data/archivedSnippets.json +++ b/snippet_data/archivedSnippets.json @@ -19,9 +19,10 @@ }, "meta": { "hash": "48d538bccbc7be7e78b8f6a69004055c4b21324d2c8d7cbc4cba0cd42e4f67fb", - "firstSeen": "", - "lastUpdated": "", - "updateCount": 1 + "firstSeen": "1567096638", + "lastUpdated": "1567096638", + "updateCount": 2, + "authorCount": 2 } }, { @@ -43,9 +44,10 @@ }, "meta": { "hash": "d59410c4fa0ea5173af553068c1e1d4ef931695e084c50cdd8166b0cd0278722", - "firstSeen": "", - "lastUpdated": "", - "updateCount": 1 + "firstSeen": "1567096638", + "lastUpdated": "1567096638", + "updateCount": 2, + "authorCount": 2 } }, { @@ -67,9 +69,10 @@ }, "meta": { "hash": "aaefc9bd6e9170001fe4754b1bc7bb9808ab97a5bec7fc6ceb1193be2f8009b1", - "firstSeen": "", - "lastUpdated": "", - "updateCount": 1 + "firstSeen": "1567096638", + "lastUpdated": "1567096638", + "updateCount": 2, + "authorCount": 2 } }, { @@ -91,9 +94,10 @@ }, "meta": { "hash": "0280a47e49f505d5f10e0e0bd2c3ab28a6ea2b931fc83f63155f8395f64a1840", - "firstSeen": "", - "lastUpdated": "", - "updateCount": 1 + "firstSeen": "1567096638", + "lastUpdated": "1567096638", + "updateCount": 2, + "authorCount": 2 } }, { @@ -115,9 +119,10 @@ }, "meta": { "hash": "961b406dfe98746e3a267532b0703ee7c5c1b1c01a0e04c1f9e13e0fd0aeced1", - "firstSeen": "", - "lastUpdated": "", - "updateCount": 1 + "firstSeen": "1567096638", + "lastUpdated": "1567096638", + "updateCount": 2, + "authorCount": 2 } }, { @@ -139,9 +144,10 @@ }, "meta": { "hash": "8eed39b1040d6472e2fd619abf744848d30f12eebffda2711966c616d474524f", - "firstSeen": "", - "lastUpdated": "", - "updateCount": 1 + "firstSeen": "1567096638", + "lastUpdated": "1567096638", + "updateCount": 2, + "authorCount": 2 } }, { @@ -163,9 +169,10 @@ }, "meta": { "hash": "a39ade2ae05ad86443446b335dbc019e3ac734fe0c1a542d50b929c554040fc0", - "firstSeen": "", - "lastUpdated": "", - "updateCount": 1 + "firstSeen": "1567096638", + "lastUpdated": "1567096638", + "updateCount": 2, + "authorCount": 2 } }, { @@ -187,9 +194,10 @@ }, "meta": { "hash": "35488eb0f56b59035b56cc67fa0a5e1a970162ede4aafd97ebb2b4009c321c01", - "firstSeen": "", - "lastUpdated": "", - "updateCount": 1 + "firstSeen": "1567096638", + "lastUpdated": "1567096638", + "updateCount": 2, + "authorCount": 2 } }, { @@ -211,9 +219,10 @@ }, "meta": { "hash": "6ff845c13444a06569be548ce9e69900b7001516c44c315795f34b31e9baa833", - "firstSeen": "", - "lastUpdated": "", - "updateCount": 1 + "firstSeen": "1567096638", + "lastUpdated": "1567096638", + "updateCount": 2, + "authorCount": 2 } }, { @@ -235,9 +244,10 @@ }, "meta": { "hash": "d0be594ab377cbeb2910308610af5890b3468c06e7567cd0995a84d11aaccf47", - "firstSeen": "", - "lastUpdated": "", - "updateCount": 1 + "firstSeen": "1567096638", + "lastUpdated": "1567096638", + "updateCount": 2, + "authorCount": 2 } }, { @@ -259,9 +269,10 @@ }, "meta": { "hash": "52ffa251dfc4e2bec7160a9066ef24a8c3047706e1ad2837f9d987cdf4d5f73e", - "firstSeen": "", - "lastUpdated": "", - "updateCount": 1 + "firstSeen": "1567096638", + "lastUpdated": "1567096638", + "updateCount": 2, + "authorCount": 2 } }, { @@ -283,9 +294,10 @@ }, "meta": { "hash": "4fccb2abe966313a742d13965ee46cfd1094763a2697591eddb19c1c5af1db7e", - "firstSeen": "", - "lastUpdated": "", - "updateCount": 1 + "firstSeen": "1567096638", + "lastUpdated": "1567096638", + "updateCount": 2, + "authorCount": 2 } }, { @@ -307,9 +319,10 @@ }, "meta": { "hash": "7eb4b1ffc1cbe28c10190bb82b7731ade2d79e78a5569bdee62af33a1020f2f5", - "firstSeen": "", - "lastUpdated": "", - "updateCount": 1 + "firstSeen": "1567096638", + "lastUpdated": "1567096638", + "updateCount": 2, + "authorCount": 2 } }, { @@ -331,9 +344,10 @@ }, "meta": { "hash": "71ebcdb61794d8222fcf447509d206ffb10dc8068072a88c6b587e21e76fc7f2", - "firstSeen": "", - "lastUpdated": "", - "updateCount": 1 + "firstSeen": "1567096638", + "lastUpdated": "1567096638", + "updateCount": 2, + "authorCount": 2 } }, { @@ -355,9 +369,10 @@ }, "meta": { "hash": "250615cfc281e99014b97d054c722d3ba6aa4190ccf66dd719e530ec80aec3bd", - "firstSeen": "", - "lastUpdated": "", - "updateCount": 1 + "firstSeen": "1567096638", + "lastUpdated": "1567096638", + "updateCount": 2, + "authorCount": 2 } }, { @@ -380,9 +395,10 @@ }, "meta": { "hash": "33e1e304fead4088971a60d4da974d0e9380370560f383ddb1ddc14e628df18b", - "firstSeen": "", - "lastUpdated": "", - "updateCount": 1 + "firstSeen": "1567096638", + "lastUpdated": "1567096638", + "updateCount": 2, + "authorCount": 2 } }, { @@ -404,9 +420,10 @@ }, "meta": { "hash": "f885a599e1185f8480445e1eb0c4a5cb8bf33948d7893f013dd4e8085478fe7a", - "firstSeen": "", - "lastUpdated": "", - "updateCount": 1 + "firstSeen": "1567096638", + "lastUpdated": "1567096638", + "updateCount": 2, + "authorCount": 2 } }, { @@ -428,9 +445,10 @@ }, "meta": { "hash": "9f71509c5937cb68b65ef31893b1ad723ce6690e8ecd161707cb222ab67a475b", - "firstSeen": "", - "lastUpdated": "", - "updateCount": 1 + "firstSeen": "1567096638", + "lastUpdated": "1567096638", + "updateCount": 2, + "authorCount": 2 } }, { @@ -452,9 +470,10 @@ }, "meta": { "hash": "d1ec7968c8f8c48642a3f91878db84330231bdf84bf74633dc0754456e951338", - "firstSeen": "", - "lastUpdated": "", - "updateCount": 1 + "firstSeen": "1567096638", + "lastUpdated": "1567096638", + "updateCount": 2, + "authorCount": 2 } }, { @@ -476,9 +495,10 @@ }, "meta": { "hash": "dba6fa36424c23d601c4e463463a5f23d32b51d8b058a6c5020d3b4098a65e51", - "firstSeen": "", - "lastUpdated": "", - "updateCount": 1 + "firstSeen": "1567096638", + "lastUpdated": "1567096638", + "updateCount": 2, + "authorCount": 2 } }, { @@ -501,9 +521,10 @@ }, "meta": { "hash": "5c26069a02342eadd2c5ba2656a1b211da8f1a94da03c2cc31a5090be556d7b7", - "firstSeen": "", - "lastUpdated": "", - "updateCount": 1 + "firstSeen": "1567096638", + "lastUpdated": "1567096638", + "updateCount": 2, + "authorCount": 2 } }, { @@ -525,9 +546,10 @@ }, "meta": { "hash": "5c6f8e292db8506568de362aa63890047f9d5a65d35143cfca1e27562642c414", - "firstSeen": "", - "lastUpdated": "", - "updateCount": 1 + "firstSeen": "1567096638", + "lastUpdated": "1567096638", + "updateCount": 2, + "authorCount": 2 } }, { @@ -549,9 +571,10 @@ }, "meta": { "hash": "0c37cf46586652fd20dfa9ca682d3635f01fe61c46864f9773f6b258e8f3b6f6", - "firstSeen": "", - "lastUpdated": "", - "updateCount": 1 + "firstSeen": "1567096638", + "lastUpdated": "1567096638", + "updateCount": 2, + "authorCount": 2 } }, { @@ -573,9 +596,10 @@ }, "meta": { "hash": "9859dbef05dc0398e825150b50fccfea370583cf6b807c00c9e83b769d2b51c0", - "firstSeen": "", - "lastUpdated": "", - "updateCount": 1 + "firstSeen": "1567096638", + "lastUpdated": "1567096638", + "updateCount": 2, + "authorCount": 2 } }, { @@ -597,9 +621,10 @@ }, "meta": { "hash": "19837ac6714833e9c5fe698811e171cc2598f7b9405a4847b33b8d3b35debf8a", - "firstSeen": "", - "lastUpdated": "", - "updateCount": 1 + "firstSeen": "1567096638", + "lastUpdated": "1567096638", + "updateCount": 2, + "authorCount": 2 } } ], diff --git a/snippet_data/snippetList.json b/snippet_data/snippetList.json index 0e70047b3..61c086a8a 100644 --- a/snippet_data/snippetList.json +++ b/snippet_data/snippetList.json @@ -412,7 +412,7 @@ ] }, "meta": { - "hash": "cc22283b6c9d1b9665c5c678f30551f0db170d4db13f2ddffb22728a8689f5be" + "hash": "e8e0c10c38e3a2dfe2f7b965d1bc96e85083414a9ed1ec21b95c4a08dc2442e9" } }, { @@ -835,7 +835,7 @@ ] }, "meta": { - "hash": "0a4684d6fc79bdbbac31df3af6c493ba7c881936ada5bc52824b4f26ca177459" + "hash": "77a01af8797ecbe71b9c9412d21c144c03a46a49dd3d0e7d869c3df38b39b2b4" } }, { @@ -898,7 +898,7 @@ ] }, "meta": { - "hash": "a4e1e33c0688dbf1ca231d9d8ea315ffed93b7f83f5d8cbf0714f10fdfeda8cf" + "hash": "6fa14364405f7b99aa49c2157bdc08c02b4ce2f288db29a4348a6983460933c7" } }, { @@ -1037,7 +1037,7 @@ ] }, "meta": { - "hash": "484bd222e636e8a8409c30ddb1fe6e3fe72ab7a43f2edf089b2758d5e9bee528" + "hash": "5f38360819f9225b887a94221bfee1a80f1bcc224a364440b3388f60491b03ba" } }, { @@ -1273,7 +1273,7 @@ ] }, "meta": { - "hash": "0eac852db7a7add352b0d36677b22718b342ed9dc12f11780cac87e3b8260a05" + "hash": "55b1ce0a892110d792a9487e40331774015525479faa2b8961f6c2ea6291c27b" } }, { @@ -1678,7 +1678,7 @@ ] }, "meta": { - "hash": "9e39c6a3a8ec5b51c5e16f69107fc9e90b2697b2cf2689850872071bb968723e" + "hash": "16c3b724b653dcb31f3e59f1664a59951abb15a93eb3697cade4d3ae0e63c532" } }, { @@ -1817,8 +1817,7 @@ "browser", "utility", "advanced", - "promise", - "advanced" + "promise" ] }, "meta": { @@ -2865,7 +2864,7 @@ ] }, "meta": { - "hash": "3db3faac666ee61ab86c70766d2ab5d1293ffd818da87edb971bfff7a366364a" + "hash": "362fddaa6244404741e84bca6fc442a101fdb642af53b299e8b9994d0d7162d8" } }, { @@ -3426,7 +3425,7 @@ ] }, "meta": { - "hash": "23ded1eef634ad88b34431b187b5f9eca4432daf09e89980fb0661fb56d8dcb0" + "hash": "012ebca6a90c50ec89278af2632d7d0d90eeb423f2bcf902ed015f6fce6d4f5a" } }, { @@ -3775,7 +3774,7 @@ ] }, "meta": { - "hash": "17bcf3f13980b7f804d9f0fe274324b2a35ab7d479c03d77322dabba81e1a34a" + "hash": "7ccbf66d8d55c60bcf12baa980cf32d67a4ba567894d59e2d798c9af792424ff" } }, { @@ -4172,7 +4171,7 @@ ] }, "meta": { - "hash": "069472d018c3102412dafc2ae8ec6e9396e53c01d0073079f2e3f1ac3c99b6e9" + "hash": "c1542907e6295eb81df918174c247a65d73c8daccc56769f2eb32d609b7846fc" } }, { @@ -4488,7 +4487,7 @@ ] }, "meta": { - "hash": "fc085a3110ffbbfa36c63ce282a3ab59e96d101eb4f489a59b68c1fda1814c14" + "hash": "532a39b77c025041de48f14122ac229a675d0af3e0a990d55a26c5f971ec3725" } }, { @@ -5615,7 +5614,6 @@ "meta": { "specification": "http://jsonapi.org/format/", "type": "snippetListingArray", - "scope": "./snippets", "language": { "short": "js", "long": "JavaScript" diff --git a/snippet_data/snippets.json b/snippet_data/snippets.json index 5f59629c8..bbbb5af66 100644 --- a/snippet_data/snippets.json +++ b/snippet_data/snippets.json @@ -20,9 +20,10 @@ }, "meta": { "hash": "ba8e5f17500d1e5428f4ca7fcc8095934a7ad3aa496b35465e8f7799f1715aaa", - "firstSeen": "1566932336", - "lastUpdated": "1566932336", - "updateCount": 2 + "firstSeen": "1567096638", + "lastUpdated": "1567096638", + "updateCount": 2, + "authorCount": 2 } }, { @@ -45,9 +46,10 @@ }, "meta": { "hash": "bda519858588ad61c9200acbb4ea5ce66630eb2ed7ceda96d12518b772b986b9", - "firstSeen": "1566932336", - "lastUpdated": "1566932336", - "updateCount": 2 + "firstSeen": "1567096638", + "lastUpdated": "1567096638", + "updateCount": 2, + "authorCount": 2 } }, { @@ -70,9 +72,10 @@ }, "meta": { "hash": "061b791456507197b9be0ff9b791b830fe0b550823868075bbe04962501f83a3", - "firstSeen": "1566932336", - "lastUpdated": "1566932336", - "updateCount": 2 + "firstSeen": "1567096638", + "lastUpdated": "1567096638", + "updateCount": 2, + "authorCount": 2 } }, { @@ -94,9 +97,10 @@ }, "meta": { "hash": "805f11e2f230c3a6b7dc590fcee27b4083b2188b6f1d0a8afb93868891cdba22", - "firstSeen": "1566932336", - "lastUpdated": "1566932336", - "updateCount": 2 + "firstSeen": "1567096638", + "lastUpdated": "1567096638", + "updateCount": 2, + "authorCount": 2 } }, { @@ -120,9 +124,10 @@ }, "meta": { "hash": "aeabb3d1d2be2d44fd8a20da3b069fdd1a8ad963f27e3e1ae9f5e8b40a8908cb", - "firstSeen": "1566932336", - "lastUpdated": "1566932336", - "updateCount": 2 + "firstSeen": "1567096638", + "lastUpdated": "1567096638", + "updateCount": 2, + "authorCount": 2 } }, { @@ -145,9 +150,10 @@ }, "meta": { "hash": "9d7e2db4a98688ab199ed2f75242bbff40a6083cc3c0ef483ed679c5d3878239", - "firstSeen": "1566932336", - "lastUpdated": "1566932336", - "updateCount": 2 + "firstSeen": "1567096638", + "lastUpdated": "1567096638", + "updateCount": 2, + "authorCount": 2 } }, { @@ -170,9 +176,10 @@ }, "meta": { "hash": "533ab7f8259624322b5911b076d8e6fcd08f2fd396e9e0bec85449fc42769d9b", - "firstSeen": "1566932336", + "firstSeen": "1567096638", "lastUpdated": "1575066838", - "updateCount": 4 + "updateCount": 4, + "authorCount": 4 } }, { @@ -196,9 +203,10 @@ }, "meta": { "hash": "32988360d63d6d62251314a88d3f4482ec3a265d67154a92a86d4140bd61c54b", - "firstSeen": "1566932336", - "lastUpdated": "1566932336", - "updateCount": 2 + "firstSeen": "1567096638", + "lastUpdated": "1567096638", + "updateCount": 2, + "authorCount": 2 } }, { @@ -220,9 +228,10 @@ }, "meta": { "hash": "a511836ad4a5755d469af2e6a331cbcd85df14b6231bbed6a1b0fe44aee3d2cf", - "firstSeen": "1566932336", - "lastUpdated": "1566932336", - "updateCount": 2 + "firstSeen": "1567096638", + "lastUpdated": "1567096638", + "updateCount": 2, + "authorCount": 2 } }, { @@ -245,9 +254,10 @@ }, "meta": { "hash": "edf5c7f142e59e4467ca7142eaf0ac95957abcb0dad1d439484b2b70fe8be6d3", - "firstSeen": "1566932336", - "lastUpdated": "1566932336", - "updateCount": 2 + "firstSeen": "1567096638", + "lastUpdated": "1567096638", + "updateCount": 2, + "authorCount": 2 } }, { @@ -271,9 +281,10 @@ }, "meta": { "hash": "7aa2052a6196029116ef9f2f7dda69b7d17344c0acc659ffedf002024b38d8b7", - "firstSeen": "1566932336", - "lastUpdated": "1566932336", - "updateCount": 2 + "firstSeen": "1567096638", + "lastUpdated": "1567096638", + "updateCount": 2, + "authorCount": 2 } }, { @@ -295,9 +306,10 @@ }, "meta": { "hash": "a801974915906c11a30deef1baa3994f44f548f1ca1cf599aede4bb730543ec6", - "firstSeen": "1566932336", - "lastUpdated": "1566932336", - "updateCount": 2 + "firstSeen": "1567096638", + "lastUpdated": "1567096638", + "updateCount": 2, + "authorCount": 2 } }, { @@ -320,9 +332,10 @@ }, "meta": { "hash": "db1b8580ab11b6ba05a7d47776b97d700c5a7e945ddc5ad9ca1f37e50f039b54", - "firstSeen": "1566932336", - "lastUpdated": "1566932336", - "updateCount": 2 + "firstSeen": "1567096638", + "lastUpdated": "1567096638", + "updateCount": 2, + "authorCount": 2 } }, { @@ -345,9 +358,10 @@ }, "meta": { "hash": "d15851c4e6991e41014768c3f2dd28df71615e44180c732b67eed1d162ea4b95", - "firstSeen": "1566932336", - "lastUpdated": "1566932336", - "updateCount": 2 + "firstSeen": "1567096638", + "lastUpdated": "1567096638", + "updateCount": 2, + "authorCount": 2 } }, { @@ -370,9 +384,10 @@ }, "meta": { "hash": "e159b77ba0bde0f38d339348b9a69b4702cf036abd767777507159aa75ce151b", - "firstSeen": "1566932336", - "lastUpdated": "1566932336", - "updateCount": 2 + "firstSeen": "1567096638", + "lastUpdated": "1567096638", + "updateCount": 2, + "authorCount": 2 } }, { @@ -395,9 +410,10 @@ }, "meta": { "hash": "e854f774dd81cdb291fb57b276a61e5d7f7ab13a6aae490c89c0e00acde820b4", - "firstSeen": "1566932336", - "lastUpdated": "1566932336", - "updateCount": 2 + "firstSeen": "1567096638", + "lastUpdated": "1567096638", + "updateCount": 2, + "authorCount": 2 } }, { @@ -419,9 +435,10 @@ }, "meta": { "hash": "0f36f6b8c7f803a55d8e888c8794cacba02db79c4d54043a8ddc71249c2f8a9f", - "firstSeen": "1566932336", - "lastUpdated": "1566932336", - "updateCount": 2 + "firstSeen": "1567096638", + "lastUpdated": "1567096638", + "updateCount": 2, + "authorCount": 2 } }, { @@ -443,9 +460,10 @@ }, "meta": { "hash": "9c2b4a28ae4f39cc034dc75e98d2f405af6113541f796041f142b85e90e27800", - "firstSeen": "1566932336", - "lastUpdated": "1566932336", - "updateCount": 2 + "firstSeen": "1567096638", + "lastUpdated": "1567096638", + "updateCount": 2, + "authorCount": 2 } }, { @@ -469,9 +487,10 @@ }, "meta": { "hash": "1c7836009987b8b1097b54a84c38144f6cb643477f08f00b1a37e274cf0c9f78", - "firstSeen": "1566932336", - "lastUpdated": "1566932336", - "updateCount": 2 + "firstSeen": "1567096638", + "lastUpdated": "1567096638", + "updateCount": 2, + "authorCount": 2 } }, { @@ -493,9 +512,10 @@ }, "meta": { "hash": "c347c3d7b5fdc40df6d480810318d1ba644a74719bda3708b3ee3290f0ff953f", - "firstSeen": "1566932336", - "lastUpdated": "1566932336", - "updateCount": 2 + "firstSeen": "1567096638", + "lastUpdated": "1567096638", + "updateCount": 2, + "authorCount": 2 } }, { @@ -518,9 +538,10 @@ }, "meta": { "hash": "0a09f658c6bd2149c2a14528f12e8851e2ba02b9bd04c7df491a89f766b63083", - "firstSeen": "1566932336", - "lastUpdated": "1566932336", - "updateCount": 2 + "firstSeen": "1567096638", + "lastUpdated": "1567096638", + "updateCount": 2, + "authorCount": 2 } }, { @@ -543,9 +564,10 @@ }, "meta": { "hash": "0c94a28b30fdfe112c8981a86868917d24cc5ddd1c84212a29783cec2d3a5ab4", - "firstSeen": "1566932336", - "lastUpdated": "1566932336", - "updateCount": 2 + "firstSeen": "1567096638", + "lastUpdated": "1567096638", + "updateCount": 2, + "authorCount": 2 } }, { @@ -568,9 +590,10 @@ }, "meta": { "hash": "aaf38afdc8033b2070b0e29ddb380db8570bbed490c6f39f55ff95167cdded8e", - "firstSeen": "1566932336", - "lastUpdated": "1566932336", - "updateCount": 2 + "firstSeen": "1567096638", + "lastUpdated": "1567096638", + "updateCount": 2, + "authorCount": 2 } }, { @@ -594,9 +617,10 @@ }, "meta": { "hash": "307add91ea4d5c2a122256f799120f580ac235567523dddeeadd6500f1e81e94", - "firstSeen": "1566932336", - "lastUpdated": "1566932336", - "updateCount": 2 + "firstSeen": "1567096638", + "lastUpdated": "1567096638", + "updateCount": 2, + "authorCount": 2 } }, { @@ -618,9 +642,10 @@ }, "meta": { "hash": "cd48981af62f6ba75694f796fc5537e6af53a58045465ebd52f8bdd1a1f892af", - "firstSeen": "1566932336", - "lastUpdated": "1566932336", - "updateCount": 2 + "firstSeen": "1567096638", + "lastUpdated": "1567096638", + "updateCount": 2, + "authorCount": 2 } }, { @@ -643,10 +668,11 @@ ] }, "meta": { - "hash": "cc22283b6c9d1b9665c5c678f30551f0db170d4db13f2ddffb22728a8689f5be", - "firstSeen": "1566932336", - "lastUpdated": "1574366947", - "updateCount": 23 + "hash": "e8e0c10c38e3a2dfe2f7b965d1bc96e85083414a9ed1ec21b95c4a08dc2442e9", + "firstSeen": "1567096638", + "lastUpdated": "1575102829", + "updateCount": 22, + "authorCount": 2 } }, { @@ -668,9 +694,10 @@ }, "meta": { "hash": "4af3783b8b490cdf70853b0a01780244556a18a7398f5bef123e4f39edbadebe", - "firstSeen": "1566932336", - "lastUpdated": "1566932336", - "updateCount": 2 + "firstSeen": "1567096638", + "lastUpdated": "1567096638", + "updateCount": 2, + "authorCount": 2 } }, { @@ -692,9 +719,10 @@ }, "meta": { "hash": "32fc5181c38c6d5bb16ac7373b68ad971c6b3cff6b80aee8cb69c296d47d0607", - "firstSeen": "1566932336", - "lastUpdated": "1566932336", - "updateCount": 2 + "firstSeen": "1567096638", + "lastUpdated": "1567096638", + "updateCount": 2, + "authorCount": 2 } }, { @@ -717,9 +745,10 @@ }, "meta": { "hash": "3b7e9a506c229c792da093336574e3524cd1a8c794d18fc450f469f171ff83cf", - "firstSeen": "1566932336", - "lastUpdated": "1566932336", - "updateCount": 2 + "firstSeen": "1567096638", + "lastUpdated": "1567096638", + "updateCount": 2, + "authorCount": 2 } }, { @@ -741,9 +770,10 @@ }, "meta": { "hash": "52b7275a934c85ccab144c174f07cf0f3aaf8b1dee913abab020b1be9666d021", - "firstSeen": "1566932336", - "lastUpdated": "1566932336", - "updateCount": 2 + "firstSeen": "1567096638", + "lastUpdated": "1567096638", + "updateCount": 2, + "authorCount": 2 } }, { @@ -765,9 +795,10 @@ }, "meta": { "hash": "b85ec57d815ff34ba3906195440fce5d2ad9f33b64d7d96159c0e1125fee283c", - "firstSeen": "1566932336", - "lastUpdated": "1566932336", - "updateCount": 2 + "firstSeen": "1567096638", + "lastUpdated": "1567096638", + "updateCount": 2, + "authorCount": 2 } }, { @@ -791,9 +822,10 @@ }, "meta": { "hash": "952f58128e70180fd6a1406562cac8781c92d258dfa0993cfb9cc6c968b0abfb", - "firstSeen": "1566932336", - "lastUpdated": "1566932336", - "updateCount": 2 + "firstSeen": "1567096638", + "lastUpdated": "1567096638", + "updateCount": 2, + "authorCount": 2 } }, { @@ -817,9 +849,10 @@ }, "meta": { "hash": "1ce726b8cbc9f87ff8ff6d68e0678325523b1118fa038b97f53ddad9031dbe23", - "firstSeen": "1566932336", - "lastUpdated": "1566932336", - "updateCount": 2 + "firstSeen": "1567096638", + "lastUpdated": "1567096638", + "updateCount": 2, + "authorCount": 2 } }, { @@ -841,9 +874,10 @@ }, "meta": { "hash": "fdd7fd5631e5c1b541eff445f3388488dc060d435e339d9c0f1f257d5733e2fe", - "firstSeen": "1566932336", - "lastUpdated": "1566932336", - "updateCount": 2 + "firstSeen": "1567096638", + "lastUpdated": "1567096638", + "updateCount": 2, + "authorCount": 2 } }, { @@ -866,9 +900,10 @@ }, "meta": { "hash": "7b6007e94c262a97cfab69ddb111d101103c095dbf2fd7680053d8733e6f2914", - "firstSeen": "1566932336", - "lastUpdated": "1566932336", - "updateCount": 2 + "firstSeen": "1567096638", + "lastUpdated": "1567096638", + "updateCount": 2, + "authorCount": 2 } }, { @@ -890,9 +925,10 @@ }, "meta": { "hash": "200b26d1e1016c56ba796665b94266e57127b6bcf23bb00b702df01676f95443", - "firstSeen": "1566932336", - "lastUpdated": "1566932336", - "updateCount": 2 + "firstSeen": "1567096638", + "lastUpdated": "1567096638", + "updateCount": 2, + "authorCount": 2 } }, { @@ -914,9 +950,10 @@ }, "meta": { "hash": "90b2780517322e1c847b7e7ae5325f1e69765eb22b72cf3472e1cd7d07f06347", - "firstSeen": "1566932336", - "lastUpdated": "1566932336", - "updateCount": 2 + "firstSeen": "1567096638", + "lastUpdated": "1567096638", + "updateCount": 2, + "authorCount": 2 } }, { @@ -938,9 +975,10 @@ }, "meta": { "hash": "37cf3e2c4a2b41cb94eab31680088761236be2fc817c2c4322a0f9f1a16ae475", - "firstSeen": "1566932336", - "lastUpdated": "1566932336", - "updateCount": 2 + "firstSeen": "1567096638", + "lastUpdated": "1567096638", + "updateCount": 2, + "authorCount": 2 } }, { @@ -963,9 +1001,10 @@ }, "meta": { "hash": "33014c31be5dadcdb16c56726db905ff10b9878a5f4e85f23d9ee303e71f0039", - "firstSeen": "1566932336", + "firstSeen": "1567096638", "lastUpdated": "1574366564", - "updateCount": 3 + "updateCount": 3, + "authorCount": 3 } }, { @@ -988,9 +1027,10 @@ }, "meta": { "hash": "d5c19dc814e9776782419f3e560dd132c1fdbf0493162e8a7a05b6ac84991f87", - "firstSeen": "1566932336", - "lastUpdated": "1566932336", - "updateCount": 2 + "firstSeen": "1567096638", + "lastUpdated": "1567096638", + "updateCount": 2, + "authorCount": 2 } }, { @@ -1012,9 +1052,10 @@ }, "meta": { "hash": "3143db5361ae9b8f20ee19ab2d5baeeebb976a195f60110522b558873204142c", - "firstSeen": "1566932336", - "lastUpdated": "1566932336", - "updateCount": 2 + "firstSeen": "1567096638", + "lastUpdated": "1567096638", + "updateCount": 2, + "authorCount": 2 } }, { @@ -1036,9 +1077,10 @@ }, "meta": { "hash": "1ae0916c575409305f4e1f1a2af7966f0f4b9260a9986711805a936ac6ebd9f7", - "firstSeen": "1566932336", - "lastUpdated": "1566932336", - "updateCount": 2 + "firstSeen": "1567096638", + "lastUpdated": "1567096638", + "updateCount": 2, + "authorCount": 2 } }, { @@ -1060,9 +1102,10 @@ }, "meta": { "hash": "233be96d6436773d7f6ceb16ad0cf63bdc63a961b59fc1faa11707af182ed510", - "firstSeen": "1566932336", - "lastUpdated": "1566932336", - "updateCount": 2 + "firstSeen": "1567096638", + "lastUpdated": "1567096638", + "updateCount": 2, + "authorCount": 2 } }, { @@ -1085,9 +1128,10 @@ }, "meta": { "hash": "d162fbc50166f304216db6ea700e5fc7f428ea33d50b204ae921e1c58552a4e0", - "firstSeen": "1566932336", - "lastUpdated": "1566932336", - "updateCount": 2 + "firstSeen": "1567096638", + "lastUpdated": "1567096638", + "updateCount": 2, + "authorCount": 2 } }, { @@ -1110,9 +1154,10 @@ }, "meta": { "hash": "bc41a9baac70cfa4415f23550ff0f0ac92ad5aa2192e577437e72c732956ada7", - "firstSeen": "1566932336", - "lastUpdated": "1566932336", - "updateCount": 2 + "firstSeen": "1567096638", + "lastUpdated": "1567096638", + "updateCount": 2, + "authorCount": 2 } }, { @@ -1136,9 +1181,10 @@ }, "meta": { "hash": "3169ab83e588063262fa6a01f7d7df7bd9521345c65a7c7f874f577478c90305", - "firstSeen": "1566932336", - "lastUpdated": "1566932336", - "updateCount": 2 + "firstSeen": "1567096638", + "lastUpdated": "1567096638", + "updateCount": 2, + "authorCount": 2 } }, { @@ -1162,9 +1208,10 @@ }, "meta": { "hash": "786d9d7dc8544fd49678b8bb71eb4a068ade86a30b2a58d07bef20da2fc28db1", - "firstSeen": "1566932336", - "lastUpdated": "1566932336", - "updateCount": 2 + "firstSeen": "1567096638", + "lastUpdated": "1567096638", + "updateCount": 2, + "authorCount": 2 } }, { @@ -1187,9 +1234,10 @@ }, "meta": { "hash": "f51d4d8679fadabe84e72547013537a5fcb7bcedd7907f79934fba06405097c7", - "firstSeen": "1566932336", - "lastUpdated": "1566932336", - "updateCount": 2 + "firstSeen": "1567096638", + "lastUpdated": "1567096638", + "updateCount": 2, + "authorCount": 2 } }, { @@ -1212,9 +1260,10 @@ }, "meta": { "hash": "80e76d37fa79511f3256d5e1c113d223fc8875fd9d6cfe8b7530b567def30456", - "firstSeen": "1566932336", - "lastUpdated": "1566932336", - "updateCount": 2 + "firstSeen": "1567096638", + "lastUpdated": "1567096638", + "updateCount": 2, + "authorCount": 2 } }, { @@ -1236,9 +1285,10 @@ }, "meta": { "hash": "9057876a6323ed24bbc3db2a6db7ddc8bdf59663493d07935b9c9238d879a689", - "firstSeen": "1566932336", - "lastUpdated": "1566932336", - "updateCount": 2 + "firstSeen": "1567096638", + "lastUpdated": "1567096638", + "updateCount": 2, + "authorCount": 2 } }, { @@ -1260,9 +1310,10 @@ }, "meta": { "hash": "bbf4d763429f499c0e1c3feb381e6291d3643d45613d25812ac5c47789d4d4f9", - "firstSeen": "1566932336", - "lastUpdated": "1566932336", - "updateCount": 2 + "firstSeen": "1567096638", + "lastUpdated": "1567096638", + "updateCount": 2, + "authorCount": 2 } }, { @@ -1285,9 +1336,10 @@ }, "meta": { "hash": "cb1b9240e8dae6a351937afeeccb1e200017a3729844b812721b8a8fcffdaa54", - "firstSeen": "1566932336", - "lastUpdated": "1566932336", - "updateCount": 2 + "firstSeen": "1567096638", + "lastUpdated": "1567096638", + "updateCount": 2, + "authorCount": 2 } }, { @@ -1298,7 +1350,7 @@ "fileName": "deepClone.md", "text": "Creates a deep clone of an object.\n\nUse recursion.\nCheck if the passed object is `null` and, if so, return `null`.\nUse `Object.assign()` and an empty object (`{}`) to create a shallow clone of the original.\nUse `Object.keys()` and `Array.prototype.forEach()` to determine which key-value pairs need to be deep cloned.\n\n", "codeBlocks": { - "es6": "const deepClone = obj => {\n if (obj === null) return null;\n let clone = Object.assign({}, obj);\n Object.keys(clone).forEach(\n key => (clone[key] = typeof obj[key] === 'object' ? deepClone(obj[key]) : obj[key])\n );\n return Array.isArray(obj) && obj.length\n ? (clone.length = obj.length) && Array.from(clone)\n : Array.isArray(obj)\n ? Array.from(obj)\n : clone;\n};", + "es6": "const deepClone = obj => {\n if (obj === null) return null;\n let clone = Object.assign({}, obj);\n Object.keys(clone).forEach(\n key => (clone[key] = typeof obj[key] === 'object' ? deepClone(obj[key]) : obj[key])\n );\n return Array.isArray(obj) && obj.length\n ? (clone.length = obj.length) && Array.from(clone)\n : Array.isArray(obj)\n ? Array.from(obj)\n : clone;\n};", "es5": "function _typeof(obj) { if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }; } return _typeof(obj); }\n\nvar deepClone = function deepClone(obj) {\n if (obj === null) return null;\n var clone = Object.assign({}, obj);\n Object.keys(clone).forEach(function (key) {\n return clone[key] = _typeof(obj[key]) === 'object' ? deepClone(obj[key]) : obj[key];\n });\n return Array.isArray(obj) && obj.length ? (clone.length = obj.length) && Array.from(clone) : Array.isArray(obj) ? Array.from(obj) : clone;\n};", "example": "const a = { foo: 'bar', obj: { a: 1, b: 2 } };\nconst b = deepClone(a); // a !== b, a.obj !== b.obj" }, @@ -1309,10 +1361,11 @@ ] }, "meta": { - "hash": "0a4684d6fc79bdbbac31df3af6c493ba7c881936ada5bc52824b4f26ca177459", - "firstSeen": "1566932336", - "lastUpdated": "1574366947", - "updateCount": 26 + "hash": "77a01af8797ecbe71b9c9412d21c144c03a46a49dd3d0e7d869c3df38b39b2b4", + "firstSeen": "1567096638", + "lastUpdated": "1575102829", + "updateCount": 25, + "authorCount": 4 } }, { @@ -1335,9 +1388,10 @@ }, "meta": { "hash": "3581c10be59a1ecac528c7dbbb2b19479193e896f75d7229ed56853f6b2ceb52", - "firstSeen": "1566932336", - "lastUpdated": "1566932336", - "updateCount": 2 + "firstSeen": "1567096638", + "lastUpdated": "1567096638", + "updateCount": 2, + "authorCount": 2 } }, { @@ -1360,9 +1414,10 @@ }, "meta": { "hash": "a96d773dc1d2d54b91ccabf3eb4acaf0964d080fc75dcbf74fc032fd40702e9e", - "firstSeen": "1566932336", - "lastUpdated": "1566932336", - "updateCount": 2 + "firstSeen": "1567096638", + "lastUpdated": "1567096638", + "updateCount": 2, + "authorCount": 2 } }, { @@ -1384,9 +1439,10 @@ }, "meta": { "hash": "818735e4b97db79e60544be6339c8e260b630f375b542ea51e1bc60e4171be42", - "firstSeen": "1566932336", - "lastUpdated": "1566932336", - "updateCount": 2 + "firstSeen": "1567096638", + "lastUpdated": "1567096638", + "updateCount": 2, + "authorCount": 2 } }, { @@ -1397,7 +1453,7 @@ "fileName": "deepMapKeys.md", "text": "Deep maps an object's keys.\n\nCreates an object with the same values as the provided object and keys generated by running the provided function for each key.\nUse `Object.keys(obj)` to iterate over the object's keys. \nUse `Array.prototype.reduce()` to create a new object with the same values and mapped keys using `fn`.\n\n", "codeBlocks": { - "es6": "const deepMapKeys = (obj, f) =>\n Array.isArray(obj)\n ? obj.map(val => deepMapKeys(val, f))\n : typeof obj === 'object'\n ? Object.keys(obj).reduce((acc, current) => {\n const val = obj[current];\n acc[f(current)] =\n val !== null && typeof val === 'object' ? deepMapKeys(val, f) : (acc[f(current)] = val);\n return acc;\n }, {})\n : obj;", + "es6": "const deepMapKeys = (obj, f) =>\n Array.isArray(obj)\n ? obj.map(val => deepMapKeys(val, f))\n : typeof obj === 'object'\n ? Object.keys(obj).reduce((acc, current) => {\n const val = obj[current];\n acc[f(current)] =\n val !== null && typeof val === 'object' ? deepMapKeys(val, f) : (acc[f(current)] = val);\n return acc;\n }, {})\n : obj;", "es5": "function _typeof(obj) { if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }; } return _typeof(obj); }\n\nvar deepMapKeys = function deepMapKeys(obj, f) {\n return Array.isArray(obj) ? obj.map(function (val) {\n return deepMapKeys(val, f);\n }) : _typeof(obj) === 'object' ? Object.keys(obj).reduce(function (acc, current) {\n var val = obj[current];\n acc[f(current)] = val !== null && _typeof(val) === 'object' ? deepMapKeys(val, f) : acc[f(current)] = val;\n return acc;\n }, {}) : obj;\n};", "example": "const obj = {\n foo: '1',\n nested: {\n child: {\n withArray: [\n {\n grandChild: ['hello']\n }\n ]\n }\n }\n};\nconst upperKeysObj = deepMapKeys(obj, key => key.toUpperCase());\n/*\n{\n \"FOO\":\"1\",\n \"NESTED\":{\n \"CHILD\":{\n \"WITHARRAY\":[\n {\n \"GRANDCHILD\":[ 'hello' ]\n }\n ]\n }\n }\n}\n*/" }, @@ -1408,10 +1464,11 @@ ] }, "meta": { - "hash": "a4e1e33c0688dbf1ca231d9d8ea315ffed93b7f83f5d8cbf0714f10fdfeda8cf", - "firstSeen": "1566932336", - "lastUpdated": "1574366947", - "updateCount": 23 + "hash": "6fa14364405f7b99aa49c2157bdc08c02b4ce2f288db29a4348a6983460933c7", + "firstSeen": "1567096638", + "lastUpdated": "1575102829", + "updateCount": 22, + "authorCount": 2 } }, { @@ -1433,9 +1490,10 @@ }, "meta": { "hash": "f891cda1417a4f1c3646c3d7451aad99833062eb28a9fcad4d414b98d1925bc6", - "firstSeen": "1566932336", - "lastUpdated": "1566932336", - "updateCount": 2 + "firstSeen": "1567096638", + "lastUpdated": "1567096638", + "updateCount": 2, + "authorCount": 2 } }, { @@ -1457,9 +1515,10 @@ }, "meta": { "hash": "7a750cc36b1a97252c4048a6896e0e01816ccf0bcb6db634db42b4ae5be1ed3b", - "firstSeen": "1566932336", - "lastUpdated": "1566932336", - "updateCount": 2 + "firstSeen": "1567096638", + "lastUpdated": "1567096638", + "updateCount": 2, + "authorCount": 2 } }, { @@ -1481,9 +1540,10 @@ }, "meta": { "hash": "2bc5b5959725150f5c678769b6dffc05f44692ad2e201b9ac1ff40c00e5dc419", - "firstSeen": "1566932336", - "lastUpdated": "1566932336", - "updateCount": 2 + "firstSeen": "1567096638", + "lastUpdated": "1567096638", + "updateCount": 2, + "authorCount": 2 } }, { @@ -1505,9 +1565,10 @@ }, "meta": { "hash": "cfa17f3a578f2790d22b5054c728a07515678b72eccef8500218b78d8a3d9e4b", - "firstSeen": "1566932336", - "lastUpdated": "1566932336", - "updateCount": 2 + "firstSeen": "1567096638", + "lastUpdated": "1567096638", + "updateCount": 2, + "authorCount": 2 } }, { @@ -1529,9 +1590,10 @@ }, "meta": { "hash": "ab72248448b94658fbbe2842d7feb3ec1621703384472f424a2355634d1aa774", - "firstSeen": "1566932336", - "lastUpdated": "1566932336", - "updateCount": 2 + "firstSeen": "1567096638", + "lastUpdated": "1567096638", + "updateCount": 2, + "authorCount": 2 } }, { @@ -1554,9 +1616,10 @@ }, "meta": { "hash": "7e49ef3e36b2fe6f1cc680e2be782bda7af3e05fa75b4bacf59c63428a6ebf50", - "firstSeen": "1566932336", - "lastUpdated": "1566932336", - "updateCount": 2 + "firstSeen": "1567096638", + "lastUpdated": "1567096638", + "updateCount": 2, + "authorCount": 2 } }, { @@ -1579,9 +1642,10 @@ }, "meta": { "hash": "1be0503ca3298cf2c05ff64889181fc35e682785476bb5617d439978b80fd35e", - "firstSeen": "1566932336", - "lastUpdated": "1566932336", - "updateCount": 2 + "firstSeen": "1567096638", + "lastUpdated": "1567096638", + "updateCount": 2, + "authorCount": 2 } }, { @@ -1604,9 +1668,10 @@ }, "meta": { "hash": "b265f3860be86344badb79b74074e3dfe37da6b2c4ff95bd8865b6e6f7c0d73b", - "firstSeen": "1566932336", - "lastUpdated": "1566932336", - "updateCount": 2 + "firstSeen": "1567096638", + "lastUpdated": "1567096638", + "updateCount": 2, + "authorCount": 2 } }, { @@ -1617,7 +1682,7 @@ "fileName": "dig.md", "text": "Returns the target value in a nested JSON object, based on the given key.\n\nUse the `in` operator to check if `target` exists in `obj`.\nIf found, return the value of `obj[target]`, otherwise use `Object.values(obj)` and `Array.prototype.reduce()` to recursively call `dig` on each nested object until the first matching key/value pair is found.\n\n", "codeBlocks": { - "es6": "const dig = (obj, target) =>\n target in obj\n ? obj[target]\n : Object.values(obj).reduce((acc, val) => {\n if (acc !== undefined) return acc;\n if (typeof val === 'object') return dig(val, target);\n }, undefined);", + "es6": "const dig = (obj, target) =>\n target in obj\n ? obj[target]\n : Object.values(obj).reduce((acc, val) => {\n if (acc !== undefined) return acc;\n if (typeof val === 'object') return dig(val, target);\n }, undefined);", "es5": "function _typeof(obj) { if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }; } return _typeof(obj); }\n\nvar dig = function dig(obj, target) {\n return target in obj ? obj[target] : Object.values(obj).reduce(function (acc, val) {\n if (acc !== undefined) return acc;\n if (_typeof(val) === 'object') return dig(val, target);\n }, undefined);\n};", "example": "const data = {\n level1: {\n level2: {\n level3: 'some data'\n }\n }\n};\ndig(data, 'level3'); // 'some data'\ndig(data, 'level4'); // undefined" }, @@ -1628,10 +1693,11 @@ ] }, "meta": { - "hash": "484bd222e636e8a8409c30ddb1fe6e3fe72ab7a43f2edf089b2758d5e9bee528", - "firstSeen": "1566932336", - "lastUpdated": "1574366947", - "updateCount": 23 + "hash": "5f38360819f9225b887a94221bfee1a80f1bcc224a364440b3388f60491b03ba", + "firstSeen": "1567096638", + "lastUpdated": "1575102829", + "updateCount": 22, + "authorCount": 2 } }, { @@ -1654,9 +1720,10 @@ }, "meta": { "hash": "adc3d101e4cdb91158dceb8053b684dfdc1f16cedcbf6cf6429fc4ed8a164b59", - "firstSeen": "1566932336", - "lastUpdated": "1566932336", - "updateCount": 2 + "firstSeen": "1567096638", + "lastUpdated": "1567096638", + "updateCount": 2, + "authorCount": 2 } }, { @@ -1678,9 +1745,10 @@ }, "meta": { "hash": "4a9da71c7d722ae58f12c73771d00cab86e74c3167254451660d26197ba6bd19", - "firstSeen": "1566932336", - "lastUpdated": "1566932336", - "updateCount": 2 + "firstSeen": "1567096638", + "lastUpdated": "1567096638", + "updateCount": 2, + "authorCount": 2 } }, { @@ -1702,9 +1770,10 @@ }, "meta": { "hash": "bf545684ca0c4abe2fc44e3fcaf15df7986430630e306ad3c009e629e63a1fab", - "firstSeen": "1566932336", - "lastUpdated": "1566932336", - "updateCount": 2 + "firstSeen": "1567096638", + "lastUpdated": "1567096638", + "updateCount": 2, + "authorCount": 2 } }, { @@ -1726,9 +1795,10 @@ }, "meta": { "hash": "36905bae3e3177bb5999580342141975020ea45d7162f240af5cc418425c871a", - "firstSeen": "1566932336", - "lastUpdated": "1566932336", - "updateCount": 2 + "firstSeen": "1567096638", + "lastUpdated": "1567096638", + "updateCount": 2, + "authorCount": 2 } }, { @@ -1751,9 +1821,10 @@ }, "meta": { "hash": "252b49a7c475d830e22c7e6dbae7df45be37a97b400e93125935c2de5c24b0a1", - "firstSeen": "1566932336", - "lastUpdated": "1566932336", - "updateCount": 2 + "firstSeen": "1567096638", + "lastUpdated": "1567096638", + "updateCount": 2, + "authorCount": 2 } }, { @@ -1776,9 +1847,10 @@ }, "meta": { "hash": "2433c61d4b168a15de1d89c3d077c51fdb36710dfd4e72465d929e83a5acb09f", - "firstSeen": "1566932336", - "lastUpdated": "1566932336", - "updateCount": 2 + "firstSeen": "1567096638", + "lastUpdated": "1567096638", + "updateCount": 2, + "authorCount": 2 } }, { @@ -1800,9 +1872,10 @@ }, "meta": { "hash": "2c6c186cf8b62305ab88307d24b413acd96dba006c80ee7835e5fb8e33e72256", - "firstSeen": "1566932336", - "lastUpdated": "1566932336", - "updateCount": 2 + "firstSeen": "1567096638", + "lastUpdated": "1567096638", + "updateCount": 2, + "authorCount": 2 } }, { @@ -1824,9 +1897,10 @@ }, "meta": { "hash": "46fed254db32437f3f54938d293aee32ebda0bac4dda24e6af33c039f4bc6f9f", - "firstSeen": "1566932336", - "lastUpdated": "1566932336", - "updateCount": 2 + "firstSeen": "1567096638", + "lastUpdated": "1567096638", + "updateCount": 2, + "authorCount": 2 } }, { @@ -1838,7 +1912,7 @@ "text": "Computes the new ratings between two or more opponents using the [Elo rating system](https://en.wikipedia.org/wiki/Elo_rating_system). It takes an array\nof pre-ratings and returns an array containing post-ratings.\nThe array should be ordered from best performer to worst performer (winner -> loser).\n\nUse the exponent `**` operator and math operators to compute the expected score (chance of winning).\nof each opponent and compute the new rating for each.\nLoop through the ratings, using each permutation to compute the post-Elo rating for each player in a pairwise fashion. \nOmit the second argument to use the default `kFactor` of 32.\n\n", "codeBlocks": { "es6": "const elo = ([...ratings], kFactor = 32, selfRating) => {\n const [a, b] = ratings;\n const expectedScore = (self, opponent) => 1 / (1 + 10 ** ((opponent - self) / 400));\n const newRating = (rating, i) =>\n (selfRating || rating) + kFactor * (i - expectedScore(i ? a : b, i ? b : a));\n if (ratings.length === 2) return [newRating(a, 1), newRating(b, 0)];\n\n for (let i = 0, len = ratings.length; i < len; i++) {\n let j = i;\n while (j < len - 1) {\n j++;\n [ratings[i], ratings[j]] = elo([ratings[i], ratings[j]], kFactor);\n }\n }\n return ratings;\n};", - "es5": "function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _nonIterableRest(); }\n\nfunction _iterableToArrayLimit(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i[\"return\"] != null) _i[\"return\"](); } finally { if (_d) throw _e; } } return _arr; }\n\nfunction _toArray(arr) { return _arrayWithHoles(arr) || _iterableToArray(arr) || _nonIterableRest(); }\n\nfunction _nonIterableRest() { throw new TypeError(\"Invalid attempt to destructure non-iterable instance\"); }\n\nfunction _iterableToArray(iter) { if (Symbol.iterator in Object(iter) || Object.prototype.toString.call(iter) === \"[object Arguments]\") return Array.from(iter); }\n\nfunction _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }\n\nvar elo = function elo(_ref) {\n var _ref2 = _toArray(_ref),\n ratings = _ref2.slice(0);\n\n var kFactor = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 32;\n var selfRating = arguments.length > 2 ? arguments[2] : undefined;\n\n var _ratings = _slicedToArray(ratings, 2),\n a = _ratings[0],\n b = _ratings[1];\n\n var expectedScore = function expectedScore(self, opponent) {\n return 1 / (1 + Math.pow(10, (opponent - self) / 400));\n };\n\n var newRating = function newRating(rating, i) {\n return (selfRating || rating) + kFactor * (i - expectedScore(i ? a : b, i ? b : a));\n };\n\n if (ratings.length === 2) return [newRating(a, 1), newRating(b, 0)];\n\n for (var i = 0, len = ratings.length; i < len; i++) {\n var j = i;\n\n while (j < len - 1) {\n j++;\n\n var _elo = elo([ratings[i], ratings[j]], kFactor);\n\n var _elo2 = _slicedToArray(_elo, 2);\n\n ratings[i] = _elo2[0];\n ratings[j] = _elo2[1];\n }\n }\n\n return ratings;\n};", + "es5": "function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _nonIterableRest(); }\n\nfunction _iterableToArrayLimit(arr, i) { if (!(Symbol.iterator in Object(arr) || Object.prototype.toString.call(arr) === \"[object Arguments]\")) { return; } var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i[\"return\"] != null) _i[\"return\"](); } finally { if (_d) throw _e; } } return _arr; }\n\nfunction _toArray(arr) { return _arrayWithHoles(arr) || _iterableToArray(arr) || _nonIterableRest(); }\n\nfunction _nonIterableRest() { throw new TypeError(\"Invalid attempt to destructure non-iterable instance\"); }\n\nfunction _iterableToArray(iter) { if (Symbol.iterator in Object(iter) || Object.prototype.toString.call(iter) === \"[object Arguments]\") return Array.from(iter); }\n\nfunction _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }\n\nvar elo = function elo(_ref) {\n var _ref2 = _toArray(_ref),\n ratings = _ref2.slice(0);\n\n var kFactor = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 32;\n var selfRating = arguments.length > 2 ? arguments[2] : undefined;\n\n var _ratings = _slicedToArray(ratings, 2),\n a = _ratings[0],\n b = _ratings[1];\n\n var expectedScore = function expectedScore(self, opponent) {\n return 1 / (1 + Math.pow(10, (opponent - self) / 400));\n };\n\n var newRating = function newRating(rating, i) {\n return (selfRating || rating) + kFactor * (i - expectedScore(i ? a : b, i ? b : a));\n };\n\n if (ratings.length === 2) return [newRating(a, 1), newRating(b, 0)];\n\n for (var i = 0, len = ratings.length; i < len; i++) {\n var j = i;\n\n while (j < len - 1) {\n j++;\n\n var _elo = elo([ratings[i], ratings[j]], kFactor);\n\n var _elo2 = _slicedToArray(_elo, 2);\n\n ratings[i] = _elo2[0];\n ratings[j] = _elo2[1];\n }\n }\n\n return ratings;\n};", "example": "// Standard 1v1s\nelo([1200, 1200]); // [1216, 1184]\nelo([1200, 1200], 64); // [1232, 1168]\n// 4 player FFA, all same rank\nelo([1200, 1200, 1200, 1200]).map(Math.round); // [1246, 1215, 1185, 1154]\n/*\nFor teams, each rating can adjusted based on own team's average rating vs.\naverage rating of opposing team, with the score being added to their\nown individual rating by supplying it as the third argument.\n*/" }, "tags": [ @@ -1849,9 +1923,10 @@ }, "meta": { "hash": "7f506f1d9999e20da3deebf7d51b80d9f56f9d87bddac6637faf63316bcd1790", - "firstSeen": "1566932336", - "lastUpdated": "1566932336", - "updateCount": 2 + "firstSeen": "1567096638", + "lastUpdated": "1567096638", + "updateCount": 2, + "authorCount": 2 } }, { @@ -1875,9 +1950,10 @@ }, "meta": { "hash": "7738cec1d3804a4542cd80899d7f6d2890d8950aae5751a76e733b0ed270d802", - "firstSeen": "1566932336", + "firstSeen": "1567096638", "lastUpdated": "1570640396", - "updateCount": 3 + "updateCount": 3, + "authorCount": 3 } }, { @@ -1901,9 +1977,10 @@ }, "meta": { "hash": "456a613a9ad94c219753a2ad2ad6f5e1668b974e9f503d221791745c570a35d4", - "firstSeen": "1566932336", - "lastUpdated": "1566932336", - "updateCount": 2 + "firstSeen": "1567096638", + "lastUpdated": "1567096638", + "updateCount": 2, + "authorCount": 2 } }, { @@ -1926,9 +2003,10 @@ }, "meta": { "hash": "91c52b53fe79cc811678086b90b073f84bf168a1bd59dfa6796462ac96adfb17", - "firstSeen": "1566932336", - "lastUpdated": "1566932336", - "updateCount": 2 + "firstSeen": "1567096638", + "lastUpdated": "1567096638", + "updateCount": 2, + "authorCount": 2 } }, { @@ -1950,9 +2028,10 @@ }, "meta": { "hash": "a111e4110ff4fe4895ba42b32ed7cb294ab8a0b1103d43cf5bf2d0c483f2ec7e", - "firstSeen": "1566932336", - "lastUpdated": "1566932336", - "updateCount": 2 + "firstSeen": "1567096638", + "lastUpdated": "1567096638", + "updateCount": 2, + "authorCount": 2 } }, { @@ -1975,9 +2054,10 @@ }, "meta": { "hash": "34df599e00a3541dfecf1c0780514006d8d6cadfe28905ead9e782cc3903902c", - "firstSeen": "1566932336", - "lastUpdated": "1566932336", - "updateCount": 2 + "firstSeen": "1567096638", + "lastUpdated": "1567096638", + "updateCount": 2, + "authorCount": 2 } }, { @@ -1988,7 +2068,7 @@ "fileName": "factorial.md", "text": "Calculates the factorial of a number.\n\nUse recursion.\nIf `n` is less than or equal to `1`, return `1`.\nOtherwise, return the product of `n` and the factorial of `n - 1`.\nThrows an exception if `n` is a negative number.\n\n", "codeBlocks": { - "es6": "const factorial = n =>\n n < 0\n ? (() => {\n throw new TypeError('Negative numbers are not allowed!');\n })()\n : n <= 1\n ? 1\n : n * factorial(n - 1);", + "es6": "const factorial = n =>\n n < 0\n ? (() => {\n throw new TypeError('Negative numbers are not allowed!');\n })()\n : n <= 1\n ? 1\n : n * factorial(n - 1);", "es5": "var factorial = function factorial(n) {\n return n < 0 ? function () {\n throw new TypeError('Negative numbers are not allowed!');\n }() : n <= 1 ? 1 : n * factorial(n - 1);\n};", "example": "factorial(6); // 720" }, @@ -1999,10 +2079,11 @@ ] }, "meta": { - "hash": "0eac852db7a7add352b0d36677b22718b342ed9dc12f11780cac87e3b8260a05", - "firstSeen": "1566932336", - "lastUpdated": "1574366947", - "updateCount": 23 + "hash": "55b1ce0a892110d792a9487e40331774015525479faa2b8961f6c2ea6291c27b", + "firstSeen": "1567096638", + "lastUpdated": "1575102829", + "updateCount": 22, + "authorCount": 2 } }, { @@ -2025,9 +2106,10 @@ }, "meta": { "hash": "156e9481207c96ff8e9fe054a5d72144933a5a0f4215e721925e3da0054f6be2", - "firstSeen": "1566932336", - "lastUpdated": "1566932336", - "updateCount": 2 + "firstSeen": "1567096638", + "lastUpdated": "1567096638", + "updateCount": 2, + "authorCount": 2 } }, { @@ -2049,9 +2131,10 @@ }, "meta": { "hash": "32b00ed543311270adc8122e95e745ef1a80297af064bc4a7343573abc2f2f51", - "firstSeen": "1566932336", - "lastUpdated": "1566932336", - "updateCount": 2 + "firstSeen": "1567096638", + "lastUpdated": "1567096638", + "updateCount": 2, + "authorCount": 2 } }, { @@ -2073,9 +2156,10 @@ }, "meta": { "hash": "f9abec985874548f8020c4b1a3f657981989c08e1c8d5547f21d1f36566b093c", - "firstSeen": "1566932336", - "lastUpdated": "1566932336", - "updateCount": 2 + "firstSeen": "1567096638", + "lastUpdated": "1567096638", + "updateCount": 2, + "authorCount": 2 } }, { @@ -2098,9 +2182,10 @@ }, "meta": { "hash": "9179ddcbbbf42b58c2fa5b2f079154bee2739e5a843ed8be84a8dc0dc9946116", - "firstSeen": "1566932336", - "lastUpdated": "1566932336", - "updateCount": 2 + "firstSeen": "1567096638", + "lastUpdated": "1567096638", + "updateCount": 2, + "authorCount": 2 } }, { @@ -2123,9 +2208,10 @@ }, "meta": { "hash": "cd829971748368811b0c202243f3d968be259e24805715b7459657394eb9f302", - "firstSeen": "1566932336", - "lastUpdated": "1566932336", - "updateCount": 2 + "firstSeen": "1567096638", + "lastUpdated": "1567096638", + "updateCount": 2, + "authorCount": 2 } }, { @@ -2147,9 +2233,10 @@ }, "meta": { "hash": "2f79feebcfde7153bc7d457358d3ce9f0c544f98ea2cd35553a5d5e9ac88be6e", - "firstSeen": "1566932336", - "lastUpdated": "1566932336", - "updateCount": 2 + "firstSeen": "1567096638", + "lastUpdated": "1567096638", + "updateCount": 2, + "authorCount": 2 } }, { @@ -2161,7 +2248,7 @@ "text": "Returns the index of the last element for which the provided function returns a truthy value.\n\nUse `Array.prototype.map()` to map each element to an array with its index and value.\nUse `Array.prototype.filter()` to remove elements for which `fn` returns falsy values, `Array.prototype.pop()` to get the last one.\n`-1` is the default value when not found.\n\n", "codeBlocks": { "es6": "const findLastIndex = (arr, fn) =>\n (arr\n .map((val, i) => [i, val])\n .filter(([i, val]) => fn(val, i, arr))\n .pop() || [-1])[0];", - "es5": "function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _nonIterableRest(); }\n\nfunction _nonIterableRest() { throw new TypeError(\"Invalid attempt to destructure non-iterable instance\"); }\n\nfunction _iterableToArrayLimit(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i[\"return\"] != null) _i[\"return\"](); } finally { if (_d) throw _e; } } return _arr; }\n\nfunction _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }\n\nvar findLastIndex = function findLastIndex(arr, fn) {\n return (arr.map(function (val, i) {\n return [i, val];\n }).filter(function (_ref) {\n var _ref2 = _slicedToArray(_ref, 2),\n i = _ref2[0],\n val = _ref2[1];\n\n return fn(val, i, arr);\n }).pop() || [-1])[0];\n};", + "es5": "function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _nonIterableRest(); }\n\nfunction _nonIterableRest() { throw new TypeError(\"Invalid attempt to destructure non-iterable instance\"); }\n\nfunction _iterableToArrayLimit(arr, i) { if (!(Symbol.iterator in Object(arr) || Object.prototype.toString.call(arr) === \"[object Arguments]\")) { return; } var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i[\"return\"] != null) _i[\"return\"](); } finally { if (_d) throw _e; } } return _arr; }\n\nfunction _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }\n\nvar findLastIndex = function findLastIndex(arr, fn) {\n return (arr.map(function (val, i) {\n return [i, val];\n }).filter(function (_ref) {\n var _ref2 = _slicedToArray(_ref, 2),\n i = _ref2[0],\n val = _ref2[1];\n\n return fn(val, i, arr);\n }).pop() || [-1])[0];\n};", "example": "findLastIndex([1, 2, 3, 4], n => n % 2 === 1); // 2 (index of the value 3)\nfindLastIndex([1, 2, 3, 4], n => n === 5); // -1 (default value when not found)" }, "tags": [ @@ -2172,9 +2259,10 @@ }, "meta": { "hash": "48e20e5a2457427add5094d4fb588bebb98c244178758610678d25fd64b60f6c", - "firstSeen": "1566932336", - "lastUpdated": "1566932336", - "updateCount": 2 + "firstSeen": "1567096638", + "lastUpdated": "1567096638", + "updateCount": 2, + "authorCount": 2 } }, { @@ -2197,9 +2285,10 @@ }, "meta": { "hash": "884ac6ea5ebaf84aa9d83bba6e2848e0b524fa4a39632cd96bf797474caf4b34", - "firstSeen": "1566932336", - "lastUpdated": "1566932336", - "updateCount": 2 + "firstSeen": "1567096638", + "lastUpdated": "1567096638", + "updateCount": 2, + "authorCount": 2 } }, { @@ -2221,9 +2310,10 @@ }, "meta": { "hash": "e1793f61af6def69138bf162d0efb8f11578e7be5d718e701075dab4c510ceaa", - "firstSeen": "1566932336", - "lastUpdated": "1566932336", - "updateCount": 2 + "firstSeen": "1567096638", + "lastUpdated": "1567096638", + "updateCount": 2, + "authorCount": 2 } }, { @@ -2246,9 +2336,10 @@ }, "meta": { "hash": "5c49020c066977d2f001fb1101301768cb0e1a757ad76982c0cd0ea9b990e27c", - "firstSeen": "1566932336", - "lastUpdated": "1566932336", - "updateCount": 2 + "firstSeen": "1567096638", + "lastUpdated": "1567096638", + "updateCount": 2, + "authorCount": 2 } }, { @@ -2271,9 +2362,10 @@ }, "meta": { "hash": "cfc08612e65d9dc9a5c634e94a379644fbdd7a858f0cbaf1c2e272d038495be9", - "firstSeen": "1566932336", - "lastUpdated": "1566932336", - "updateCount": 2 + "firstSeen": "1567096638", + "lastUpdated": "1567096638", + "updateCount": 2, + "authorCount": 2 } }, { @@ -2296,9 +2388,10 @@ }, "meta": { "hash": "31b710c7f120ba4e484fb3c782ab6cb3da0a47e84521220d474473229103ed5a", - "firstSeen": "1566932336", - "lastUpdated": "1566932336", - "updateCount": 2 + "firstSeen": "1567096638", + "lastUpdated": "1567096638", + "updateCount": 2, + "authorCount": 2 } }, { @@ -2310,7 +2403,7 @@ "text": "Returns the human readable format of the given number of milliseconds.\n\nDivide `ms` with the appropriate values to obtain the appropriate values for `day`, `hour`, `minute`, `second` and `millisecond`.\nUse `Object.entries()` with `Array.prototype.filter()` to keep only non-zero values.\nUse `Array.prototype.map()` to create the string for each value, pluralizing appropriately.\nUse `String.prototype.join(', ')` to combine the values into a string.\n\n", "codeBlocks": { "es6": "const formatDuration = ms => {\n if (ms < 0) ms = -ms;\n const time = {\n day: Math.floor(ms / 86400000),\n hour: Math.floor(ms / 3600000) % 24,\n minute: Math.floor(ms / 60000) % 60,\n second: Math.floor(ms / 1000) % 60,\n millisecond: Math.floor(ms) % 1000\n };\n return Object.entries(time)\n .filter(val => val[1] !== 0)\n .map(([key, val]) => `${val} ${key}${val !== 1 ? 's' : ''}`)\n .join(', ');\n};", - "es5": "function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _nonIterableRest(); }\n\nfunction _nonIterableRest() { throw new TypeError(\"Invalid attempt to destructure non-iterable instance\"); }\n\nfunction _iterableToArrayLimit(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i[\"return\"] != null) _i[\"return\"](); } finally { if (_d) throw _e; } } return _arr; }\n\nfunction _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }\n\nvar formatDuration = function formatDuration(ms) {\n if (ms < 0) ms = -ms;\n var time = {\n day: Math.floor(ms / 86400000),\n hour: Math.floor(ms / 3600000) % 24,\n minute: Math.floor(ms / 60000) % 60,\n second: Math.floor(ms / 1000) % 60,\n millisecond: Math.floor(ms) % 1000\n };\n return Object.entries(time).filter(function (val) {\n return val[1] !== 0;\n }).map(function (_ref) {\n var _ref2 = _slicedToArray(_ref, 2),\n key = _ref2[0],\n val = _ref2[1];\n\n return \"\".concat(val, \" \").concat(key).concat(val !== 1 ? 's' : '');\n }).join(', ');\n};", + "es5": "function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _nonIterableRest(); }\n\nfunction _nonIterableRest() { throw new TypeError(\"Invalid attempt to destructure non-iterable instance\"); }\n\nfunction _iterableToArrayLimit(arr, i) { if (!(Symbol.iterator in Object(arr) || Object.prototype.toString.call(arr) === \"[object Arguments]\")) { return; } var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i[\"return\"] != null) _i[\"return\"](); } finally { if (_d) throw _e; } } return _arr; }\n\nfunction _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }\n\nvar formatDuration = function formatDuration(ms) {\n if (ms < 0) ms = -ms;\n var time = {\n day: Math.floor(ms / 86400000),\n hour: Math.floor(ms / 3600000) % 24,\n minute: Math.floor(ms / 60000) % 60,\n second: Math.floor(ms / 1000) % 60,\n millisecond: Math.floor(ms) % 1000\n };\n return Object.entries(time).filter(function (val) {\n return val[1] !== 0;\n }).map(function (_ref) {\n var _ref2 = _slicedToArray(_ref, 2),\n key = _ref2[0],\n val = _ref2[1];\n\n return \"\".concat(val, \" \").concat(key).concat(val !== 1 ? 's' : '');\n }).join(', ');\n};", "example": "formatDuration(1001); // '1 second, 1 millisecond'\nformatDuration(34325055574); // '397 days, 6 hours, 44 minutes, 15 seconds, 574 milliseconds'" }, "tags": [ @@ -2323,9 +2416,10 @@ }, "meta": { "hash": "176cd07a9486286924a7393fe631e83471e7123e3b6349309a7c1cee7746d764", - "firstSeen": "1566932336", - "lastUpdated": "1566932336", - "updateCount": 2 + "firstSeen": "1567096638", + "lastUpdated": "1567096638", + "updateCount": 2, + "authorCount": 2 } }, { @@ -2337,7 +2431,7 @@ "text": "Encode a set of form elements as an `object`.\n\nUse the `FormData` constructor to convert the HTML `form` to `FormData`, `Array.from()` to convert to an array.\nCollect the object from the array, using `Array.prototype.reduce()`.\n\n", "codeBlocks": { "es6": "const formToObject = form =>\n Array.from(new FormData(form)).reduce(\n (acc, [key, value]) => ({\n ...acc,\n [key]: value\n }),\n {}\n );", - "es5": "function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }\n\nfunction _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(source, true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(source).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }\n\nfunction _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\n\nfunction _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _nonIterableRest(); }\n\nfunction _nonIterableRest() { throw new TypeError(\"Invalid attempt to destructure non-iterable instance\"); }\n\nfunction _iterableToArrayLimit(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i[\"return\"] != null) _i[\"return\"](); } finally { if (_d) throw _e; } } return _arr; }\n\nfunction _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }\n\nvar formToObject = function formToObject(form) {\n return Array.from(new FormData(form)).reduce(function (acc, _ref) {\n var _ref2 = _slicedToArray(_ref, 2),\n key = _ref2[0],\n value = _ref2[1];\n\n return _objectSpread({}, acc, _defineProperty({}, key, value));\n }, {});\n};", + "es5": "function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }\n\nfunction _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }\n\nfunction _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\n\nfunction _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _nonIterableRest(); }\n\nfunction _nonIterableRest() { throw new TypeError(\"Invalid attempt to destructure non-iterable instance\"); }\n\nfunction _iterableToArrayLimit(arr, i) { if (!(Symbol.iterator in Object(arr) || Object.prototype.toString.call(arr) === \"[object Arguments]\")) { return; } var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i[\"return\"] != null) _i[\"return\"](); } finally { if (_d) throw _e; } } return _arr; }\n\nfunction _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }\n\nvar formToObject = function formToObject(form) {\n return Array.from(new FormData(form)).reduce(function (acc, _ref) {\n var _ref2 = _slicedToArray(_ref, 2),\n key = _ref2[0],\n value = _ref2[1];\n\n return _objectSpread({}, acc, _defineProperty({}, key, value));\n }, {});\n};", "example": "formToObject(document.querySelector('#form')); // { email: 'test@email.com', name: 'Test Name' }" }, "tags": [ @@ -2348,9 +2442,10 @@ }, "meta": { "hash": "24c79c76a89e64ad0d4a29f542400937bf280f49cd7bbafff3e26b63f0c4ad4d", - "firstSeen": "1566932336", - "lastUpdated": "1566932336", - "updateCount": 2 + "firstSeen": "1567096638", + "lastUpdated": "1567096638", + "updateCount": 2, + "authorCount": 2 } }, { @@ -2372,9 +2467,10 @@ }, "meta": { "hash": "0f4525106d39a394413f7623eff35661baad618f49d7c2265496153804862c55", - "firstSeen": "1566932336", - "lastUpdated": "1566932336", - "updateCount": 2 + "firstSeen": "1567096638", + "lastUpdated": "1567096638", + "updateCount": 2, + "authorCount": 2 } }, { @@ -2396,9 +2492,10 @@ }, "meta": { "hash": "8810b76dac2c4294a0a029e697441ad73aa87f98a7b1698a61f31c62d5981ec8", - "firstSeen": "1566932336", - "lastUpdated": "1566932336", - "updateCount": 2 + "firstSeen": "1567096638", + "lastUpdated": "1567096638", + "updateCount": 2, + "authorCount": 2 } }, { @@ -2420,9 +2517,10 @@ }, "meta": { "hash": "1b4fe94ee0e82ecd4c77de9ea258ded34a8a834da1bb021b5b25fe84ab8e4eea", - "firstSeen": "1566932336", - "lastUpdated": "1566932336", - "updateCount": 2 + "firstSeen": "1567096638", + "lastUpdated": "1567096638", + "updateCount": 2, + "authorCount": 2 } }, { @@ -2445,9 +2543,10 @@ }, "meta": { "hash": "9f8947652b9c2faba5f1bda82f992bdc81a71c67374fcc843e96ce2a327a28db", - "firstSeen": "1566932336", - "lastUpdated": "1566932336", - "updateCount": 2 + "firstSeen": "1567096638", + "lastUpdated": "1567096638", + "updateCount": 2, + "authorCount": 2 } }, { @@ -2470,9 +2569,10 @@ }, "meta": { "hash": "1ad875e1b31348464b3eedddc0e0a4b0e10154e16b08025fa5e46d94995aa887", - "firstSeen": "1566932336", - "lastUpdated": "1566932336", - "updateCount": 2 + "firstSeen": "1567096638", + "lastUpdated": "1567096638", + "updateCount": 2, + "authorCount": 2 } }, { @@ -2495,9 +2595,10 @@ }, "meta": { "hash": "751df689bc853192c8302d245e96684deaf158da463d8cdcbd54f84bb0d7c6dc", - "firstSeen": "1566932336", - "lastUpdated": "1566932336", - "updateCount": 2 + "firstSeen": "1567096638", + "lastUpdated": "1567096638", + "updateCount": 2, + "authorCount": 2 } }, { @@ -2519,9 +2620,10 @@ }, "meta": { "hash": "dec4fa85a58d11deefd90a66b0ede5ec73ad3e2481d5cf76918d13235c3238d9", - "firstSeen": "1566932336", - "lastUpdated": "1566932336", - "updateCount": 2 + "firstSeen": "1567096638", + "lastUpdated": "1567096638", + "updateCount": 2, + "authorCount": 2 } }, { @@ -2543,9 +2645,10 @@ }, "meta": { "hash": "9f1b9128c94cd905327d5f09904f924fee541e8114e298fe7e01855d87cfe3d2", - "firstSeen": "1566932336", - "lastUpdated": "1566932336", - "updateCount": 2 + "firstSeen": "1567096638", + "lastUpdated": "1567096638", + "updateCount": 2, + "authorCount": 2 } }, { @@ -2567,9 +2670,10 @@ }, "meta": { "hash": "b2802086a18e09907de87f5409547d902ce7f6ae4f5a39cbc8869a662353303e", - "firstSeen": "1566932336", - "lastUpdated": "1566932336", - "updateCount": 2 + "firstSeen": "1567096638", + "lastUpdated": "1567096638", + "updateCount": 2, + "authorCount": 2 } }, { @@ -2591,9 +2695,10 @@ }, "meta": { "hash": "0a2c0629c3c0661519c08d21768dadd5bebac35c892d980d390b16b60c60a2eb", - "firstSeen": "1566932336", - "lastUpdated": "1566932336", - "updateCount": 2 + "firstSeen": "1567096638", + "lastUpdated": "1567096638", + "updateCount": 2, + "authorCount": 2 } }, { @@ -2615,9 +2720,10 @@ }, "meta": { "hash": "1caa2b9a8817bc11874785cdcf9f676e169caec6487c54124287ce85bb818c93", - "firstSeen": "1566932336", - "lastUpdated": "1566932336", - "updateCount": 2 + "firstSeen": "1567096638", + "lastUpdated": "1567096638", + "updateCount": 2, + "authorCount": 2 } }, { @@ -2628,7 +2734,7 @@ "fileName": "getMeridiemSuffixOfInteger.md", "text": "Converts an integer to a suffixed string, adding `am` or `pm` based on its value.\n\nUse the modulo operator (`%`) and conditional checks to transform an integer to a stringified 12-hour format with meridiem suffix.\n\n", "codeBlocks": { - "es6": "const getMeridiemSuffixOfInteger = num =>\n num === 0 || num === 24\n ? 12 + 'am'\n : num === 12\n ? 12 + 'pm'\n : num < 12\n ? (num % 12) + 'am'\n : (num % 12) + 'pm';", + "es6": "const getMeridiemSuffixOfInteger = num =>\n num === 0 || num === 24\n ? 12 + 'am'\n : num === 12\n ? 12 + 'pm'\n : num < 12\n ? (num % 12) + 'am'\n : (num % 12) + 'pm';", "es5": "var getMeridiemSuffixOfInteger = function getMeridiemSuffixOfInteger(num) {\n return num === 0 || num === 24 ? 12 + 'am' : num === 12 ? 12 + 'pm' : num < 12 ? num % 12 + 'am' : num % 12 + 'pm';\n};", "example": "getMeridiemSuffixOfInteger(0); // \"12am\"\ngetMeridiemSuffixOfInteger(11); // \"11am\"\ngetMeridiemSuffixOfInteger(13); // \"1pm\"\ngetMeridiemSuffixOfInteger(25); // \"1pm\"" }, @@ -2638,10 +2744,11 @@ ] }, "meta": { - "hash": "9e39c6a3a8ec5b51c5e16f69107fc9e90b2697b2cf2689850872071bb968723e", - "firstSeen": "1566932336", - "lastUpdated": "1574366947", - "updateCount": 23 + "hash": "16c3b724b653dcb31f3e59f1664a59951abb15a93eb3697cade4d3ae0e63c532", + "firstSeen": "1567096638", + "lastUpdated": "1575102829", + "updateCount": 22, + "authorCount": 2 } }, { @@ -2663,9 +2770,10 @@ }, "meta": { "hash": "255afa82679e614e1388476fb4392f0e1bb45f11e1c02e965925e231401f1f2c", - "firstSeen": "1566932336", - "lastUpdated": "1566932336", - "updateCount": 2 + "firstSeen": "1567096638", + "lastUpdated": "1567096638", + "updateCount": 2, + "authorCount": 2 } }, { @@ -2688,9 +2796,10 @@ }, "meta": { "hash": "f779277f9fb5fe54aa4b122bf87d73d921cd2550253a5bda3a2b512ebf70a976", - "firstSeen": "1566932336", - "lastUpdated": "1566932336", - "updateCount": 2 + "firstSeen": "1567096638", + "lastUpdated": "1567096638", + "updateCount": 2, + "authorCount": 2 } }, { @@ -2712,9 +2821,10 @@ }, "meta": { "hash": "7209ddadbe2402ac811e20f69feecbb682ee8ec0545dc4d0839455d4cb790432", - "firstSeen": "1566932336", - "lastUpdated": "1566932336", - "updateCount": 2 + "firstSeen": "1567096638", + "lastUpdated": "1567096638", + "updateCount": 2, + "authorCount": 2 } }, { @@ -2739,9 +2849,10 @@ }, "meta": { "hash": "460d0f75a526126cabbc1a0b7b727b78999332bec7876959519c187cd8db96db", - "firstSeen": "1566932336", - "lastUpdated": "1566932336", - "updateCount": 2 + "firstSeen": "1567096638", + "lastUpdated": "1567096638", + "updateCount": 2, + "authorCount": 2 } }, { @@ -2764,9 +2875,10 @@ }, "meta": { "hash": "8f501c922c2d5d7fcb20bc84153e7b392b4209592f54b7bae5c61b77bb107f81", - "firstSeen": "1566932336", - "lastUpdated": "1566932336", - "updateCount": 2 + "firstSeen": "1567096638", + "lastUpdated": "1567096638", + "updateCount": 2, + "authorCount": 2 } }, { @@ -2788,9 +2900,10 @@ }, "meta": { "hash": "b4234c37a89fb91b38283fc4ce8c4ccb2d7fb62d522f0becad4dd3d6a62efe56", - "firstSeen": "1566932336", - "lastUpdated": "1566932336", - "updateCount": 2 + "firstSeen": "1567096638", + "lastUpdated": "1567096638", + "updateCount": 2, + "authorCount": 2 } }, { @@ -2813,9 +2926,10 @@ }, "meta": { "hash": "bb20ea2c4697a6036f1d149063f91a973de3bb5902649ca7ac6c9271a3561375", - "firstSeen": "1566932336", - "lastUpdated": "1566932336", - "updateCount": 2 + "firstSeen": "1567096638", + "lastUpdated": "1567096638", + "updateCount": 2, + "authorCount": 2 } }, { @@ -2837,9 +2951,10 @@ }, "meta": { "hash": "45c7a17b5debde35c4b31270a22e1a052fb4b4f1d7c05d10c8045caec96ef550", - "firstSeen": "1566932336", - "lastUpdated": "1566932336", - "updateCount": 2 + "firstSeen": "1567096638", + "lastUpdated": "1567096638", + "updateCount": 2, + "authorCount": 2 } }, { @@ -2858,15 +2973,15 @@ "browser", "utility", "advanced", - "promise", - "advanced" + "promise" ] }, "meta": { "hash": "beb6f68f5a8b63fd90a671758556aa72b5c061b681df049779cdf5631837966c", - "firstSeen": "1566932336", - "lastUpdated": "1566932336", - "updateCount": 2 + "firstSeen": "1567096638", + "lastUpdated": "1567096638", + "updateCount": 2, + "authorCount": 2 } }, { @@ -2890,9 +3005,10 @@ }, "meta": { "hash": "e7b6164cfaacf4869f997747df3e135a1ec4342abf5a56498586513332272a96", - "firstSeen": "1566932336", - "lastUpdated": "1566932336", - "updateCount": 2 + "firstSeen": "1567096638", + "lastUpdated": "1567096638", + "updateCount": 2, + "authorCount": 2 } }, { @@ -2916,7 +3032,8 @@ "hash": "09664f8ede4cc568302d52fe37d3a29dc6c4b052e76834e761a02c391178f33a", "firstSeen": "1571143513", "lastUpdated": "1574366548", - "updateCount": 9 + "updateCount": 9, + "authorCount": 4 } }, { @@ -2938,9 +3055,10 @@ }, "meta": { "hash": "ce8a65975fa1d28533405e5518de608bcd3701bd21f97df39bc6e22b0e9bdf78", - "firstSeen": "1566932336", - "lastUpdated": "1566932336", - "updateCount": 2 + "firstSeen": "1567096638", + "lastUpdated": "1567096638", + "updateCount": 2, + "authorCount": 2 } }, { @@ -2964,9 +3082,10 @@ }, "meta": { "hash": "f61b08541372ded95a947cc570f57f7bbc9c7908ede569d59f294c5b9ef6feb1", - "firstSeen": "1566932336", - "lastUpdated": "1566932336", - "updateCount": 2 + "firstSeen": "1567096638", + "lastUpdated": "1567096638", + "updateCount": 2, + "authorCount": 2 } }, { @@ -2989,9 +3108,10 @@ }, "meta": { "hash": "b2cb8be1a0e2b2d6471762cdac531925aa3c0c695f2ef162e0c8c1f4a1c174aa", - "firstSeen": "1566932336", - "lastUpdated": "1566932336", - "updateCount": 2 + "firstSeen": "1567096638", + "lastUpdated": "1567096638", + "updateCount": 2, + "authorCount": 2 } }, { @@ -3015,9 +3135,10 @@ }, "meta": { "hash": "c138c0e5f16d48997691a98de7c0bc43b228a0b4285f0ab2b26d230e209d1530", - "firstSeen": "1566932336", - "lastUpdated": "1566932336", - "updateCount": 2 + "firstSeen": "1567096638", + "lastUpdated": "1567096638", + "updateCount": 2, + "authorCount": 2 } }, { @@ -3041,9 +3162,10 @@ }, "meta": { "hash": "5b29941074f19769531b3320ec8d61e2b2bdc69735fb781bf7e880ff2080ec04", - "firstSeen": "1566932336", - "lastUpdated": "1566932336", - "updateCount": 2 + "firstSeen": "1567096638", + "lastUpdated": "1567096638", + "updateCount": 2, + "authorCount": 2 } }, { @@ -3066,9 +3188,10 @@ }, "meta": { "hash": "37468f75e3b2200d43906644eacce72a17a0e22441367bf1b8689e01e3c9ee76", - "firstSeen": "1566932336", - "lastUpdated": "1566932336", - "updateCount": 2 + "firstSeen": "1567096638", + "lastUpdated": "1567096638", + "updateCount": 2, + "authorCount": 2 } }, { @@ -3090,9 +3213,10 @@ }, "meta": { "hash": "542bc8c7cc17654b02dc9fdcd6791901f61a6907c89e42192f6e5d2a8eba41be", - "firstSeen": "1566932336", - "lastUpdated": "1566932336", - "updateCount": 2 + "firstSeen": "1567096638", + "lastUpdated": "1567096638", + "updateCount": 2, + "authorCount": 2 } }, { @@ -3116,7 +3240,8 @@ "hash": "61b01330acd22d4099d244463131f2f2332af05a6ecb00b50397fb2997fc8cff", "firstSeen": "1572896236", "lastUpdated": "1572956990", - "updateCount": 3 + "updateCount": 3, + "authorCount": 3 } }, { @@ -3140,7 +3265,8 @@ "hash": "8f19064ba89ab86c50456844646b56f6bd2afec2fc4f9ab3478bd6201510a745", "firstSeen": "1572817757", "lastUpdated": "1572817757", - "updateCount": 2 + "updateCount": 2, + "authorCount": 2 } }, { @@ -3163,9 +3289,10 @@ }, "meta": { "hash": "544ebe19f71cab5f4b4ad5a6121d4327ebf2b09f04451151e7339c90c8924789", - "firstSeen": "1566932336", - "lastUpdated": "1566932336", - "updateCount": 2 + "firstSeen": "1567096638", + "lastUpdated": "1567096638", + "updateCount": 2, + "authorCount": 2 } }, { @@ -3187,9 +3314,10 @@ }, "meta": { "hash": "40c8167847d364d53d84026917aa41947024d180b0fbc70aa7033c1ef348c344", - "firstSeen": "1566932336", - "lastUpdated": "1566932336", - "updateCount": 2 + "firstSeen": "1567096638", + "lastUpdated": "1567096638", + "updateCount": 2, + "authorCount": 2 } }, { @@ -3211,9 +3339,10 @@ }, "meta": { "hash": "c2479bc7d9e651dde057378ed2641f37b75d5b4fc8ed295997bea8d37d46bba0", - "firstSeen": "1566932336", - "lastUpdated": "1566932336", - "updateCount": 2 + "firstSeen": "1567096638", + "lastUpdated": "1567096638", + "updateCount": 2, + "authorCount": 2 } }, { @@ -3235,9 +3364,10 @@ }, "meta": { "hash": "ada7e68c9a5a701265c1ea38dfc253b8ccb7d9c261dffcf9a42cc560b264cabc", - "firstSeen": "1566932336", - "lastUpdated": "1566932336", - "updateCount": 2 + "firstSeen": "1567096638", + "lastUpdated": "1567096638", + "updateCount": 2, + "authorCount": 2 } }, { @@ -3260,9 +3390,10 @@ }, "meta": { "hash": "f4e970fb09664acfd567ee0ebc9867672095c529778b8b9169ed5b13d431c563", - "firstSeen": "1566932336", - "lastUpdated": "1566932336", - "updateCount": 2 + "firstSeen": "1567096638", + "lastUpdated": "1567096638", + "updateCount": 2, + "authorCount": 2 } }, { @@ -3285,9 +3416,10 @@ }, "meta": { "hash": "59cc7791996547b646472153ebb1fb0bee4d177199e6a7311791eab98c58e3be", - "firstSeen": "1566932336", - "lastUpdated": "1566932336", - "updateCount": 2 + "firstSeen": "1567096638", + "lastUpdated": "1567096638", + "updateCount": 2, + "authorCount": 2 } }, { @@ -3310,9 +3442,10 @@ }, "meta": { "hash": "0e8321b0286c38321fdb3e27353567cdb03c6767152210e8e14e4925057adfe1", - "firstSeen": "1566932336", - "lastUpdated": "1566932336", - "updateCount": 2 + "firstSeen": "1567096638", + "lastUpdated": "1567096638", + "updateCount": 2, + "authorCount": 2 } }, { @@ -3335,9 +3468,10 @@ }, "meta": { "hash": "21b455190adbd8b80d2559a88d9ec244ac32544235b7cfed8caca65c11c8ab80", - "firstSeen": "1566932336", - "lastUpdated": "1566932336", - "updateCount": 2 + "firstSeen": "1567096638", + "lastUpdated": "1567096638", + "updateCount": 2, + "authorCount": 2 } }, { @@ -3359,9 +3493,10 @@ }, "meta": { "hash": "911d4a90c6ded62d063887e772d4017d4612e4fce48e79836ad19fc41e2c1abe", - "firstSeen": "1566932336", - "lastUpdated": "1566932336", - "updateCount": 2 + "firstSeen": "1567096638", + "lastUpdated": "1567096638", + "updateCount": 2, + "authorCount": 2 } }, { @@ -3383,9 +3518,10 @@ }, "meta": { "hash": "9a2e1d5c50b955f8be4e0ee6b63894525be4904905a62c483789dd4e3d4bb11e", - "firstSeen": "1566932336", - "lastUpdated": "1566932336", - "updateCount": 2 + "firstSeen": "1567096638", + "lastUpdated": "1567096638", + "updateCount": 2, + "authorCount": 2 } }, { @@ -3407,9 +3543,10 @@ }, "meta": { "hash": "72db2aadee9327a4e794727fd39a254cc9cfcaa4f0819b2d03ad3c39c950264b", - "firstSeen": "1566932336", - "lastUpdated": "1566932336", - "updateCount": 2 + "firstSeen": "1567096638", + "lastUpdated": "1567096638", + "updateCount": 2, + "authorCount": 2 } }, { @@ -3432,9 +3569,10 @@ }, "meta": { "hash": "8d42afae6c90ddcd75a078a39db780eedd9a484103fc2174f7b392613a31085f", - "firstSeen": "1566932336", - "lastUpdated": "1566932336", - "updateCount": 2 + "firstSeen": "1567096638", + "lastUpdated": "1567096638", + "updateCount": 2, + "authorCount": 2 } }, { @@ -3457,9 +3595,10 @@ }, "meta": { "hash": "ad560d72d29aa86e305bdbd54a7a5b5cde8c57a38386342fd8d6905575de1f7a", - "firstSeen": "1566932336", - "lastUpdated": "1566932336", - "updateCount": 2 + "firstSeen": "1567096638", + "lastUpdated": "1567096638", + "updateCount": 2, + "authorCount": 2 } }, { @@ -3482,9 +3621,10 @@ }, "meta": { "hash": "3dd3ad662f52d4189d00c5abea2e3d8f408acc789065d2071d16ff2a442c7c55", - "firstSeen": "1566932336", - "lastUpdated": "1566932336", - "updateCount": 2 + "firstSeen": "1567096638", + "lastUpdated": "1567096638", + "updateCount": 2, + "authorCount": 2 } }, { @@ -3507,9 +3647,10 @@ }, "meta": { "hash": "193618c3f15f2aa14ce53dd88ee928aa8f6be6891c5253d7921eb87547ee7dbd", - "firstSeen": "1566932336", - "lastUpdated": "1566932336", - "updateCount": 2 + "firstSeen": "1567096638", + "lastUpdated": "1567096638", + "updateCount": 2, + "authorCount": 2 } }, { @@ -3533,9 +3674,10 @@ }, "meta": { "hash": "c9bbbe9ff32915b2c44849dfe8e1ab3554383cb0b7df9551424ca2597e355f41", - "firstSeen": "1566932336", - "lastUpdated": "1566932336", - "updateCount": 2 + "firstSeen": "1567096638", + "lastUpdated": "1567096638", + "updateCount": 2, + "authorCount": 2 } }, { @@ -3560,9 +3702,10 @@ }, "meta": { "hash": "7523c5d3ab85075efa61efc135bb1c8d85e2a2e5407ddc5768099993d46f13b5", - "firstSeen": "1566932336", - "lastUpdated": "1566932336", - "updateCount": 2 + "firstSeen": "1567096638", + "lastUpdated": "1567096638", + "updateCount": 2, + "authorCount": 2 } }, { @@ -3585,9 +3728,10 @@ }, "meta": { "hash": "19efe22718bca00459c41fa9df56c3574270c500bdd670873358052ccc870f5b", - "firstSeen": "1566932336", - "lastUpdated": "1566932336", - "updateCount": 2 + "firstSeen": "1567096638", + "lastUpdated": "1567096638", + "updateCount": 2, + "authorCount": 2 } }, { @@ -3610,9 +3754,10 @@ }, "meta": { "hash": "d5d6a4a5652dfb641a7cade70e041e2e91aec06e9184d06f6bb82499bfee0498", - "firstSeen": "1566932336", - "lastUpdated": "1566932336", - "updateCount": 2 + "firstSeen": "1567096638", + "lastUpdated": "1567096638", + "updateCount": 2, + "authorCount": 2 } }, { @@ -3635,9 +3780,10 @@ }, "meta": { "hash": "0694b883486ca56109cb2c2ad8ed3477c0c4ee84d2fa81884409c40302a13fa7", - "firstSeen": "1566932336", - "lastUpdated": "1566932336", - "updateCount": 2 + "firstSeen": "1567096638", + "lastUpdated": "1567096638", + "updateCount": 2, + "authorCount": 2 } }, { @@ -3660,9 +3806,10 @@ }, "meta": { "hash": "e0d70480b239a585f907c965214a037ce23ae15f5484ab80930ea9f57cbe529e", - "firstSeen": "1566932336", - "lastUpdated": "1566932336", - "updateCount": 2 + "firstSeen": "1567096638", + "lastUpdated": "1567096638", + "updateCount": 2, + "authorCount": 2 } }, { @@ -3684,9 +3831,10 @@ }, "meta": { "hash": "2c2e66152db8a6445af911c49a181d4cd5ca92db5bd23f24124d2df06bebbc15", - "firstSeen": "1566932336", - "lastUpdated": "1566932336", - "updateCount": 2 + "firstSeen": "1567096638", + "lastUpdated": "1567096638", + "updateCount": 2, + "authorCount": 2 } }, { @@ -3709,9 +3857,10 @@ }, "meta": { "hash": "6fb24837c043a0cc320a46695ef0e286a558aaf06e9354407569ae61c4a8d0bd", - "firstSeen": "1566932336", - "lastUpdated": "1566932336", - "updateCount": 2 + "firstSeen": "1567096638", + "lastUpdated": "1567096638", + "updateCount": 2, + "authorCount": 2 } }, { @@ -3733,9 +3882,10 @@ }, "meta": { "hash": "3aab66b09df0070568e0ff69717ac0d5c62d88727262419d07b0f50e1a6677e4", - "firstSeen": "1566932336", - "lastUpdated": "1566932336", - "updateCount": 2 + "firstSeen": "1567096638", + "lastUpdated": "1567096638", + "updateCount": 2, + "authorCount": 2 } }, { @@ -3757,9 +3907,10 @@ }, "meta": { "hash": "e89795b1f8240e97e4ed1825f2cb38deaa356b8c08ecdd3eaaeb6fe243363f7f", - "firstSeen": "1566932336", - "lastUpdated": "1566932336", - "updateCount": 2 + "firstSeen": "1567096638", + "lastUpdated": "1567096638", + "updateCount": 2, + "authorCount": 2 } }, { @@ -3782,9 +3933,10 @@ }, "meta": { "hash": "f2ca078f493b19d44dddd6556e933b056bc9fff56e493a5481c3d943b24f1e01", - "firstSeen": "1566932336", - "lastUpdated": "1566932336", - "updateCount": 2 + "firstSeen": "1567096638", + "lastUpdated": "1567096638", + "updateCount": 2, + "authorCount": 2 } }, { @@ -3809,9 +3961,10 @@ }, "meta": { "hash": "ff080fab7095a63d01048bca4ed77d033af852303d26668c1ee7f564db8407d1", - "firstSeen": "1566932336", - "lastUpdated": "1566932336", - "updateCount": 2 + "firstSeen": "1567096638", + "lastUpdated": "1567096638", + "updateCount": 2, + "authorCount": 2 } }, { @@ -3833,9 +3986,10 @@ }, "meta": { "hash": "fa16462c8309a49d282421fd80c995fd3f8a9debaba5e492dd4a3625eecce101", - "firstSeen": "1566932336", - "lastUpdated": "1566932336", - "updateCount": 2 + "firstSeen": "1567096638", + "lastUpdated": "1567096638", + "updateCount": 2, + "authorCount": 2 } }, { @@ -3858,9 +4012,10 @@ }, "meta": { "hash": "c9004512c957ceeda55d851452ad2b2d59235648272222fd36ca75d98965f0b6", - "firstSeen": "1566932336", - "lastUpdated": "1566932336", - "updateCount": 2 + "firstSeen": "1567096638", + "lastUpdated": "1567096638", + "updateCount": 2, + "authorCount": 2 } }, { @@ -3883,9 +4038,10 @@ }, "meta": { "hash": "e47bc176d868f3aab83f762997bf9d355258607594648573d2482faf7fc08826", - "firstSeen": "1566932336", - "lastUpdated": "1566932336", - "updateCount": 2 + "firstSeen": "1567096638", + "lastUpdated": "1567096638", + "updateCount": 2, + "authorCount": 2 } }, { @@ -3908,9 +4064,10 @@ }, "meta": { "hash": "ec55fd2848f1443613e33d59634ecaefc9dc82b721424b5416830a7389e1ce6e", - "firstSeen": "1566932336", - "lastUpdated": "1566932336", - "updateCount": 2 + "firstSeen": "1567096638", + "lastUpdated": "1567096638", + "updateCount": 2, + "authorCount": 2 } }, { @@ -3932,9 +4089,10 @@ }, "meta": { "hash": "fd508fc1174e19116709b5979af67b3bcc48100b19e5a87e15b9545ba0a56d88", - "firstSeen": "1566932336", - "lastUpdated": "1566932336", - "updateCount": 2 + "firstSeen": "1567096638", + "lastUpdated": "1567096638", + "updateCount": 2, + "authorCount": 2 } }, { @@ -3956,9 +4114,10 @@ }, "meta": { "hash": "ecce7adac512977eb9a1f6ea9644c1e1318ca8611512009fbd55ea38519aa1c3", - "firstSeen": "1566932336", - "lastUpdated": "1566932336", - "updateCount": 2 + "firstSeen": "1567096638", + "lastUpdated": "1567096638", + "updateCount": 2, + "authorCount": 2 } }, { @@ -3981,9 +4140,10 @@ }, "meta": { "hash": "5c6e6defd17719973b507d6c55cf00f958ea92ea3c55b6d9dff6d0441f53dc9a", - "firstSeen": "1566932336", - "lastUpdated": "1566932336", - "updateCount": 2 + "firstSeen": "1567096638", + "lastUpdated": "1567096638", + "updateCount": 2, + "authorCount": 2 } }, { @@ -4006,9 +4166,10 @@ }, "meta": { "hash": "06b78776522f9e213357c031e21568295d7a528871fe05781ae2ac4f7e5d8451", - "firstSeen": "1566932336", - "lastUpdated": "1566932336", - "updateCount": 2 + "firstSeen": "1567096638", + "lastUpdated": "1567096638", + "updateCount": 2, + "authorCount": 2 } }, { @@ -4031,9 +4192,10 @@ }, "meta": { "hash": "c3424342e1ccfaff2b8f0b0727595fc2cd8063a185ecc42708fa41a2a7c25fc4", - "firstSeen": "1566932336", - "lastUpdated": "1566932336", - "updateCount": 2 + "firstSeen": "1567096638", + "lastUpdated": "1567096638", + "updateCount": 2, + "authorCount": 2 } }, { @@ -4057,7 +4219,8 @@ "hash": "9d259b2877b38e255222f876d6f00247b6449da44082d24eadd48f46d71ccd9d", "firstSeen": "1569432906", "lastUpdated": "1569432906", - "updateCount": 2 + "updateCount": 2, + "authorCount": 2 } }, { @@ -4080,9 +4243,10 @@ }, "meta": { "hash": "8a9ef17eda1a977bdd1149a4a782d7d0e7addd8c6db8d4bd3734c9269863b12c", - "firstSeen": "1566932336", - "lastUpdated": "1566932336", - "updateCount": 2 + "firstSeen": "1567096638", + "lastUpdated": "1567096638", + "updateCount": 2, + "authorCount": 2 } }, { @@ -4105,9 +4269,10 @@ }, "meta": { "hash": "aafa416b434137db2540668a13e8a33138cb04d652f29e8793a6c76b6a62983d", - "firstSeen": "1566932336", - "lastUpdated": "1566932336", - "updateCount": 2 + "firstSeen": "1567096638", + "lastUpdated": "1567096638", + "updateCount": 2, + "authorCount": 2 } }, { @@ -4132,9 +4297,10 @@ }, "meta": { "hash": "2df9322464af125f8a33dad1f15a7df5ccd7d8f9322efe871dc026974971ac85", - "firstSeen": "1566932336", - "lastUpdated": "1566932336", - "updateCount": 2 + "firstSeen": "1567096638", + "lastUpdated": "1567096638", + "updateCount": 2, + "authorCount": 2 } }, { @@ -4158,9 +4324,10 @@ }, "meta": { "hash": "3edbaa911db73b703d8af9a0681a18f4c61d65db15cbd5812b78ecd3ac364cef", - "firstSeen": "1566932336", - "lastUpdated": "1566932336", - "updateCount": 2 + "firstSeen": "1567096638", + "lastUpdated": "1567096638", + "updateCount": 2, + "authorCount": 2 } }, { @@ -4183,9 +4350,10 @@ }, "meta": { "hash": "a8199a2ae7965f48651bc7996e810423b2de44467204d481df54f7c8fa2dd44e", - "firstSeen": "1566932336", - "lastUpdated": "1566932336", - "updateCount": 2 + "firstSeen": "1567096638", + "lastUpdated": "1567096638", + "updateCount": 2, + "authorCount": 2 } }, { @@ -4208,9 +4376,10 @@ }, "meta": { "hash": "4accb95c8fb5ac770c73c78b6236938773499c74617df09a1f73a60abd6f44d7", - "firstSeen": "1566932336", - "lastUpdated": "1566932336", - "updateCount": 2 + "firstSeen": "1567096638", + "lastUpdated": "1567096638", + "updateCount": 2, + "authorCount": 2 } }, { @@ -4222,7 +4391,7 @@ "text": "Returns `1` if the array is sorted in ascending order, `-1` if it is sorted in descending order or `0` if it is not sorted.\n\nCalculate the ordering `direction` for the first two elements.\nUse `Object.entries()` to loop over array objects and compare them in pairs.\nReturn `0` if the `direction` changes or the `direction` if the last element is reached.\n\n", "codeBlocks": { "es6": "const isSorted = arr => {\n let direction = -(arr[0] - arr[1]);\n for (let [i, val] of arr.entries()) {\n direction = !direction ? -(arr[i - 1] - arr[i]) : direction;\n if (i === arr.length - 1) return !direction ? 0 : direction;\n else if ((val - arr[i + 1]) * direction > 0) return 0;\n }\n};", - "es5": "function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _nonIterableRest(); }\n\nfunction _nonIterableRest() { throw new TypeError(\"Invalid attempt to destructure non-iterable instance\"); }\n\nfunction _iterableToArrayLimit(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i[\"return\"] != null) _i[\"return\"](); } finally { if (_d) throw _e; } } return _arr; }\n\nfunction _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }\n\nvar isSorted = function isSorted(arr) {\n var direction = -(arr[0] - arr[1]);\n var _iteratorNormalCompletion = true;\n var _didIteratorError = false;\n var _iteratorError = undefined;\n\n try {\n for (var _iterator = arr.entries()[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {\n var _step$value = _slicedToArray(_step.value, 2),\n i = _step$value[0],\n val = _step$value[1];\n\n direction = !direction ? -(arr[i - 1] - arr[i]) : direction;\n if (i === arr.length - 1) return !direction ? 0 : direction;else if ((val - arr[i + 1]) * direction > 0) return 0;\n }\n } catch (err) {\n _didIteratorError = true;\n _iteratorError = err;\n } finally {\n try {\n if (!_iteratorNormalCompletion && _iterator[\"return\"] != null) {\n _iterator[\"return\"]();\n }\n } finally {\n if (_didIteratorError) {\n throw _iteratorError;\n }\n }\n }\n};", + "es5": "function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _nonIterableRest(); }\n\nfunction _nonIterableRest() { throw new TypeError(\"Invalid attempt to destructure non-iterable instance\"); }\n\nfunction _iterableToArrayLimit(arr, i) { if (!(Symbol.iterator in Object(arr) || Object.prototype.toString.call(arr) === \"[object Arguments]\")) { return; } var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i[\"return\"] != null) _i[\"return\"](); } finally { if (_d) throw _e; } } return _arr; }\n\nfunction _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }\n\nvar isSorted = function isSorted(arr) {\n var direction = -(arr[0] - arr[1]);\n var _iteratorNormalCompletion = true;\n var _didIteratorError = false;\n var _iteratorError = undefined;\n\n try {\n for (var _iterator = arr.entries()[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {\n var _step$value = _slicedToArray(_step.value, 2),\n i = _step$value[0],\n val = _step$value[1];\n\n direction = !direction ? -(arr[i - 1] - arr[i]) : direction;\n if (i === arr.length - 1) return !direction ? 0 : direction;else if ((val - arr[i + 1]) * direction > 0) return 0;\n }\n } catch (err) {\n _didIteratorError = true;\n _iteratorError = err;\n } finally {\n try {\n if (!_iteratorNormalCompletion && _iterator[\"return\"] != null) {\n _iterator[\"return\"]();\n }\n } finally {\n if (_didIteratorError) {\n throw _iteratorError;\n }\n }\n }\n};", "example": "isSorted([0, 1, 2, 2]); // 1\nisSorted([4, 3, 2]); // -1\nisSorted([4, 3, 5]); // 0" }, "tags": [ @@ -4232,9 +4401,10 @@ }, "meta": { "hash": "b916ab345483f3d11d921f5f54da89bbf1c724aceb1d1c16f5b7365794da6e0e", - "firstSeen": "1566932336", - "lastUpdated": "1566932336", - "updateCount": 2 + "firstSeen": "1567096638", + "lastUpdated": "1567096638", + "updateCount": 2, + "authorCount": 2 } }, { @@ -4257,9 +4427,10 @@ }, "meta": { "hash": "5e2955867dd0b233a65bf95587e4a190da61629a4cba61e270d36e0a26c7946e", - "firstSeen": "1566932336", - "lastUpdated": "1566932336", - "updateCount": 2 + "firstSeen": "1567096638", + "lastUpdated": "1567096638", + "updateCount": 2, + "authorCount": 2 } }, { @@ -4282,9 +4453,10 @@ }, "meta": { "hash": "4a29ea0e99857a128109e6cf7d1120bc4cdb6b05be2ce4602715e6c863b1cc3d", - "firstSeen": "1566932336", - "lastUpdated": "1566932336", - "updateCount": 2 + "firstSeen": "1567096638", + "lastUpdated": "1567096638", + "updateCount": 2, + "authorCount": 2 } }, { @@ -4306,9 +4478,10 @@ }, "meta": { "hash": "8599f274909a26bd17178514b849ee803959f3c69207fce2951923d1719fbddb", - "firstSeen": "1566932336", - "lastUpdated": "1566932336", - "updateCount": 2 + "firstSeen": "1567096638", + "lastUpdated": "1567096638", + "updateCount": 2, + "authorCount": 2 } }, { @@ -4330,9 +4503,10 @@ }, "meta": { "hash": "aaf7f8a0beaeedb11a5b13b304fa1c51eddf66e103d2b44a1c3648de39fd1e23", - "firstSeen": "1566932336", - "lastUpdated": "1566932336", - "updateCount": 2 + "firstSeen": "1567096638", + "lastUpdated": "1567096638", + "updateCount": 2, + "authorCount": 2 } }, { @@ -4354,9 +4528,10 @@ }, "meta": { "hash": "6ebaa03264b6b2f637f8380b8796ebdc820a2031db72fcfd5d6d657af79b496c", - "firstSeen": "1566932336", - "lastUpdated": "1566932336", - "updateCount": 2 + "firstSeen": "1567096638", + "lastUpdated": "1567096638", + "updateCount": 2, + "authorCount": 2 } }, { @@ -4379,9 +4554,10 @@ }, "meta": { "hash": "e9f213bd74fba0cfc5e7706967f03dee72ee516e213715dab97c5fd32ba7f4f3", - "firstSeen": "1566932336", + "firstSeen": "1567096638", "lastUpdated": "1567395249", - "updateCount": 3 + "updateCount": 3, + "authorCount": 3 } }, { @@ -4404,9 +4580,10 @@ }, "meta": { "hash": "3b695d9ce6aa94aea1a367fba124a615d0132c8894e702f96e042fd6e6349ac1", - "firstSeen": "1566932336", - "lastUpdated": "1566932336", - "updateCount": 2 + "firstSeen": "1567096638", + "lastUpdated": "1567096638", + "updateCount": 2, + "authorCount": 2 } }, { @@ -4428,9 +4605,10 @@ }, "meta": { "hash": "f4b7c801ff0d3a23d10d2cb4de23d63e0d1dd09cd0d014c414a81c5628b8ff8b", - "firstSeen": "1566932336", - "lastUpdated": "1566932336", - "updateCount": 2 + "firstSeen": "1567096638", + "lastUpdated": "1567096638", + "updateCount": 2, + "authorCount": 2 } }, { @@ -4452,9 +4630,10 @@ }, "meta": { "hash": "6b2bfb3ce5798f702332f4cf14749b4b044fe7de6ee1d79bc786c1e3fe704dbd", - "firstSeen": "1566932336", - "lastUpdated": "1566932336", - "updateCount": 2 + "firstSeen": "1567096638", + "lastUpdated": "1567096638", + "updateCount": 2, + "authorCount": 2 } }, { @@ -4477,9 +4656,10 @@ }, "meta": { "hash": "8f9400b2f8204180520e4cb2d2150ea515eb704d684f483377ba3e5513268bb0", - "firstSeen": "1566932336", - "lastUpdated": "1566932336", - "updateCount": 2 + "firstSeen": "1567096638", + "lastUpdated": "1567096638", + "updateCount": 2, + "authorCount": 2 } }, { @@ -4490,7 +4670,7 @@ "fileName": "join.md", "text": "Joins all elements of an array into a string and returns this string.\nUses a separator and an end separator.\n\nUse `Array.prototype.reduce()` to combine elements into a string.\nOmit the second argument, `separator`, to use a default separator of `','`.\nOmit the third argument, `end`, to use the same value as `separator` by default.\n\n", "codeBlocks": { - "es6": "const join = (arr, separator = ',', end = separator) =>\n arr.reduce(\n (acc, val, i) =>\n i === arr.length - 2\n ? acc + val + end\n : i === arr.length - 1\n ? acc + val\n : acc + val + separator,\n ''\n );", + "es6": "const join = (arr, separator = ',', end = separator) =>\n arr.reduce(\n (acc, val, i) =>\n i === arr.length - 2\n ? acc + val + end\n : i === arr.length - 1\n ? acc + val\n : acc + val + separator,\n ''\n );", "es5": "var join = function join(arr) {\n var separator = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : ',';\n var end = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : separator;\n return arr.reduce(function (acc, val, i) {\n return i === arr.length - 2 ? acc + val + end : i === arr.length - 1 ? acc + val : acc + val + separator;\n }, '');\n};", "example": "join(['pen', 'pineapple', 'apple', 'pen'], ',', '&'); // \"pen,pineapple,apple&pen\"\njoin(['pen', 'pineapple', 'apple', 'pen'], ','); // \"pen,pineapple,apple,pen\"\njoin(['pen', 'pineapple', 'apple', 'pen']); // \"pen,pineapple,apple,pen\"" }, @@ -4500,10 +4680,11 @@ ] }, "meta": { - "hash": "3db3faac666ee61ab86c70766d2ab5d1293ffd818da87edb971bfff7a366364a", - "firstSeen": "1566932336", - "lastUpdated": "1574366947", - "updateCount": 23 + "hash": "362fddaa6244404741e84bca6fc442a101fdb642af53b299e8b9994d0d7162d8", + "firstSeen": "1567096638", + "lastUpdated": "1575102829", + "updateCount": 22, + "authorCount": 2 } }, { @@ -4527,9 +4708,10 @@ }, "meta": { "hash": "5b76a1a772d79233e7d8c87d903f1ef48b4c4bc52a05df4d13753ed810795380", - "firstSeen": "1566932336", - "lastUpdated": "1566932336", - "updateCount": 2 + "firstSeen": "1567096638", + "lastUpdated": "1567096638", + "updateCount": 2, + "authorCount": 2 } }, { @@ -4552,9 +4734,10 @@ }, "meta": { "hash": "e7b3dc5eaa43f1ccf6b4863e437b9b4b275ec79fb18623a4c3d0e6ec300d9bcb", - "firstSeen": "1566932336", - "lastUpdated": "1566932336", - "updateCount": 2 + "firstSeen": "1567096638", + "lastUpdated": "1567096638", + "updateCount": 2, + "authorCount": 2 } }, { @@ -4576,9 +4759,10 @@ }, "meta": { "hash": "e39f9d9a330111b1aa8c32545a9fcb20211563a8f25fdbed2abfb2ce6defad62", - "firstSeen": "1566932336", - "lastUpdated": "1566932336", - "updateCount": 2 + "firstSeen": "1567096638", + "lastUpdated": "1567096638", + "updateCount": 2, + "authorCount": 2 } }, { @@ -4601,9 +4785,10 @@ }, "meta": { "hash": "31f59a2480a0c840666af05f87ede6b169aece233b0323e9f03fd79ac7d4bc44", - "firstSeen": "1566932336", - "lastUpdated": "1566932336", - "updateCount": 2 + "firstSeen": "1567096638", + "lastUpdated": "1567096638", + "updateCount": 2, + "authorCount": 2 } }, { @@ -4627,9 +4812,10 @@ }, "meta": { "hash": "1277ce52444adcbc3a7b62d5c9019aa3cf01293e7749b8d0e1871ae2aa6a8c88", - "firstSeen": "1566932336", - "lastUpdated": "1566932336", - "updateCount": 2 + "firstSeen": "1567096638", + "lastUpdated": "1567096638", + "updateCount": 2, + "authorCount": 2 } }, { @@ -4651,9 +4837,10 @@ }, "meta": { "hash": "5a7033d47335bedd0239adab9cc2f112a311c28398d46da2bc2196fe61c9ce78", - "firstSeen": "1566932336", - "lastUpdated": "1566932336", - "updateCount": 2 + "firstSeen": "1567096638", + "lastUpdated": "1567096638", + "updateCount": 2, + "authorCount": 2 } }, { @@ -4676,9 +4863,10 @@ }, "meta": { "hash": "ab83bac8546d02dfe4227792750f0b4c64cd2c8f8ce6063eef2a3f4357210d63", - "firstSeen": "1566932336", - "lastUpdated": "1566932336", - "updateCount": 2 + "firstSeen": "1567096638", + "lastUpdated": "1567096638", + "updateCount": 2, + "authorCount": 2 } }, { @@ -4701,9 +4889,10 @@ }, "meta": { "hash": "3e721dd4b5fc9a41ed7f3ae6eb888848c8ae557a0feea28f17f945a24ab677ae", - "firstSeen": "1566932336", - "lastUpdated": "1566932336", - "updateCount": 2 + "firstSeen": "1567096638", + "lastUpdated": "1567096638", + "updateCount": 2, + "authorCount": 2 } }, { @@ -4725,9 +4914,10 @@ }, "meta": { "hash": "46da170d5f14d8070725e9f31e5b24de72aa4b0b476912d602e0480400638c9c", - "firstSeen": "1566932336", - "lastUpdated": "1566932336", - "updateCount": 2 + "firstSeen": "1567096638", + "lastUpdated": "1567096638", + "updateCount": 2, + "authorCount": 2 } }, { @@ -4750,9 +4940,10 @@ }, "meta": { "hash": "3afc30c02480be79ae5fb41e05ee2b1cc6f3b408ccb64a1a192d0ad34148ede2", - "firstSeen": "1566932336", - "lastUpdated": "1566932336", - "updateCount": 2 + "firstSeen": "1567096638", + "lastUpdated": "1567096638", + "updateCount": 2, + "authorCount": 2 } }, { @@ -4777,9 +4968,10 @@ }, "meta": { "hash": "c4df98d941aeadd165c6a02143d79f7a9bf013f8c221f709aa545bf83495a956", - "firstSeen": "1566932336", - "lastUpdated": "1566932336", - "updateCount": 2 + "firstSeen": "1567096638", + "lastUpdated": "1567096638", + "updateCount": 2, + "authorCount": 2 } }, { @@ -4802,9 +4994,10 @@ }, "meta": { "hash": "3853716eb171ac10f5b6dbd0b6afda1342262de305336cd0effd43dc75592f3c", - "firstSeen": "1566932336", - "lastUpdated": "1566932336", - "updateCount": 2 + "firstSeen": "1567096638", + "lastUpdated": "1567096638", + "updateCount": 2, + "authorCount": 2 } }, { @@ -4828,9 +5021,10 @@ }, "meta": { "hash": "20da2d84848993791b963b0b44a1bbe6746259a6c40675e477a6f0e4ed449ab5", - "firstSeen": "1566932336", - "lastUpdated": "1566932336", - "updateCount": 2 + "firstSeen": "1567096638", + "lastUpdated": "1567096638", + "updateCount": 2, + "authorCount": 2 } }, { @@ -4853,9 +5047,10 @@ }, "meta": { "hash": "45206aac5046169bce32aeeb14785735eb11b42e0bf8d3911531ae1ce6a56282", - "firstSeen": "1566932336", - "lastUpdated": "1566932336", - "updateCount": 2 + "firstSeen": "1567096638", + "lastUpdated": "1567096638", + "updateCount": 2, + "authorCount": 2 } }, { @@ -4879,9 +5074,10 @@ }, "meta": { "hash": "27bc40621fd8cb1b6ded57d7bbbbb33590d889ff87a5e418ef2c0ec6e4005505", - "firstSeen": "1566932336", - "lastUpdated": "1566932336", - "updateCount": 2 + "firstSeen": "1567096638", + "lastUpdated": "1567096638", + "updateCount": 2, + "authorCount": 2 } }, { @@ -4905,9 +5101,10 @@ }, "meta": { "hash": "bcedf0ea886a7ef2c3a4a925335f087c0bab2e2cb3eb4bc5843f7951cbd5c798", - "firstSeen": "1566932336", - "lastUpdated": "1566932336", - "updateCount": 2 + "firstSeen": "1567096638", + "lastUpdated": "1567096638", + "updateCount": 2, + "authorCount": 2 } }, { @@ -4930,9 +5127,10 @@ }, "meta": { "hash": "dc618772c3321607f451b13b124358fd3207f81fbeaa7f2deb3b7cd1da671175", - "firstSeen": "1566932336", - "lastUpdated": "1566932336", - "updateCount": 2 + "firstSeen": "1567096638", + "lastUpdated": "1567096638", + "updateCount": 2, + "authorCount": 2 } }, { @@ -4955,9 +5153,10 @@ }, "meta": { "hash": "888b1addde4cd2fa6137733130e9d847a87299d6753ddda5c8dd8c94b542db80", - "firstSeen": "1566932336", - "lastUpdated": "1566932336", - "updateCount": 2 + "firstSeen": "1567096638", + "lastUpdated": "1567096638", + "updateCount": 2, + "authorCount": 2 } }, { @@ -4980,9 +5179,10 @@ }, "meta": { "hash": "bf0a5bf2fe4d28262fe7e8f3eec16d24c05a177b06d20937db413c0d404cda12", - "firstSeen": "1566932336", - "lastUpdated": "1566932336", - "updateCount": 2 + "firstSeen": "1567096638", + "lastUpdated": "1567096638", + "updateCount": 2, + "authorCount": 2 } }, { @@ -5004,9 +5204,10 @@ }, "meta": { "hash": "451dd1fad58f3d4984363426a0f77e9a26697f6be944d53ed82d32c71849280e", - "firstSeen": "1566932336", - "lastUpdated": "1566932336", - "updateCount": 2 + "firstSeen": "1567096638", + "lastUpdated": "1567096638", + "updateCount": 2, + "authorCount": 2 } }, { @@ -5029,9 +5230,10 @@ }, "meta": { "hash": "cda4db6e9da35706f6e4b13f2860a210433c8bc2ac6078f9ff63aef6771c72d3", - "firstSeen": "1566932336", - "lastUpdated": "1566932336", - "updateCount": 2 + "firstSeen": "1567096638", + "lastUpdated": "1567096638", + "updateCount": 2, + "authorCount": 2 } }, { @@ -5043,7 +5245,7 @@ "text": "Calculates the midpoint between two pairs of (x,y) points.\n\nDestructure the array to get `x1`, `y1`, `x2` and `y2`, calculate the midpoint for each dimension by dividing the sum of the two endpoints by `2`.\n\n", "codeBlocks": { "es6": "const midpoint = ([x1, y1], [x2, y2]) => [(x1 + x2) / 2, (y1 + y2) / 2];", - "es5": "function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _nonIterableRest(); }\n\nfunction _nonIterableRest() { throw new TypeError(\"Invalid attempt to destructure non-iterable instance\"); }\n\nfunction _iterableToArrayLimit(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i[\"return\"] != null) _i[\"return\"](); } finally { if (_d) throw _e; } } return _arr; }\n\nfunction _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }\n\nvar midpoint = function midpoint(_ref, _ref2) {\n var _ref3 = _slicedToArray(_ref, 2),\n x1 = _ref3[0],\n y1 = _ref3[1];\n\n var _ref4 = _slicedToArray(_ref2, 2),\n x2 = _ref4[0],\n y2 = _ref4[1];\n\n return [(x1 + x2) / 2, (y1 + y2) / 2];\n};", + "es5": "function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _nonIterableRest(); }\n\nfunction _nonIterableRest() { throw new TypeError(\"Invalid attempt to destructure non-iterable instance\"); }\n\nfunction _iterableToArrayLimit(arr, i) { if (!(Symbol.iterator in Object(arr) || Object.prototype.toString.call(arr) === \"[object Arguments]\")) { return; } var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i[\"return\"] != null) _i[\"return\"](); } finally { if (_d) throw _e; } } return _arr; }\n\nfunction _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }\n\nvar midpoint = function midpoint(_ref, _ref2) {\n var _ref3 = _slicedToArray(_ref, 2),\n x1 = _ref3[0],\n y1 = _ref3[1];\n\n var _ref4 = _slicedToArray(_ref2, 2),\n x2 = _ref4[0],\n y2 = _ref4[1];\n\n return [(x1 + x2) / 2, (y1 + y2) / 2];\n};", "example": "midpoint([2, 2], [4, 4]); // [3, 3]\nmidpoint([4, 4], [6, 6]); // [5, 5]\nmidpoint([1, 3], [2, 4]); // [1.5, 3.5]" }, "tags": [ @@ -5054,9 +5256,10 @@ }, "meta": { "hash": "f9db07575860cfcc7fc619788c33821d7adb390d44b68160d6e561bfe41f7316", - "firstSeen": "1566932336", - "lastUpdated": "1566932336", - "updateCount": 2 + "firstSeen": "1567096638", + "lastUpdated": "1567096638", + "updateCount": 2, + "authorCount": 2 } }, { @@ -5080,9 +5283,10 @@ }, "meta": { "hash": "4c4ea74f666a35184db36bd5084614743446091a699086a5e5280ac2891be1c2", - "firstSeen": "1566932336", - "lastUpdated": "1566932336", - "updateCount": 2 + "firstSeen": "1567096638", + "lastUpdated": "1567096638", + "updateCount": 2, + "authorCount": 2 } }, { @@ -5105,9 +5309,10 @@ }, "meta": { "hash": "cf59c98e2fc56230399d301d1e3645dd5961389c5c361d763e4a5fce01d22db2", - "firstSeen": "1566932336", - "lastUpdated": "1566932336", - "updateCount": 2 + "firstSeen": "1567096638", + "lastUpdated": "1567096638", + "updateCount": 2, + "authorCount": 2 } }, { @@ -5130,9 +5335,10 @@ }, "meta": { "hash": "65bcfbbf3937f35f591285306ec3bfbee46a1738a6a8f097c99bf07150aec198", - "firstSeen": "1566932336", - "lastUpdated": "1566932336", - "updateCount": 2 + "firstSeen": "1567096638", + "lastUpdated": "1567096638", + "updateCount": 2, + "authorCount": 2 } }, { @@ -5154,9 +5360,10 @@ }, "meta": { "hash": "120e31fa38796906a99beccdc457e83a8075e6ec72b5a937e03913b2e996ae26", - "firstSeen": "1566932336", - "lastUpdated": "1566932336", - "updateCount": 2 + "firstSeen": "1567096638", + "lastUpdated": "1567096638", + "updateCount": 2, + "authorCount": 2 } }, { @@ -5178,9 +5385,10 @@ }, "meta": { "hash": "20deb11c89b14b294b13f9846fde62e4a9ac8df0a71553509431b16b5c88d24a", - "firstSeen": "1566932336", - "lastUpdated": "1566932336", - "updateCount": 2 + "firstSeen": "1567096638", + "lastUpdated": "1567096638", + "updateCount": 2, + "authorCount": 2 } }, { @@ -5192,7 +5400,7 @@ "text": "Given a flat array of objects linked to one another, it will nest them recursively.\nUseful for nesting comments, such as the ones on reddit.com.\n\nUse recursion.\nUse `Array.prototype.filter()` to filter the items where the `id` matches the `link`, then `Array.prototype.map()` to map each one to a new object that has a `children` property which recursively nests the items based on which ones are children of the current item.\nOmit the second argument, `id`, to default to `null` which indicates the object is not linked to another one (i.e. it is a top level object).\nOmit the third argument, `link`, to use `'parent_id'` as the default property which links the object to another one by its `id`.\n\n", "codeBlocks": { "es6": "const nest = (items, id = null, link = 'parent_id') =>\n items\n .filter(item => item[link] === id)\n .map(item => ({ ...item, children: nest(items, item.id) }));", - "es5": "function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }\n\nfunction _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(source, true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(source).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }\n\nfunction _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\n\nvar nest = function nest(items) {\n var id = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null;\n var link = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 'parent_id';\n return items.filter(function (item) {\n return item[link] === id;\n }).map(function (item) {\n return _objectSpread({}, item, {\n children: nest(items, item.id)\n });\n });\n};", + "es5": "function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }\n\nfunction _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }\n\nfunction _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\n\nvar nest = function nest(items) {\n var id = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null;\n var link = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 'parent_id';\n return items.filter(function (item) {\n return item[link] === id;\n }).map(function (item) {\n return _objectSpread({}, item, {\n children: nest(items, item.id)\n });\n });\n};", "example": "// One top level comment\nconst comments = [\n { id: 1, parent_id: null },\n { id: 2, parent_id: 1 },\n { id: 3, parent_id: 1 },\n { id: 4, parent_id: 2 },\n { id: 5, parent_id: 4 }\n];\nconst nestedComments = nest(comments); // [{ id: 1, parent_id: null, children: [...] }]" }, "tags": [ @@ -5202,9 +5410,10 @@ }, "meta": { "hash": "6133ec3409b8c18ccfc89d857149c7875eb4733803772b43743df3b7c51bd02c", - "firstSeen": "1566932336", - "lastUpdated": "1566932336", - "updateCount": 2 + "firstSeen": "1567096638", + "lastUpdated": "1567096638", + "updateCount": 2, + "authorCount": 2 } }, { @@ -5227,9 +5436,10 @@ }, "meta": { "hash": "3c4f99f0a0b9d2103e7ed3553bf7268475135603aa46d2eae204d3f34fe51ffd", - "firstSeen": "1566932336", - "lastUpdated": "1566932336", - "updateCount": 2 + "firstSeen": "1567096638", + "lastUpdated": "1567096638", + "updateCount": 2, + "authorCount": 2 } }, { @@ -5252,9 +5462,10 @@ }, "meta": { "hash": "a11f7bdacee4978a1cc579091b04a912962a239dc7bd442518420a4d39c290d5", - "firstSeen": "1566932336", - "lastUpdated": "1566932336", - "updateCount": 2 + "firstSeen": "1567096638", + "lastUpdated": "1567096638", + "updateCount": 2, + "authorCount": 2 } }, { @@ -5277,9 +5488,10 @@ }, "meta": { "hash": "1885078f5fddc5de00844a837ab3c427f770c5325a70d5362ecab26c1c904125", - "firstSeen": "1566932336", - "lastUpdated": "1566932336", - "updateCount": 2 + "firstSeen": "1567096638", + "lastUpdated": "1567096638", + "updateCount": 2, + "authorCount": 2 } }, { @@ -5301,9 +5513,10 @@ }, "meta": { "hash": "51af30db5952a0473fe9ae72c338b974a88813cbca522ba56d0dc3b4ec6fc51c", - "firstSeen": "1566932336", - "lastUpdated": "1566932336", - "updateCount": 2 + "firstSeen": "1567096638", + "lastUpdated": "1567096638", + "updateCount": 2, + "authorCount": 2 } }, { @@ -5315,7 +5528,7 @@ "text": "Creates an object from the given key-value pairs.\n\nUse `Array.prototype.reduce()` to create and combine key-value pairs.\n\n", "codeBlocks": { "es6": "const objectFromPairs = arr => arr.reduce((a, [key, val]) => ((a[key] = val), a), {});", - "es5": "function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _nonIterableRest(); }\n\nfunction _nonIterableRest() { throw new TypeError(\"Invalid attempt to destructure non-iterable instance\"); }\n\nfunction _iterableToArrayLimit(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i[\"return\"] != null) _i[\"return\"](); } finally { if (_d) throw _e; } } return _arr; }\n\nfunction _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }\n\nvar objectFromPairs = function objectFromPairs(arr) {\n return arr.reduce(function (a, _ref) {\n var _ref2 = _slicedToArray(_ref, 2),\n key = _ref2[0],\n val = _ref2[1];\n\n return a[key] = val, a;\n }, {});\n};", + "es5": "function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _nonIterableRest(); }\n\nfunction _nonIterableRest() { throw new TypeError(\"Invalid attempt to destructure non-iterable instance\"); }\n\nfunction _iterableToArrayLimit(arr, i) { if (!(Symbol.iterator in Object(arr) || Object.prototype.toString.call(arr) === \"[object Arguments]\")) { return; } var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i[\"return\"] != null) _i[\"return\"](); } finally { if (_d) throw _e; } } return _arr; }\n\nfunction _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }\n\nvar objectFromPairs = function objectFromPairs(arr) {\n return arr.reduce(function (a, _ref) {\n var _ref2 = _slicedToArray(_ref, 2),\n key = _ref2[0],\n val = _ref2[1];\n\n return a[key] = val, a;\n }, {});\n};", "example": "objectFromPairs([['a', 1], ['b', 2]]); // {a: 1, b: 2}" }, "tags": [ @@ -5326,9 +5539,10 @@ }, "meta": { "hash": "99537507288f1e101bfc0f80ba708b415832b27ce060033fbba8bdfc32cc3cea", - "firstSeen": "1566932336", - "lastUpdated": "1566932336", - "updateCount": 2 + "firstSeen": "1567096638", + "lastUpdated": "1567096638", + "updateCount": 2, + "authorCount": 2 } }, { @@ -5351,9 +5565,10 @@ }, "meta": { "hash": "ed97cd30b8004ca41939fabebf535f9017868b261ded4c2081c3367fa0ab1847", - "firstSeen": "1566932336", - "lastUpdated": "1566932336", - "updateCount": 2 + "firstSeen": "1567096638", + "lastUpdated": "1567096638", + "updateCount": 2, + "authorCount": 2 } }, { @@ -5364,8 +5579,8 @@ "fileName": "objectToQueryString.md", "text": "Returns a query string generated from the key-value pairs of the given object.\n\nUse `Array.prototype.reduce()` on `Object.entries(queryParameters)` to create the query string.\nDetermine the `symbol` to be either `?` or `&` based on the `index` and concatenate `val` to `queryString` only if it's a string.\nReturn the `queryString` or an empty string when the `queryParameters` are falsy.\n\n", "codeBlocks": { - "es6": "const objectToQueryString = queryParameters => {\n return queryParameters\n ? Object.entries(queryParameters).reduce((queryString, [key, val], index) => {\n const symbol = index === 0 ? '?' : '&';\n queryString += typeof val === 'string' ? `${symbol}${key}=${val}` : '';\n return queryString;\n }, '')\n : '';\n};", - "es5": "function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _nonIterableRest(); }\n\nfunction _nonIterableRest() { throw new TypeError(\"Invalid attempt to destructure non-iterable instance\"); }\n\nfunction _iterableToArrayLimit(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i[\"return\"] != null) _i[\"return\"](); } finally { if (_d) throw _e; } } return _arr; }\n\nfunction _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }\n\nvar objectToQueryString = function objectToQueryString(queryParameters) {\n return queryParameters ? Object.entries(queryParameters).reduce(function (queryString, _ref, index) {\n var _ref2 = _slicedToArray(_ref, 2),\n key = _ref2[0],\n val = _ref2[1];\n\n var symbol = index === 0 ? '?' : '&';\n queryString += typeof val === 'string' ? \"\".concat(symbol).concat(key, \"=\").concat(val) : '';\n return queryString;\n }, '') : '';\n};", + "es6": "const objectToQueryString = queryParameters => {\n return queryParameters\n ? Object.entries(queryParameters).reduce((queryString, [key, val], index) => {\n const symbol = index === 0 ? '?' : '&';\n queryString += typeof val === 'string' ? `${symbol}${key}=${val}` : '';\n return queryString;\n }, '')\n : '';\n};", + "es5": "function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _nonIterableRest(); }\n\nfunction _nonIterableRest() { throw new TypeError(\"Invalid attempt to destructure non-iterable instance\"); }\n\nfunction _iterableToArrayLimit(arr, i) { if (!(Symbol.iterator in Object(arr) || Object.prototype.toString.call(arr) === \"[object Arguments]\")) { return; } var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i[\"return\"] != null) _i[\"return\"](); } finally { if (_d) throw _e; } } return _arr; }\n\nfunction _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }\n\nvar objectToQueryString = function objectToQueryString(queryParameters) {\n return queryParameters ? Object.entries(queryParameters).reduce(function (queryString, _ref, index) {\n var _ref2 = _slicedToArray(_ref, 2),\n key = _ref2[0],\n val = _ref2[1];\n\n var symbol = index === 0 ? '?' : '&';\n queryString += typeof val === 'string' ? \"\".concat(symbol).concat(key, \"=\").concat(val) : '';\n return queryString;\n }, '') : '';\n};", "example": "objectToQueryString({ page: '1', size: '2kg', key: undefined }); // '?page=1&size=2kg'" }, "tags": [ @@ -5376,10 +5591,11 @@ ] }, "meta": { - "hash": "23ded1eef634ad88b34431b187b5f9eca4432daf09e89980fb0661fb56d8dcb0", + "hash": "012ebca6a90c50ec89278af2632d7d0d90eeb423f2bcf902ed015f6fce6d4f5a", "firstSeen": "1570824965", - "lastUpdated": "1574366947", - "updateCount": 9 + "lastUpdated": "1575102829", + "updateCount": 10, + "authorCount": 4 } }, { @@ -5402,9 +5618,10 @@ }, "meta": { "hash": "98673c6d6bebe907c0ac285f342147f30de01bc326feb5109b6d25739fe473aa", - "firstSeen": "1566932336", - "lastUpdated": "1566932336", - "updateCount": 2 + "firstSeen": "1567096638", + "lastUpdated": "1567096638", + "updateCount": 2, + "authorCount": 2 } }, { @@ -5427,9 +5644,10 @@ }, "meta": { "hash": "ab081473a5589edddab0b641758744ee5a65bf43cb93eeca23f48e86e0fdbb9c", - "firstSeen": "1566932336", - "lastUpdated": "1566932336", - "updateCount": 2 + "firstSeen": "1567096638", + "lastUpdated": "1567096638", + "updateCount": 2, + "authorCount": 2 } }, { @@ -5451,9 +5669,10 @@ }, "meta": { "hash": "87cd3d6c458b2ecbb373645230a03c7e0770ca3991c635571ffaae5d7a40987c", - "firstSeen": "1566932336", - "lastUpdated": "1566932336", - "updateCount": 2 + "firstSeen": "1567096638", + "lastUpdated": "1567096638", + "updateCount": 2, + "authorCount": 2 } }, { @@ -5476,9 +5695,10 @@ }, "meta": { "hash": "64c941025c6bf130b6b6639427cf64c8af5759734118efbbbec9e8d490845a10", - "firstSeen": "1566932336", - "lastUpdated": "1566932336", - "updateCount": 2 + "firstSeen": "1567096638", + "lastUpdated": "1567096638", + "updateCount": 2, + "authorCount": 2 } }, { @@ -5502,9 +5722,10 @@ }, "meta": { "hash": "2119b62768ca88da15cef3bb1671c65a557d81f224c846bdaa6a75d320577366", - "firstSeen": "1566932336", - "lastUpdated": "1566932336", - "updateCount": 2 + "firstSeen": "1567096638", + "lastUpdated": "1567096638", + "updateCount": 2, + "authorCount": 2 } }, { @@ -5527,9 +5748,10 @@ }, "meta": { "hash": "37b8c9323006f3eb66cbfbe240d5020ef0896e312e9f1ed949b200a767324877", - "firstSeen": "1566932336", - "lastUpdated": "1566932336", - "updateCount": 2 + "firstSeen": "1567096638", + "lastUpdated": "1567096638", + "updateCount": 2, + "authorCount": 2 } }, { @@ -5551,9 +5773,10 @@ }, "meta": { "hash": "61603245edccd32edad26ecdbf39d3c8d99bde8d2672a1a392508ca9c30c6d22", - "firstSeen": "1566932336", - "lastUpdated": "1566932336", - "updateCount": 2 + "firstSeen": "1567096638", + "lastUpdated": "1567096638", + "updateCount": 2, + "authorCount": 2 } }, { @@ -5576,9 +5799,10 @@ }, "meta": { "hash": "f12c78c23280839489bf4dfae847eeab3ceb72fef326b5bca3f2ed1bdcc44ee3", - "firstSeen": "1566932336", - "lastUpdated": "1566932336", - "updateCount": 2 + "firstSeen": "1567096638", + "lastUpdated": "1567096638", + "updateCount": 2, + "authorCount": 2 } }, { @@ -5590,7 +5814,7 @@ "text": "Returns a sorted array of objects ordered by properties and orders.\n\nUses `Array.prototype.sort()`, `Array.prototype.reduce()` on the `props` array with a default value of `0`, use array destructuring to swap the properties position depending on the order passed.\nIf no `orders` array is passed it sort by `'asc'` by default.\n\n", "codeBlocks": { "es6": "const orderBy = (arr, props, orders) =>\n [...arr].sort((a, b) =>\n props.reduce((acc, prop, i) => {\n if (acc === 0) {\n const [p1, p2] = orders && orders[i] === 'desc' ? [b[prop], a[prop]] : [a[prop], b[prop]];\n acc = p1 > p2 ? 1 : p1 < p2 ? -1 : 0;\n }\n return acc;\n }, 0)\n );", - "es5": "function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _nonIterableRest(); }\n\nfunction _nonIterableRest() { throw new TypeError(\"Invalid attempt to destructure non-iterable instance\"); }\n\nfunction _iterableToArrayLimit(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i[\"return\"] != null) _i[\"return\"](); } finally { if (_d) throw _e; } } return _arr; }\n\nfunction _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }\n\nfunction _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _nonIterableSpread(); }\n\nfunction _nonIterableSpread() { throw new TypeError(\"Invalid attempt to spread non-iterable instance\"); }\n\nfunction _iterableToArray(iter) { if (Symbol.iterator in Object(iter) || Object.prototype.toString.call(iter) === \"[object Arguments]\") return Array.from(iter); }\n\nfunction _arrayWithoutHoles(arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = new Array(arr.length); i < arr.length; i++) { arr2[i] = arr[i]; } return arr2; } }\n\nvar orderBy = function orderBy(arr, props, orders) {\n return _toConsumableArray(arr).sort(function (a, b) {\n return props.reduce(function (acc, prop, i) {\n if (acc === 0) {\n var _ref = orders && orders[i] === 'desc' ? [b[prop], a[prop]] : [a[prop], b[prop]],\n _ref2 = _slicedToArray(_ref, 2),\n p1 = _ref2[0],\n p2 = _ref2[1];\n\n acc = p1 > p2 ? 1 : p1 < p2 ? -1 : 0;\n }\n\n return acc;\n }, 0);\n });\n};", + "es5": "function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _nonIterableRest(); }\n\nfunction _nonIterableRest() { throw new TypeError(\"Invalid attempt to destructure non-iterable instance\"); }\n\nfunction _iterableToArrayLimit(arr, i) { if (!(Symbol.iterator in Object(arr) || Object.prototype.toString.call(arr) === \"[object Arguments]\")) { return; } var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i[\"return\"] != null) _i[\"return\"](); } finally { if (_d) throw _e; } } return _arr; }\n\nfunction _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }\n\nfunction _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _nonIterableSpread(); }\n\nfunction _nonIterableSpread() { throw new TypeError(\"Invalid attempt to spread non-iterable instance\"); }\n\nfunction _iterableToArray(iter) { if (Symbol.iterator in Object(iter) || Object.prototype.toString.call(iter) === \"[object Arguments]\") return Array.from(iter); }\n\nfunction _arrayWithoutHoles(arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = new Array(arr.length); i < arr.length; i++) { arr2[i] = arr[i]; } return arr2; } }\n\nvar orderBy = function orderBy(arr, props, orders) {\n return _toConsumableArray(arr).sort(function (a, b) {\n return props.reduce(function (acc, prop, i) {\n if (acc === 0) {\n var _ref = orders && orders[i] === 'desc' ? [b[prop], a[prop]] : [a[prop], b[prop]],\n _ref2 = _slicedToArray(_ref, 2),\n p1 = _ref2[0],\n p2 = _ref2[1];\n\n acc = p1 > p2 ? 1 : p1 < p2 ? -1 : 0;\n }\n\n return acc;\n }, 0);\n });\n};", "example": "const users = [{ name: 'fred', age: 48 }, { name: 'barney', age: 36 }, { name: 'fred', age: 40 }];\norderBy(users, ['name', 'age'], ['asc', 'desc']); // [{name: 'barney', age: 36}, {name: 'fred', age: 48}, {name: 'fred', age: 40}]\norderBy(users, ['name', 'age']); // [{name: 'barney', age: 36}, {name: 'fred', age: 40}, {name: 'fred', age: 48}]" }, "tags": [ @@ -5601,9 +5825,10 @@ }, "meta": { "hash": "a53f86761dacc7d0bc184c304dd2e59461a393d45214212d17d02a8df94144b0", - "firstSeen": "1566932336", - "lastUpdated": "1566932336", - "updateCount": 2 + "firstSeen": "1567096638", + "lastUpdated": "1567096638", + "updateCount": 2, + "authorCount": 2 } }, { @@ -5626,9 +5851,10 @@ }, "meta": { "hash": "ac660685eb10f64c7e573d0299936ae0bb562e531b2f3a76b048e3bbe9605bcc", - "firstSeen": "1566932336", - "lastUpdated": "1566932336", - "updateCount": 2 + "firstSeen": "1567096638", + "lastUpdated": "1567096638", + "updateCount": 2, + "authorCount": 2 } }, { @@ -5651,9 +5877,10 @@ }, "meta": { "hash": "8aa05f5b221bb24bb52cf3b75b6087ca664ede628a8cfff2b3193ebe67f6b2e7", - "firstSeen": "1566932336", - "lastUpdated": "1566932336", - "updateCount": 2 + "firstSeen": "1567096638", + "lastUpdated": "1567096638", + "updateCount": 2, + "authorCount": 2 } }, { @@ -5675,9 +5902,10 @@ }, "meta": { "hash": "04a1e9e83ff8bb138a86e7bb060a19de2593bc4054ce48cfef511eec1052edbe", - "firstSeen": "1566932336", - "lastUpdated": "1566932336", - "updateCount": 2 + "firstSeen": "1567096638", + "lastUpdated": "1567096638", + "updateCount": 2, + "authorCount": 2 } }, { @@ -5699,9 +5927,10 @@ }, "meta": { "hash": "1cb29029bb6d17d5ab853b7f932e39e56639d294d732eff00d621fcffb24adb3", - "firstSeen": "1566932336", - "lastUpdated": "1566932336", - "updateCount": 2 + "firstSeen": "1567096638", + "lastUpdated": "1567096638", + "updateCount": 2, + "authorCount": 2 } }, { @@ -5724,9 +5953,10 @@ }, "meta": { "hash": "c25aef075df93042a81bd98ebd7b77aefb91df3f08b9f1d2e7859ec0d95ad55b", - "firstSeen": "1566932336", - "lastUpdated": "1566932336", - "updateCount": 2 + "firstSeen": "1567096638", + "lastUpdated": "1567096638", + "updateCount": 2, + "authorCount": 2 } }, { @@ -5748,9 +5978,10 @@ }, "meta": { "hash": "fc0a07189064e1026c5a350923b1aa833523c2755eef1d66f9567a15caeebdf8", - "firstSeen": "1566932336", - "lastUpdated": "1566932336", - "updateCount": 2 + "firstSeen": "1567096638", + "lastUpdated": "1567096638", + "updateCount": 2, + "authorCount": 2 } }, { @@ -5772,9 +6003,10 @@ }, "meta": { "hash": "4d3cd9630e00f8c723b8321f1c17d17c4c7d0b7ad025dbafda492897b8300a24", - "firstSeen": "1566932336", - "lastUpdated": "1566932336", - "updateCount": 2 + "firstSeen": "1567096638", + "lastUpdated": "1567096638", + "updateCount": 2, + "authorCount": 2 } }, { @@ -5798,9 +6030,10 @@ }, "meta": { "hash": "fdaa6d4470e5bb113a2c20008652bf0030d23fbee789ca6c3c4ce0c9be9ae700", - "firstSeen": "1566932336", - "lastUpdated": "1566932336", - "updateCount": 2 + "firstSeen": "1567096638", + "lastUpdated": "1567096638", + "updateCount": 2, + "authorCount": 2 } }, { @@ -5822,9 +6055,10 @@ }, "meta": { "hash": "6fb26c1c3157de2309d5fe08354345d9bd18d175cc29e049cc5f19363f7ed374", - "firstSeen": "1566932336", - "lastUpdated": "1566932336", - "updateCount": 2 + "firstSeen": "1567096638", + "lastUpdated": "1567096638", + "updateCount": 2, + "authorCount": 2 } }, { @@ -5847,9 +6081,10 @@ }, "meta": { "hash": "821e55db97be7e29b6a969cafbaf06da5ad72d5677eb9e275fb43d536052655b", - "firstSeen": "1566932336", + "firstSeen": "1567096638", "lastUpdated": "1574366512", - "updateCount": 3 + "updateCount": 3, + "authorCount": 3 } }, { @@ -5872,9 +6107,10 @@ }, "meta": { "hash": "d8d3bc54bdc1ba649c052658a09ddd415ad88a30409d13489b32684c150cb799", - "firstSeen": "1566932336", - "lastUpdated": "1566932336", - "updateCount": 2 + "firstSeen": "1567096638", + "lastUpdated": "1567096638", + "updateCount": 2, + "authorCount": 2 } }, { @@ -5898,9 +6134,10 @@ }, "meta": { "hash": "19851ac642bb32dcc56042f8e4f15184b293e300bd818a07573b8e23d1a1d06e", - "firstSeen": "1566932336", - "lastUpdated": "1566932336", - "updateCount": 2 + "firstSeen": "1567096638", + "lastUpdated": "1567096638", + "updateCount": 2, + "authorCount": 2 } }, { @@ -5913,7 +6150,7 @@ "codeBlocks": { "es6": "const pipeAsyncFunctions = (...fns) => arg => fns.reduce((p, f) => p.then(f), Promise.resolve(arg));", "es5": "var pipeAsyncFunctions = function pipeAsyncFunctions() {\n for (var _len = arguments.length, fns = new Array(_len), _key = 0; _key < _len; _key++) {\n fns[_key] = arguments[_key];\n }\n\n return function (arg) {\n return fns.reduce(function (p, f) {\n return p.then(f);\n }, Promise.resolve(arg));\n };\n};", - "example": "const sum = pipeAsyncFunctions(\n x => x + 1,\n x => new Promise(resolve => setTimeout(() => resolve(x + 2), 1000)),\n x => x + 3,\n async x => (await x) + 4\n);\n(async() => {\n console.log(await sum(5)); // 15 (after one second)\n})();" + "example": "const sum = pipeAsyncFunctions(\n x => x + 1,\n x => new Promise(resolve => setTimeout(() => resolve(x + 2), 1000)),\n x => x + 3,\n async x => (await x) + 4\n);\n(async () => {\n console.log(await sum(5)); // 15 (after one second)\n})();" }, "tags": [ "adapter", @@ -5923,10 +6160,11 @@ ] }, "meta": { - "hash": "17bcf3f13980b7f804d9f0fe274324b2a35ab7d479c03d77322dabba81e1a34a", - "firstSeen": "1566932336", - "lastUpdated": "1574366947", - "updateCount": 15 + "hash": "7ccbf66d8d55c60bcf12baa980cf32d67a4ba567894d59e2d798c9af792424ff", + "firstSeen": "1567096638", + "lastUpdated": "1575102829", + "updateCount": 15, + "authorCount": 2 } }, { @@ -5949,9 +6187,10 @@ }, "meta": { "hash": "dbdae1e05f13477865039be627fcd258943cbf2d7926e160de74a3ab5244dba1", - "firstSeen": "1566932336", - "lastUpdated": "1566932336", - "updateCount": 2 + "firstSeen": "1567096638", + "lastUpdated": "1567096638", + "updateCount": 2, + "authorCount": 2 } }, { @@ -5973,9 +6212,10 @@ }, "meta": { "hash": "3bcd52927608bd59de8e20369fbd51f39b99d77b19f66de4de8bbc80140ea009", - "firstSeen": "1566932336", - "lastUpdated": "1566932336", - "updateCount": 2 + "firstSeen": "1567096638", + "lastUpdated": "1567096638", + "updateCount": 2, + "authorCount": 2 } }, { @@ -5997,9 +6237,10 @@ }, "meta": { "hash": "b19b526319caff44e7b15c3126128701dedaa76b74cedb50761003268676b5b6", - "firstSeen": "1566932336", - "lastUpdated": "1566932336", - "updateCount": 2 + "firstSeen": "1567096638", + "lastUpdated": "1567096638", + "updateCount": 2, + "authorCount": 2 } }, { @@ -6022,9 +6263,10 @@ }, "meta": { "hash": "6668f37f9f1158b2bdd292ad64defea6e33a0b2908ea1e494b191dcaa9f039d6", - "firstSeen": "1566932336", - "lastUpdated": "1566932336", - "updateCount": 2 + "firstSeen": "1567096638", + "lastUpdated": "1567096638", + "updateCount": 2, + "authorCount": 2 } }, { @@ -6048,9 +6290,10 @@ }, "meta": { "hash": "e752de4a4f2b339851e796a5289e7adde51cf7e672b8230fd97bf79cf7330758", - "firstSeen": "1566932336", - "lastUpdated": "1566932336", - "updateCount": 2 + "firstSeen": "1567096638", + "lastUpdated": "1567096638", + "updateCount": 2, + "authorCount": 2 } }, { @@ -6073,9 +6316,10 @@ }, "meta": { "hash": "8c11b6647c91c22969f8c568cf248a9c3c5b08323fe9491c3fad2cbbce90a8ac", - "firstSeen": "1566932336", - "lastUpdated": "1566932336", - "updateCount": 2 + "firstSeen": "1567096638", + "lastUpdated": "1567096638", + "updateCount": 2, + "authorCount": 2 } }, { @@ -6099,9 +6343,10 @@ }, "meta": { "hash": "a6fe92925d4c25fccd29ae85d1c2004f88c73222099091ce30824a917a2fcfa2", - "firstSeen": "1566932336", - "lastUpdated": "1566932336", - "updateCount": 2 + "firstSeen": "1567096638", + "lastUpdated": "1567096638", + "updateCount": 2, + "authorCount": 2 } }, { @@ -6123,9 +6368,10 @@ }, "meta": { "hash": "5d0655b4a4c1008dbfba8b4e59ae7144dde6ac98f2fcf0a60f4d80135d8feeba", - "firstSeen": "1566932336", - "lastUpdated": "1566932336", - "updateCount": 2 + "firstSeen": "1567096638", + "lastUpdated": "1567096638", + "updateCount": 2, + "authorCount": 2 } }, { @@ -6147,9 +6393,10 @@ }, "meta": { "hash": "dacbce5a4a058056f0c33a7975c4bdb586037223f6713d2d27379c9cb2eb93cd", - "firstSeen": "1566932336", - "lastUpdated": "1566932336", - "updateCount": 2 + "firstSeen": "1567096638", + "lastUpdated": "1567096638", + "updateCount": 2, + "authorCount": 2 } }, { @@ -6171,9 +6418,10 @@ }, "meta": { "hash": "760685e275cac5e2b81b035cfd4799eb8e39483d56d5a483a0a04e19bf46a29d", - "firstSeen": "1566932336", - "lastUpdated": "1566932336", - "updateCount": 2 + "firstSeen": "1567096638", + "lastUpdated": "1567096638", + "updateCount": 2, + "authorCount": 2 } }, { @@ -6196,9 +6444,10 @@ }, "meta": { "hash": "5166b5b5b9812d42c50364953ceb2311cafad66eb8881f21ec7d949396e6effb", - "firstSeen": "1566932336", - "lastUpdated": "1566932336", - "updateCount": 2 + "firstSeen": "1567096638", + "lastUpdated": "1567096638", + "updateCount": 2, + "authorCount": 2 } }, { @@ -6220,9 +6469,10 @@ }, "meta": { "hash": "1a510a46746f7ea0eafcdc6a06eec78da731788311ef42a70e3a42c2a4080f60", - "firstSeen": "1566932336", - "lastUpdated": "1566932336", - "updateCount": 2 + "firstSeen": "1567096638", + "lastUpdated": "1567096638", + "updateCount": 2, + "authorCount": 2 } }, { @@ -6245,9 +6495,10 @@ }, "meta": { "hash": "42788f8392f5511db3641dbe2ab92b2c043b3b5209e95c386c73e5d96eaa63af", - "firstSeen": "1566932336", - "lastUpdated": "1566932336", - "updateCount": 2 + "firstSeen": "1567096638", + "lastUpdated": "1567096638", + "updateCount": 2, + "authorCount": 2 } }, { @@ -6271,9 +6522,10 @@ }, "meta": { "hash": "7bff02cd849d994da1229f3153cca71b4c054d6774ab732101a5f60a0a04ba3a", - "firstSeen": "1566932336", - "lastUpdated": "1566932336", - "updateCount": 2 + "firstSeen": "1567096638", + "lastUpdated": "1567096638", + "updateCount": 2, + "authorCount": 2 } }, { @@ -6297,9 +6549,10 @@ }, "meta": { "hash": "8d8cca3d593e677c8a4ffc17e9f97b3018f800e7c014daa3462edc152fbbeec7", - "firstSeen": "1566932336", - "lastUpdated": "1566932336", - "updateCount": 2 + "firstSeen": "1567096638", + "lastUpdated": "1567096638", + "updateCount": 2, + "authorCount": 2 } }, { @@ -6323,9 +6576,10 @@ }, "meta": { "hash": "c86e3227e32565afb301805798da3a46756e13bff0115b880fcc3175a58d95af", - "firstSeen": "1566932336", - "lastUpdated": "1566932336", - "updateCount": 2 + "firstSeen": "1567096638", + "lastUpdated": "1567096638", + "updateCount": 2, + "authorCount": 2 } }, { @@ -6349,9 +6603,10 @@ }, "meta": { "hash": "d84f789a1b8a11d0fa4daf8e5f015e9839340adfefbc210e2304de8d63649f9e", - "firstSeen": "1566932336", - "lastUpdated": "1566932336", - "updateCount": 2 + "firstSeen": "1567096638", + "lastUpdated": "1567096638", + "updateCount": 2, + "authorCount": 2 } }, { @@ -6374,9 +6629,10 @@ }, "meta": { "hash": "5f2f2e33d269de787a1aaa245c6324030cc5cbe8345b46352a218f3f2453c220", - "firstSeen": "1566932336", - "lastUpdated": "1566932336", - "updateCount": 2 + "firstSeen": "1567096638", + "lastUpdated": "1567096638", + "updateCount": 2, + "authorCount": 2 } }, { @@ -6399,9 +6655,10 @@ }, "meta": { "hash": "b780a5af9c22faa9601191aff53c24d55f5e88b62ac79fd2e02517f9a724b502", - "firstSeen": "1566932336", - "lastUpdated": "1566932336", - "updateCount": 2 + "firstSeen": "1567096638", + "lastUpdated": "1567096638", + "updateCount": 2, + "authorCount": 2 } }, { @@ -6424,9 +6681,10 @@ }, "meta": { "hash": "b5eb860bad14f54d114103321b8135e474057c63b703dfb06183a97530af402f", - "firstSeen": "1566932336", - "lastUpdated": "1566932336", - "updateCount": 2 + "firstSeen": "1567096638", + "lastUpdated": "1567096638", + "updateCount": 2, + "authorCount": 2 } }, { @@ -6448,9 +6706,10 @@ }, "meta": { "hash": "eb9a81be04298dc36d5b01dbbff22b9aac19d5ef1f1c752ef4c48e6a2cc0ea32", - "firstSeen": "1566932336", - "lastUpdated": "1566932336", - "updateCount": 2 + "firstSeen": "1567096638", + "lastUpdated": "1567096638", + "updateCount": 2, + "authorCount": 2 } }, { @@ -6473,9 +6732,10 @@ }, "meta": { "hash": "276b7cc7252a0c5202520e4903d8083153240ca6fd035eb709eaf5bf6cc1eccc", - "firstSeen": "1566932336", - "lastUpdated": "1566932336", - "updateCount": 2 + "firstSeen": "1567096638", + "lastUpdated": "1567096638", + "updateCount": 2, + "authorCount": 2 } }, { @@ -6498,9 +6758,10 @@ }, "meta": { "hash": "4da6106d2a999166888ef3f2d1cfaa3b32666ef12bbdfddac832cd0b8c7404d4", - "firstSeen": "1566932336", - "lastUpdated": "1566932336", - "updateCount": 2 + "firstSeen": "1567096638", + "lastUpdated": "1567096638", + "updateCount": 2, + "authorCount": 2 } }, { @@ -6522,9 +6783,10 @@ }, "meta": { "hash": "64c311bfab7115cd3df81172f9ed524a1f71e1d57100f8b003830ca41d9fd77f", - "firstSeen": "1566932336", + "firstSeen": "1567096638", "lastUpdated": "1568054097", - "updateCount": 3 + "updateCount": 3, + "authorCount": 3 } }, { @@ -6535,7 +6797,7 @@ "fileName": "remove.md", "text": "Removes elements from an array for which the given function returns `false`.\n\nUse `Array.prototype.filter()` to find array elements that return truthy values and `Array.prototype.reduce()` to remove elements using `Array.prototype.splice()`.\nThe `func` is invoked with three arguments (`value, index, array`).\n\n", "codeBlocks": { - "es6": "const remove = (arr, func) =>\n Array.isArray(arr)\n ? arr.filter(func).reduce((acc, val) => {\n arr.splice(arr.indexOf(val), 1);\n return acc.concat(val);\n }, [])\n : [];", + "es6": "const remove = (arr, func) =>\n Array.isArray(arr)\n ? arr.filter(func).reduce((acc, val) => {\n arr.splice(arr.indexOf(val), 1);\n return acc.concat(val);\n }, [])\n : [];", "es5": "var remove = function remove(arr, func) {\n return Array.isArray(arr) ? arr.filter(func).reduce(function (acc, val) {\n arr.splice(arr.indexOf(val), 1);\n return acc.concat(val);\n }, []) : [];\n};", "example": "remove([1, 2, 3, 4], n => n % 2 === 0); // [2, 4]" }, @@ -6545,10 +6807,11 @@ ] }, "meta": { - "hash": "069472d018c3102412dafc2ae8ec6e9396e53c01d0073079f2e3f1ac3c99b6e9", - "firstSeen": "1566932336", - "lastUpdated": "1566932336", - "updateCount": 2 + "hash": "c1542907e6295eb81df918174c247a65d73c8daccc56769f2eb32d609b7846fc", + "firstSeen": "1567096638", + "lastUpdated": "1567096638", + "updateCount": 2, + "authorCount": 2 } }, { @@ -6571,9 +6834,10 @@ }, "meta": { "hash": "b557e3d59a04dac19161e9d69b5c347a758ad491c2214d56437d1592614f6944", - "firstSeen": "1566932336", - "lastUpdated": "1566932336", - "updateCount": 2 + "firstSeen": "1567096638", + "lastUpdated": "1567096638", + "updateCount": 2, + "authorCount": 2 } }, { @@ -6585,7 +6849,7 @@ "text": "Replaces the names of multiple object keys with the values provided.\n\nUse `Object.keys()` in combination with `Array.prototype.reduce()` and the spread operator (`...`) to get the object's keys and rename them according to `keysMap`.\n\n", "codeBlocks": { "es6": "const renameKeys = (keysMap, obj) =>\n Object.keys(obj).reduce(\n (acc, key) => ({\n ...acc,\n ...{ [keysMap[key] || key]: obj[key] }\n }),\n {}\n );", - "es5": "function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }\n\nfunction _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(source, true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(source).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }\n\nfunction _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\n\nvar renameKeys = function renameKeys(keysMap, obj) {\n return Object.keys(obj).reduce(function (acc, key) {\n return _objectSpread({}, acc, {}, _defineProperty({}, keysMap[key] || key, obj[key]));\n }, {});\n};", + "es5": "function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }\n\nfunction _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }\n\nfunction _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\n\nvar renameKeys = function renameKeys(keysMap, obj) {\n return Object.keys(obj).reduce(function (acc, key) {\n return _objectSpread({}, acc, {}, _defineProperty({}, keysMap[key] || key, obj[key]));\n }, {});\n};", "example": "const obj = { name: 'Bobo', job: 'Front-End Master', shoeSize: 100 };\nrenameKeys({ name: 'firstName', job: 'passion' }, obj); // { firstName: 'Bobo', passion: 'Front-End Master', shoeSize: 100 }" }, "tags": [ @@ -6595,9 +6859,10 @@ }, "meta": { "hash": "d425dd9806d3ae9b3ac08404c43cf28c48084835ffbce5fbd01f04ee1d7a7e5a", - "firstSeen": "1566932336", - "lastUpdated": "1566932336", - "updateCount": 2 + "firstSeen": "1567096638", + "lastUpdated": "1567096638", + "updateCount": 2, + "authorCount": 2 } }, { @@ -6620,9 +6885,10 @@ }, "meta": { "hash": "f608179567e28f0c7de78fce112c5dda6cf01989f9d8499119c80bdd119b0c8d", - "firstSeen": "1566932336", - "lastUpdated": "1566932336", - "updateCount": 2 + "firstSeen": "1567096638", + "lastUpdated": "1567096638", + "updateCount": 2, + "authorCount": 2 } }, { @@ -6644,9 +6910,10 @@ }, "meta": { "hash": "592446fabae44d631396de3441738710626c4d274eaabe3dfdb9b822ce3a5179", - "firstSeen": "1566932336", - "lastUpdated": "1566932336", - "updateCount": 2 + "firstSeen": "1567096638", + "lastUpdated": "1567096638", + "updateCount": 2, + "authorCount": 2 } }, { @@ -6668,9 +6935,10 @@ }, "meta": { "hash": "8e1d9b3d05e81deb58e6608a0dbf9a336deb73e17820490defc4e98b1febf8e1", - "firstSeen": "1566932336", - "lastUpdated": "1566932336", - "updateCount": 2 + "firstSeen": "1567096638", + "lastUpdated": "1567096638", + "updateCount": 2, + "authorCount": 2 } }, { @@ -6695,9 +6963,10 @@ }, "meta": { "hash": "e8e3b0389a64049fccb2dec854868d94ce03c2ff9e9fdcef9b9b5e9477a7602b", - "firstSeen": "1566932336", - "lastUpdated": "1566932336", - "updateCount": 2 + "firstSeen": "1567096638", + "lastUpdated": "1567096638", + "updateCount": 2, + "authorCount": 2 } }, { @@ -6720,9 +6989,10 @@ }, "meta": { "hash": "0999832f2ad6dd8f9726494cffed82f85db80121f81b7d7ba43f184911abaf05", - "firstSeen": "1566932336", - "lastUpdated": "1566932336", - "updateCount": 2 + "firstSeen": "1567096638", + "lastUpdated": "1567096638", + "updateCount": 2, + "authorCount": 2 } }, { @@ -6745,9 +7015,10 @@ }, "meta": { "hash": "c17b6181734f37fd452c486dc37b85500aeffeb6472874cd4ff1b71bd79288b1", - "firstSeen": "1566932336", - "lastUpdated": "1566932336", - "updateCount": 2 + "firstSeen": "1567096638", + "lastUpdated": "1567096638", + "updateCount": 2, + "authorCount": 2 } }, { @@ -6770,9 +7041,10 @@ }, "meta": { "hash": "dbca8b17910aa993f1a5746193a915a46b0825a8d69210e3d99d9fbcb484b919", - "firstSeen": "1566932336", - "lastUpdated": "1566932336", - "updateCount": 2 + "firstSeen": "1567096638", + "lastUpdated": "1567096638", + "updateCount": 2, + "authorCount": 2 } }, { @@ -6794,9 +7066,10 @@ }, "meta": { "hash": "2e8250f339e49af92c10c877ae4dbc9d2889ed14bdab24f96bfda82a095d4989", - "firstSeen": "1566932336", - "lastUpdated": "1566932336", - "updateCount": 2 + "firstSeen": "1567096638", + "lastUpdated": "1567096638", + "updateCount": 2, + "authorCount": 2 } }, { @@ -6819,9 +7092,10 @@ }, "meta": { "hash": "58d91b4760b4af29df95cf1b073166c02660f9af3d46c950fba64b922c999ba1", - "firstSeen": "1566932336", - "lastUpdated": "1566932336", - "updateCount": 2 + "firstSeen": "1567096638", + "lastUpdated": "1567096638", + "updateCount": 2, + "authorCount": 2 } }, { @@ -6844,9 +7118,10 @@ }, "meta": { "hash": "defdaa306864196a4f561c37c4c7f74ffc159406c4538a0f7e1f3f153840eebe", - "firstSeen": "1566932336", - "lastUpdated": "1566932336", - "updateCount": 2 + "firstSeen": "1567096638", + "lastUpdated": "1567096638", + "updateCount": 2, + "authorCount": 2 } }, { @@ -6869,9 +7144,10 @@ }, "meta": { "hash": "8edd4093e584bbfae52b464e55a335c0af33861ee2d580d4ec005b85cd7491ee", - "firstSeen": "1566932336", - "lastUpdated": "1566932336", - "updateCount": 2 + "firstSeen": "1567096638", + "lastUpdated": "1567096638", + "updateCount": 2, + "authorCount": 2 } }, { @@ -6893,9 +7169,10 @@ }, "meta": { "hash": "8f531d87240d659970223c06c464bb1434fb3096e365d48dccb5c386a39e1ac4", - "firstSeen": "1566932336", - "lastUpdated": "1566932336", - "updateCount": 2 + "firstSeen": "1567096638", + "lastUpdated": "1567096638", + "updateCount": 2, + "authorCount": 2 } }, { @@ -6917,9 +7194,10 @@ }, "meta": { "hash": "4a19fb8e2ef816c5dfa373d3f0cbcb223c34fe8fe2861f09f139edb18bfb2978", - "firstSeen": "1566932336", - "lastUpdated": "1566932336", - "updateCount": 2 + "firstSeen": "1567096638", + "lastUpdated": "1567096638", + "updateCount": 2, + "authorCount": 2 } }, { @@ -6941,9 +7219,10 @@ }, "meta": { "hash": "65d097127b81a7fd3bfbaf79e804ce09114ef4ad08e27d64fa98891f4d68cb6b", - "firstSeen": "1566932336", - "lastUpdated": "1566932336", - "updateCount": 2 + "firstSeen": "1567096638", + "lastUpdated": "1567096638", + "updateCount": 2, + "authorCount": 2 } }, { @@ -6966,9 +7245,10 @@ }, "meta": { "hash": "541411afec987a2cf11bfa2d3d6a4f5f3e1b4f3e7363dd57281715bbf433cc40", - "firstSeen": "1566932336", - "lastUpdated": "1566932336", - "updateCount": 2 + "firstSeen": "1567096638", + "lastUpdated": "1567096638", + "updateCount": 2, + "authorCount": 2 } }, { @@ -6991,9 +7271,10 @@ }, "meta": { "hash": "10ea54fc484a0ccc346126ff9665835da5ef5bfa6f75fdea98bfaacfb2dbb65e", - "firstSeen": "1566932336", - "lastUpdated": "1566932336", - "updateCount": 2 + "firstSeen": "1567096638", + "lastUpdated": "1567096638", + "updateCount": 2, + "authorCount": 2 } }, { @@ -7016,9 +7297,10 @@ }, "meta": { "hash": "9a8cf04ac3d6a593ef6e5169338c96feaec5b19a799256cbc26543f1fac8234a", - "firstSeen": "1566932336", - "lastUpdated": "1566932336", - "updateCount": 2 + "firstSeen": "1567096638", + "lastUpdated": "1567096638", + "updateCount": 2, + "authorCount": 2 } }, { @@ -7029,7 +7311,7 @@ "fileName": "size.md", "text": "Get size of arrays, objects or strings.\n\nGet type of `val` (`array`, `object` or `string`). \nUse `length` property for arrays.\nUse `length` or `size` value if available or number of keys for objects.\nUse `size` of a [`Blob` object](https://developer.mozilla.org/en-US/docs/Web/API/Blob) created from `val` for strings.\nSplit strings into array of characters with `split('')` and return its length.\n\n", "codeBlocks": { - "es6": "const size = val =>\n Array.isArray(val)\n ? val.length\n : val && typeof val === 'object'\n ? val.size || val.length || Object.keys(val).length\n : typeof val === 'string'\n ? new Blob([val]).size\n : 0;", + "es6": "const size = val =>\n Array.isArray(val)\n ? val.length\n : val && typeof val === 'object'\n ? val.size || val.length || Object.keys(val).length\n : typeof val === 'string'\n ? new Blob([val]).size\n : 0;", "es5": "function _typeof(obj) { if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }; } return _typeof(obj); }\n\nvar size = function size(val) {\n return Array.isArray(val) ? val.length : val && _typeof(val) === 'object' ? val.size || val.length || Object.keys(val).length : typeof val === 'string' ? new Blob([val]).size : 0;\n};", "example": "size([1, 2, 3, 4, 5]); // 5\nsize('size'); // 4\nsize({ one: 1, two: 2, three: 3 }); // 3" }, @@ -7041,10 +7323,11 @@ ] }, "meta": { - "hash": "fc085a3110ffbbfa36c63ce282a3ab59e96d101eb4f489a59b68c1fda1814c14", - "firstSeen": "1566932336", - "lastUpdated": "1566932336", - "updateCount": 2 + "hash": "532a39b77c025041de48f14122ac229a675d0af3e0a990d55a26c5f971ec3725", + "firstSeen": "1567096638", + "lastUpdated": "1567096638", + "updateCount": 2, + "authorCount": 2 } }, { @@ -7067,9 +7350,10 @@ }, "meta": { "hash": "07393d7a0e2d433b57abea9792aef5165990bf0ba81eb4e45a01cabceffdaed6", - "firstSeen": "1566932336", - "lastUpdated": "1566932336", - "updateCount": 2 + "firstSeen": "1567096638", + "lastUpdated": "1567096638", + "updateCount": 2, + "authorCount": 2 } }, { @@ -7092,9 +7376,10 @@ }, "meta": { "hash": "e7d3354d7f5e16a3e7f26ebde9fa93a58c806f2eb7767e9f4269136a408dacb3", - "firstSeen": "1566932336", - "lastUpdated": "1566932336", - "updateCount": 2 + "firstSeen": "1567096638", + "lastUpdated": "1567096638", + "updateCount": 2, + "authorCount": 2 } }, { @@ -7116,9 +7401,10 @@ }, "meta": { "hash": "5aaca9e4e7703fd856345cd3cd124f7db9d3d9b33fc8971ded6e0692f1a5df79", - "firstSeen": "1566932336", - "lastUpdated": "1566932336", - "updateCount": 2 + "firstSeen": "1567096638", + "lastUpdated": "1567096638", + "updateCount": 2, + "authorCount": 2 } }, { @@ -7141,9 +7427,10 @@ }, "meta": { "hash": "86849a05d8395934e7f83d52d2c70a9b9d7982db85cfc264ffb4410c03496f79", - "firstSeen": "1566932336", - "lastUpdated": "1566932336", - "updateCount": 2 + "firstSeen": "1567096638", + "lastUpdated": "1567096638", + "updateCount": 2, + "authorCount": 2 } }, { @@ -7167,9 +7454,10 @@ }, "meta": { "hash": "1b3e4c56abe1a9a8d3fa17798c1efc281f0294be4e2877e8e8c323dfcb4ca591", - "firstSeen": "1566932336", - "lastUpdated": "1566932336", - "updateCount": 2 + "firstSeen": "1567096638", + "lastUpdated": "1567096638", + "updateCount": 2, + "authorCount": 2 } }, { @@ -7192,9 +7480,10 @@ }, "meta": { "hash": "82ced04bfc70d243245fad7f3ebf9ef5945bd102d74e77102f917687b3e53d22", - "firstSeen": "1566932336", - "lastUpdated": "1566932336", - "updateCount": 2 + "firstSeen": "1567096638", + "lastUpdated": "1567096638", + "updateCount": 2, + "authorCount": 2 } }, { @@ -7218,9 +7507,10 @@ }, "meta": { "hash": "517118a841e0a4f3feb0e73d2d7012fc48c9cb655129002b399a2c5c3fd7a3f6", - "firstSeen": "1566932336", - "lastUpdated": "1566932336", - "updateCount": 2 + "firstSeen": "1567096638", + "lastUpdated": "1567096638", + "updateCount": 2, + "authorCount": 2 } }, { @@ -7242,9 +7532,10 @@ }, "meta": { "hash": "0c21e5e8c3549051085ada0effdfa8f3e19a266778967ef46697c7b9b78b5227", - "firstSeen": "1566932336", - "lastUpdated": "1566932336", - "updateCount": 2 + "firstSeen": "1567096638", + "lastUpdated": "1567096638", + "updateCount": 2, + "authorCount": 2 } }, { @@ -7266,9 +7557,10 @@ }, "meta": { "hash": "53c9bc4c5b6a5131f5dd8591c10e5eac376cfd96715015d783d8466d49ed0058", - "firstSeen": "1566932336", - "lastUpdated": "1566932336", - "updateCount": 2 + "firstSeen": "1567096638", + "lastUpdated": "1567096638", + "updateCount": 2, + "authorCount": 2 } }, { @@ -7292,9 +7584,10 @@ }, "meta": { "hash": "4f0ace59a000b0898eab157f0d5232fb8e0a19d854baf8496442a2928c15f87d", - "firstSeen": "1566932336", - "lastUpdated": "1566932336", - "updateCount": 2 + "firstSeen": "1567096638", + "lastUpdated": "1567096638", + "updateCount": 2, + "authorCount": 2 } }, { @@ -7317,9 +7610,10 @@ }, "meta": { "hash": "f0fe3943b1ac2f0935a3a5a3b7004f88f168faebe9bb4088f4dc441a06975cbb", - "firstSeen": "1566932336", - "lastUpdated": "1566932336", - "updateCount": 2 + "firstSeen": "1567096638", + "lastUpdated": "1567096638", + "updateCount": 2, + "authorCount": 2 } }, { @@ -7342,9 +7636,10 @@ }, "meta": { "hash": "1a4c3427df70f2633c0d1a2c47b9ef7452664e1b6ea58525ce4067e1ea6a51a8", - "firstSeen": "1566932336", + "firstSeen": "1567096638", "lastUpdated": "1574366533", - "updateCount": 3 + "updateCount": 3, + "authorCount": 3 } }, { @@ -7368,9 +7663,10 @@ }, "meta": { "hash": "a33dbe87821f5017cf4238c69d9effcfe993698f055fec5e915f4fff68c01e34", - "firstSeen": "1566932336", - "lastUpdated": "1566932336", - "updateCount": 2 + "firstSeen": "1567096638", + "lastUpdated": "1567096638", + "updateCount": 2, + "authorCount": 2 } }, { @@ -7393,9 +7689,10 @@ }, "meta": { "hash": "a3ba3ba8f7bb293e1560c3140da2b50ac739ac4e5fb10c857f837b6dc54b029b", - "firstSeen": "1566932336", - "lastUpdated": "1566932336", - "updateCount": 2 + "firstSeen": "1567096638", + "lastUpdated": "1567096638", + "updateCount": 2, + "authorCount": 2 } }, { @@ -7419,9 +7716,10 @@ }, "meta": { "hash": "3e92614cb14073c51991cb6978e6a7e5871a00f1f24a886046f441fdc4633175", - "firstSeen": "1566932336", - "lastUpdated": "1566932336", - "updateCount": 2 + "firstSeen": "1567096638", + "lastUpdated": "1567096638", + "updateCount": 2, + "authorCount": 2 } }, { @@ -7443,9 +7741,10 @@ }, "meta": { "hash": "5ba3bb9fbfb3e5b61195b6e72e5b8f9f3e86b1a9b478e52f2429c4399718d118", - "firstSeen": "1566932336", - "lastUpdated": "1566932336", - "updateCount": 2 + "firstSeen": "1567096638", + "lastUpdated": "1567096638", + "updateCount": 2, + "authorCount": 2 } }, { @@ -7468,9 +7767,10 @@ }, "meta": { "hash": "7f920d42aa9408822b33d9790b0664f7f289989a363f21e9a1a87cb88510fb54", - "firstSeen": "1566932336", - "lastUpdated": "1566932336", - "updateCount": 2 + "firstSeen": "1567096638", + "lastUpdated": "1567096638", + "updateCount": 2, + "authorCount": 2 } }, { @@ -7493,9 +7793,10 @@ }, "meta": { "hash": "f31a5937c12873095d7e167410eab03efdffb4bf6eb0561881a66111ddc750a7", - "firstSeen": "1566932336", - "lastUpdated": "1566932336", - "updateCount": 2 + "firstSeen": "1567096638", + "lastUpdated": "1567096638", + "updateCount": 2, + "authorCount": 2 } }, { @@ -7518,9 +7819,10 @@ }, "meta": { "hash": "2d54a197d2cd14bddc7daf88f64413ad8c3b4a42fdee91a0a5cf45d71688d8cf", - "firstSeen": "1566932336", - "lastUpdated": "1566932336", - "updateCount": 2 + "firstSeen": "1567096638", + "lastUpdated": "1567096638", + "updateCount": 2, + "authorCount": 2 } }, { @@ -7542,9 +7844,10 @@ }, "meta": { "hash": "200a7d0c4ccca7ad8f80c9489ed461d46d5ad0ca75184d18c3414437fd99bad2", - "firstSeen": "1566932336", - "lastUpdated": "1566932336", - "updateCount": 2 + "firstSeen": "1567096638", + "lastUpdated": "1567096638", + "updateCount": 2, + "authorCount": 2 } }, { @@ -7566,9 +7869,10 @@ }, "meta": { "hash": "670d66a804a498c3826e65fe1cb8917832f72ff3a41cdee9f3c29f357aadb7fb", - "firstSeen": "1566932336", - "lastUpdated": "1566932336", - "updateCount": 2 + "firstSeen": "1567096638", + "lastUpdated": "1567096638", + "updateCount": 2, + "authorCount": 2 } }, { @@ -7590,9 +7894,10 @@ }, "meta": { "hash": "4c83bc03b1146f6a9f49f12855a4118dd32367b6b6d46e64e94959404411e823", - "firstSeen": "1566932336", - "lastUpdated": "1566932336", - "updateCount": 2 + "firstSeen": "1567096638", + "lastUpdated": "1567096638", + "updateCount": 2, + "authorCount": 2 } }, { @@ -7615,9 +7920,10 @@ }, "meta": { "hash": "ee5e3e006f3b756090a5f3f02cd0d2ea06da048dd0550277c25719b83ceeeaf6", - "firstSeen": "1566932336", - "lastUpdated": "1566932336", - "updateCount": 2 + "firstSeen": "1567096638", + "lastUpdated": "1567096638", + "updateCount": 2, + "authorCount": 2 } }, { @@ -7629,7 +7935,7 @@ "text": "Removes elements in an array until the passed function returns `true`. Returns the removed elements.\n\nLoop through the array, using a `for...of` loop over `Array.prototype.entries()` until the returned value from the function is `true`.\nReturn the removed elements, using `Array.prototype.slice()`.\n\n", "codeBlocks": { "es6": "const takeWhile = (arr, func) => {\n for (const [i, val] of arr.entries()) if (func(val)) return arr.slice(0, i);\n return arr;\n};", - "es5": "function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _nonIterableRest(); }\n\nfunction _nonIterableRest() { throw new TypeError(\"Invalid attempt to destructure non-iterable instance\"); }\n\nfunction _iterableToArrayLimit(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i[\"return\"] != null) _i[\"return\"](); } finally { if (_d) throw _e; } } return _arr; }\n\nfunction _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }\n\nvar takeWhile = function takeWhile(arr, func) {\n var _iteratorNormalCompletion = true;\n var _didIteratorError = false;\n var _iteratorError = undefined;\n\n try {\n for (var _iterator = arr.entries()[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {\n var _step$value = _slicedToArray(_step.value, 2),\n i = _step$value[0],\n val = _step$value[1];\n\n if (func(val)) return arr.slice(0, i);\n }\n } catch (err) {\n _didIteratorError = true;\n _iteratorError = err;\n } finally {\n try {\n if (!_iteratorNormalCompletion && _iterator[\"return\"] != null) {\n _iterator[\"return\"]();\n }\n } finally {\n if (_didIteratorError) {\n throw _iteratorError;\n }\n }\n }\n\n return arr;\n};", + "es5": "function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _nonIterableRest(); }\n\nfunction _nonIterableRest() { throw new TypeError(\"Invalid attempt to destructure non-iterable instance\"); }\n\nfunction _iterableToArrayLimit(arr, i) { if (!(Symbol.iterator in Object(arr) || Object.prototype.toString.call(arr) === \"[object Arguments]\")) { return; } var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i[\"return\"] != null) _i[\"return\"](); } finally { if (_d) throw _e; } } return _arr; }\n\nfunction _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }\n\nvar takeWhile = function takeWhile(arr, func) {\n var _iteratorNormalCompletion = true;\n var _didIteratorError = false;\n var _iteratorError = undefined;\n\n try {\n for (var _iterator = arr.entries()[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {\n var _step$value = _slicedToArray(_step.value, 2),\n i = _step$value[0],\n val = _step$value[1];\n\n if (func(val)) return arr.slice(0, i);\n }\n } catch (err) {\n _didIteratorError = true;\n _iteratorError = err;\n } finally {\n try {\n if (!_iteratorNormalCompletion && _iterator[\"return\"] != null) {\n _iterator[\"return\"]();\n }\n } finally {\n if (_didIteratorError) {\n throw _iteratorError;\n }\n }\n }\n\n return arr;\n};", "example": "takeWhile([1, 2, 3, 4], n => n >= 3); // [1, 2]" }, "tags": [ @@ -7640,9 +7946,10 @@ }, "meta": { "hash": "1131730353754c8cdb3f3c2d81eb750fbfc99020ff7266987253e857b9aee6c5", - "firstSeen": "1566932336", - "lastUpdated": "1566932336", - "updateCount": 2 + "firstSeen": "1567096638", + "lastUpdated": "1567096638", + "updateCount": 2, + "authorCount": 2 } }, { @@ -7664,9 +7971,10 @@ }, "meta": { "hash": "0ff3f88fae6144b972137023cf882931df405a09413c1c48bdcb7ed78c1977aa", - "firstSeen": "1566932336", - "lastUpdated": "1566932336", - "updateCount": 2 + "firstSeen": "1567096638", + "lastUpdated": "1567096638", + "updateCount": 2, + "authorCount": 2 } }, { @@ -7688,9 +7996,10 @@ }, "meta": { "hash": "f4f19054ff681f91e6d45f0b08ce964192b96eac5a6807df85877457cb4b366c", - "firstSeen": "1566932336", - "lastUpdated": "1566932336", - "updateCount": 2 + "firstSeen": "1567096638", + "lastUpdated": "1567096638", + "updateCount": 2, + "authorCount": 2 } }, { @@ -7712,9 +8021,10 @@ }, "meta": { "hash": "26246364ba1e8e3f52a51c8e1f329af721b05a5d307ed88bf31ccd2620c0deee", - "firstSeen": "1566932336", - "lastUpdated": "1566932336", - "updateCount": 2 + "firstSeen": "1567096638", + "lastUpdated": "1567096638", + "updateCount": 2, + "authorCount": 2 } }, { @@ -7737,9 +8047,10 @@ }, "meta": { "hash": "5a38a98081a22fe5a56d272038bc1f7dadab097b1cf4c16c34286e9d51c26331", - "firstSeen": "1566932336", - "lastUpdated": "1566932336", - "updateCount": 2 + "firstSeen": "1567096638", + "lastUpdated": "1567096638", + "updateCount": 2, + "authorCount": 2 } }, { @@ -7761,9 +8072,10 @@ }, "meta": { "hash": "2f817f7dc3ca24a50bfaa1a59dec3ec6d8ee3392ac2d7f3ecae3a93a9c96f09c", - "firstSeen": "1566932336", - "lastUpdated": "1566932336", - "updateCount": 2 + "firstSeen": "1567096638", + "lastUpdated": "1567096638", + "updateCount": 2, + "authorCount": 2 } }, { @@ -7786,9 +8098,10 @@ }, "meta": { "hash": "426eb2319298548df80de3db701eb3c130abd4ff9613a87bd2ae55f76aae7039", - "firstSeen": "1566932336", - "lastUpdated": "1566932336", - "updateCount": 2 + "firstSeen": "1567096638", + "lastUpdated": "1567096638", + "updateCount": 2, + "authorCount": 2 } }, { @@ -7810,9 +8123,10 @@ }, "meta": { "hash": "994b3e4bd75982d26fef1b3812890b90118c8d89aec6e8a666ce7e132c382081", - "firstSeen": "1566932336", - "lastUpdated": "1566932336", - "updateCount": 2 + "firstSeen": "1567096638", + "lastUpdated": "1567096638", + "updateCount": 2, + "authorCount": 2 } }, { @@ -7834,9 +8148,10 @@ }, "meta": { "hash": "4d9656f6d96e3cdd49ab1df4389315e004c5a134fe22ad1036befb6168ee1e54", - "firstSeen": "1566932336", - "lastUpdated": "1566932336", - "updateCount": 2 + "firstSeen": "1567096638", + "lastUpdated": "1567096638", + "updateCount": 2, + "authorCount": 2 } }, { @@ -7859,9 +8174,10 @@ }, "meta": { "hash": "0981cb8583c317d56894840bb31fd83e820b56fd7eef18d96db1edcb0a222860", - "firstSeen": "1566932336", - "lastUpdated": "1566932336", - "updateCount": 2 + "firstSeen": "1567096638", + "lastUpdated": "1567096638", + "updateCount": 2, + "authorCount": 2 } }, { @@ -7883,9 +8199,10 @@ }, "meta": { "hash": "79e76e143e7f595b4d2c5be657629728cd5fb2cc4248706dedb7e0c8e9512d3c", - "firstSeen": "1566932336", - "lastUpdated": "1566932336", - "updateCount": 2 + "firstSeen": "1567096638", + "lastUpdated": "1567096638", + "updateCount": 2, + "authorCount": 2 } }, { @@ -7908,9 +8225,10 @@ }, "meta": { "hash": "0ebd3351685fd96bf678c2baa38fabc9aa18bd6a3fa6674ea0bae9663424ea5f", - "firstSeen": "1566932336", - "lastUpdated": "1566932336", - "updateCount": 2 + "firstSeen": "1567096638", + "lastUpdated": "1567096638", + "updateCount": 2, + "authorCount": 2 } }, { @@ -7932,9 +8250,10 @@ }, "meta": { "hash": "ebe1997777f4fb4c97cd5ae23a0cc590a0aab8f6762ae1d39c17f27bf2efe1c6", - "firstSeen": "1566932336", - "lastUpdated": "1566932336", - "updateCount": 2 + "firstSeen": "1567096638", + "lastUpdated": "1567096638", + "updateCount": 2, + "authorCount": 2 } }, { @@ -7957,9 +8276,10 @@ }, "meta": { "hash": "84b49b4a42fc39414edc473addc5de9a956e3ad26496133bd721c8d691352def", - "firstSeen": "1566932336", - "lastUpdated": "1566932336", - "updateCount": 2 + "firstSeen": "1567096638", + "lastUpdated": "1567096638", + "updateCount": 2, + "authorCount": 2 } }, { @@ -7982,9 +8302,10 @@ }, "meta": { "hash": "9ec5b60fcad2b633dfdbb342bf3fad8f3b63d2e06da09781c73481283f0cab1b", - "firstSeen": "1566932336", - "lastUpdated": "1566932336", - "updateCount": 2 + "firstSeen": "1567096638", + "lastUpdated": "1567096638", + "updateCount": 2, + "authorCount": 2 } }, { @@ -8007,9 +8328,10 @@ }, "meta": { "hash": "2186f42e4ed6452b13986c08af41e7e98b6fb6528ca1994e2ee843d0453ef695", - "firstSeen": "1566932336", - "lastUpdated": "1566932336", - "updateCount": 2 + "firstSeen": "1567096638", + "lastUpdated": "1567096638", + "updateCount": 2, + "authorCount": 2 } }, { @@ -8032,9 +8354,10 @@ }, "meta": { "hash": "61673214d218ca447cac81b95b6766264b66fd141462fbd5e3814e4c6cf7ded2", - "firstSeen": "1566932336", - "lastUpdated": "1566932336", - "updateCount": 2 + "firstSeen": "1567096638", + "lastUpdated": "1567096638", + "updateCount": 2, + "authorCount": 2 } }, { @@ -8056,9 +8379,10 @@ }, "meta": { "hash": "6f9ea1ee77d87c9b78e7b069bf27cf8bafd269023f3f7b675a65791446d7d2d3", - "firstSeen": "1566932336", - "lastUpdated": "1566932336", - "updateCount": 2 + "firstSeen": "1567096638", + "lastUpdated": "1567096638", + "updateCount": 2, + "authorCount": 2 } }, { @@ -8082,9 +8406,10 @@ }, "meta": { "hash": "7e4b72845da78eb0665de207c9d94c2f728d945be47d6dd13a14b53101e7a6a4", - "firstSeen": "1566932336", - "lastUpdated": "1566932336", - "updateCount": 2 + "firstSeen": "1567096638", + "lastUpdated": "1567096638", + "updateCount": 2, + "authorCount": 2 } }, { @@ -8107,9 +8432,10 @@ }, "meta": { "hash": "73046804bd1b91d397ee382d19eb59798f17319c1acf74393a550286be8cf087", - "firstSeen": "1566932336", - "lastUpdated": "1566932336", - "updateCount": 2 + "firstSeen": "1567096638", + "lastUpdated": "1567096638", + "updateCount": 2, + "authorCount": 2 } }, { @@ -8131,9 +8457,10 @@ }, "meta": { "hash": "9947959c989195fe0581aa57ea3456f90d3c0e10a2f6e772f3a891ac81574f34", - "firstSeen": "1566932336", - "lastUpdated": "1566932336", - "updateCount": 2 + "firstSeen": "1567096638", + "lastUpdated": "1567096638", + "updateCount": 2, + "authorCount": 2 } }, { @@ -8156,9 +8483,10 @@ }, "meta": { "hash": "f469a318ae70e50251f0430c34d8fe0f57ca9158c2a8619ba146d2246adee8d5", - "firstSeen": "1566932336", - "lastUpdated": "1566932336", - "updateCount": 2 + "firstSeen": "1567096638", + "lastUpdated": "1567096638", + "updateCount": 2, + "authorCount": 2 } }, { @@ -8180,9 +8508,10 @@ }, "meta": { "hash": "bc549ec3e2504bca06ef5ce7f1424b3b7dcd8959ebe983eeb576cda7eb5f6017", - "firstSeen": "1566932336", - "lastUpdated": "1566932336", - "updateCount": 2 + "firstSeen": "1567096638", + "lastUpdated": "1567096638", + "updateCount": 2, + "authorCount": 2 } }, { @@ -8205,9 +8534,10 @@ }, "meta": { "hash": "c1003c7baca5e5492e603c28aaa822cf24393036d6322fd90591519f9e7c74d9", - "firstSeen": "1566932336", - "lastUpdated": "1566932336", - "updateCount": 2 + "firstSeen": "1567096638", + "lastUpdated": "1567096638", + "updateCount": 2, + "authorCount": 2 } }, { @@ -8230,9 +8560,10 @@ }, "meta": { "hash": "9b1bc0a79c182b07f6c9142ceb346a2958e1902c7b5defa906f071573583dcb7", - "firstSeen": "1566932336", - "lastUpdated": "1566932336", - "updateCount": 2 + "firstSeen": "1567096638", + "lastUpdated": "1567096638", + "updateCount": 2, + "authorCount": 2 } }, { @@ -8255,9 +8586,10 @@ }, "meta": { "hash": "db6fe4b924d30c2d844e7c55a1b73250c323ccccaa22ae15d936ce653a5c7a15", - "firstSeen": "1566932336", - "lastUpdated": "1566932336", - "updateCount": 2 + "firstSeen": "1567096638", + "lastUpdated": "1567096638", + "updateCount": 2, + "authorCount": 2 } }, { @@ -8280,9 +8612,10 @@ }, "meta": { "hash": "2784f965f4f4c04998f63b440c6554613bb2042ea1b45a461775c8ffc9e2ec29", - "firstSeen": "1566932336", - "lastUpdated": "1566932336", - "updateCount": 2 + "firstSeen": "1567096638", + "lastUpdated": "1567096638", + "updateCount": 2, + "authorCount": 2 } }, { @@ -8304,9 +8637,10 @@ }, "meta": { "hash": "474b3568e2a842246ff6ab2800aeec3f82353732080bb63911adb142d273e34c", - "firstSeen": "1566932336", - "lastUpdated": "1566932336", - "updateCount": 2 + "firstSeen": "1567096638", + "lastUpdated": "1567096638", + "updateCount": 2, + "authorCount": 2 } }, { @@ -8329,9 +8663,10 @@ }, "meta": { "hash": "a506c398c0d84b8c6926b70e62f28ca6180a02d010088c89fc9c8d7e2706e0bc", - "firstSeen": "1566932336", - "lastUpdated": "1566932336", - "updateCount": 2 + "firstSeen": "1567096638", + "lastUpdated": "1567096638", + "updateCount": 2, + "authorCount": 2 } }, { @@ -8354,9 +8689,10 @@ }, "meta": { "hash": "59867a867b440985ad221def644ec15594908db1d2ae413fc8a41f2669e3798a", - "firstSeen": "1566932336", - "lastUpdated": "1566932336", - "updateCount": 2 + "firstSeen": "1567096638", + "lastUpdated": "1567096638", + "updateCount": 2, + "authorCount": 2 } }, { @@ -8379,9 +8715,10 @@ }, "meta": { "hash": "553400fbd0f95322a82a87440dcaef7c25277740e3116027b5d23731a926cc61", - "firstSeen": "1566932336", - "lastUpdated": "1566932336", - "updateCount": 2 + "firstSeen": "1567096638", + "lastUpdated": "1567096638", + "updateCount": 2, + "authorCount": 2 } }, { @@ -8404,9 +8741,10 @@ }, "meta": { "hash": "fc0e9c9b78dfc63137bd1a7bf71d03089d732356803f16af37febce1adefda9a", - "firstSeen": "1566932336", - "lastUpdated": "1566932336", - "updateCount": 2 + "firstSeen": "1567096638", + "lastUpdated": "1567096638", + "updateCount": 2, + "authorCount": 2 } }, { @@ -8428,9 +8766,10 @@ }, "meta": { "hash": "5165ec928d2bf1d48f21f8591df40cc466e2821064e5180aa598bb5aff4d642a", - "firstSeen": "1566932336", - "lastUpdated": "1566932336", - "updateCount": 2 + "firstSeen": "1567096638", + "lastUpdated": "1567096638", + "updateCount": 2, + "authorCount": 2 } }, { @@ -8453,9 +8792,10 @@ }, "meta": { "hash": "12bf4549e753e503e1798b21dcebc3bc2026ee3e6f391887d4bb0fa99211e2f6", - "firstSeen": "1566932336", - "lastUpdated": "1566932336", - "updateCount": 2 + "firstSeen": "1567096638", + "lastUpdated": "1567096638", + "updateCount": 2, + "authorCount": 2 } }, { @@ -8479,9 +8819,10 @@ }, "meta": { "hash": "6050cfa3a2a39089151bacfce1f5cedaec12f5da253dbc20a56dfaf50cb8924b", - "firstSeen": "1566932336", - "lastUpdated": "1566932336", - "updateCount": 2 + "firstSeen": "1567096638", + "lastUpdated": "1567096638", + "updateCount": 2, + "authorCount": 2 } }, { @@ -8505,9 +8846,10 @@ }, "meta": { "hash": "9f84a12da85558ebdb189097dbc581b338e07d52eedc5975f1001133b123aad2", - "firstSeen": "1566932336", - "lastUpdated": "1566932336", - "updateCount": 2 + "firstSeen": "1567096638", + "lastUpdated": "1567096638", + "updateCount": 2, + "authorCount": 2 } }, { @@ -8531,9 +8873,10 @@ }, "meta": { "hash": "79604b0f854a91af789fea8416c7099acfb3633259ef387f52a21337d2242478", - "firstSeen": "1566932336", - "lastUpdated": "1566932336", - "updateCount": 2 + "firstSeen": "1567096638", + "lastUpdated": "1567096638", + "updateCount": 2, + "authorCount": 2 } }, { @@ -8556,9 +8899,10 @@ }, "meta": { "hash": "73fc55564fa0b59a71553aa442bda666cbcddbcd618f9ca53c2b55e42a7c26ca", - "firstSeen": "1566932336", - "lastUpdated": "1566932336", - "updateCount": 2 + "firstSeen": "1567096638", + "lastUpdated": "1567096638", + "updateCount": 2, + "authorCount": 2 } }, { @@ -8580,9 +8924,10 @@ }, "meta": { "hash": "a2c8560a2e285ebe11caad3a46c07ee0e41a64bd850b2e5a4f5aebc12da09dcc", - "firstSeen": "1566932336", - "lastUpdated": "1566932336", - "updateCount": 2 + "firstSeen": "1567096638", + "lastUpdated": "1567096638", + "updateCount": 2, + "authorCount": 2 } }, { @@ -8604,9 +8949,10 @@ }, "meta": { "hash": "4ec8d33670ad1c716f00c72100c27c43a0031eb8ee411699aa4740df3bfe9659", - "firstSeen": "1566932336", - "lastUpdated": "1566932336", - "updateCount": 2 + "firstSeen": "1567096638", + "lastUpdated": "1567096638", + "updateCount": 2, + "authorCount": 2 } }, { @@ -8628,9 +8974,10 @@ }, "meta": { "hash": "54f15178f6196172218aeffd14defe4e9af475ee3e29f0857ada823f618d3c8f", - "firstSeen": "1566932336", - "lastUpdated": "1566932336", - "updateCount": 2 + "firstSeen": "1567096638", + "lastUpdated": "1567096638", + "updateCount": 2, + "authorCount": 2 } }, { @@ -8653,9 +9000,10 @@ }, "meta": { "hash": "b072b9cad23554279e7601cafb20813d6675459293aab607a22c820a2f2a0eb9", - "firstSeen": "1566932336", - "lastUpdated": "1566932336", - "updateCount": 2 + "firstSeen": "1567096638", + "lastUpdated": "1567096638", + "updateCount": 2, + "authorCount": 2 } }, { @@ -8678,9 +9026,10 @@ }, "meta": { "hash": "8202d07045f90d897db21799a4daa0de39613c035b4ed1e92ab65c8cd5ce2e15", - "firstSeen": "1566932336", - "lastUpdated": "1566932336", - "updateCount": 2 + "firstSeen": "1567096638", + "lastUpdated": "1567096638", + "updateCount": 2, + "authorCount": 2 } }, { @@ -8703,9 +9052,10 @@ }, "meta": { "hash": "6365f144def8abb711b890f8689ff8c9f1f1aee092525583fa913057ba623472", - "firstSeen": "1566932336", - "lastUpdated": "1566932336", - "updateCount": 2 + "firstSeen": "1567096638", + "lastUpdated": "1567096638", + "updateCount": 2, + "authorCount": 2 } }, { @@ -8727,9 +9077,10 @@ }, "meta": { "hash": "033e90570af5f5ed3d8c0ea4407d6ccaea760372562c5633a24bf08e1f8782d3", - "firstSeen": "1566932336", - "lastUpdated": "1566932336", - "updateCount": 2 + "firstSeen": "1567096638", + "lastUpdated": "1567096638", + "updateCount": 2, + "authorCount": 2 } }, { @@ -8751,9 +9102,10 @@ }, "meta": { "hash": "ec0b5750affd681f1eed8dd7a4711c103675f559da38aab23162d5270567d329", - "firstSeen": "1566932336", - "lastUpdated": "1566932336", - "updateCount": 2 + "firstSeen": "1567096638", + "lastUpdated": "1567096638", + "updateCount": 2, + "authorCount": 2 } }, { @@ -8776,9 +9128,10 @@ }, "meta": { "hash": "f2c7e2c6a8e566946e631c92b295c76cc406650347ec0e21318522f26094acd7", - "firstSeen": "1566932336", - "lastUpdated": "1566932336", - "updateCount": 2 + "firstSeen": "1567096638", + "lastUpdated": "1567096638", + "updateCount": 2, + "authorCount": 2 } }, { @@ -8801,16 +9154,16 @@ }, "meta": { "hash": "457830ee4df5b57b6605c4133b863cc3f3eebf0031ccd1358fae3c6f5cb3c75e", - "firstSeen": "1566932336", - "lastUpdated": "1566932336", - "updateCount": 2 + "firstSeen": "1567096638", + "lastUpdated": "1567096638", + "updateCount": 2, + "authorCount": 2 } } ], "meta": { "specification": "http://jsonapi.org/format/", "type": "snippetArray", - "scope": "./snippets", "language": { "short": "js", "long": "JavaScript" diff --git a/snippets/checkProp.md b/snippets/checkProp.md index 9d6197120..58d5a9430 100644 --- a/snippets/checkProp.md +++ b/snippets/checkProp.md @@ -40,6 +40,7 @@ const checkProp = (predicate, prop) => obj => !!predicate(obj[prop]); + const lengthIs4 = checkProp(l => l === 4, 'length'); diff --git a/snippets/deepClone.md b/snippets/deepClone.md index a0da1f0a5..583169aa7 100644 --- a/snippets/deepClone.md +++ b/snippets/deepClone.md @@ -20,8 +20,8 @@ const deepClone = obj => { return Array.isArray(obj) && obj.length ? (clone.length = obj.length) && Array.from(clone) : Array.isArray(obj) - ? Array.from(obj) - : clone; + ? Array.from(obj) + : clone; }; ``` diff --git a/snippets/deepMapKeys.md b/snippets/deepMapKeys.md index e07084847..e9561091d 100644 --- a/snippets/deepMapKeys.md +++ b/snippets/deepMapKeys.md @@ -14,13 +14,13 @@ const deepMapKeys = (obj, f) => Array.isArray(obj) ? obj.map(val => deepMapKeys(val, f)) : typeof obj === 'object' - ? Object.keys(obj).reduce((acc, current) => { + ? Object.keys(obj).reduce((acc, current) => { const val = obj[current]; acc[f(current)] = val !== null && typeof val === 'object' ? deepMapKeys(val, f) : (acc[f(current)] = val); return acc; }, {}) - : obj; + : obj; ``` ```js diff --git a/snippets/dig.md b/snippets/dig.md index 16c08bebe..b1ec83f8e 100644 --- a/snippets/dig.md +++ b/snippets/dig.md @@ -9,13 +9,14 @@ Use the `in` operator to check if `target` exists in `obj`. If found, return the value of `obj[target]`, otherwise use `Object.values(obj)` and `Array.prototype.reduce()` to recursively call `dig` on each nested object until the first matching key/value pair is found. ```js + const dig = (obj, target) => target in obj ? obj[target] : Object.values(obj).reduce((acc, val) => { - if (acc !== undefined) return acc; - if (typeof val === 'object') return dig(val, target); - }, undefined); + if (acc !== undefined) return acc; + if (typeof val === 'object') return dig(val, target); + }, undefined); ``` ```js diff --git a/snippets/factorial.md b/snippets/factorial.md index 0b1413c15..baa668b8f 100644 --- a/snippets/factorial.md +++ b/snippets/factorial.md @@ -11,14 +11,15 @@ Otherwise, return the product of `n` and the factorial of `n - 1`. Throws an exception if `n` is a negative number. ```js + const factorial = n => n < 0 ? (() => { - throw new TypeError('Negative numbers are not allowed!'); - })() + throw new TypeError('Negative numbers are not allowed!'); + })() : n <= 1 - ? 1 - : n * factorial(n - 1); + ? 1 + : n * factorial(n - 1); ``` ```js diff --git a/snippets/getMeridiemSuffixOfInteger.md b/snippets/getMeridiemSuffixOfInteger.md index c460f5644..74ac86ec7 100644 --- a/snippets/getMeridiemSuffixOfInteger.md +++ b/snippets/getMeridiemSuffixOfInteger.md @@ -8,14 +8,15 @@ Converts an integer to a suffixed string, adding `am` or `pm` based on its value Use the modulo operator (`%`) and conditional checks to transform an integer to a stringified 12-hour format with meridiem suffix. ```js + const getMeridiemSuffixOfInteger = num => num === 0 || num === 24 ? 12 + 'am' : num === 12 - ? 12 + 'pm' - : num < 12 - ? (num % 12) + 'am' - : (num % 12) + 'pm'; + ? 12 + 'pm' + : num < 12 + ? (num % 12) + 'am' + : (num % 12) + 'pm'; ``` ```js diff --git a/snippets/join.md b/snippets/join.md index 6df3c9145..6bf258224 100644 --- a/snippets/join.md +++ b/snippets/join.md @@ -11,14 +11,15 @@ Omit the second argument, `separator`, to use a default separator of `','`. Omit the third argument, `end`, to use the same value as `separator` by default. ```js + const join = (arr, separator = ',', end = separator) => arr.reduce( (acc, val, i) => i === arr.length - 2 ? acc + val + end : i === arr.length - 1 - ? acc + val - : acc + val + separator, + ? acc + val + : acc + val + separator, '' ); ``` diff --git a/snippets/objectToQueryString.md b/snippets/objectToQueryString.md index 3ec24cb45..970eaa7f4 100644 --- a/snippets/objectToQueryString.md +++ b/snippets/objectToQueryString.md @@ -10,14 +10,13 @@ Determine the `symbol` to be either `?` or `&` based on the `index` and concaten Return the `queryString` or an empty string when the `queryParameters` are falsy. ```js - const objectToQueryString = queryParameters => { return queryParameters ? Object.entries(queryParameters).reduce((queryString, [key, val], index) => { - const symbol = index === 0 ? '?' : '&'; - queryString += typeof val === 'string' ? `${symbol}${key}=${val}` : ''; - return queryString; - }, '') + const symbol = index === 0 ? '?' : '&'; + queryString += typeof val === 'string' ? `${symbol}${key}=${val}` : ''; + return queryString; + }, '') : ''; }; ``` diff --git a/snippets/pipeAsyncFunctions.md b/snippets/pipeAsyncFunctions.md index 31bbfbd21..4904b600a 100644 --- a/snippets/pipeAsyncFunctions.md +++ b/snippets/pipeAsyncFunctions.md @@ -14,14 +14,13 @@ const pipeAsyncFunctions = (...fns) => arg => fns.reduce((p, f) => p.then(f), Pr ``` ```js - const sum = pipeAsyncFunctions( x => x + 1, x => new Promise(resolve => setTimeout(() => resolve(x + 2), 1000)), x => x + 3, async x => (await x) + 4 ); -(async() => { +(async () => { console.log(await sum(5)); // 15 (after one second) })(); ``` \ No newline at end of file diff --git a/snippets/remove.md b/snippets/remove.md index 1b3b066a1..c9f127afb 100644 --- a/snippets/remove.md +++ b/snippets/remove.md @@ -9,12 +9,13 @@ Use `Array.prototype.filter()` to find array elements that return truthy values The `func` is invoked with three arguments (`value, index, array`). ```js + const remove = (arr, func) => Array.isArray(arr) ? arr.filter(func).reduce((acc, val) => { - arr.splice(arr.indexOf(val), 1); - return acc.concat(val); - }, []) + arr.splice(arr.indexOf(val), 1); + return acc.concat(val); + }, []) : []; ``` diff --git a/snippets/size.md b/snippets/size.md index 43cad604d..be2501d5d 100644 --- a/snippets/size.md +++ b/snippets/size.md @@ -12,14 +12,15 @@ Use `size` of a [`Blob` object](https://developer.mozilla.org/en-US/docs/Web/API Split strings into array of characters with `split('')` and return its length. ```js + const size = val => Array.isArray(val) ? val.length : val && typeof val === 'object' - ? val.size || val.length || Object.keys(val).length - : typeof val === 'string' - ? new Blob([val]).size - : 0; + ? val.size || val.length || Object.keys(val).length + : typeof val === 'string' + ? new Blob([val]).size + : 0; ``` ```js diff --git a/test/_30s.js b/test/_30s.js index 1de087f4d..a63d27c11 100644 --- a/test/_30s.js +++ b/test/_30s.js @@ -199,8 +199,8 @@ const deepClone = obj => { return Array.isArray(obj) && obj.length ? (clone.length = obj.length) && Array.from(clone) : Array.isArray(obj) - ? Array.from(obj) - : clone; + ? Array.from(obj) + : clone; }; const deepFlatten = arr => [].concat(...arr.map(v => (Array.isArray(v) ? deepFlatten(v) : v))); const deepFreeze = obj => @@ -212,13 +212,13 @@ const deepMapKeys = (obj, f) => Array.isArray(obj) ? obj.map(val => deepMapKeys(val, f)) : typeof obj === 'object' - ? Object.keys(obj).reduce((acc, current) => { + ? Object.keys(obj).reduce((acc, current) => { const val = obj[current]; acc[f(current)] = val !== null && typeof val === 'object' ? deepMapKeys(val, f) : (acc[f(current)] = val); return acc; }, {}) - : obj; + : obj; const defaults = (obj, ...defs) => Object.assign({}, obj, ...defs.reverse(), obj); const defer = (fn, ...args) => setTimeout(fn, 1, ...args); const degreesToRads = deg => (deg * Math.PI) / 180.0; @@ -240,9 +240,9 @@ const dig = (obj, target) => target in obj ? obj[target] : Object.values(obj).reduce((acc, val) => { - if (acc !== undefined) return acc; - if (typeof val === 'object') return dig(val, target); - }, undefined); + if (acc !== undefined) return acc; + if (typeof val === 'object') return dig(val, target); + }, undefined); const digitize = n => [...`${n}`].map(i => parseInt(i)); const distance = (x0, y0, x1, y1) => Math.hypot(x1 - x0, y1 - y0); const drop = (arr, n = 1) => arr.slice(n); @@ -314,11 +314,11 @@ const extendHex = shortHex => const factorial = n => n < 0 ? (() => { - throw new TypeError('Negative numbers are not allowed!'); - })() + throw new TypeError('Negative numbers are not allowed!'); + })() : n <= 1 - ? 1 - : n * factorial(n - 1); + ? 1 + : n * factorial(n - 1); const fibonacci = n => Array.from({ length: n }).reduce( (acc, val, i) => acc.concat(i > 1 ? acc[i - 1] + acc[i - 2] : i), @@ -419,10 +419,10 @@ const getMeridiemSuffixOfInteger = num => num === 0 || num === 24 ? 12 + 'am' : num === 12 - ? 12 + 'pm' - : num < 12 - ? (num % 12) + 'am' - : (num % 12) + 'pm'; + ? 12 + 'pm' + : num < 12 + ? (num % 12) + 'am' + : (num % 12) + 'pm'; const getScrollPosition = (el = window) => ({ x: el.pageXOffset !== undefined ? el.pageXOffset : el.scrollLeft, y: el.pageYOffset !== undefined ? el.pageYOffset : el.scrollTop @@ -656,8 +656,8 @@ const join = (arr, separator = ',', end = separator) => i === arr.length - 2 ? acc + val + end : i === arr.length - 1 - ? acc + val - : acc + val + separator, + ? acc + val + : acc + val + separator, '' ); const JSONtoCSV = (arr, columns, delimiter = ',') => @@ -776,10 +776,10 @@ const objectToPairs = obj => Object.keys(obj).map(k => [k, obj[k]]); const objectToQueryString = queryParameters => { return queryParameters ? Object.entries(queryParameters).reduce((queryString, [key, val], index) => { - const symbol = index === 0 ? '?' : '&'; - queryString += typeof val === 'string' ? `${symbol}${key}=${val}` : ''; - return queryString; - }, '') + const symbol = index === 0 ? '?' : '&'; + queryString += typeof val === 'string' ? `${symbol}${key}=${val}` : ''; + return queryString; + }, '') : ''; }; const observeMutations = (element, callback, options) => { @@ -1011,9 +1011,9 @@ const reject = (pred, array) => array.filter((...args) => !pred(...args)); const remove = (arr, func) => Array.isArray(arr) ? arr.filter(func).reduce((acc, val) => { - arr.splice(arr.indexOf(val), 1); - return acc.concat(val); - }, []) + arr.splice(arr.indexOf(val), 1); + return acc.concat(val); + }, []) : []; const removeNonASCII = str => str.replace(/[^\x20-\x7E]/g, ''); const renameKeys = (keysMap, obj) => @@ -1091,10 +1091,10 @@ const size = val => Array.isArray(val) ? val.length : val && typeof val === 'object' - ? val.size || val.length || Object.keys(val).length - : typeof val === 'string' - ? new Blob([val]).size - : 0; + ? val.size || val.length || Object.keys(val).length + : typeof val === 'string' + ? new Blob([val]).size + : 0; const sleep = ms => new Promise(resolve => setTimeout(resolve, ms)); const smoothScroll = element => document.querySelector(element).scrollIntoView({ diff --git a/vscode_snippets/snippets.json b/vscode_snippets/snippets.json index ba16ebdb5..7d47eb627 100644 --- a/vscode_snippets/snippets.json +++ b/vscode_snippets/snippets.json @@ -512,8 +512,8 @@ " return Array.isArray(obj) && obj.length", " ? (clone.length = obj.length) && Array.from(clone)", " : Array.isArray(obj)", - " ? Array.from(obj)", - " : clone;", + " ? Array.from(obj)", + " : clone;", "};" ], "description": "Creates a deep clone of an object.\n\nUse recursion.\nCheck if the passed object is `null` and, if so, return `null`.\nUse `Object.assign()` and an empty object (`{}`) to create a shallow clone of the original.\nUse `Object.keys()` and `Array.prototype.forEach()` to determine which key-value pairs need to be deep cloned.\n" @@ -549,13 +549,13 @@ " Array.isArray(obj)", " ? obj.map(val => deepMapKeys(val, f))", " : typeof obj === 'object'", - " ? Object.keys(obj).reduce((acc, current) => {", + " ? Object.keys(obj).reduce((acc, current) => {", " const val = obj[current];", " acc[f(current)] =", " val !== null && typeof val === 'object' ? deepMapKeys(val, f) : (acc[f(current)] = val);", " return acc;", " }, {})", - " : obj;" + " : obj;" ], "description": "Deep maps an object's keys.\n\nCreates an object with the same values as the provided object and keys generated by running the provided function for each key.\nUse `Object.keys(obj)` to iterate over the object's keys. \nUse `Array.prototype.reduce()` to create a new object with the same values and mapped keys using `fn`.\n" }, @@ -631,9 +631,9 @@ " target in obj", " ? obj[target]", " : Object.values(obj).reduce((acc, val) => {", - " if (acc !== undefined) return acc;", - " if (typeof val === 'object') return dig(val, target);", - " }, undefined);" + " if (acc !== undefined) return acc;", + " if (typeof val === 'object') return dig(val, target);", + " }, undefined);" ], "description": "Returns the target value in a nested JSON object, based on the given key.\n\nUse the `in` operator to check if `target` exists in `obj`.\nIf found, return the value of `obj[target]`, otherwise use `Object.values(obj)` and `Array.prototype.reduce()` to recursively call `dig` on each nested object until the first matching key/value pair is found.\n" }, @@ -795,11 +795,11 @@ "const factorial = n =>", " n < 0", " ? (() => {", - " throw new TypeError('Negative numbers are not allowed!');", - " })()", + " throw new TypeError('Negative numbers are not allowed!');", + " })()", " : n <= 1", - " ? 1", - " : n * factorial(n - 1);" + " ? 1", + " : n * factorial(n - 1);" ], "description": "Calculates the factorial of a number.\n\nUse recursion.\nIf `n` is less than or equal to `1`, return `1`.\nOtherwise, return the product of `n` and the factorial of `n - 1`.\nThrows an exception if `n` is a negative number.\n" }, @@ -1056,10 +1056,10 @@ " num === 0 || num === 24", " ? 12 + 'am'", " : num === 12", - " ? 12 + 'pm'", - " : num < 12", - " ? (num % 12) + 'am'", - " : (num % 12) + 'pm';" + " ? 12 + 'pm'", + " : num < 12", + " ? (num % 12) + 'am'", + " : (num % 12) + 'pm';" ], "description": "Converts an integer to a suffixed string, adding `am` or `pm` based on its value.\n\nUse the modulo operator (`%`) and conditional checks to transform an integer to a stringified 12-hour format with meridiem suffix.\n" }, @@ -1743,8 +1743,8 @@ " i === arr.length - 2", " ? acc + val + end", " : i === arr.length - 1", - " ? acc + val", - " : acc + val + separator,", + " ? acc + val", + " : acc + val + separator,", " ''", " );" ], @@ -2073,10 +2073,10 @@ "const objectToQueryString = queryParameters => {", " return queryParameters", " ? Object.entries(queryParameters).reduce((queryString, [key, val], index) => {", - " const symbol = index === 0 ? '?' : '&';", - " queryString += typeof val === 'string' ? `${symbol}${key}=${val}` : '';", - " return queryString;", - " }, '')", + " const symbol = index === 0 ? '?' : '&';", + " queryString += typeof val === 'string' ? `${symbol}${key}=${val}` : '';", + " return queryString;", + " }, '')", " : '';", "};" ], @@ -2590,9 +2590,9 @@ "const remove = (arr, func) =>", " Array.isArray(arr)", " ? arr.filter(func).reduce((acc, val) => {", - " arr.splice(arr.indexOf(val), 1);", - " return acc.concat(val);", - " }, [])", + " arr.splice(arr.indexOf(val), 1);", + " return acc.concat(val);", + " }, [])", " : [];" ], "description": "Removes elements from an array for which the given function returns `false`.\n\nUse `Array.prototype.filter()` to find array elements that return truthy values and `Array.prototype.reduce()` to remove elements using `Array.prototype.splice()`.\nThe `func` is invoked with three arguments (`value, index, array`).\n" @@ -2790,10 +2790,10 @@ " Array.isArray(val)", " ? val.length", " : val && typeof val === 'object'", - " ? val.size || val.length || Object.keys(val).length", - " : typeof val === 'string'", - " ? new Blob([val]).size", - " : 0;" + " ? val.size || val.length || Object.keys(val).length", + " : typeof val === 'string'", + " ? new Blob([val]).size", + " : 0;" ], "description": "Get size of arrays, objects or strings.\n\nGet type of `val` (`array`, `object` or `string`). \nUse `length` property for arrays.\nUse `length` or `size` value if available or number of keys for objects.\nUse `size` of a [`Blob` object](https://developer.mozilla.org/en-US/docs/Web/API/Blob) created from `val` for strings.\nSplit strings into array of characters with `split('')` and return its length.\n" },