markdown-it-synapse-math
Version:
Markdown-it plugin to include math in your document
42 lines (37 loc) • 1.21 kB
JavaScript
;
/* Object.assign
*
* https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/
* Global_Objects/Object/assign
*
* This polyfill doesn't support symbol properties, since ES5 doesn't
* have symbols anyway:
*/
if (!Object.assign) {
Object.defineProperty(Object, 'assign', {
enumerable: false,
configurable: true,
writable: true,
value: function(target) {
if (typeof target === 'undefined' || target === null) {
throw new TypeError('Cannot convert first argument to object');
}
var to = Object(target);
for (var i = 1; i < arguments.length; i++) {
var nextSource = arguments[i];
if (typeof nextSource === 'undefined' || nextSource === null) {
continue;
}
var keysArray = Object.keys(Object(nextSource));
for (var nextIndex = 0, len = keysArray.length; nextIndex < len; nextIndex++) {
var nextKey = keysArray[nextIndex];
var desc = Object.getOwnPropertyDescriptor(nextSource, nextKey);
if (typeof desc !== 'undefined' && desc.enumerable) {
to[nextKey] = nextSource[nextKey];
}
}
}
return to;
}
});
}