Skip to content

Commit

Permalink
Migrated parser to Bun
Browse files Browse the repository at this point in the history
  • Loading branch information
matvp91 committed Oct 10, 2024
1 parent d5a578f commit e8cc50a
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 15 deletions.
9 changes: 3 additions & 6 deletions packages/stitcher/src/parser/index.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
export { parseMasterPlaylist, parseMediaPlaylist } from "./parse.js";
export {
stringifyMasterPlaylist,
stringifyMediaPlaylist,
} from "./stringify.js";
export { parseMasterPlaylist, parseMediaPlaylist } from "./parse";
export { stringifyMasterPlaylist, stringifyMediaPlaylist } from "./stringify";

export * from "./types.js";
export * from "./types";
6 changes: 3 additions & 3 deletions packages/stitcher/src/parser/lexical-parse.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
import { assert } from "../assert.js";
import { mapAttributes, partOf } from "./helpers.js";
import { DateTime } from "luxon";
import { assert } from "../assert";
import { mapAttributes, partOf } from "./helpers";
import type {
Resolution,
MediaInitializationSection,
PlaylistType,
DateRange,
} from "./types.js";
} from "./types";

// Based on the latest spec:
// https://datatracker.ietf.org/doc/html/draft-pantos-hls-rfc8216bis
Expand Down
8 changes: 4 additions & 4 deletions packages/stitcher/src/parser/parse.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { assert } from "../assert.js";
import { lexicalParse } from "./lexical-parse.js";
import { assert } from "../assert";
import { lexicalParse } from "./lexical-parse";
import type {
MediaPlaylist,
MasterPlaylist,
Expand All @@ -9,8 +9,8 @@ import type {
Variant,
Rendition,
DateRange,
} from "./types.js";
import type { Tag, StreamInf, Media } from "./lexical-parse.js";
} from "./types";
import type { Tag, StreamInf, Media } from "./lexical-parse";
import type { DateTime } from "luxon";

function formatMediaPlaylist(tags: Tag[]): MediaPlaylist {
Expand Down
4 changes: 2 additions & 2 deletions packages/stitcher/src/parser/stringify.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Lines } from "./lines.js";
import { Lines } from "./lines";
import type {
Rendition,
Variant,
Expand All @@ -7,7 +7,7 @@ import type {
MediaPlaylist,
MediaInitializationSection,
DateRange,
} from "./types.js";
} from "./types";

function buildRendition(lines: Lines, rendition: Rendition) {
const attrs = [
Expand Down

0 comments on commit e8cc50a

Please sign in to comment.