Skip to content

Commit

Permalink
changed string quotes order
Browse files Browse the repository at this point in the history
  • Loading branch information
cosmosgenius committed Aug 24, 2014
1 parent 2c0b147 commit 72f4cdd
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 11 deletions.
20 changes: 10 additions & 10 deletions index.js
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
/*jslint node: true */
'use strict';
var is = require('type-is');
var util = require('util');
"use strict";
var is = require("type-is");
var util = require("util");

/**
* Messages to be used
* @type {Object}
*/
var messages = {
'contentType' : 'Unexpected Content-Type "%s", expecting "application/json".',
'parseError': 'Problems parsing JSON',
'emptyBody' : 'Request body cannot be empty'
"contentType" : "Unexpected Content-Type '%s', expecting 'application/json'.",
"parseError": "Problems parsing JSON",
"emptyBody" : "Request body cannot be empty"
};

/**
Expand All @@ -26,10 +26,10 @@ var messages = {

function hasbody(req) {
var headers = req.headers;
if ('transfer-encoding' in headers) {
if ("transfer-encoding" in headers) {
return true;
}
var length = headers['content-length'];
var length = headers["content-length"];
if (!length) {
return false;
}
Expand All @@ -39,7 +39,7 @@ var messages = {
module.exports = function(options) {
options = options || {};
var strict = !!options.strict;
var type = options.type || 'json';
var type = options.type || "json";

return function(req, res, next) {
var err;
Expand All @@ -51,7 +51,7 @@ module.exports = function(options) {
}

if(!is(req, type)) {
var msg = util.format(messages.contentType,req.headers['content-type']);
var msg = util.format(messages.contentType,req.headers["content-type"]);
err = new Error(msg);
err.status = 415;
return next(err);
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "jsonparser",
"version": "0.1.0",
"version": "0.1.1",
"description": "A JSON Parser for node http server",
"main": "index.js",
"scripts": {
Expand Down

0 comments on commit 72f4cdd

Please sign in to comment.