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

ymaps-loader

Package Overview
Dependencies
Maintainers
1
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

ymaps-loader - npm Package Compare versions

Comparing version 1.0.0 to 1.0.1

3

package.json
{
"name": "ymaps-loader",
"version": "1.0.0",
"version": "1.0.1",
"description": "Загрузчик Яндекс Карт",

@@ -24,3 +24,4 @@ "keywords": [

"dependencies": {
"remote-script-loader": "^1.0.0"
}
}

@@ -1,17 +0,8 @@

const load = ({ lang, region, apiKey }) => new Promise((resolve) => {
if (window.ymaps === undefined) {
const yandexMapScript = document.createElement('SCRIPT');
yandexMapScript.setAttribute('src',
`https://api-maps.yandex.ru/2.1/?lang=${lang || 'ru'}_${region || 'RU'}&apikey=${apiKey}`);
yandexMapScript.setAttribute('async', '');
yandexMapScript.setAttribute('defer', '');
yandexMapScript.setAttribute('type', 'text/javascript');
const { loadScriptOnce } = require('remote-script-loader');
yandexMapScript.onload = () => ymaps.ready(resolve);
document.body.appendChild(yandexMapScript);
} else {
resolve();
}
});
const load = ({ lang, region, apiKey }) => new Promise(resolve => loadScriptOnce(
`https://api-maps.yandex.ru/2.1/?lang=${lang || 'ru'}_${region || 'RU'}&apikey=${apiKey}`,
'ymaps',
).then(() => ymaps.ready(resolve)));
module.exports = load;
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