Renamed!
This package has been renamed to @sass-fairy/exception and organised in a mono-repo for better maintainablity, an improved user experience, and full documentation. Explore more about the change at sass-fairy.com.
This Sass module provides functions to standardize exception messages and assist with common validation.
Install the package:
npm install sass-exceptionUse the package like any other Sass module:
@use 'sass-exception';Depending on your setup, you may need to configure node_modules as include path:
const sass = require('sass');
sass.render({
file: scss_filename,
includePaths: ['node_modules']
});is-separator-invalid ( $value )- Indicates whether a specified value is invalid for a separator parameter.
parameter ( $message, $context, $names... )- Returns an error message stating an issue with one or more parameters.
parameter-type ( $context, $name, $value, $types... )- Returns an error message stating a parameter received the wrong type.
separator ( [$context] )- Returns an error message stating a separator parameter or variable received the wrong value.
validate-index ( $context, $name, $value, $iterable )- Returns a valid index for the specified iterable; otherwise, an error message stating the reason the index is invalid.
variable ( $message, $names... )- Returns an error message stating an issue with one or more variables.
variable-type ( $name, $value, $types... [, $message] )- Returns an error message stating a variable received the wrong type.
Don't see the function you're looking for? Request a new feature describing a use case.