New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details
Socket
Book a DemoSign in
Socket

left-split

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

left-split

Split string capture group retained on left

latest
npmnpm
Version
1.0.0
Version published
Maintainers
1
Created
Source

left-split

Split string capture group is captured to the left hand array item.

Capturing parenthesis return the separator as a distinct array element. left-split puts it at the end of the left hand array item.

Install

npm install left-split

Usage


leftsplit = require('left-split')

'foo bar'.split(/(\s)/)
// => ['foo', ' ', 'bar']

leftsplit('foo bar', /(\s)/)
// => ['foo ', 'bar']

'foo\nbar\n'.split(/(\r?\n)/)
// => ['foo', '\n', 'bar', '\n', '']

leftsplit('foo\nbar\n', /(\r?\n)/)
// => ['foo\n', 'bar\n', '']

Keywords

leftsplit

FAQs

Package last updated on 24 Mar 2016

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