@bavary/lib
TypeScript icon, indicating that this package has built-in type declarations

0.0.2 • Public • Published

Logo


Build Status Coverage Status Download count Current version Support me

Checkout related packages

Install via npm:

$ npm install -g @bavary/lib

Install via yarn:

$ yarn global add @bavary/lib

Include directly via jsdelivr:

<script src="https://cdn.jsdelivr.net/npm/@bavary/lib/lib/bavary.lib.js"></script>

Usage

import {

    /**
     * Custom functions crafted for @bavary/core.
     * Checkout the available-functions section for more info!
     */
    functions,

    /**
     * Pass an array of function-names you want to use.
     * Returns an object with functions.
     */
    use
} from '@bavary/lib';

If you want to use these but have no idea how: checkout the documentation for how function work. You can even make custom ones!

Functions

Checkout the source if you want to now exactly whats going on in each function!

  • ignore(...values) - Does nothing. Can be used to ignore the value of nested groups.
  • count(value, tag) - Saves the length of value (either array or string) into tag.
  • pick(value, property) - Extracts property from value and applies it as current result.
  • concat(a, b, tag?) _- Concatenates strings, arrays or objects.
  • expectEqual(msg | 'null', ...values) - Check whenever all values are equal. Returns false if first argument is null, otherwise the string is thrown as error. Returns false if at least one value is null.
  • defineProperty(tag, ...values) - Saves whatever is passed after the tag as property into the result. If more than one value is passed into it they're wrapped into an array.
  • deleteProperty(...props) - Deletes properties by their name in the current result. If no tag is specified for objects and arrays the value will be appended to a (Via .push or Object.assign). The tag is mandatory for strings._

Related packages

Package Sidebar

Install

npm i @bavary/lib

Weekly Downloads

0

Version

0.0.2

License

MIT

Unpacked Size

34.9 kB

Total Files

25

Last publish

Collaborators

  • simonwep