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

@toml-tools/lexer

Package Overview
Dependencies
Maintainers
1
Versions
11
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@toml-tools/lexer - npm Package Compare versions

Comparing version 0.1.1 to 0.2.0

api.d.ts

14

lib/api.js
const { Lexer } = require("chevrotain");
const { tokensArray, tokensDictionary } = require("./tokens");
const tomlLexer = new Lexer(tokensArray, { ensureOptimizations: true });
const tomlLexer = new Lexer(tokensArray, {
// Reducing the amount of position tracking can provide a small performance boost (<10%)
// Likely best to keep the full info for better error position reporting and
// to expose "fuller" ITokens from the Lexer.
positionTracking: "full",
ensureOptimizations: true,
// Both TOML lineTerminators contain a "\n"
// The "lineTerminatorCharacters" parameter is only used to flag patterns that **may**
// contain line terminators, so this is still correct.
lineTerminatorCharacters: ["\n"],
lineTerminatorsPattern: /\n|\r\n/g
});
function tokenize(text) {

@@ -7,0 +19,0 @@ return tomlLexer.tokenize(text);

9

package.json
{
"name": "@toml-tools/lexer",
"version": "0.1.1",
"version": "0.2.0",
"description": "TOML Lexer Implemented in JavaScript",
"main": "lib/api.js",
"repository": "https://github.com/bd82/toml-tools/packages/lexer",
"repository": "https://github.com/bd82/toml-tools/tree/master/packages/lexer",
"license": "MIT",

@@ -12,8 +12,9 @@ "dependencies": {

"scripts": {
"test": "echo TBD"
"test": "mocha ./test/*spec.js"
},
"typings": "./api.d.ts",
"publishConfig": {
"access": "public"
},
"gitHead": "985568629950665054ac56fd2601d465cb9aa716"
"gitHead": "229fd640c1874e99ee65ce80887169f3aa5787e9"
}
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