cher-tools
Advanced tools
Comparing version 0.2.0 to 0.2.1
{ | ||
"name": "cher-tools", | ||
"version": "0.2.0", | ||
"version": "0.2.1", | ||
"description": "Tools and utilities for the Cher platform", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -164,2 +164,20 @@ 'use strict'; | ||
// Utility function to respond with jsonp format | ||
exports.jsonpResponse = ( res, results, err ) => { | ||
let code; | ||
let response; | ||
let toFormat; | ||
if ( err ) { | ||
toFormat = err; | ||
code = 500; | ||
} else { | ||
toFormat = results; | ||
code = 200; | ||
} | ||
response = responseObj( toFormat ); | ||
res.status( code ).jsonp( response ); | ||
}; | ||
function responseObj( results ) { | ||
@@ -166,0 +184,0 @@ let obj = {}; |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
18458
573