diff options
author | Volpeon <git@volpeon.ink> | 2024-10-19 23:57:35 +0200 |
---|---|---|
committer | Volpeon <git@volpeon.ink> | 2024-10-19 23:57:35 +0200 |
commit | fcfda9c8b8d3e1f513a221743bd1b1fc51cc61a0 (patch) | |
tree | 789a9bc988bcf787db1f0897aa8bb73b927895ea /src/_props.scss | |
parent | Update (diff) | |
download | iro-sass-fcfda9c8b8d3e1f513a221743bd1b1fc51cc61a0.tar.gz iro-sass-fcfda9c8b8d3e1f513a221743bd1b1fc51cc61a0.tar.bz2 iro-sass-fcfda9c8b8d3e1f513a221743bd1b1fc51cc61a0.zip |
More robust prop check
Diffstat (limited to 'src/_props.scss')
-rw-r--r-- | src/_props.scss | 6 |
1 files changed, 6 insertions, 0 deletions
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 @@ | |||
35 | @return get($value, $key, $keys); | 35 | @return get($value, $key, $keys); |
36 | } | 36 | } |
37 | @if meta.type-of($value) == 'map' and $key != null { | 37 | @if meta.type-of($value) == 'map' and $key != null { |
38 | @if meta.type-of($key) != 'string' { | ||
39 | @error 'Expected string, got #{$key}'; | ||
40 | } | ||
38 | @return get-deep(#{$name}#{$key}, map.get($value, $key), $keys...); | 41 | @return get-deep(#{$name}#{$key}, map.get($value, $key), $keys...); |
39 | } | 42 | } |
40 | @return $name $value; | 43 | @return $name $value; |
@@ -42,6 +45,9 @@ | |||
42 | 45 | ||
43 | @function map-to-vars($name, $map) { | 46 | @function map-to-vars($name, $map) { |
44 | @if meta.type-of($map) != 'map' { | 47 | @if meta.type-of($map) != 'map' { |
48 | @if meta.type-of($name) != 'string' { | ||
49 | @error 'Expected variable name, got #{$name} instead'; | ||
50 | } | ||
45 | @return var($name); | 51 | @return var($name); |
46 | } | 52 | } |
47 | 53 | ||