Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

google-maps-js-api-loader

Package Overview
Dependencies
Maintainers
1
Versions
17
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

google-maps-js-api-loader - npm Package Compare versions

Comparing version 2.0.0 to 2.0.1

2

dist/google-maps-loader.modern.js

@@ -1,2 +0,2 @@

var e;!function(e){e[e.NONE=0]="NONE",e[e.LOADING=1]="LOADING",e[e.LOADED=2]="LOADED",e[e.ERROR=3]="ERROR"}(e||(e={}));const t={promise:new Promise((e,o)=>{Object.defineProperties(t,{resolve:{value:e},reject:{value:o}})}),status:e.NONE};class o{static get status(){return t.status}static get completion(){return t.promise}static load(){if(t.status===e.NONE){if(!this.options)throw t.status=e.ERROR,new Error("no options was provided");if(window.google&&window.google.maps)throw t.status=e.ERROR,new Error("Google Maps already loaded");t.status=e.LOADING,this.onLoadingStart(),window.__googleMapsCallback=()=>{t.status=e.LOADED,t.resolve(),delete window.__googleMapsCallback},((o,s)=>{const a=document.createElement("script"),{nonce:r,defer:n,async:i}=o;void 0!==n&&(a.defer=n),void 0!==i&&(a.async=!0),r&&(a.nonce=r),a.src=(e=>{const t={key:e.apiKey,channel:e.channel,client:e.client,v:e.version,language:e.language,region:e.region,map_ids:e.mapIds,libraries:e.libraries,callback:"__googleMapsCallback",auth_referrer_policy:e.authReferrerPolicy},o=Object.keys(t),s=[];for(let e=o.length;e--;){const a=o[e],r=t[a];r&&s.push(`${a}=${Array.isArray(r)?r.join(","):r}`)}const a=e.url||"https://maps.googleapis.com/maps/api/js";return s.length?`${a}?${s.join("&")}`:a})(o),a.type="text/javascript",a.addEventListener("error",o=>{t.status=e.ERROR,t.reject(o)}),document.head.appendChild(a)})(this.options)}return t.promise}}o.options=void 0,o.onLoadingStart=function(){};export{e as LoaderStatus,o as default};
var e;let o,t;!function(e){e[e.NONE=0]="NONE",e[e.LOADING=1]="LOADING",e[e.LOADED=2]="LOADED",e[e.ERROR=3]="ERROR"}(e||(e={}));const a=new Promise((e,a)=>{o=e,t=a});let n=e.NONE;class r{static get status(){return n}static get completion(){return a}static load(){if(n===e.NONE){if(!this.options)throw n=e.ERROR,new Error("no options was provided");if(window.google&&window.google.maps)throw n=e.ERROR,new Error("Google Maps already loaded");n=e.LOADING,this.onLoadingStart(),window.__googleMapsCallback=()=>{n=e.LOADED,o(),delete window.__googleMapsCallback},((e,o)=>{const t=document.createElement("script"),{nonce:a,defer:n,async:r}=e;void 0!==n&&(t.defer=n),void 0!==r&&(t.async=!0),a&&(t.nonce=a),t.src=(e=>{const o={key:e.apiKey,channel:e.channel,client:e.client,v:e.version,language:e.language,region:e.region,map_ids:e.mapIds,libraries:e.libraries,callback:"__googleMapsCallback",auth_referrer_policy:e.authReferrerPolicy},t=Object.keys(o),a=[];for(let e=t.length;e--;){const n=t[e],r=o[n];r&&a.push(`${n}=${Array.isArray(r)?r.join(","):r}`)}const n=e.url||"https://maps.googleapis.com/maps/api/js";return a.length?`${n}?${a.join("&")}`:n})(e),t.type="text/javascript",t.addEventListener("error",o),document.head.appendChild(t)})(this.options,o=>{n=e.ERROR,t(o)})}return a}}r.options=void 0,r.onLoadingStart=function(){};export{e as LoaderStatus,r as default};
//# sourceMappingURL=google-maps-loader.modern.js.map

@@ -1,2 +0,2 @@

