Skip to content

Commit c468197

Browse files
chore(format): 🤖 ✨ (#157)
Co-authored-by: ecoscript[bot] <143032650+ecoscript[bot]@users.noreply.github.com>
1 parent e74b924 commit c468197

6 files changed

Lines changed: 10 additions & 16 deletions

File tree

‎src/buildMarksTree.ts‎

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,9 @@ import type {
44
PortableTextMarkDefinition,
55
} from '@portabletext/types'
66

7-
import type {ToolkitNestedPortableTextSpan, ToolkitTextNode} from './types'
8-
97
import {isPortableTextSpan} from './asserters'
108
import {sortMarksByOccurences} from './sortMarksByOccurences'
9+
import type {ToolkitNestedPortableTextSpan, ToolkitTextNode} from './types'
1110

1211
/**
1312
* Takes a Portable Text block and returns a nested tree of nodes optimized for rendering

‎src/nestLists.ts‎

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
11
import type {PortableTextBlock, PortableTextListItemBlock, TypedObject} from '@portabletext/types'
22

3+
import {
4+
isPortableTextListItemBlock,
5+
isPortableTextSpan,
6+
isPortableTextToolkitList,
7+
} from './asserters'
38
import type {
49
ToolkitListNestMode,
510
ToolkitPortableTextDirectList,
@@ -8,12 +13,6 @@ import type {
813
ToolkitPortableTextListItem,
914
} from './types'
1015

11-
import {
12-
isPortableTextListItemBlock,
13-
isPortableTextSpan,
14-
isPortableTextToolkitList,
15-
} from './asserters'
16-
1716
export type ToolkitNestListsOutputNode<T> =
1817
| T
1918
| ToolkitPortableTextHtmlList

‎src/spanToPlainText.ts‎

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
1-
import type {ToolkitNestedPortableTextSpan} from './types'
2-
31
import {isPortableTextToolkitSpan, isPortableTextToolkitTextNode} from './asserters'
2+
import type {ToolkitNestedPortableTextSpan} from './types'
43

54
/**
65
* Returns the plain-text representation of a

‎test/buildMarksTree.test.ts‎

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
1-
import type {PortableTextBlock} from '@portabletext/types'
2-
31
import {buildMarksTree} from '@portabletext/toolkit'
2+
import type {PortableTextBlock} from '@portabletext/types'
43
import {expect, test} from 'vitest'
54

65
test('buildMarksTree: returns empty tree on empty blocks', () => {

‎test/nestLists.test.ts‎

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
1-
import type {PortableTextListItemBlock} from '@portabletext/types'
2-
31
import {LIST_NEST_MODE_DIRECT, LIST_NEST_MODE_HTML, nestLists} from '@portabletext/toolkit'
2+
import type {PortableTextListItemBlock} from '@portabletext/types'
43
import {expect, test} from 'vitest'
54

65
test('nestLists: returns empty tree on no blocks', () => {

‎test/sortMarksByOccurences.test.ts‎

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
1-
import type {PortableTextBlock} from '@portabletext/types'
2-
31
import {sortMarksByOccurences} from '@portabletext/toolkit'
2+
import type {PortableTextBlock} from '@portabletext/types'
43
import {expect, test} from 'vitest'
54

65
test('sortMarksByOccurences: sorts correctly', () => {

0 commit comments

Comments
 (0)