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

class-lib

Package Overview
Dependencies
Maintainers
1
Versions
22
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

class-lib - npm Package Compare versions

Comparing version 0.0.0 to 0.0.1

9

build/src/getClassReg.js

@@ -6,5 +6,10 @@ 'use strict';

});
var cache = {};
var getClassReg = function getClassReg(name) {
var sReg = '(?:^|\\s+)' + name + '(?:\\s+|$)';
return sReg;
if (!cache[name]) {
var sReg = '(?:^|\\s+)' + name + '(?:\\s+|$)';
cache[name] = new RegExp(sReg);
}
return cache[name];
};

@@ -11,0 +16,0 @@

@@ -14,5 +14,3 @@ 'use strict';

var hasClass = function hasClass(classes, name) {
var sReg = (0, _getClassReg2.default)(name);
var oReg = new RegExp(sReg);
return oReg.test(classes);
return (0, _getClassReg2.default)(name).test(classes);
};

@@ -19,0 +17,0 @@

@@ -19,4 +19,3 @@ 'use strict';

if (classes && (0, _hasClass2.default)(classes, name)) {
var sReg = (0, _getClassReg2.default)(name);
classes = classes.replace(sReg, ' ').replace(/(^\s+)|\s+$/g, '');
classes = classes.replace((0, _getClassReg2.default)(name), ' ').replace(/(^\s+)|\s+$/g, '');
if ((0, _hasClass2.default)(classes, name)) {

@@ -23,0 +22,0 @@ // in case of multiple adjacent

{
"name": "class-lib",
"version": "0.0.0",
"version": "0.0.1",
"description": "ClassName Library",

@@ -5,0 +5,0 @@ "repository": "react-atomic/react-atomic-organism",

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