From da611c948d17b459e9e39d127f22de7fc0ee76dc Mon Sep 17 00:00:00 2001 From: simonihmig Date: Sun, 14 Jul 2019 20:38:13 +0200 Subject: [PATCH] Add assertion for not passing @model and @models to --- lib/ast-link-to-transform.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/lib/ast-link-to-transform.js b/lib/ast-link-to-transform.js index 9a9e848..379d70e 100644 --- a/lib/ast-link-to-transform.js +++ b/lib/ast-link-to-transform.js @@ -33,6 +33,12 @@ class AngleBracketLinkToPolyfill { let models = attributes.find(({ name }) => name === '@models'); let query = attributes.find(({ name }) => name === '@query'); + if (model && models) { + throw new Error( + 'You cannot provide both the `@model` and `@models` arguments to the component.' + ); + } + let needsParamsHelper = (models && models.value.path.original !== 'array') || (query && query.value.path.original !== 'hash');