UNPKG

remjson

Version:

JSON-RPC 1.0/2.0 compliant server and client

16 lines (13 loc) 320 B
/* * Helper for testing object instantiation/serialization */ var Counter = module.exports = function (value) { if (typeof(value) !== 'number' || !isFinite(value)) value = 0; this.count = value; }; /* * Increment internal counter */ Counter.prototype.incrementBy = function (value) { this.count += value; };