Material Web Team 41d41cc278 chore: update repository for Material 3
PiperOrigin-RevId: 455635969
2022-06-17 16:42:04 +00:00

17 lines
489 B
SCSS

@use 'sass:meta';
///
/// is-type returns the given value if it matches the given type. If not, it
/// throws an error.
/// @param {*} $val - the value to check the type of.
/// @param {String} $type - the type we expect $val to be.
/// @return {*} returns $val assuming it is of type $type.
///
@function is-type($val, $type) {
$actual: meta.type-of($val);
@if $actual != $type {
@error 'expected "#{$val}" to be of type "#{$type}"; was type "#{$actual}"';
}
@return $val;
}