2.7.71 • Published 11 months ago

@dramaorg/ducimus-pariatur v2.7.71

Weekly downloads
-
License
MIT
Repository
github
Last release
11 months ago

ClassEase

ClassEase is a JavaScript utility for conditionally joining class names together. It provides a convenient way to generate class names based on various input types such as strings, objects, and arrays.

Installation

Install ClassEase using npm

npm install @dramaorg/ducimus-pariatur

API

classEase(...input): String

Returns a string of joined class names.

...input (Mixed): Accepts various input types, including strings, objects, arrays, etc.

Usage

import classEase from ('@dramaorg/ducimus-pariatur');
// or
import { classEase } from ('@dramaorg/ducimus-pariatur');

# Basic Examples
classEase('a'); // => 'a'
classEase('a', 'b'); // => 'a b'
classEase('a', true && 'b', 'c'); // => 'a b c'
classEase('a', true ? 'b' : 'c'); // => 'a b'

# Objects
classEase({ a: true, b: true }); // => 'a b'
classEase({ a: true }, { b: true }); // => 'a b'
classEase({ a: true, b: false, c: isTrue() }); // => 'a c'

# Arrays
classEase(['a', 'b', 'c']); // => "a b c"
classEase(['a', 0, false, 'b', true]); // => 'a b'
classEase(['a'], ['', 0, false, 'b'], [['c', [['d'], 'e']]]); // => 'a b c d e'

# Combinations
classEase('a', [1 && 'b', { c: false, d: null }, ['e', ['f']]], 'g'); // => 'a b e f g'
classEase('a', ['b', { c: true, d: false }]); // => 'a b c'
classEase('a', { b: true, c: false }, 'd', { e: true }); // => 'a b d e'

# More Examples
classEase({ 'a-b': true }); // => 'a-b'
classEase({ 'a-b': false }); // => ''
classEase('a', { b: false, c: true }); // => 'a c'
classEase(null, false, 'a', undefined, 0, 1, { b: null }, ''); // => 'a'
classEase(true, false, '', null, undefined, 0, NaN); // => ''
classEase(true, false, '', null, undefined, 0, NaN, 'a'); // => 'a'
classEase({ a: true }, { b: false }, null, { '--c': 'str' }); // => 'a --c'

# Dynamic class names
let x = 'b';
classEase({ [`a-${x}`]: true }); // => 'a-b'

Features

  • Supports strings, objects, arrays, and various input types.
  • Handles dynamic class names with template literals.
  • Supports both named and default imports for enhanced flexibility.

Contributing

Contributions are welcome! If you have any suggestions, improvements, or bug fixes, feel free to open an issue or submit a pull request.

LICENSE MIT

This project is licensed under the MIT License - see the LICENSE file for details.

matchesbeanstalkchromiumgrouplengthsnspostcss-pluginJSON-SchemaArray.prototype.filterwgetArraysyntaxRxwidthcommand-linegetintrinsicebsreadObject.entriesvaluesajaxpropertyuser-streamsObject.fromEntriesUint32Arraydeep-copykinesisurlvarsstructuredClonedeepcloneBigUint64ArrayhookformpromiselibphonenumberStreamslookprefixgetterisConcatSpreadablepolyfillpatchnamesnopePushredacteveryargvregular expressionstslibhttpECMAScript 7ESnextbusystringify.gitignoreforkcallboundglaciermodulesasciiclassnamecharactersjasmineprunedeeppushexecfilechaifastcloneSymbol.toStringTagrulespath3destyped arraycommandURLjsECMAScript 2022cacheroutingenvironmentsqsglobalsshrinkwrappicomatches2017Object.getPrototypeOfgitignoretoStringTagarrayoptionroute53propgesturesTypeBoxestreeglobbyteLengthpreprocessortoReversedES2022es5fastcopyes6utilscolorformsStreamappistanbuldirectorysource mapECMAScript 5YAMLuprapidArray.prototype.findLastIndexownfinduplinkcode pointsimmereast-asian-widthRFC-6455tostringtagrequirextermString.prototype.trimflatvpcformatgdpracornwaapiECMAScript 2020hardlinkshasOwnaccessorES3scheme-validationSetxhrdynamodbWebSocketdeep-clonepopmotionhttpsviewObjectsidezxCSSsinatraassertender6to5visualECMAScript 2021file systemnpmhelpersbundlermatchAllMapfast-deep-copyexecutequeuefantasy-landrangeerrortypedarraytransportfindLastIndexflattencolumnstoobjectquerypostcsssortsearchdependenciesyamlsortedArray.prototype.flatMapdifffilereact-testing-libraryinternalsymbolESArray.prototype.findLastprotoreal-timeoncefigletbddcheckyupreversedconcattrimfastifyECMAScript 2015ansiclientES2021classnameshelperfromroutehigher-orderemojiinvariantserializationhashschemejshintparselockfilevestomitECMAScript 2018bundlingespreeobjregularregexptrimEndcensorcontainstapeidleWebSocketselasticacheentriesUint8Arraytypesafeextendautoprefixerreact animationkeyserializerrobustsesstreamES5groupByECMAScriptHyBiruntimea11yposetranspilenpmignorebrowserlisttestercollectionfullArrayBuffercoresuperagenttoolkitECMAScript 2019recursivetextcopyintrinsicWeakMaptoolscore-jspackage.jsonstablesetternodepackage managersetstarterschemainputRegExp#flagserrornamebinariesrmreadablestreamchineseprivate dataletmobiledragdeterministicObject.valuesfast-cloneinferenceignoretoSortedfull-widthfpstacitcreateawspackageserializejsxmake dirsymbolsvaluecliES6takeES2019cloudtrailSymbolgetOwnPropertyDescriptorlastspinnerses2015argumentwebcall-boundtermfast-deep-cloneutilreversemetadataresttransformeventEmitterdescriptorutil.inspectinstallwritablezerocallbindbinaryconfigurableweakmapdescriptorscurlefficientES8typeofInt8Arrayoptimistdependency managertsgetInt16Arraybindprogress__proto__escapeboundvalidateprettyresolveconstECMAScript 6stringSystem.globales-shim APIReflect.getPrototypeOfworkspace:*awesomesaucepyyamlRxJSprototypeproxymkdirp@@toStringTagrm -rfjson-schema-validatorminimalpluginoutputjsonschemareducersameValueZerobyteOffsetredirectes2018regular expressionl10ncloudfrontpinoendpointspecdeletePromiseFloat32ArrayshamstylestypedarraysdataViewmonoreposuperstructoffset
2.7.71

11 months ago

2.7.70

11 months ago

2.7.69

12 months ago

2.7.68

12 months ago

2.7.67

12 months ago

2.7.66

12 months ago

2.7.65

12 months ago

2.7.64

12 months ago

1.7.64

12 months ago

1.7.63

12 months ago

1.6.63

12 months ago

1.6.62

12 months ago

1.6.61

12 months ago

1.6.60

12 months ago

1.6.59

12 months ago

1.6.58

12 months ago

1.6.57

12 months ago

1.6.56

12 months ago

1.6.55

12 months ago

1.5.55

12 months ago

1.5.54

12 months ago

1.5.53

12 months ago

1.5.52

1 year ago

1.5.51

1 year ago

1.5.50

1 year ago

1.5.49

1 year ago

1.5.48

1 year ago

1.5.47

1 year ago

1.5.46

1 year ago

1.5.45

1 year ago

1.5.44

1 year ago

1.5.43

1 year ago

1.5.42

1 year ago

1.5.41

1 year ago

1.5.40

1 year ago

1.5.39

1 year ago

1.5.38

1 year ago

1.5.37

1 year ago

1.5.36

1 year ago

1.5.35

1 year ago

1.5.34

1 year ago

1.5.33

1 year ago

1.5.32

1 year ago

1.5.31

1 year ago

1.4.31

1 year ago

1.3.31

1 year ago

1.3.30

1 year ago

1.3.29

1 year ago

1.3.28

1 year ago

1.3.27

1 year ago

1.3.26

1 year ago

1.3.25

1 year ago

1.3.24

1 year ago

1.3.23

1 year ago

1.3.22

1 year ago

1.3.21

1 year ago

1.3.20

1 year ago

1.3.19

1 year ago

1.3.18

1 year ago

1.3.17

1 year ago

1.3.16

1 year ago

1.2.16

1 year ago

1.1.16

1 year ago

1.1.15

1 year ago

1.0.15

1 year ago

1.0.14

1 year ago

1.0.13

1 year ago

1.0.12

1 year ago

1.0.11

1 year ago

1.0.10

1 year ago

1.0.9

1 year ago

1.0.8

1 year ago

1.0.7

1 year ago

1.0.6

1 year ago

1.0.5

1 year ago

1.0.4

1 year ago

1.0.3

1 year ago

1.0.2

1 year ago

1.0.1

1 year ago

1.0.0

1 year ago