This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const createServer = require('http').createServer | |
const app = require('./http/app') // Express app | |
const server = createServer(app) | |
server.listen(port) | |
/** | |
* ^ This is where I'm getting the Flow error: | |
* | |
* call of method `listen`: /Users/shane/projects/blockpop/server/src/server.js:22 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// recursively flatten arbitrarily nested array(s) of integers | |
const flatten = (arr) => { | |
// Reduce nested array(s) into a flat array (starting with empty array) | |
return arr.reduce((prev, cur) => { | |
if (Array.isArray(cur)) { | |
// if it's an array, concat its flattened result | |
return prev.concat(flatten(cur)) | |
} | |
if (Number.isInteger(cur)) { | |
// if it's an integer, concat the value |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{"lastUpload":"2022-04-11T18:15:52.987Z","extensionVersion":"v3.4.3"} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# | |
# Sets Prezto options. | |
# | |
# Authors: | |
# Sorin Ionescu <[email protected]> | |
# | |
# | |
# General | |
# |