Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

absurdum

Package Overview
Dependencies
Maintainers
1
Versions
177
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

absurdum - npm Package Compare versions

Comparing version 0.3.1 to 0.4.0

src/arrays/tap.js

26

dist/arrays.js

@@ -114,2 +114,11 @@ (function webpackUniversalModuleDefinition(root, factory) {

var _tap = __webpack_require__(4);
Object.defineProperty(exports, 'tap', {
enumerable: true,
get: function get() {
return _tap.tap;
}
});
/***/ }),

@@ -163,2 +172,19 @@ /* 1 */

/***/ }),
/* 4 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
var tap = exports.tap = function tap(input, func) {
input.forEach(function (x) {
return func(x);
});
return input;
};
/***/ })

@@ -165,0 +191,0 @@ /******/ ]);

@@ -33,1 +33,15 @@ # Type: Array

```
### arrays.tap(arr, func)
Applies a function to each element in the array without mutating it
```javascript
let result = arrays.tap([1, 2, 3, 4], console.log);
console.log(result);
> 1
> 2
> 3
> 4
> [1, 2, 3, 4]
```

2

package.json
{
"name": "absurdum",
"version": "0.3.1",
"version": "0.4.0",
"description": "Reductio Ad Absurdum - The Riduculous Application of Reduce",

@@ -5,0 +5,0 @@ "keywords": [

export { filter } from './filter';
export { map } from './map';
export { reverse } from './reverse';
export { tap } from './tap';

@@ -31,1 +31,10 @@ const test = require('tape');

});
test('tap(arr) - should apply a function to the input without mutating it', (t) => {
let result = arrays.tap([1, 2, 3, 4], console.log);
let expect = [1, 2, 3, 4];
t.equal(Object.prototype.toString.call(result), '[object Array]', 'type');
t.equal(result.length, 4, 'length');
t.deepEqual(result, expect, 'value');
t.end();
});

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc