@uxland/utilities
    TypeScript icon, indicating that this package has built-in type declarations

    1.0.0 • Public • Published

    UXL Utilities npm version

    Build Status Statements Branches Functions Lines
    BuildStatus Statements Branches Functions Lines

    Installation

    npm i @uxland/utilities

    Usage

    Collect

    Returns nested object value and prototype from provided key.

    collect("foo", "foo"); //=> {}
    collect({ foo: "bar" }); //=> {0: 'b', 1: 'a', 2: 'r'}
    collect({ foo: { bar: "qux" } }); //=> {bar: 'qux'}

    Constant Builder

    Converts a string to a new one with provided prefix and suffix in builder

    constantBuilder("PREFIX")("CONSTANT"); //=> 'PREFIX:CONSTANT'
    constantBuilder("PREFIX", "SUFFIX")("CONSTANT"); //=> 'PREFIX:CONSTANT:SUFFIX'
    constantBuilder("PREFIX", "SUFFIX", "$$")("CONSTANT"); //=> 'PREFIX$$CONSTANT$$SUFFIX'

    Invariant

    Check if condition is fulfilled, otherwise throws supplied message error

    invariant(R.is("number")(3), "Supplied value is not a number"); //=> undefined
    invariant(R.is("number")("3"), "Supplied value is not a number"); //=> 'Supplied value is not a number'

    No operation

    Defines an empty function

    nop(); //=> undefined

    Keywords

    none

    Install

    npm i @uxland/utilities

    DownloadsWeekly Downloads

    139

    Version

    1.0.0

    License

    BSD-4-Clause

    Unpacked Size

    36.2 kB

    Total Files

    30

    Last publish

    Collaborators

    • avizcaino
    • uxland-admin