Move Endian enum into index.ts

This commit is contained in:
Holly Stubbs 2023-05-12 14:04:33 +01:00
parent 9c93894160
commit c6d1eb2e54
3 changed files with 6 additions and 6 deletions

View file

@ -1,4 +0,0 @@
export enum Endian {
LE,
BE
}

View file

@ -1,4 +1,3 @@
import { Endian } from "./Endian";
import { IReader } from "./readers/IReader"; import { IReader } from "./readers/IReader";
import { IWriter } from "./writers/IWriter"; import { IWriter } from "./writers/IWriter";
import { ReaderBE } from "./readers/ReaderBE"; import { ReaderBE } from "./readers/ReaderBE";
@ -6,6 +5,11 @@ import { ReaderLE } from "./readers/ReaderLE";
import { WriterBE } from "./writers/WriterBE"; import { WriterBE } from "./writers/WriterBE";
import { WriterLE } from "./writers/WriterLE"; import { WriterLE } from "./writers/WriterLE";
export enum Endian {
LE,
BE
}
export function createReader(endianness:Endian, buffer:Buffer) : IReader { export function createReader(endianness:Endian, buffer:Buffer) : IReader {
if (endianness === Endian.LE) { if (endianness === Endian.LE) {
return new ReaderLE(buffer); return new ReaderLE(buffer);

View file

@ -1,6 +1,6 @@
{ {
"name": "bufferstuff", "name": "bufferstuff",
"version": "1.0.0", "version": "1.1.0",
"description": "A set of utility classes for reading and writing binary data in NodeJS and the browser", "description": "A set of utility classes for reading and writing binary data in NodeJS and the browser",
"main": "./lib/index.js", "main": "./lib/index.js",
"types": "./lib/index.d.ts", "types": "./lib/index.d.ts",