Skip to content

Commit

Permalink
capricorn86#521@minor: Continue added partial support for XMLHttpRequ…
Browse files Browse the repository at this point in the history
…est.
  • Loading branch information
Mas0nShi committed Jul 1, 2022
1 parent a1c0e81 commit 9f9df58
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions packages/happy-dom/src/xml-http-request/XMLHttpReqeustUtility.ts
@@ -0,0 +1,13 @@
const NodeVersion = process.version.replace('v', '').split('.');

export interface IXMLHttpRequestOptions {
anon?: boolean;
}

export const MajorNodeVersion = Number.parseInt(NodeVersion[0]);
export const copyToArrayBuffer = (buffer: Buffer, offset?: number): ArrayBuffer => {
const arrayBuffer = new ArrayBuffer(buffer.length);
const view = new Uint8Array(arrayBuffer);
view.set(buffer, offset || 0);
return arrayBuffer;
};

0 comments on commit 9f9df58

Please sign in to comment.