src/exposed.js
function expose(obj, val) {
	if(arguments.length === 1) {
		if(obj instanceof Error)
			Object.defineProperty(obj, "message", {
				enumerable: true,
				value: obj.message
			});

		val = obj;
	}

	return resource(obj, {
		expose: val
	});
}
function expose(obj, val) {
	if(arguments.length === 1) {
		if(obj instanceof Error)
			Object.defineProperty(obj, "message", {
				enumerable: true,
				value: obj.message
			});

		val = obj;
	}

	return resource(obj, {
		expose: val
	});
}
Exposes objects as another value when serialized.
`expose` uses the `expose` property of object [resources]{@link resource} internally.
@module expose
@param {!object} obj The object to expose.
@param {any} [val] The value that should be used instead of obj when serialized. If not specified and `obj` is an `Error`, `obj.message` will be made enumerable and obj will get itself as its exposed value.
@return {object} The exposed object.