🚀 Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more
Socket
Book a DemoInstallSign in
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

ClassName Library

0.0.13
Source
npm
Version published
Maintainers
1
Created
Source

ClassName Library

Better classname tool, especially more make sense for reactjs that change all first parameters to pure class string.

  • GIT
    • https://github.com/react-atomic/react-atomic-organism/tree/master/packages/lib/class-lib
  • NPM

Functions

hasClass( rawClass, newName )

  • Ex: rawClass = "a b c"
  • hasClass(rawClass, "d") // return false
  • hasClass(rawClass, "a") // return true

removeClass( rawClass, newName )

  • Ex: rawClass = "a b c"
  • removeClass(rawClass, "a"); // return "b c"

mixClass( rawClass, newName )

  • Ex. rawClass = "a b c"
  • mixClass(rawClass, "d"); // return "a b c d"
  • mixClass(rawClass, "d", "e"); // return "a b c d e"
  • mixClass(rawClass, {d: false, e: true}); // return "a b c e"

toggleClass( rawClass, newName )

  • Ex. rawClass = "a b c"
  • toggleClass(rawClass, "d"); //return "a b c d"
  • toggleClass(rawClass, "c"); //return "a b"

FAQs

Package last updated on 22 Sep 2018

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts