Skip to content

Commit 674ddd8

Browse files
prettier fix in core package
1 parent 891a531 commit 674ddd8

3 files changed

Lines changed: 18 additions & 6 deletions

File tree

packages/core/src/core.ts

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,11 @@ export default function r2wc<Props extends R2WCBaseProps, Context>(
147147
const type = propTypes[prop]
148148
const transform = type ? transforms[type] : null
149149

150-
if (prop in propTypes && transform?.parse && (value || type === "method")) {
150+
if (
151+
prop in propTypes &&
152+
transform?.parse &&
153+
(value || type === "method")
154+
) {
151155
//@ts-ignore
152156
this[propsSymbol][prop] = transform.parse(value, attribute, this)
153157

@@ -197,7 +201,11 @@ export default function r2wc<Props extends R2WCBaseProps, Context>(
197201
}
198202
}
199203
} else {
200-
if (prop in propTypes && transform?.parse && (value || type === "method")) {
204+
if (
205+
prop in propTypes &&
206+
transform?.parse &&
207+
(value || type === "method")
208+
) {
201209
//@ts-ignore
202210
this[propsSymbol][prop] = transform.parse(value, attribute, this)
203211
}

packages/core/src/transforms/index.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,11 @@ export type R2WCElement = HTMLElement & {
1111

1212
export interface Transform<Type> {
1313
stringify?: (value: Type, attribute: string, element: R2WCElement) => string
14-
parse: (value: string, attribute: string, element: R2WCElement) => Type | undefined
14+
parse: (
15+
value: string,
16+
attribute: string,
17+
element: R2WCElement,
18+
) => Type | undefined
1519
}
1620

1721
const transforms = {

packages/core/src/transforms/method.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,9 @@ const method_: Transform<(...args: unknown[]) => unknown> = {
1515
}
1616

1717
if (
18-
typeof r2wcElement !== "undefined"
19-
&& functionName in r2wcElement
20-
&& typeof r2wcElement[functionName] !== "undefined"
18+
typeof r2wcElement !== "undefined" &&
19+
functionName in r2wcElement &&
20+
typeof r2wcElement[functionName] !== "undefined"
2121
) {
2222
let fn = r2wcElement[functionName]
2323
if (!(boundSymbol in r2wcElement[functionName])) {

0 commit comments

Comments
 (0)