Comparing version 0.0.11 to 0.0.12
@@ -170,7 +170,22 @@ "use strict"; | ||
if ( typeof data === 'string' ) { | ||
data = { | ||
message: data, | ||
data: null | ||
}; | ||
code = code || 500; | ||
switch ( typeof data ) { | ||
case 'object': | ||
if ( !data.message ) { | ||
data.message = null; | ||
} | ||
if ( !data.data ) { | ||
data.data = null; | ||
} | ||
break; | ||
default: | ||
data = { | ||
message: data || null, | ||
data: null | ||
}; | ||
break; | ||
} | ||
@@ -177,0 +192,0 @@ |
{ | ||
"name": "fling", | ||
"description": "JSON Fling is a simple JSON-RPC framework for NodeJS with built-in permissions and support for different transports.", | ||
"version": "0.0.11", | ||
"version": "0.0.12", | ||
"author": "Anthony Hildoer <anthony@bluerival.com>", | ||
@@ -6,0 +6,0 @@ "repository": { |
36777
1182