New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

react-onesignal

Package Overview
Dependencies
Maintainers
1
Versions
38
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-onesignal - npm Package Compare versions

Comparing version 1.1.13 to 1.1.14

11

dist/index.es.js

@@ -19,3 +19,3 @@ /* eslint-disable no-unused-vars */

*/
var getModuleScriptBody = function (appId) { return "\n var OneSignal = window.OneSignal || [];\n OneSignal.push(function() {\n OneSignal.init({\n appId: \"" + appId + "\",\n });\n });\n"; };
var getModuleScriptBody = function (appId, isCustomCode) { return "\n var OneSignal = window.OneSignal || [];\n OneSignal.push(function() {\n OneSignal.init({\n appId: \"" + appId + "\",\n notifyButton: {\n enable: " + isCustomCode + ",\n },\n });\n });\n"; };
/**

@@ -58,5 +58,5 @@ * Gets the window OneSignal instance.

*/
var injectModuleScript = function (appId) {
var injectModuleScript = function (appId, isCustomCode) {
injectScript(DEFAULT_MODULE_SCRIPT_ID, function (script) {
script.innerHTML = getModuleScriptBody(appId);
script.innerHTML = getModuleScriptBody(appId, isCustomCode);
script.async = true;

@@ -69,3 +69,4 @@ return script;

*/
var initialize = function (appId) {
var initialize = function (appId, isCustomCode) {
if (isCustomCode === void 0) { isCustomCode = false; }
if (!appId) {

@@ -78,3 +79,3 @@ throw new Error('You need to provide your OneSignal appId.');

injectBaseScript();
injectModuleScript(appId);
injectModuleScript(appId, isCustomCode);
};

@@ -81,0 +82,0 @@ /**

@@ -23,3 +23,3 @@ 'use strict';

*/
var getModuleScriptBody = function (appId) { return "\n var OneSignal = window.OneSignal || [];\n OneSignal.push(function() {\n OneSignal.init({\n appId: \"" + appId + "\",\n });\n });\n"; };
var getModuleScriptBody = function (appId, isCustomCode) { return "\n var OneSignal = window.OneSignal || [];\n OneSignal.push(function() {\n OneSignal.init({\n appId: \"" + appId + "\",\n notifyButton: {\n enable: " + isCustomCode + ",\n },\n });\n });\n"; };
/**

@@ -62,5 +62,5 @@ * Gets the window OneSignal instance.

*/
var injectModuleScript = function (appId) {
var injectModuleScript = function (appId, isCustomCode) {
injectScript(DEFAULT_MODULE_SCRIPT_ID, function (script) {
script.innerHTML = getModuleScriptBody(appId);
script.innerHTML = getModuleScriptBody(appId, isCustomCode);
script.async = true;

@@ -73,3 +73,4 @@ return script;

*/
var initialize = function (appId) {
var initialize = function (appId, isCustomCode) {
if (isCustomCode === void 0) { isCustomCode = false; }
if (!appId) {

@@ -82,3 +83,3 @@ throw new Error('You need to provide your OneSignal appId.');

injectBaseScript();
injectModuleScript(appId);
injectModuleScript(appId, isCustomCode);
};

@@ -85,0 +86,0 @@ /**

@@ -5,3 +5,3 @@ /**

declare const ReactOneSignal: {
initialize: (appId: string) => void;
initialize: (appId: string, isCustomCode?: boolean) => void;
notificationPermission: () => string[] | null;

@@ -8,0 +8,0 @@ getNotificationPermission: () => Promise<string>;

{
"name": "react-onesignal",
"version": "1.1.13",
"version": "1.1.14",
"description": "React OneSignal Module: Make it easy to integrate OneSignal with your React App!",

@@ -5,0 +5,0 @@ "author": "pedro-lb",

@@ -16,3 +16,3 @@ // eslint-disable-next-line no-unused-vars

*/
const getModuleScriptBody = (appId: string) => `
const getModuleScriptBody = (appId: string, isCustomCode: boolean) => `
var OneSignal = window.OneSignal || [];

@@ -22,2 +22,5 @@ OneSignal.push(function() {

appId: "${appId}",
notifyButton: {
enable: ${isCustomCode},
},
});

@@ -78,5 +81,5 @@ });

*/
const injectModuleScript = (appId: string) => {
const injectModuleScript = (appId: string, isCustomCode: boolean) => {
injectScript(DEFAULT_MODULE_SCRIPT_ID, (script) => {
script.innerHTML = getModuleScriptBody(appId);
script.innerHTML = getModuleScriptBody(appId, isCustomCode);
script.async = true;

@@ -91,3 +94,6 @@

*/
const initialize = (appId: string) => {
const initialize = (
appId: string,
isCustomCode: boolean = false,
) => {
if (!appId) {

@@ -102,3 +108,3 @@ throw new Error('You need to provide your OneSignal appId.');

injectBaseScript();
injectModuleScript(appId);
injectModuleScript(appId, isCustomCode);
};

@@ -105,0 +111,0 @@

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