kopia lustrzana https://github.com/c9/core
15 wiersze
405 B
JavaScript
15 wiersze
405 B
JavaScript
|
|
define(function(require, exports, module) {
|
||
|
|
|
||
|
|
/**
|
||
|
|
* Turns a JS Error into a proper object that can be stringified
|
||
|
|
* https://github.com/timjrobinson/oberr for more information
|
||
|
|
**/
|
||
|
|
exports.oberr = function(err) {
|
||
|
|
var ob = {};
|
||
|
|
Object.getOwnPropertyNames(err).forEach(function(key) {
|
||
|
|
ob[key] = err[key];
|
||
|
|
});
|
||
|
|
return ob;
|
||
|
|
};
|
||
|
|
|
||
|
|
});
|