1.0.0 • Published 8 years ago
helpers-javascript v1.0.0
JPINN Javascript Helper Functions.
A library of helper functions in Javascript for use across multiple development projects.
Current Version: v1.0.0
Function Libraries
REST Helper Library { .rest }
A library of functions to help with RESTful API concepts (e.g. Handling 'http' requests and responses).
/// Usage:
var jpdev = require("@jpdev/helpers-javascript");
var rest = jpdev.rest;
Verify Request Body
///////////////////////////////////////////////////////////////////////////////
/// - Parameters:
/// Object testBody: The 'http' request object under test.
/// Object testKey: The 'key' used to verify the test body.
///
/// - Returns:
/// Number statusCode: A status code indicating the results of the test.
/// Legend:
/// 200 -> Verified success.
/// 501 -> Missing object node.
/// 502 -> Unexpected object node.
/// 503 -> Incorrect type for node.
///
///////////////////////////////////////////////////////////////////////////////
/// Usage:
var jpdev = require("@jpdev/helpers-javascript");
var statusCode = jpdev.rest.verifyRequestBody(testBody, testKey);
1.0.0
8 years ago