UNPKG

safenet

Version:

Low-level javascript API wrapper for communicating with the SAFE Network launcher

29 lines (27 loc) 867 B
// enable fetch and promises globally require('es6-promise').polyfill(); require('isomorphic-fetch'); /** * Enable Object.assign, because it's nice * @source https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/assign */ if (typeof Object.assign != 'function') { Object.assign = function (target) { 'use strict'; if (target === undefined || target === null) { throw new TypeError('Cannot convert undefined or null to object'); } var output = Object(target); for (var index = 1; index < arguments.length; index++) { var source = arguments[index]; if (source !== undefined && source !== null) { for (var nextKey in source) { if (source.hasOwnProperty(nextKey)) { output[nextKey] = source[nextKey]; } } } } return output; }; }