Skip to content

Instantly share code, notes, and snippets.

@Chadtech
Created January 21, 2015 16:54
Show Gist options
  • Save Chadtech/1769c4e7aaa601102639 to your computer and use it in GitHub Desktop.
Save Chadtech/1769c4e7aaa601102639 to your computer and use it in GitHub Desktop.
if options.flowControl or options.flowcontrol
fc = options.flowControl or options.flowcontrol
if typeof fc is "boolean"
options.rtscts = true
else
fc.forEach (flowControl) ->
fcup = flowControl.toUpperCase()
idx = FLOWCONTROLS.indexOf(fcup)
if idx < 0
err = new Error("Invalid \"flowControl\": " + fcup + ". Valid options: " + FLOWCONTROLS.join(", "))
callback err
else
# "XON", "XOFF", "XANY", "DTRDTS", "RTSCTS"
switch idx
when 0
options.rtscts = true
console.log "still going"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment