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 {
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