Skip to content
This repository has been archived by the owner on May 3, 2021. It is now read-only.

Commit

Permalink
Object.assign polyfill. Closes #41
Browse files Browse the repository at this point in the history
  • Loading branch information
jsanahuja committed Feb 22, 2021
1 parent f3fdd68 commit 018a8c1
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 3 deletions.
2 changes: 1 addition & 1 deletion dist/InstagramFeed.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "@jsanahuja/instagramfeed",
"description": "Instagram Feed without access token. Not using the Instagram API",
"homepage": "https://github.com/jsanahuja/InstagramFeed",
"version": "2.0.1",
"version": "2.0.2",
"keywords": [
"instagram",
"feed",
Expand Down
24 changes: 23 additions & 1 deletion src/InstagramFeed.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/*
* InstagramFeed
*
* @version 2.0.0
* @version 2.0.2
*
* https://github.com/jsanahuja/InstagramFeed
*
Expand Down Expand Up @@ -61,6 +61,28 @@
});
}

if (typeof Object.assign != 'function') {
Object.assign = function (target) {
'use strict';
if (target == null) {
throw new TypeError('Cannot convert undefined or null to object');
}

target = Object(target);
for (var index = 1; index < arguments.length; index++) {
var source = arguments[index];
if (source != null) {
for (var key in source) {
if (Object.prototype.hasOwnProperty.call(source, key)) {
target[key] = source[key];
}
}
}
}
return target;
};
}

return function(opts) {
this.options = Object.assign({}, defaults);
this.options = Object.assign(this.options, opts);
Expand Down

0 comments on commit 018a8c1

Please sign in to comment.