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

character-parser

Package Overview
Dependencies
Maintainers
2
Versions
17
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

character-parser - npm Package Compare versions

Comparing version 2.1.1 to 2.2.0

12

index.js
'use strict';
var objIsRegex = require('is-regex');
exports = (module.exports = parse);

@@ -51,3 +53,3 @@

while (index < src.length) {
if ((options.ignoreNesting || !state.isNesting(options)) && startsWith(src, delimiter, index)) {
if ((options.ignoreNesting || !state.isNesting(options)) && matches(src, delimiter, index)) {
var end = index;

@@ -224,4 +226,8 @@ return {

function startsWith(str, start, i) {
return str.substr(i || 0, start.length) === start;
function matches(str, matcher, i) {
if (objIsRegex(matcher)) {
return matcher.test(str.substr(i || 0));
} else {
return str.substr(i || 0, matcher.length) === matcher;
}
}

@@ -228,0 +234,0 @@

{
"name": "character-parser",
"version": "2.1.1",
"version": "2.2.0",
"description": "Parse JavaScript one character at a time to look for snippets in Templates. This is not a validator, it's just designed to allow you to have sections of JavaScript delimited by brackets robustly.",

@@ -29,3 +29,6 @@ "main": "index.js",

"testit": "~2.0.2"
},
"dependencies": {
"is-regex": "^1.0.3"
}
}
}
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