-
-
Notifications
You must be signed in to change notification settings - Fork 201
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
#1215@trivial: Adds support for a new package called happy-dom-withou…
…t-nodejs.
- Loading branch information
1 parent
1379a54
commit 0b2467f
Showing
28 changed files
with
232 additions
and
148 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
/* eslint-disable import/no-extraneous-dependencies */ | ||
|
||
import { Blob } from 'happy-dom-without-nodejs'; | ||
/** | ||
* | ||
*/ | ||
class Buffer { | ||
/** | ||
* | ||
*/ | ||
public static from(): Buffer { | ||
return new Buffer(); | ||
} | ||
} | ||
|
||
export { Buffer, Blob }; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
/** | ||
* | ||
*/ | ||
class ConsoleConstructor {} | ||
/** | ||
* | ||
*/ | ||
class Console {} | ||
|
||
export { Console, ConsoleConstructor }; |
File renamed without changes.
2 changes: 1 addition & 1 deletion
2
...happy-dom-without-nodejs/polyfills/net.js → ...happy-dom-without-nodejs/polyfills/net.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
import { URL, URLSearchParams } from 'whatwg-url'; | ||
type UrlObject = {}; | ||
|
||
export { URL, URLSearchParams, UrlObject }; |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
type Context = object; | ||
|
||
/** | ||
* | ||
*/ | ||
class Script { | ||
private code: string; | ||
|
||
/** | ||
* | ||
* @param code | ||
*/ | ||
constructor(code: string) { | ||
this.code = code; | ||
} | ||
/** | ||
* | ||
* @param context | ||
*/ | ||
public runInContext(context: Context): void { | ||
const evaluate = (code: string): void => { | ||
eval(code); | ||
}; | ||
evaluate.call(context, this.code); | ||
} | ||
} | ||
const contextSymbol = Symbol('context'); | ||
const isContext = (context: Context): boolean => { | ||
return context[contextSymbol] === true; | ||
}; | ||
const createContext = (context: Context): Context => { | ||
context[contextSymbol] = true; | ||
return context; | ||
}; | ||
export { Script, isContext, createContext }; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
{ | ||
"compilerOptions": { | ||
"rootDir": "polyfills", | ||
"outDir": "lib/polyfills", | ||
"target": "ES2020", | ||
"declaration": true, | ||
"declarationMap": true, | ||
"module": "ESNext", | ||
"moduleResolution": "Bundler", | ||
"esModuleInterop": true, | ||
"experimentalDecorators": true, | ||
"allowSyntheticDefaultImports": true, | ||
"resolveJsonModule": true, | ||
"noUnusedLocals": true, | ||
"noUnusedParameters": true, | ||
"removeComments": false, | ||
"preserveConstEnums": true, | ||
"sourceMap": true, | ||
"skipLibCheck": true, | ||
"baseUrl": ".", | ||
"composite": false, | ||
"incremental": false, | ||
"allowJs": true, | ||
"lib": [ | ||
"es2020", | ||
"dom" | ||
], | ||
"types": [] | ||
}, | ||
"include": [ | ||
"polyfills" | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.