Skip to content

Commit

Permalink
Remove last reference to node:buffer
Browse files Browse the repository at this point in the history
  • Loading branch information
bjornstar committed Jul 5, 2024
1 parent a7a45ff commit 4503c55
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 11 deletions.
1 change: 0 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,6 @@ graph TD;
FT-->RWNS(readable-web-to-node-stream)
FT-->S
FT-->TY
TY-->NB(node:buffer)
RWNS-->RS(readable-stream)
RS-->SD(string_decoder)
SD-->SB(safe-buffer)
Expand Down
5 changes: 2 additions & 3 deletions lib/aiff/AiffToken.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
import * as Token from 'token-types';
import { Buffer } from 'node:buffer';

import { FourCcToken } from '../common/FourCC.js';
import * as iff from '../iff/index.js';

import { IGetToken } from 'strtok3';
import type { IGetToken } from 'strtok3';

/**
* The Common Chunk.
Expand All @@ -30,7 +29,7 @@ export class Common implements IGetToken<ICommon> {
this.len = header.chunkSize;
}

public get(buf: Buffer, off: number): ICommon {
public get(buf: Uint8Array, off: number): ICommon {

// see: https://cycling74.com/forums/aiffs-80-bit-sample-rate-value
const shift = Token.UINT16_BE.get(buf, off + 8) - 16398;
Expand Down
3 changes: 1 addition & 2 deletions lib/apev2/APEv2Token.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import * as Token from 'token-types';
import { IGetToken } from 'strtok3/core';
import { Buffer } from 'node:buffer';

import { FourCcToken } from '../common/FourCC.js';

Expand Down Expand Up @@ -158,7 +157,7 @@ export const Header: IGetToken<IHeader> = {
export const TagFooter: IGetToken<IFooter> = {
len: 32,

get: (buf: Buffer, off) => {
get: (buf, off) => {
return {
// should equal 'APETAGEX'
ID: new Token.StringType(8, 'ascii').get(buf, off),
Expand Down
9 changes: 4 additions & 5 deletions lib/asf/AsfUtil.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import * as Token from 'token-types';
import { Buffer } from 'node:buffer';

import * as util from '../common/Util.js';
import { DataType } from './AsfObject.js';
Expand Down Expand Up @@ -30,19 +29,19 @@ export class AsfUtil {
return new Uint8Array(buf);
}

private static parseBoolAttr(buf: Buffer, offset: number = 0): boolean {
private static parseBoolAttr(buf: Uint8Array, offset: number = 0): boolean {
return AsfUtil.parseWordAttr(buf, offset) === 1;
}

private static parseDWordAttr(buf: Buffer, offset: number = 0): number {
private static parseDWordAttr(buf: Uint8Array, offset: number = 0): number {
return Token.UINT32_LE.get(buf, offset);
}

private static parseQWordAttr(buf: Buffer, offset: number = 0): bigint {
private static parseQWordAttr(buf: Uint8Array, offset: number = 0): bigint {
return Token.UINT64_LE.get(buf, offset);
}

private static parseWordAttr(buf: Buffer, offset: number = 0): number {
private static parseWordAttr(buf: Uint8Array, offset: number = 0): number {
return Token.UINT16_LE.get(buf, offset);
}
}

0 comments on commit 4503c55

Please sign in to comment.