generated from iamogbz/node-js-boilerplate
-
-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
style: switch indentation to 2 spaces
- Loading branch information
Showing
34 changed files
with
865 additions
and
873 deletions.
There are no files selected for viewing
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 |
---|---|---|
@@ -1,7 +1,7 @@ | ||
{ | ||
"bracketSpacing": true, | ||
"semi": true, | ||
"singleQuote": false, | ||
"tabWidth": 4, | ||
"trailingComma": "all" | ||
"bracketSpacing": true, | ||
"semi": true, | ||
"singleQuote": false, | ||
"tabWidth": 2, | ||
"trailingComma": "all" | ||
} |
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 |
---|---|---|
@@ -1,23 +1,23 @@ | ||
export default class DOMRect { | ||
bottom = 0; | ||
left = 0; | ||
right = 0; | ||
top = 0; | ||
constructor( | ||
// eslint-disable-next-line no-unused-vars | ||
public x = 0, | ||
// eslint-disable-next-line no-unused-vars | ||
public y = 0, | ||
// eslint-disable-next-line no-unused-vars | ||
public width = 0, | ||
// eslint-disable-next-line no-unused-vars | ||
public height = 0, | ||
) { | ||
this.left = x; | ||
this.top = y; | ||
this.right = x + width; | ||
this.bottom = y + height; | ||
} | ||
bottom = 0; | ||
left = 0; | ||
right = 0; | ||
top = 0; | ||
constructor( | ||
// eslint-disable-next-line no-unused-vars | ||
public x = 0, | ||
// eslint-disable-next-line no-unused-vars | ||
public y = 0, | ||
// eslint-disable-next-line no-unused-vars | ||
public width = 0, | ||
// eslint-disable-next-line no-unused-vars | ||
public height = 0, | ||
) { | ||
this.left = x; | ||
this.top = y; | ||
this.right = x + width; | ||
this.bottom = y + height; | ||
} | ||
} | ||
|
||
Object.assign(window, { DOMRect }); |
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 |
---|---|---|
@@ -1,13 +1,13 @@ | ||
export default class ResizeObserver { | ||
observe() { | ||
// do nothing | ||
} | ||
unobserve() { | ||
// do nothing | ||
} | ||
disconnect() { | ||
// do nothing | ||
} | ||
observe() { | ||
// do nothing | ||
} | ||
unobserve() { | ||
// do nothing | ||
} | ||
disconnect() { | ||
// do nothing | ||
} | ||
} | ||
|
||
Object.assign(window, { ResizeObserver }); |
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
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 |
---|---|---|
@@ -1,13 +1,13 @@ | ||
describe("Entry", () => { | ||
it("exports expected modules", async () => { | ||
// eslint-disable-next-line @typescript-eslint/no-var-requires | ||
expect(require("../")).toMatchInlineSnapshot(` | ||
it("exports expected modules", async () => { | ||
// eslint-disable-next-line @typescript-eslint/no-var-requires | ||
expect(require("../")).toMatchInlineSnapshot(` | ||
Object { | ||
"Frame": [Function], | ||
"Mirror": [Function], | ||
"Reflection": [Function], | ||
"useMirror": [Function], | ||
} | ||
`); | ||
}); | ||
}); | ||
}); |
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 |
---|---|---|
@@ -1,28 +1,28 @@ | ||
import * as React from "react"; | ||
|
||
export type ElementProps<T extends string> = | ||
T extends keyof JSX.IntrinsicElements | ||
? JSX.IntrinsicElements[T] | ||
: JSX.IntrinsicElements[keyof JSX.IntrinsicElements]; | ||
T extends keyof JSX.IntrinsicElements | ||
? JSX.IntrinsicElements[T] | ||
: JSX.IntrinsicElements[keyof JSX.IntrinsicElements]; | ||
|
||
type DOMElement<T extends string> = T extends keyof HTMLElementTagNameMap | ||
? HTMLElementTagNameMap[T] | ||
: never; | ||
? HTMLElementTagNameMap[T] | ||
: never; | ||
|
||
type DOMElementProps<T extends string> = { | ||
tagName: T; | ||
domRef?: React.Ref<DOMElement<T>>; | ||
tagName: T; | ||
domRef?: React.Ref<DOMElement<T>>; | ||
} & ElementProps<T>; | ||
|
||
export function Element<T extends string>({ | ||
children, | ||
domRef, | ||
tagName, | ||
...props | ||
children, | ||
domRef, | ||
tagName, | ||
...props | ||
}: DOMElementProps<T>) { | ||
return React.createElement( | ||
tagName.toLowerCase(), | ||
{ ...props, ref: domRef }, | ||
...(Array.isArray(children) ? children : [children]), | ||
); | ||
return React.createElement( | ||
tagName.toLowerCase(), | ||
{ ...props, ref: domRef }, | ||
...(Array.isArray(children) ? children : [children]), | ||
); | ||
} |
Oops, something went wrong.