New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

ng2-pipes

Package Overview
Dependencies
Maintainers
1
Versions
88
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

ng2-pipes - npm Package Compare versions

Comparing version 0.4.9 to 0.4.10

2

bin/app/pipes/array/intersection.d.ts
import { PipeTransform } from '@angular/core';
export declare class IntersectionPipe implements PipeTransform {
transform(arr: any[], args?: any[]): any[];
transform(arr: any[], ...args: any[]): any[];
}

@@ -15,4 +15,7 @@ "use strict";

}
IntersectionPipe.prototype.transform = function (arr, args) {
if (args === void 0) { args = []; }
IntersectionPipe.prototype.transform = function (arr) {
var args = [];
for (var _i = 1; _i < arguments.length; _i++) {
args[_i - 1] = arguments[_i];
}
return args.reduce(function (newArr, currArr) {

@@ -19,0 +22,0 @@ return newArr.filter(function (elm) { return !!~currArr.indexOf(elm); });

{
"name": "ng2-pipes",
"version": "0.4.9",
"version": "0.4.10",
"author": "Dan Revah",

@@ -5,0 +5,0 @@ "description": "Useful angular2 pipes",

@@ -1,2 +0,2 @@

import {IntersectionPipe} from "./intersection";
import {IntersectionPipe} from './intersection';

@@ -15,10 +15,10 @@ describe('IntersectionPipe', () => {

it('should return empty array if there are no elements in the intersection', () => {
expect(pipe.transform([1, 2, 3], [[4, 5, 6]])).toEqual([]);
expect(pipe.transform([1, 2, 3], [[4, 5, 6], [7, 8, 9]])).toEqual([]);
expect(pipe.transform([1, 2, 3], [4, 5, 6])).toEqual([]);
expect(pipe.transform([1, 2, 3], [4, 5, 6], [7, 8, 9])).toEqual([]);
});
it('should return intersection of arrays', () => {
expect(pipe.transform([1, 2, 3], [[1, 2 ,3, 4, 5, 6]])).toEqual([1,2,3]);
expect(pipe.transform([1, 2, 3], [[1, 2, 4, 5, 6], [1, 2, 7, 8, 9]])).toEqual([1, 2]);
expect(pipe.transform([1, 2, 3], [1, 2 ,3, 4, 5, 6])).toEqual([1,2,3]);
expect(pipe.transform([1, 2, 3], [1, 2, 4, 5, 6], [1, 2, 7, 8, 9])).toEqual([1, 2]);
});
});

@@ -7,7 +7,7 @@ import {PipeTransform, Pipe, Injectable} from '@angular/core';

transform(arr:any[], args:any[] = []):any[] {
transform(arr: any[], ...args: any[]): any[] {
return args.reduce((newArr, currArr) =>
newArr.filter(elm => !!~currArr.indexOf(elm))
, arr);
, arr);
}
}

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