All files / languages/sparql/services query-results-format.ts

100% Statements 3/3
100% Branches 0/0
100% Functions 3/3
100% Lines 3/3

Press n or j to go to the next uncovered block, b, p or k for the previous block.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27                7x               1x               14x    
import { getConfig } from '@src/utilities/vscode/config';
import { BindingsFormat, IriForm, ResultsExportTarget } from './bindings-formatter';
 
/**
 * Returns the format of the text a notebook cell offers to the built-in copy command.
 * @returns The configured copy format, defaulting to CSV.
 */
export function getResultsCopyFormat(): BindingsFormat {
	return getConfig('sparql').get<BindingsFormat>('resultsCopyFormat', 'csv');
}
 
/**
 * Returns the target the results toolbar sends the results to when a format is chosen.
 * @returns The configured export target, defaulting to a new document.
 */
export function getResultsExportTarget(): ResultsExportTarget {
	return getConfig('sparql').get<ResultsExportTarget>('resultsExportTarget', 'document');
}
 
/**
 * Returns the rendering of IRIs in copied and exported query results.
 * @returns The configured IRI form, defaulting to the full IRI.
 */
export function getResultsIriFormat(): IriForm {
	return getConfig('sparql').get<IriForm>('resultsIriFormat', 'full');
}