Initial commit

This commit is contained in:
Marcelo
2025-11-20 15:27:34 -06:00
commit cc72c9fc5d
3221 changed files with 737477 additions and 0 deletions

21
node_modules/@serialport/parser-delimiter/LICENSE generated vendored Normal file
View File

@@ -0,0 +1,21 @@
The MIT License (MIT)
Copyright 2010 Christopher Williams. All rights reserved.
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to
deal in the Software without restriction, including without limitation the
rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
sell copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
IN THE SOFTWARE.

3
node_modules/@serialport/parser-delimiter/README.md generated vendored Normal file
View File

@@ -0,0 +1,3 @@
# @serialport/parser-delimiter
See our api docs https://serialport.io/docs/api-parser-delimiter

View File

@@ -0,0 +1,23 @@
/// <reference types="node" />
/// <reference types="node" />
import { Transform, TransformCallback, TransformOptions } from 'stream';
export interface DelimiterOptions extends TransformOptions {
/** The delimiter on which to split incoming data. */
delimiter: string | Buffer | number[];
/** Should the delimiter be included at the end of data. Defaults to `false` */
includeDelimiter?: boolean;
}
/**
* A transform stream that emits data each time a byte sequence is received.
* @extends Transform
*
* To use the `Delimiter` parser, provide a delimiter as a string, buffer, or array of bytes. Runs in O(n) time.
*/
export declare class DelimiterParser extends Transform {
includeDelimiter: boolean;
delimiter: Buffer;
buffer: Buffer;
constructor({ delimiter, includeDelimiter, ...options }: DelimiterOptions);
_transform(chunk: Buffer, encoding: BufferEncoding, cb: TransformCallback): void;
_flush(cb: TransformCallback): void;
}

View File

@@ -0,0 +1,43 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.DelimiterParser = void 0;
const stream_1 = require("stream");
/**
* A transform stream that emits data each time a byte sequence is received.
* @extends Transform
*
* To use the `Delimiter` parser, provide a delimiter as a string, buffer, or array of bytes. Runs in O(n) time.
*/
class DelimiterParser extends stream_1.Transform {
includeDelimiter;
delimiter;
buffer;
constructor({ delimiter, includeDelimiter = false, ...options }) {
super(options);
if (delimiter === undefined) {
throw new TypeError('"delimiter" is not a bufferable object');
}
if (delimiter.length === 0) {
throw new TypeError('"delimiter" has a 0 or undefined length');
}
this.includeDelimiter = includeDelimiter;
this.delimiter = Buffer.from(delimiter);
this.buffer = Buffer.alloc(0);
}
_transform(chunk, encoding, cb) {
let data = Buffer.concat([this.buffer, chunk]);
let position;
while ((position = data.indexOf(this.delimiter)) !== -1) {
this.push(data.slice(0, position + (this.includeDelimiter ? this.delimiter.length : 0)));
data = data.slice(position + this.delimiter.length);
}
this.buffer = data;
cb();
}
_flush(cb) {
this.push(this.buffer);
this.buffer = Buffer.alloc(0);
cb();
}
}
exports.DelimiterParser = DelimiterParser;

25
node_modules/@serialport/parser-delimiter/package.json generated vendored Normal file
View File

@@ -0,0 +1,25 @@
{
"name": "@serialport/parser-delimiter",
"main": "./dist/index.js",
"types": "./dist/index.d.ts",
"version": "12.0.0",
"engines": {
"node": ">=12.0.0"
},
"publishConfig": {
"access": "public"
},
"license": "MIT",
"scripts": {
"build": "tsc --build tsconfig-build.json"
},
"repository": {
"type": "git",
"url": "git://github.com/serialport/node-serialport.git"
},
"funding": "https://opencollective.com/serialport/donate",
"devDependencies": {
"typescript": "5.2.2"
},
"gitHead": "f7e7bd53f9578a26c4f44cc1949fef396dc064c7"
}