MCPcopy Create free account
hub / github.com/dataform-co/dataform / checkExcessProperties

Function checkExcessProperties

core/utils.ts:220–237  ·  view source on GitHub ↗
(
  reportError: (e: Error) => void,
  object: T,
  supportedProperties: string[],
  name?: string
)

Source from the content-addressed store, hash-verified

218 * @deprecated verifyObjectMatchesProto will be replacing this soon.
219 */
220export function checkExcessProperties<T>(
221 reportError: (e: Error) => void,
222 object: T,
223 supportedProperties: string[],
224 name?: string
225) {
226 const extraProperties = Object.keys(object).filter(
227 key => !(supportedProperties as string[]).includes(key)
228 );
229 if (extraProperties.length > 0) {
230 reportError(
231 new Error(
232 `Unexpected property "${extraProperties[0]}"${!!name ? ` in ${name}` : ""
233 }. Supported properties are: ${JSON.stringify(supportedProperties)}`
234 )
235 );
236 }
237}
238
239export function validateQueryString(session: Session, query: string, filename: string) {
240 if (query?.trim().slice(-1) === ";") {

Callers 4

verifyConfigMethod · 0.90
configMethod · 0.90
verifyConfigMethod · 0.90
verifyConfigMethod · 0.90

Calls 1

stringifyMethod · 0.80

Tested by

no test coverage detected