Page Menu
Home
Sealhub
Search
Configure Global Search
Log In
Files
F8922313
table.test.ts
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
924 B
Referenced Files
None
Subscribers
None
table.test.ts
View Options
import
{
Table
}
from
"./table.js"
;
import
{
Structured
}
from
"./structured.js"
;
import
{
List
}
from
"./list.js"
;
import
{
ShortText
}
from
"./short-text.js"
;
import
{
ExtractParsed
}
from
"./component-argument.js"
;
describe
(
"table argument"
,
()
=>
{
it
(
"properly parses type value"
,
()
=>
{
const
table_arg
=
new
Table
(
new
Structured
(
<
const
>
{
value
:
new
ShortText
().
setExampleValues
([
""
]),
tags
:
new
List
(
new
ShortText
()),
}),
new
Structured
({
tags
:
new
List
(
new
ShortText
()).
setExampleValues
([[
"okazja"
]]),
})
);
const
table_value
=
{
rows
:
[
{
type
:
"row"
,
cells
:
[]
},
{
type
:
"header"
,
value
:
""
,
tags
:
[]
},
],
}
as
ExtractParsed
<
typeof
table_arg
>
;
table_value
.
rows
.
map
((
row
)
=>
{
if
(
row
.
type
==
"row"
)
{
row
.
cells
.
map
((
cell
)
=>
{
cell
.
tags
.
map
((
tag
)
=>
tag
);
// if the types are written correctly, this will typecheck OK
});
}
});
});
});
File Metadata
Details
Attached
Mime Type
text/x-java
Expires
Sat, Sep 20, 14:28 (1 d, 13 h)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
929296
Default Alt Text
table.test.ts (924 B)
Attached To
Mode
rJDD jdd
Attached
Detach File
Event Timeline
Log In to Comment