var e;!function(e){e[e.NONE=0]="NONE",e[e.LOADING=1]="LOADING",e[e.LOADED=2]="LOADED",e[e.ERROR=3]="ERROR"}(e||(e={}));var t={promise:new Promise(function(e,o){Object.defineProperties(t,{resolve:{value:e},reject:{value:o}})}),status:e.NONE},o=/*#__PURE__*/function(){function o(){}var r,n;return o.load=function(){if(t.status===e.NONE){if(!this.options)throw t.status=e.ERROR,new Error("no options was provided");if(window.google&&window.google.maps)throw t.status=e.ERROR,new Error("Google Maps already loaded");t.status=e.LOADING,this.onLoadingStart(),window.__googleMapsCallback=function(){t.status=e.LOADED,t.resolve(),delete window.__googleMapsCallback},o=this.options,r=function(o){t.status=e.ERROR,t.reject(o)},n=document.createElement("script"),a=o.nonce,s=o.async,void 0!==(i=o.defer)&&(n.defer=i),void 0!==s&&(n.async=!0),a&&(n.nonce=a),n.src=function(e){for(var t={key:e.apiKey,channel:e.channel,client:e.client,v:e.version,language:e.language,region:e.region,map_ids:e.mapIds,libraries:e.libraries,callback:"__googleMapsCallback",auth_referrer_policy:e.authReferrerPolicy},o=Object.keys(t),r=[],n=o.length;n--;){var a=o[n],i=t[a];i&&r.push(a+"="+(Array.isArray(i)?i.join(","):i))}var s=e.url||"https://maps.googleapis.com/maps/api/js";return r.length?s+"?"+r.join("&"):s}(o),n.type="text/javascript",n.addEventListener("error",r),document.head.appendChild(n)}var o,r,n,a,i,s;return t.promise},r=o,(n=[{key:"status",get:function(){return t.status}},{key:"completion",get:function(){return t.promise}}])&&function(e,t){for(var o=0;o<t.length;o++){var r=t[o];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}(r,n),Object.defineProperty(r,"prototype",{writable:!1}),o}();o.options=void 0,o.onLoadingStart=function(){};export{e as LoaderStatus,o as default};
var e,n,o;!function(e){e[e.NONE=0]="NONE",e[e.LOADING=1]="LOADING",e[e.LOADED=2]="LOADED",e[e.ERROR=3]="ERROR"}(e||(e={}));var r=new Promise(function(e,r){n=e,o=r}),t=e.NONE,a=/*#__PURE__*/function(){function a(){}var i,l;return a.load=function(){if(t===e.NONE){if(!this.options)throw t=e.ERROR,new Error("no options was provided");if(window.google&&window.google.maps)throw t=e.ERROR,new Error("Google Maps already loaded");t=e.LOADING,this.onLoadingStart(),window.__googleMapsCallback=function(){t=e.LOADED,n(),delete window.__googleMapsCallback},function(e,n){var o=document.createElement("script"),r=e.nonce,t=e.defer,a=e.async;void 0!==t&&(o.defer=t),void 0!==a&&(o.async=!0),r&&(o.nonce=r),o.src=function(e){for(var n={key:e.apiKey,channel:e.channel,client:e.client,v:e.version,language:e.language,region:e.region,map_ids:e.mapIds,libraries:e.libraries,callback:"__googleMapsCallback",auth_referrer_policy:e.authReferrerPolicy},o=Object.keys(n),r=[],t=o.length;t--;){var a=o[t],i=n[a];i&&r.push(a+"="+(Array.isArray(i)?i.join(","):i))}var l=e.url||"https://maps.googleapis.com/maps/api/js";return r.length?l+"?"+r.join("&"):l}(e),o.type="text/javascript",o.addEventListener("error",n),document.head.appendChild(o)}(this.options,function(n){t=e.ERROR,o(n)})}return r},i=a,(l=[{key:"status",get:function(){return t}},{key:"completion",get:function(){return r}}])&&function(e,n){for(var o=0;o<n.length;o++){var r=n[o];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}(i,l),Object.defineProperty(i,"prototype",{writable:!1}),a}();a.options=void 0,a.onLoadingStart=function(){};export{e as LoaderStatus,a as default};
//# sourceMappingURL=google-maps-loader.module.js.map

@@ -1,2 +0,2 @@

!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t((e||self).googleMapsJsApiLoader={})}(this,function(e){var t,o="__googleMapsCallback";e.LoaderStatus=void 0,(t=e.LoaderStatus||(e.LoaderStatus={}))[t.NONE=0]="NONE",t[t.LOADING=1]="LOADING",t[t.LOADED=2]="LOADED",t[t.ERROR=3]="ERROR";var r={promise:new Promise(function(e,t){Object.defineProperties(r,{resolve:{value:e},reject:{value:t}})}),status:e.LoaderStatus.NONE},a=/*#__PURE__*/function(){function t(){}var a,n;return t.load=function(){if(r.status===e.LoaderStatus.NONE){if(!this.options)throw r.status=e.LoaderStatus.ERROR,new Error("no options was provided");if(window.google&&window.google.maps)throw r.status=e.LoaderStatus.ERROR,new Error("Google Maps already loaded");r.status=e.LoaderStatus.LOADING,this.onLoadingStart(),window[o]=function(){r.status=e.LoaderStatus.LOADED,r.resolve(),delete window[o]},t=this.options,a=function(t){r.status=e.LoaderStatus.ERROR,r.reject(t)},n=document.createElement("script"),i=t.nonce,u=t.async,void 0!==(s=t.defer)&&(n.defer=s),void 0!==u&&(n.async=!0),i&&(n.nonce=i),n.src=function(e){for(var t={key:e.apiKey,channel:e.channel,client:e.client,v:e.version,language:e.language,region:e.region,map_ids:e.mapIds,libraries:e.libraries,callback:o,auth_referrer_policy:e.authReferrerPolicy},r=Object.keys(t),a=[],n=r.length;n--;){var i=r[n],s=t[i];s&&a.push(i+"="+(Array.isArray(s)?s.join(","):s))}var u=e.url||"https://maps.googleapis.com/maps/api/js";return a.length?u+"?"+a.join("&"):u}(t),n.type="text/javascript",n.addEventListener("error",a),document.head.appendChild(n)}var t,a,n,i,s,u;return r.promise},a=t,(n=[{key:"status",get:function(){return r.status}},{key:"completion",get:function(){return r.promise}}])&&function(e,t){for(var o=0;o<t.length;o++){var r=t[o];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}(a,n),Object.defineProperty(a,"prototype",{writable:!1}),t}();a.options=void 0,a.onLoadingStart=function(){},e.default=a});
!function(e,o){"object"==typeof exports&&"undefined"!=typeof module?o(exports):"function"==typeof define&&define.amd?define(["exports"],o):o((e||self).googleMapsJsApiLoader={})}(this,function(e){var o,t,n,r="__googleMapsCallback";e.LoaderStatus=void 0,(o=e.LoaderStatus||(e.LoaderStatus={}))[o.NONE=0]="NONE",o[o.LOADING=1]="LOADING",o[o.LOADED=2]="LOADED",o[o.ERROR=3]="ERROR";var a=new Promise(function(e,o){t=e,n=o}),i=e.LoaderStatus.NONE,s=/*#__PURE__*/function(){function o(){}var s,d;return o.load=function(){if(i===e.LoaderStatus.NONE){if(!this.options)throw i=e.LoaderStatus.ERROR,new Error("no options was provided");if(window.google&&window.google.maps)throw i=e.LoaderStatus.ERROR,new Error("Google Maps already loaded");i=e.LoaderStatus.LOADING,this.onLoadingStart(),window[r]=function(){i=e.LoaderStatus.LOADED,t(),delete window[r]},function(e,o){var t=document.createElement("script"),n=e.nonce,a=e.defer,i=e.async;void 0!==a&&(t.defer=a),void 0!==i&&(t.async=!0),n&&(t.nonce=n),t.src=function(e){for(var o={key:e.apiKey,channel:e.channel,client:e.client,v:e.version,language:e.language,region:e.region,map_ids:e.mapIds,libraries:e.libraries,callback:r,auth_referrer_policy:e.authReferrerPolicy},t=Object.keys(o),n=[],a=t.length;a--;){var i=t[a],s=o[i];s&&n.push(i+"="+(Array.isArray(s)?s.join(","):s))}var d=e.url||"https://maps.googleapis.com/maps/api/js";return n.length?d+"?"+n.join("&"):d}(e),t.type="text/javascript",t.addEventListener("error",o),document.head.appendChild(t)}(this.options,function(o){i=e.LoaderStatus.ERROR,n(o)})}return a},s=o,(d=[{key:"status",get:function(){return i}},{key:"completion",get:function(){return a}}])&&function(e,o){for(var t=0;t<o.length;t++){var n=o[t];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}(s,d),Object.defineProperty(s,"prototype",{writable:!1}),o}();s.options=void 0,s.onLoadingStart=function(){},e.default=s});
//# sourceMappingURL=google-maps-loader.umd.js.map
{
"name": "google-maps-js-api-loader",
"version": "2.0.0",
"version": "2.0.1",
"description": "Wrapper for the loading of Google Maps JavaScript API script in the browser",

@@ -5,0 +5,0 @@ "repository": {

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc