Skip to content

Commit

Permalink
Merge pull request #3 from jstewmon/no-dom-lib
Browse files Browse the repository at this point in the history
chore: remove dependency on dom lib
  • Loading branch information
microshine committed Nov 3, 2020
2 parents 922b3bd + 7e8992e commit 1615b1f
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 5 deletions.
2 changes: 2 additions & 0 deletions src/buffer_source_converter.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
export type BufferSource = ArrayBuffer | ArrayBufferView;

export class BufferSourceConverter {

public static toArrayBuffer(data: BufferSource) {
Expand Down
9 changes: 6 additions & 3 deletions src/convert.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
import { BufferSourceConverter } from './buffer_source_converter';
import { BufferSource, BufferSourceConverter } from "./buffer_source_converter";

export type BufferEncoding = "utf8" | "binary" | "base64" | "base64url" | "hex" | string;

declare const unescape: (value: string) => string;
declare const escape: (value: string) => string;
// augment global scope with names whose availability varies by environment
declare global {
var btoa: undefined | ((data: string) => string);
var atob: undefined | ((data: string) => string);
}

function PrepareBuffer(buffer: BufferSource) {
if (typeof Buffer !== "undefined" && Buffer.isBuffer(buffer)) {
Expand Down
3 changes: 1 addition & 2 deletions tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,7 @@
"module": "commonjs",
"target": "ES2018",
"lib": [
"es2015",
"dom"
"es2015"
],
"noImplicitAny": true,
"experimentalDecorators": true,
Expand Down

0 comments on commit 1615b1f

Please sign in to comment.