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.5 to 0.2.0

build/cjs/src/prefixClass.js

5

build/cjs/src/getClassReg.js

@@ -11,5 +11,4 @@ "use strict";

var cache = (0, _getSafeReg.cacheReg)({})(getRegString);
var getClassReg = function getClassReg(name) {
var getClassReg = exports.getClassReg = function getClassReg(name) {
return cache(name);
};
exports.getClassReg = getClassReg;
};

3

build/cjs/src/hasClass.js

@@ -16,4 +16,3 @@ "use strict";

};
var _default = hasClass;
exports["default"] = _default;
var _default = exports["default"] = hasClass;
module.exports = exports.default;

@@ -5,5 +5,7 @@ "use strict";

exports.__esModule = true;
exports.toggleClass = exports.toTailwindObj = exports.removeClass = exports.mixClass = exports.hasClass = void 0;
exports.toggleClass = exports.toTailwindObj = exports.removeClass = exports.prefixClass = exports.mixClass = exports.hasClass = void 0;
var _mixClass = _interopRequireDefault(require("./mixClass.js"));
exports.mixClass = _mixClass["default"];
var _prefixClass = _interopRequireDefault(require("./prefixClass.js"));
exports.prefixClass = _prefixClass["default"];
var _hasClass = _interopRequireDefault(require("./hasClass.js"));

@@ -10,0 +12,0 @@ exports.hasClass = _hasClass["default"];

@@ -9,5 +9,9 @@ "use strict";

var _array = _interopRequireDefault(require("array.dedup"));
var strToArray = function strToArray(maybeString) {
return (maybeString + "").split(" ");
};
var _strToArray = require("./strToArray.js");
//@ts-check
/**
* @param {any[]} args
* @returns {string}
*/
var mixClass = function mixClass() {

@@ -24,3 +28,3 @@ var classes = [];

if (argType === _reshowConstant.NUMBER || argType === _reshowConstant.STRING) {
classes.push.apply(classes, (0, _toConsumableArray2["default"])(strToArray(arg)));
classes.push.apply(classes, (0, _toConsumableArray2["default"])((0, _strToArray.strToArray)(arg)));
} else if ((0, _reshowConstant.IS_ARRAY)(arg)) {

@@ -31,3 +35,3 @@ classes.push(mixClass.apply(null, arg));

if (arg[k]) {
classes.push.apply(classes, (0, _toConsumableArray2["default"])(strToArray(k)));
classes.push.apply(classes, (0, _toConsumableArray2["default"])((0, _strToArray.strToArray)(k)));
}

@@ -39,4 +43,3 @@ });

};
var _default = mixClass;
exports["default"] = _default;
var _default = exports["default"] = mixClass;
module.exports = exports.default;

@@ -25,4 +25,3 @@ "use strict";

};
var _default = removeClass;
exports["default"] = _default;
var _default = exports["default"] = removeClass;
module.exports = exports.default;

@@ -9,2 +9,9 @@ "use strict";

var _mixClass = _interopRequireDefault(require("./mixClass.js"));
//@ts-check
/**
* @param {string} classes
* @param {string} name
* @returns {string}
*/
var toggleClass = function toggleClass(classes, name) {

@@ -18,4 +25,3 @@ if ((0, _hasClass["default"])(classes, name)) {

};
var _default = toggleClass;
exports["default"] = _default;
var _default = exports["default"] = toggleClass;
module.exports = exports.default;

@@ -7,2 +7,3 @@ "use strict";

var _reshowConstant = require("reshow-constant");
var _strToArray = require("./strToArray.js");
//@ts-check

@@ -14,4 +15,4 @@

*/
var toTailwindObj = function toTailwindObj(className) {
var classes = (className !== null && className !== void 0 ? className : "").split(" ");
var toTailwindObj = exports.toTailwindObj = function toTailwindObj(className) {
var classes = (0, _strToArray.strToArray)(className);
var r = (0, _reshowConstant.NEW_OBJ)();

@@ -28,3 +29,2 @@ classes.forEach(function (item) {

return r;
};
exports.toTailwindObj = toTailwindObj;
};
{
"version": "0.1.5",
"version": "0.2.0",
"name": "class-lib",

@@ -4,0 +4,0 @@ "repository": {

export { default as mixClass } from "./mixClass";
export { default as prefixClass } from "./prefixClass";
export { default as hasClass } from "./hasClass";

@@ -3,0 +4,0 @@ export { default as removeClass } from "./removeClass";

export default mixClass;
/**
* @param {any[]} args
* @returns {string}
*/
declare function mixClass(...args: any[]): string;
export default toggleClass;
declare function toggleClass(classes: any, name: any): any;
/**
* @param {string} classes
* @param {string} name
* @returns {string}
*/
declare function toggleClass(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

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