UNPKG

pjax

Version:

Easily enable fast AJAX navigation on any website (using pushState + XHR)

14 lines (13 loc) 281 B
module.exports = function(obj) { /* istanbul ignore if */ if (null === obj || "object" !== typeof obj) { return obj; } var copy = obj.constructor(); for (var attr in obj) { if (obj.hasOwnProperty(attr)) { copy[attr] = obj[attr]; } } return copy; };