MCPcopy Index your code
hub / github.com/zenstackhq/zenstack / getDataSourceProvider

Function getDataSourceProvider

packages/language/src/utils.ts:178–188  ·  view source on GitHub ↗
(model: Model)

Source from the content-addressed store, hash-verified

176 * if no datasource is found or its provider is not a literal.
177 */
178export function getDataSourceProvider(model: Model) {
179 const dataSource = model.declarations.find(isDataSource);
180 if (!dataSource) {
181 return undefined;
182 }
183 const providerField = dataSource.fields.find((f) => f.name === 'provider');
184 if (!providerField) {
185 return undefined;
186 }
187 return getLiteral<string>(providerField.value);
188}
189
190/**
191 * Resolves the given reference and returns the target AST node. Throws an error if the reference is not resolved.

Callers 3

_checkFuzzyMethod · 0.90
_checkFullTextMethod · 0.90

Calls 2

getLiteralFunction · 0.85
findMethod · 0.80

Tested by

no test coverage detected