mirror of
https://github.com/supabase/supabase.git
synced 2026-05-07 09:20:21 -04:00
03dcd51700
## Before Search results ignored if they are CLI references. ## After Search results returned for CLI references.
33 lines
764 B
TypeScript
33 lines
764 B
TypeScript
import { Json } from 'common'
|
|
import { isPlainObject } from '~/features/helpers.misc'
|
|
import { type SearchResultInterface } from '../globalSearch/globalSearchInterface'
|
|
|
|
export const DB_METADATA_TAG_PLATFORM_CLI = 'cli'
|
|
|
|
export class ReferenceCLICommandModel implements SearchResultInterface {
|
|
public title?: string
|
|
public href?: string
|
|
public content?: string
|
|
|
|
constructor({
|
|
title,
|
|
href,
|
|
content,
|
|
subsections,
|
|
}: {
|
|
title?: string
|
|
href?: string
|
|
content?: string
|
|
subsections?: Array<Json>
|
|
}) {
|
|
this.title = title
|
|
this.href = href
|
|
this.content =
|
|
content +
|
|
'\n\n' +
|
|
subsections
|
|
?.map((subsection) => (isPlainObject(subsection) && subsection.content) || '')
|
|
.join('\n\n')
|
|
}
|
|
}
|