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

@mparticle/web-sdk

Package Overview
Dependencies
Maintainers
10
Versions
115
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@mparticle/web-sdk - npm Package Compare versions

Comparing version 2.15.2 to 2.15.3

5

package.json
{
"name": "@mparticle/web-sdk",
"version": "2.15.2",
"version": "2.15.3",
"description": "mParticle core SDK for web applications",

@@ -119,4 +119,5 @@ "license": "Apache-2.0",

"dependencies": {
"@babel/runtime": "^7.6.0"
"@babel/runtime": "^7.6.0",
"slugify": "^1.3.6"
}
}

16

src/helpers.js
import Types from './types';
import Constants from './constants';
import Slugify from 'slugify';

@@ -723,16 +724,5 @@ var StorageNames = Constants.StorageNames,

this.isDataPlanSlug = function(str) {
// This verifies that `str` matches how our backend defines data plan slug names.
// i.e. under_score_slug instead kabob-case-slug
// We also want to reject any non-string values
return (
typeof str === 'string' &&
str ===
str
.trim()
.replaceAll(/[^0-9a-zA-Z]+/g, '_')
.toLowerCase()
);
this.isSlug = function(str) {
return str === Slugify(str);
};
}

@@ -200,9 +200,13 @@ import Constants from './constants';

if (config.dataPlan.hasOwnProperty('planId')) {
if (
mpInstance._Helpers.isDataPlanSlug(config.dataPlan.planId)
) {
this.SDKConfig.dataPlan.PlanId = config.dataPlan.planId;
if (typeof config.dataPlan.planId === 'string') {
if (mpInstance._Helpers.isSlug(config.dataPlan.planId)) {
this.SDKConfig.dataPlan.PlanId = config.dataPlan.planId;
} else {
mpInstance.Logger.error(
'Your data plan id must be in a slug format'
);
}
} else {
mpInstance.Logger.error(
'Your data plan id must be a string and match the data plan slug format (i.e. under_case_slug)'
'Your data plan id must be a string'
);

@@ -209,0 +213,0 @@ }

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

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