Skip to content

Commit

Permalink
Fix the issue in the extend function
Browse files Browse the repository at this point in the history
  • Loading branch information
nagix committed Nov 26, 2020
1 parent 733da34 commit 4b4cea3
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 4 deletions.
4 changes: 2 additions & 2 deletions docs/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
<script src="https://cdn.jsdelivr.net/npm/bootstrap@4.5.3/dist/js/bootstrap.bundle.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/bootstrap-select@1.13.18/dist/js/bootstrap-select.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/mapbox-gl@1.13.0/dist/mapbox-gl.js"></script>
<script src="https://cdn.jsdelivr.net/npm/mapbox-gl-animated-popup@0.1.3"></script>
<script src="https://cdn.jsdelivr.net/npm/mapbox-gl-animated-popup@0.1.4"></script>
<style>
#map-title {
width: 840px;
Expand Down Expand Up @@ -190,7 +190,7 @@ <h2>An animated popup component for <a href="https://github.com/mapbox/mapbox-gl
&lt;title&gt;Attach a popup to a marker instance&lt;/title&gt;<br>
&lt;meta name="viewport" content="initial-scale=1,maximum-scale=1,user-scalable=no" /&gt;<br>
&lt;script src="https://api.mapbox.com/mapbox-gl-js/v1.13.0/mapbox-gl.js"&gt;&lt;/script&gt;<br>
&lt;script src="https://cdn.jsdelivr.net/npm/mapbox-gl-animated-popup@v0.1.3/dist/mapbox-gl-animated-popup.min.js"&gt;&lt;/script&gt;<br>
&lt;script src="https://cdn.jsdelivr.net/npm/mapbox-gl-animated-popup@v0.1.4/dist/mapbox-gl-animated-popup.min.js"&gt;&lt;/script&gt;<br>
&lt;link href="https://api.mapbox.com/mapbox-gl-js/v1.13.0/mapbox-gl.css" rel="stylesheet" /&gt;<br>
&lt;style&gt;<br>
&nbsp;&nbsp;body { margin: 0; padding: 0; }<br>
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "mapbox-gl-animated-popup",
"version": "0.1.3",
"version": "0.1.4",
"description": "An animated popup component for Mapbox GL JS",
"main": "dist/mapbox-gl-animated-popup.js",
"devDependencies": {
Expand Down
5 changes: 4 additions & 1 deletion src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -259,7 +259,10 @@ function animate(style, ease, duration, reverse, complete) {
function extend(dest, ...sources) {
for (const src of sources) {
for (const k in src) {
if (typeof dest[k] === 'object' && typeof src[k] === 'object') {
if (typeof src[k] === 'object') {
if (!dest[k]) {
dest[k] = {};
}
extend(dest[k], src[k]);
} else {
dest[k] = src[k];
Expand Down

0 comments on commit 4b4cea3

Please sign in to comment.