Skip to content

Commit

Permalink
Use assertions
Browse files Browse the repository at this point in the history
  • Loading branch information
lahmatiy committed Oct 30, 2023
1 parent 72a41c0 commit a923c7c
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/extensions/inspector.js
Original file line number Diff line number Diff line change
Expand Up @@ -278,7 +278,7 @@ export default (host) => {
data => data.value.view && data.value.view.skipped ? 'skipped' : false
],
content: [
'text:value | viewRoot.name or view.config.view | $ + "" = $ ? $ : "ƒn"' // FIXME: `$ + "" = $` is a hack to check value is a string
'text:value | viewRoot.name or view.config.view | is string ?: "ƒn"'
// {
// view: 'list',
// when: false, // postponed for future releases
Expand Down
2 changes: 1 addition & 1 deletion src/extensions/inspector/props-config.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ export const propsConfigView = {
{
view: 'block',
className: 'content-section render',
when: 'config | view + "" != view',
when: 'config.view is not string',
content: 'source:{ content: config.view + "", syntax: "js" }'
},
{
Expand Down
4 changes: 2 additions & 2 deletions src/extensions/inspector/view-tree.js
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ export function viewTree(el, { selectTreeViewLeaf, detailsSidebarLeafExpanded })
data => data.view?.skipped ? 'skipped' : false,
'selected'
],
content: 'text:view.config.view or "#root" | $ + "" = $ ? $ : "ƒn"', // FIXME: `$ + "" = $` is a hack to check value is a string
content: 'text:view.config.view or "#root" | is string ?: "ƒn"',
postRender(el_) {
requestAnimationFrame(() => {
el.querySelector('.sidebar').scrollTop = viewTreeScrollTopBeforeSelect;
Expand All @@ -100,7 +100,7 @@ export function viewTree(el, { selectTreeViewLeaf, detailsSidebarLeafExpanded })
{
view: 'link',
className: data => data.view?.skipped ? 'skipped' : false,
data: '{ text: view.config.view or "#root" | $ + "" = $ ? $ : "ƒn", href: false, view, self: $ }', // FIXME: `$ + "" = $` is a hack to check value is a string
data: '{ text: view.config.view or "#root" | is string ?: "ƒn", href: false, view, self: $ }',
onClick(_, data) {
viewTreeScrollTopBeforeSelect = el.querySelector('.sidebar')?.scrollTop || 0;
selectTreeViewLeaf(data.self);
Expand Down

0 comments on commit a923c7c

Please sign in to comment.