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.3.6 to 0.3.7

2

package.json
{
"name": "ng2-pipes",
"version": "0.3.6",
"version": "0.3.7",
"author": "Dan Revah",

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

@@ -16,6 +16,6 @@ import {StripTagsPipe} from "./strip-tags";

it('Should strip tags only tags which are not allowed', () => {
expect(pipe.transform('<a href="">foo</a><p class="foo">bar</p>', [['p']])).toEqual('foo<p class="foo">bar</p>');
expect(pipe.transform('<a href="">foo</a><p class="foo">bar</p>', [['a']])).toEqual('<a href="">foo</a>bar');
expect(pipe.transform('<a href="">foo</a><p class="foo">bar</p>', [['p', 'a']])).toEqual('<a href="">foo</a><p class="foo">bar</p>');
expect(pipe.transform('<a href="">foo</a><p class="foo">bar</p>', 'p')).toEqual('foo<p class="foo">bar</p>');
expect(pipe.transform('<a href="">foo</a><p class="foo">bar</p>', 'a')).toEqual('<a href="">foo</a>bar');
expect(pipe.transform('<a href="">foo</a><p class="foo">bar</p>', 'p', 'a')).toEqual('<a href="">foo</a><p class="foo">bar</p>');
});
});

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

transform(text:string, [allowedTags = []]:any[] = []):string {
transform(text:string, ...allowedTags: any[]):string {
return allowedTags.length > 0

@@ -10,0 +10,0 @@ ? text.replace(new RegExp(`<(?!\/?(${allowedTags.join('|')})\s*\/?)[^>]+>`, 'g'), '')

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