Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add declaration token support to the Details section #361

Open
wants to merge 6 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
refactor: make it more readable
  • Loading branch information
Dobromir Hristov committed Dec 2, 2022
commit a4679e5eb9e5d982a4f3ad0d79c740dd1a630ed5
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
>{{ normaliseType(type) }}</span><template
v-if="index + 1 < typesCount"
>
<template v-if="!moreThanTwo"> or </template>
<template v-if="twoOrLess"> or </template>
<template
v-else>, <template v-if="index === typesCount - 2">or </template>
</template>
Expand All @@ -43,7 +43,7 @@ export default {
},
computed: {
typesCount: ({ types }) => types.length,
moreThanTwo: ({ types }) => types.length > 2,
twoOrLess: ({ typesCount }) => typesCount <= 2,
},
methods: {
normaliseType({ arrayMode, baseType = '*' }) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,11 +75,7 @@ describe('PropertyListKeyType', () => {
types[0],
types[1],
]).text()).toBe('string or number');
expect(mountWithTypes([
types[0],
types[1],
types[2],
]).text()).toBe('string, number, or boolean');
expect(mountWithTypes(types).text()).toBe('string, number, or boolean');
});

it('uses "*" as a wildcard placeholder for the base type', () => {
Expand Down