How to use the jsprim.flattenObject function in jsprim

To help you get started, we’ve selected a few jsprim examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github joyent / node-skinner / lib / skinner.js View on Github external
skAggregator.prototype.result = function ()
{
	var self, rv;

	self = this;
	rv = mod_jsprim.flattenObject(this.sa_value,
	    this.sa_decomps.length);
	rv.forEach(function (row) {
		var i, field;

		/*
		 * Convert numeric values that were turned into strings back
		 * into numbers.
		 */
		for (i = 0; i < self.sa_decomps.length; i++) {
			field = self.sa_decomps[i];
			if (!self.sa_bucketizers.hasOwnProperty(field))
				continue;

			row[i] = +row[i];
		}
	});
github joyent / daggr / lib / daggr.js View on Github external
DataAggregator.prototype.reportFlattened = function ()
{
	var flattened = mod_jsprim.flattenObject(
	    this.da_data, this.da_key.length);
	return (flattened);
};