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

lodash-listfindandremove

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

lodash-listfindandremove

Extend lodash to remove a matching item from a string containg a delimited list.

  • 1.0.2
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
3
Maintainers
1
Weekly downloads
 
Created
Source

Lodash listFindAndRemove

Build Status Known Vulnerabilities NPM version

Extends Lodash to search a delimited string and remove any occurrences of a specified value.
Returns a new string with the specified values removed, the original string is unchanged.

_.listFindAndRemove(list, target, [delimiter=','])

Arguments
list (string): The string containing the delimited list to be search. Required.
target (string): The value to remove from the list. Matching is case-sensitive. Required.
[delimiter] (string): The optional character used to delimit items in the list. When none is supplied a comma (,) is used.

Returns
(string): Returns a string containing the delimited list with all occurrences of the target removed.

Examples

var _ = require('lodash')
require('lodash-listfindandremove')

_.listFindAndRemove(d,a,b,c,d,e,d,f,d', 'd') // 'a,b,c,e,f'  
_.listFindAndRemove('d,a,b,c,D,e,d,f,d', 'd') // 'a,b,c,D,e,f'  
_.listFindAndRemove('d~a~b~c~d~e~d~f~d', 'd', '~') // 'a~b~c~e~f'  
_.listFindAndRemove('a,b,c,d,e,f', 'z') // 'a,b,c,d,e,f'  
_.listFindAndRemove('a|b|c|d|e|f|xyz', 'z', '|') // 'a|b|c|d|e|f|xyz'  
_.listFindAndRemove('', 'a') // ''   
_.listFindAndRemove('1,2,3,100,4,1,5', '1') // '2,3,100,4,5'  

Version History

VersionRelease DateDetails
1.0.225th February, 2018An extra character had snuck into one of the links meaning the badge was correct but clicking on it didn't give the expected result. No functionality changes.
1.0.125th February, 2018Added 2 new badges to the README (Known Vulnerabilities & NPM Version) and this Version History. No functionality changes.
1.0.024th February, 2018Initial release.

FAQs

Package last updated on 25 Feb 2018

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

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