Skip to content

Commit

Permalink
feat: Update code
Browse files Browse the repository at this point in the history
  • Loading branch information
nuintun committed Oct 21, 2024
1 parent bbb951b commit e115ff4
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
8 changes: 1 addition & 7 deletions src/ReadStream.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

import { PathLike } from 'fs';
import { Buffer } from 'buffer';
import { Range } from './utils/http';
import { FileSystem } from './utils/fs';
import { Readable, ReadableOptions } from 'stream';

Expand All @@ -13,13 +14,6 @@ const enum ReadState {
SUFFIX
}

export interface Range {
offset: number;
length: number;
prefix?: Buffer;
suffix?: Buffer;
}

export interface Options
extends Pick<
ReadableOptions,
Expand Down
8 changes: 7 additions & 1 deletion src/utils/http.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,16 @@
import { Stats } from 'fs';
import { Context } from 'koa';
import { Buffer } from 'buffer';
import { Range } from './stream';
import { generate } from './hash';
import parseRange from 'range-parser';

export interface Range {
offset: number;
length: number;
prefix?: Buffer;
suffix?: Buffer;
}

type Ranges = Range[] | -1 | -2;

const TOKEN_SPLIT_REGEX = /\s*,\s*/;
Expand Down

0 comments on commit e115ff4

Please sign in to comment.