Comparing version 0.1.2 to 0.1.3
@@ -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
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Wildcard dependency
QualityPackage has a dependency with a floating version range. This can cause issues if the dependency publishes a new major version.
Found 2 instances in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
12446
269
4
4
+ Addedreshow-constant@*
+ Addedreshow-runtime@*
+ Addedreshow-constant@0.17.14(transitive)
+ Addedreshow-runtime@0.17.15(transitive)