Comparing version 4.0.0 to 4.1.0
/// <reference types="node" /> | ||
import { IGetToken, IToken, ITokenizer } from './types'; | ||
import { ITokenizer } from './types'; | ||
import { IGetToken, IToken } from '@tokenizer/token'; | ||
/** | ||
@@ -4,0 +5,0 @@ * Core tokenizer |
/// <reference types="node" /> | ||
import { ITokenizer, IGetToken, IToken } from './types'; | ||
import { ITokenizer } from './types'; | ||
import { IGetToken, IToken } from '@tokenizer/token'; | ||
export declare class BufferTokenizer implements ITokenizer { | ||
@@ -4,0 +5,0 @@ private buffer; |
@@ -6,3 +6,4 @@ /// <reference types="node" /> | ||
export { EndOfStreamError } from 'then-read-stream'; | ||
export { IToken, IFlush, IGetToken, ITokenizer } from './types'; | ||
export { ITokenizer } from './types'; | ||
export { IToken, IGetToken } from '@tokenizer/token'; | ||
/** | ||
@@ -9,0 +10,0 @@ * Construct ReadStreamTokenizer from given Stream. |
@@ -5,3 +5,4 @@ /// <reference types="node" /> | ||
export { fromFile } from './FileTokenizer'; | ||
export { IToken, IFlush, IGetToken, ITokenizer, EndOfStreamError, fromBuffer } from './core'; | ||
export { ITokenizer, EndOfStreamError, fromBuffer } from './core'; | ||
export { IToken, IGetToken } from '@tokenizer/token'; | ||
/** | ||
@@ -8,0 +9,0 @@ * Construct ReadStreamTokenizer from given Stream. |
/// <reference types="node" /> | ||
export declare type IFlush = (b: Buffer, o: number) => void; | ||
export interface IGetToken<T> { | ||
/** | ||
* Length in bytes of encoded value | ||
*/ | ||
len: number; | ||
/** | ||
* Decode value from buffer at offset | ||
* @param buf - Buffer to read the decoded value from | ||
* @param off - Decode offset | ||
*/ | ||
get(buf: Buffer, off: number): T; | ||
} | ||
export interface IToken<T> extends IGetToken<T> { | ||
/** | ||
* Encode value to buffer | ||
* @param buffer - Buffer to write the encoded value to | ||
* @param offset - Buffer write offset | ||
* @param value - Value to decode of type T | ||
* @param flush - ToDo | ||
*/ | ||
put(buffer: Buffer, offset: number, value: T, flush?: IFlush): number; | ||
} | ||
/** | ||
* The tokenizer allows us to read or peek from the tokenizer-stream. | ||
* The tokenizer-stream is an abstraction of a stream, file or Buffer. | ||
* It can also be translated in chunked reads, as done in @tokenizer/http; | ||
*/ | ||
import { IGetToken } from '@tokenizer/token'; | ||
export interface ITokenizer { | ||
@@ -26,0 +9,0 @@ /** |
{ | ||
"name": "strtok3", | ||
"version": "4.0.0", | ||
"version": "4.1.0", | ||
"description": "A promise based streaming tokenizer", | ||
@@ -29,7 +29,7 @@ "author": { | ||
"type": "git", | ||
"url": "git+https://github.com/Borewit/strtok3.git" | ||
"url": "https://github.com/Borewit/strtok3.git" | ||
}, | ||
"license": "MIT", | ||
"main": "lib/index.js", | ||
"typings": "lib/index", | ||
"typings": "lib/index.d.ts", | ||
"bugs": { | ||
@@ -39,2 +39,3 @@ "url": "https://github.com/Borewit/strtok3/issues" | ||
"devDependencies": { | ||
"@tokenizer/token": "^0.1.0", | ||
"@types/chai": "^4.2.5", | ||
@@ -54,3 +55,3 @@ "@types/mocha": "^5.2.7", | ||
"source-map-support": "^0.5.16", | ||
"token-types": "^1.3.0", | ||
"token-types": "^2.0.0", | ||
"ts-node": "^8.5.2", | ||
@@ -57,0 +58,0 @@ "typescript": "^3.7.4" |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
53016
18
771