From fcfda9c8b8d3e1f513a221743bd1b1fc51cc61a0 Mon Sep 17 00:00:00 2001 From: Volpeon Date: Sat, 19 Oct 2024 23:57:35 +0200 Subject: More robust prop check --- src/_props.scss | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'src/_props.scss') diff --git a/src/_props.scss b/src/_props.scss index 5682611..59ecd58 100644 --- a/src/_props.scss +++ b/src/_props.scss @@ -35,6 +35,9 @@ @return get($value, $key, $keys); } @if meta.type-of($value) == 'map' and $key != null { + @if meta.type-of($key) != 'string' { + @error 'Expected string, got #{$key}'; + } @return get-deep(#{$name}#{$key}, map.get($value, $key), $keys...); } @return $name $value; @@ -42,6 +45,9 @@ @function map-to-vars($name, $map) { @if meta.type-of($map) != 'map' { + @if meta.type-of($name) != 'string' { + @error 'Expected variable name, got #{$name} instead'; + } @return var($name); } -- cgit v1.2.3-70-g09d2