This package has been deprecated

Author message:

Replaced by (@hansogj/array.utils)[https://www.npmjs.com/package/@hansogj/array.utils]

array.onempty
TypeScript icon, indicating that this package has built-in type declarations

2.2.0 • Public • Published

array.onempty(fn)

Enable call of callback function to empty arrays

Simple example:

<script type="txt/javascript src="/path/to/libs/array.onempty.js" ></script>

||

require('array.onempty);

and then

[1,2,3,4,5]
.filter((item) =>  item > 10 ) //this should return an empty list
.onEmpty(() => console.log('Ey! This is an empty list'));


[]
.onEmpty((empty) => empty.push(1)) //returning an array : [1]
.onEmpty(() => {
     //now this won't be invoked
 });

Build code

npm install

Test code

npm test

Publish

npm version [<newversion> | major | minor | patch | premajor | preminor | prepatch | prerelease]

git push --follow-tags

npm publish

Dependencies (0)

    Dev Dependencies (13)

    Package Sidebar

    Install

    npm i array.onempty

    Weekly Downloads

    1

    Version

    2.2.0

    License

    ISC

    Unpacked Size

    4.89 kB

    Total Files

    6

    Last publish

    Collaborators

    • hansogj