deconcat

0.0.1 • Public • Published

deconcat

Tokenize a Concatenation Expression

features

🔥 Blazing Fast O(1) Time.

🌳 Quotes (including backticks) are preserved.

👾 Spaces are properly ignored.

🍳 Handles quotes and plus signs inside of strings

install

npm install deconcat

usage

Tokenizing String Concatentation

import deconcat from 'deconcat';

const expr = `"My name is " + name + "."`;
const tokens = deconcat(expr);
// tokens are [`"My name is"`, "name", `"."`];
// note: quotes are preserved, but spaces are not

Tokenizing Numerical Concatentation

import deconcat from 'deconcat';

const expr = `1 + 2 + 3`;
const tokens = deconcat(expr);
// tokens are ["1", "2", "3"];

Package Sidebar

Install

npm i deconcat

Weekly Downloads

1

Version

0.0.1

License

CC0-1.0

Unpacked Size

9.41 kB

Total Files

4

Last publish

Collaborators

  • danieljdufour