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

xstream

Package Overview
Dependencies
Maintainers
2
Versions
100
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

xstream - npm Package Compare versions

Comparing version 5.3.5 to 5.3.6

10

CHANGELOG.md

@@ -0,1 +1,11 @@

<a name="5.3.6"></a>
## [5.3.6](https://github.com/staltz/xstream/compare/v5.3.5...v5.3.6) (2016-08-17)
### Bug Fixes
* **dropRepeats:** fix usage with xs.combine ([4b3d65c](https://github.com/staltz/xstream/commit/4b3d65c)), closes [#105](https://github.com/staltz/xstream/issues/105)
<a name="5.3.5"></a>

@@ -2,0 +12,0 @@ ## [5.3.5](https://github.com/staltz/xstream/compare/v5.3.4...v5.3.5) (2016-08-17)

2

extra/dropRepeats.js

@@ -31,3 +31,3 @@ "use strict";

return;
this.v = t;
this.v = Array.isArray(t) ? t.slice() : t;
u._n(t);

@@ -34,0 +34,0 @@ };

{
"name": "xstream",
"version": "5.3.5",
"version": "5.3.6",
"description": "An extremely intuitive, small, and fast functional reactive stream library for JavaScript",

@@ -5,0 +5,0 @@ "main": "index.js",

@@ -33,3 +33,3 @@ import {Operator, Stream} from '../core';

if (v !== empty && this.isEq(t, v)) return;
this.v = t;
this.v = Array.isArray(t) ? <T> <any> (<Array<any>> <any> t).slice() : t;
u._n(t);

@@ -36,0 +36,0 @@ }

/// <reference path="../../typings/globals/mocha/index.d.ts" />
/// <reference path="../../typings/globals/node/index.d.ts" />
import xs, {Stream} from '../../src/index';
import fromDiagram from '../../src/extra/fromDiagram';
import dropRepeats from '../../src/extra/dropRepeats';

@@ -65,2 +66,24 @@ import * as assert from 'assert';

});
it('should support dropping duplicates of combine arrays', (done) => {
const A: Stream<string> = fromDiagram('---a---b------b------|');
const B: Stream<string> = fromDiagram('-x---y---y------z--y-|');
const stream = xs.combine(A, B).compose(
dropRepeats(([i1, i2]: [string, string], [j1, j2]: [string, string]) => {
return i1 === j1 && i2 === j2;
})
).map(arr => arr.join(''));
const expected = ['ax', 'ay', 'by', 'bz', 'by'];
stream.addListener({
next: (x: string) => {
assert.equal(x, expected.shift());
},
error: (err: any) => done(err),
complete: () => {
assert.equal(expected.length, 0);
done();
},
});
});
});

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