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

quoted-string-space-split

Package Overview
Dependencies
Maintainers
1
Versions
8
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

quoted-string-space-split

npm package that allows to split a string by spaces, but bypassing quoted content

latest
Source
npmnpm
Version
1.1.1
Version published
Weekly downloads
422
25.6%
Maintainers
1
Weekly downloads
 
Created
Source

quoted-string-space-split

CI/CD npm Coverage Status npm bundle size

Typescript / Javascript string splitter that allows to split a string by spaces, but bypassing quoted content

Bypassing quoted content (Content and "quoted content") means that you can know what does the user actually wanted to say, in case where you need to split your string by space.

Installation

npm install quoted-string-space-split

Basic Usage

There are two main methods to use this package :

import splitSpacesExcludeQuotes from 'quoted-string-space-split';

const myArray = splitSpacesExcludeQuotes('Content and "quoted content"');

console.log(myArray); // ["Content", "and", "quoted content"]
import { splitSpacesExcludeQuotesDetailed } from 'quoted-string-space-split';

const myArray = splitSpacesExcludeQuotesDetailed('Content and "quoted content"');

console.log(myArray);
/*
[
    {
        type: "plain",
        value: "Content"
    },
    {
        type: "plain",
        value: "and"
    },
    {
        type: "double",
        value: "quoted content"
    }
]
*/

Author

  • Guillaume Marcoux (V-ed) - Owner

See also the list of contributors who participated in this project.

License

This project is licensed under the MIT License - see the LICENSE file for details.

Keywords

string

FAQs

Package last updated on 10 May 2022

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