Skip to content

Commit

Permalink
chore: format
Browse files Browse the repository at this point in the history
  • Loading branch information
antfu committed Oct 3, 2022
1 parent 24f4c47 commit 534593c
Show file tree
Hide file tree
Showing 7 changed files with 14 additions and 11 deletions.
4 changes: 2 additions & 2 deletions packages/compiler-core/src/transforms/vOn.ts
Original file line number Diff line number Diff line change
Expand Up @@ -54,9 +54,9 @@ export const transformOn: DirectiveTransform = (
? // for component and vnode lifecycle event listeners, auto convert
// it to camelCase. See issue #2249
toHandlerKey(camelize(rawName))
// preserve case for plain element listeners that have uppercase
: // preserve case for plain element listeners that have uppercase
// letters, as these may be custom elements' custom events
: `on:${rawName}`
`on:${rawName}`
eventName = createSimpleExpression(eventString, true, arg.loc)
} else {
// #2388
Expand Down
8 changes: 6 additions & 2 deletions packages/compiler-sfc/__tests__/rewriteDefault.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,10 @@ describe('compiler sfc: rewriteDefault', () => {

test('@Component\nexport default class w/ comments', async () => {
expect(
rewriteDefault(`// export default\n@Component\nexport default class Foo {}`, 'script')
rewriteDefault(
`// export default\n@Component\nexport default class Foo {}`,
'script'
)
).toMatchInlineSnapshot(`
"// export default
@Component
Expand All @@ -231,7 +234,8 @@ describe('compiler sfc: rewriteDefault', () => {
test('@Component\nexport default class w/ comments 3', async () => {
expect(
rewriteDefault(
`/*\n@Component\nexport default class Foo {}*/\n` + `export default class Bar {}`,
`/*\n@Component\nexport default class Foo {}*/\n` +
`export default class Bar {}`,
'script'
)
).toMatchInlineSnapshot(`
Expand Down
3 changes: 1 addition & 2 deletions packages/compiler-ssr/src/ssrCodegenTransform.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,7 @@ export function ssrCodegenTransform(ast: RootNode, options: CompilerOptions) {
createCompoundExpression([`const _cssVars = { style: `, varsExp, `}`])
)
Array.from(cssContext.helpers.keys()).forEach(helper => {
if (!ast.helpers.includes(helper))
ast.helpers.push(helper)
if (!ast.helpers.includes(helper)) ast.helpers.push(helper)
})
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@ export function ssrTransformTransitionGroup(
node,
context,
otherProps,
true, /* isComponent */
false, /* isDynamicComponent */
true /* isComponent */,
false /* isDynamicComponent */,
true /* ssr (skip event listeners) */
)
let propsExp = null
Expand Down
1 change: 0 additions & 1 deletion packages/runtime-core/__tests__/apiOptions.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1048,7 +1048,6 @@ describe('api: options', () => {
expect(root.innerHTML).toBe(`<h1>Foo</h1>`)
})


test('options defined in component have higher priority', async () => {
const Mixin = {
msg1: 'base'
Expand Down
2 changes: 1 addition & 1 deletion packages/runtime-core/src/helpers/withMemo.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ export function isMemoSame(cached: VNode, memo: any[]) {
if (prev.length != memo.length) {
return false
}

for (let i = 0; i < prev.length; i++) {
if (hasChanged(prev[i], memo[i])) {
return false
Expand Down
3 changes: 2 additions & 1 deletion packages/shared/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,8 @@ export const isMap = (val: unknown): val is Map<any, any> =>
export const isSet = (val: unknown): val is Set<any> =>
toTypeString(val) === '[object Set]'

export const isDate = (val: unknown): val is Date => toTypeString(val) === '[object Date]'
export const isDate = (val: unknown): val is Date =>
toTypeString(val) === '[object Date]'
export const isFunction = (val: unknown): val is Function =>
typeof val === 'function'
export const isString = (val: unknown): val is string => typeof val === 'string'
Expand Down

0 comments on commit 534593c

Please sign in to comment.