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.1.2 to 0.1.3

7

build/cjs/src/getClassReg.js

@@ -6,3 +6,3 @@ "use strict";

exports.__esModule = true;
exports["default"] = void 0;
exports.getClassReg = void 0;

@@ -17,7 +17,6 @@ var _getSafeReg = _interopRequireWildcard(require("get-safe-reg"));

var _default = function _default(name) {
var getClassReg = function getClassReg(name) {
return cache(name);
};
exports["default"] = _default;
module.exports = exports.default;
exports.getClassReg = getClassReg;
"use strict";
var _interopRequireDefault = require("reshow-runtime/helpers/interopRequireDefault");
exports.__esModule = true;
exports["default"] = void 0;
var _getClassReg = _interopRequireDefault(require("./getClassReg.js"));
var _getClassReg = require("./getClassReg.js");
//@ts-check
/**
* @param {string} classes
* @param {string} name
* @returns {boolean}
*/
var hasClass = function hasClass(classes, name) {
return (0, _getClassReg["default"])(name).test(classes);
return (0, _getClassReg.getClassReg)(name).test(classes);
};

@@ -13,0 +18,0 @@

@@ -8,9 +8,16 @@ "use strict";

var _getClassReg = _interopRequireDefault(require("./getClassReg.js"));
var _getClassReg = require("./getClassReg.js");
var _hasClass = _interopRequireDefault(require("./hasClass.js"));
//@ts-check
/**
* @param {string} classes
* @param {string} name
* @returns {string}
*/
var removeClass = function removeClass(classes, name) {
if (classes && (0, _hasClass["default"])(classes, name)) {
classes = classes.replace((0, _getClassReg["default"])(name), " ").replace(/(^\s+)|\s+$/g, "");
classes = classes.replace((0, _getClassReg.getClassReg)(name), " ").replace(/(^\s+)|\s+$/g, "");

@@ -17,0 +24,0 @@ if ((0, _hasClass["default"])(classes, name)) {

{
"version": "0.1.2",
"version": "0.1.3",
"name": "class-lib",

@@ -22,3 +22,5 @@ "repository": {

"array.dedup": "*",
"get-safe-reg": "*"
"get-safe-reg": "*",
"reshow-constant": "*",
"reshow-runtime": "*"
},

@@ -25,0 +27,0 @@ "devDependencies": {

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

declare function _default(name: any): any;
export default _default;
export function getClassReg(name: any): any;
export default hasClass;
declare function hasClass(classes: any, name: any): any;
/**
* @param {string} classes
* @param {string} name
* @returns {boolean}
*/
declare function hasClass(classes: string, name: string): boolean;
export default removeClass;
declare function removeClass(classes: any, name: any): any;
/**
* @param {string} classes
* @param {string} name
* @returns {string}
*/
declare function removeClass(classes: string, name: string): string;

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