function reviveError( key, value ) {
	var hasStack;
	var ctor;
	var keys;
	var err;
	var k;
	var i;
	if (
		value &&
		value.type &&
		isString( value.message )
	) {
		ctor = ctors[ value.type ];
		if ( ctor ) {
			err = new ctor( value.message );
			keys = objectKeys( value );
			for ( i = 0; i < keys.length; i++ ) {
				k = keys[ i ];
				if (
					k === 'type' ||
					k === 'message' ||
					k === 'name' // read-only for built-ins
				) {
					continue;
				}
				if ( k === 'stack' ) {
					if ( !isString( value[k] ) ) {
						continue;
					}
					hasStack = true;
				}
				err[ k ] = value[ k ];
			}
			if ( !hasStack && isString( err.stack ) ) {
				err.stack = '';
			}
			return err;
		}
	}
	return value;
}
Revives a JSON-serialized error object.

@param {string} key - key
@param {*} value - value
@returns {(*|Error|SyntaxError|URIError|EvalError|ReferenceError|RangeError|TypeError)} value or error object

@example
var parseJSON = require( '@stdlib/utils/parse-json' );

var str = '{"type":"TypeError","message":"beep"}';
var err = parseJSON( str, reviveError );
// returns <TypeError>