Skip to content

authentication.js - lots of repeated code #18

@des-des

Description

@des-des

how many times have you written out res.on('data') ...
if you abstracted this process the first time you did it you would have made you code neater and saved time.. ie.

function getBody(response, callback) {
  var body = '';
  response.on('chunk', function(chunk) {
    body += chunk
  });
  response.on('end', function(chunk) {
    callback(body)
  });
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions