Wondering what’s next for npm?Check out our public roadmap! »

    more-boolean-methods
    TypeScript icon, indicating that this package has built-in type declarations

    1.0.2 • Public • Published

    More Boolean Methods!

    Installation

    require('more-boolean-methods')();
    // Done!

    Methods

    Method Description
    .random() Will give you a random boolean
    .not() Will negate the boolean
    .stringify() Will convert the boolean to a string
    .numberify() Will convert the boolean to a number
    .arrayify() Will convert the boolean to an array
    .true() Will return true
    .false() Will return false
    .and(boolean) Will return the 'AND' value of the two booleans
    .or(boolean) Will return the 'OR' value of the two booleans
    .equals(boolean) Will return true if both booleans are equal
    .xor(boolean) Will return the 'XOR' value of the two booleans

    Examples

    true.and(false) // expected output: false
    false.or(true) // expected output: true
    true.not() // expected output: false
    true.false() // expected output: false
    true.stringify() // expected output: 'true'

    Infos

    This module was kinda made as a joke, but you're free to use it anyways!

    Install

    npm i more-boolean-methods

    DownloadsWeekly Downloads

    1

    Version

    1.0.2

    License

    MIT

    Unpacked Size

    4.47 kB

    Total Files

    5

    Last publish

    Collaborators

    • avatar