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

@emmetio/scanner

Package Overview
Dependencies
Maintainers
2
Versions
13
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@emmetio/scanner - npm Package Compare versions

Comparing version 0.0.3 to 0.0.4

4

index.d.ts

@@ -64,5 +64,5 @@ declare type MatchFn = (ch: number) => boolean;

*/
error(message: string): StreamReaderError;
error(message: string, pos?: number): ScannerError;
}
export declare class StreamReaderError extends Error {
export declare class ScannerError extends Error {
pos: number;

@@ -69,0 +69,0 @@ string: string;

{
"name": "@emmetio/scanner",
"version": "0.0.3",
"version": "0.0.4",
"description": "Scans given text character-by-character",

@@ -5,0 +5,0 @@ "main": "./scanner.js",

@@ -32,2 +32,6 @@ const defaultQuotedOptions = {

}
/**
* Check if given character code is a white-space character: a space character
* or line breaks
*/
function isWhiteSpace(code) {

@@ -39,3 +43,3 @@ return code === 32 /* space */

/**
* Check if given character code is a space
* Check if given character code is a space character
*/

@@ -211,7 +215,7 @@ function isSpace(code) {

*/
error(message) {
return new StreamReaderError(`${message} at ${this.pos + 1}`, this.pos, this.string);
error(message, pos = this.pos) {
return new ScannerError(`${message} at ${pos + 1}`, pos, this.string);
}
}
class StreamReaderError extends Error {
class ScannerError extends Error {
constructor(message, pos, str) {

@@ -225,3 +229,3 @@ super(message);

export default Scanner;
export { StreamReaderError, eatPair, eatQuoted, isAlpha, isAlphaNumeric, isAlphaNumericWord, isAlphaWord, isNumber, isQuote, isSpace, isWhiteSpace };
export { ScannerError, eatPair, eatQuoted, isAlpha, isAlphaNumeric, isAlphaNumericWord, isAlphaWord, isNumber, isQuote, isSpace, isWhiteSpace };
//# sourceMappingURL=scanner.es.js.map

@@ -36,2 +36,6 @@ 'use strict';

}
/**
* Check if given character code is a white-space character: a space character
* or line breaks
*/
function isWhiteSpace(code) {

@@ -43,3 +47,3 @@ return code === 32 /* space */

/**
* Check if given character code is a space
* Check if given character code is a space character
*/

@@ -215,7 +219,7 @@ function isSpace(code) {

*/
error(message) {
return new StreamReaderError(`${message} at ${this.pos + 1}`, this.pos, this.string);
error(message, pos = this.pos) {
return new ScannerError(`${message} at ${pos + 1}`, pos, this.string);
}
}
class StreamReaderError extends Error {
class ScannerError extends Error {
constructor(message, pos, str) {

@@ -228,3 +232,3 @@ super(message);

exports.StreamReaderError = StreamReaderError;
exports.ScannerError = ScannerError;
exports.default = Scanner;

@@ -231,0 +235,0 @@ exports.eatPair = eatPair;

@@ -22,5 +22,9 @@ import Scanner from './index';

export declare function isAlphaWord(code: number): boolean;
/**
* Check if given character code is a white-space character: a space character
* or line breaks
*/
export declare function isWhiteSpace(code: number): boolean;
/**
* Check if given character code is a space
* Check if given character code is a space character
*/

@@ -27,0 +31,0 @@ export declare function isSpace(code: number): boolean;

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

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