{"_id":"@alapnian-sass/throw","_rev":"2-a19106c352b17bff7c563afd8698efcb","name":"@alapnian-sass/throw","dist-tags":{"latest":"0.0.1"},"versions":{"0.0.0":{"name":"@alapnian-sass/throw","version":"0.0.0","keywords":["sass","scss","library","module","throw","exception","error","alapnian-sass"],"author":{"url":"https://alapnian.com/teams/@sassdev","name":"Alapnian Sass Dev","email":"sassdev@alapnian.com"},"license":"MIT","_id":"@alapnian-sass/throw@0.0.0","maintainers":[{"name":"alpaniandev","email":"alapnian.xviid@gmail.com"},{"name":"dyowiranatamulya","email":"dyowiranatamulya@gmail.com"}],"homepage":"https://module.alapnian.com/sass/throw","bugs":{"url":"https://github.com/alapniandev/alapnian-sass/issues"},"dist":{"shasum":"1152f036754993e72f0a1984143335bfc864a3af","tarball":"https://registry.npmjs.org/@alapnian-sass/throw/-/throw-0.0.0.tgz","fileCount":26,"integrity":"sha512-43c9BntQP5ijFb5Pvv00dU2N2VtdhEtHCW0RgkqjUHl5VTp/EK8sh2UjQEASRbpI8TvoNSBmYsGHPj71ZcAzDw==","signatures":[{"sig":"MEYCIQCQ/qKWFo33KBEz56Vma95V1etbSEBektEp79Hfauyr8gIhALC/kgO6Abe8B04UTjG28YBlVe3Yqm//1DBiNoe6xlR3","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":182032},"main":"./_index.scss","exports":{".":"./_index.scss"},"gitHead":"c04f2a5f305887e86646077e44b778d415d9d133","scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"_npmUser":{"name":"dyowiranatamulya","email":"dyowiranatamulya@gmail.com"},"repository":{"url":"git+https://github.com/alapniandev/alapnian-sass.git","type":"git","branch":"main","directory":"packages/throw"},"_npmVersion":"11.7.0","description":"Provides Sass functions to standardize exception messages.","directories":{},"displayName":"Alapnian Sass Throw Module","_nodeVersion":"22.17.1","dependencies":{},"publishConfig":{"registry":"https://registry.npmjs.com/"},"_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/throw_0.0.0_1766719884022_0.41229709057666875","host":"s3://npm-registry-packages-npm-production"}},"0.0.1":{"name":"@alapnian-sass/throw","version":"0.0.1","displayName":"Alapnian Sass Throw Module","description":"Provides Sass functions to standardize exception messages.","keywords":["sass","scss","library","module","throw","exception","error","alapnian-sass"],"homepage":"https://module.alapnian.com/sass/throw","bugs":{"url":"https://github.com/alapniandev/alapnian-sass/issues"},"repository":{"type":"git","directory":"packages/throw","branch":"main","url":"git+https://github.com/alapniandev/alapnian-sass.git"},"license":"MIT","author":{"name":"Alapnian Sass Dev","email":"sassdev@alapnian.com","url":"https://alapnian.com/teams/@sassdev"},"exports":{".":"./_index.scss"},"main":"./_index.scss","publishConfig":{"registry":"https://registry.npmjs.com/"},"scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"dependencies":{},"gitHead":"6d54135cecf5e53a48f03535a2fe1108ec382928","_id":"@alapnian-sass/throw@0.0.1","_nodeVersion":"24.13.0","_npmVersion":"11.6.2","dist":{"integrity":"sha512-/5FyMj9CeWAAhJSZd7/jxcX/Pch2w4+GIX0ANn/nPJkS4kW9g78m11MoPruT1IHsng6Zic55TrEppredpdKPzA==","shasum":"0c68b7b60c7c5bde4759135e49dc7e086f1accf3","tarball":"https://registry.npmjs.org/@alapnian-sass/throw/-/throw-0.0.1.tgz","fileCount":26,"unpackedSize":183577,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIFZwfQF+cCZsYSCcrjKsJXcJ+5H1EfkabSz5HYcmUO/1AiEA9Wowpj8QhcOUdO/5jSmDVlZKkxATGgbQ9cNJ/Pqhb0o="}]},"_npmUser":{"name":"dyowiranatamulya","email":"dyowiranatamulya@gmail.com"},"directories":{},"maintainers":[{"name":"alpaniandev","email":"alapnian.xviid@gmail.com"},{"name":"dyowiranatamulya","email":"dyowiranatamulya@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/throw_0.0.1_1768994987077_0.5774836186405166"},"_hasShrinkwrap":false}},"time":{"created":"2025-12-26T03:31:23.923Z","modified":"2026-01-21T11:29:47.415Z","0.0.0":"2025-12-26T03:31:24.358Z","0.0.1":"2026-01-21T11:29:47.259Z"},"bugs":{"url":"https://github.com/alapniandev/alapnian-sass/issues"},"author":{"name":"Alapnian Sass Dev","email":"sassdev@alapnian.com","url":"https://alapnian.com/teams/@sassdev"},"license":"MIT","homepage":"https://module.alapnian.com/sass/throw","keywords":["sass","scss","library","module","throw","exception","error","alapnian-sass"],"repository":{"type":"git","directory":"packages/throw","branch":"main","url":"git+https://github.com/alapniandev/alapnian-sass.git"},"description":"Provides Sass functions to standardize exception messages.","maintainers":[{"name":"alpaniandev","email":"alapnian.xviid@gmail.com"},{"name":"dyowiranatamulya","email":"dyowiranatamulya@gmail.com"}],"readme":"<p>\r\n    <picture>\r\n        <source srcset=\"banner.png\" type=\"image/png\">\r\n        <img align=\"center\" src=\"banner.png\" alt=\"Alapnian Sass Throw Module\">\r\n    </picture>\r\n</p><br>\r\n\r\n<picture>\r\n  <source srcset=\"https://fonts.gstatic.com/s/e/notoemoji/latest/1f680/512.webp\" type=\"image/webp\">\r\n  <img src=\"https://fonts.gstatic.com/s/e/notoemoji/latest/1f680/512.gif\" align=\"left\" alt=\"🚀\" width=\"32\" height=\"32\">\r\n</picture>\r\n<picture>\r\n  <source srcset=\"https://fonts.gstatic.com/s/e/notoemoji/latest/1f680/512.webp\" type=\"image/webp\">\r\n  <img src=\"https://fonts.gstatic.com/s/e/notoemoji/latest/1f680/512.gif\" align=\"right\" alt=\"🚀\" width=\"32\" height=\"32\">\r\n</picture>\r\n<h1 align=\"center\">Get Started</h1>\r\n\r\n<h2>👁️ Overview</h2>\r\n<p>\r\n    Alapnian Sass Throw Module is provides Sass functions to standardize exception messages. In this module, there are 4 mixins and 2 functions that are ready for you to use, namely:\r\n    <ul>\r\n        <li>\r\n            Mixins: <a href=\"#variable\"><code>variable()</code></a>, <a href=\"#variable-type\"><code>variable-type()</code></a>, <a href=\"#parameter\"><code>parameter()</code></a>, <a href=\"#parameter-type\"><code>parameter-type()</code></a>\r\n        </li>\r\n        <li>Functions: <a href=\"#parameter-1\"><code>parameter()</code></a>, <a href=\"#parameter-type-1\"><code>parameter-type()</code></a></li>\r\n    </ul>\r\n</p>\r\n\r\n\r\n<h2>📋 Requirements</h2>\r\n<p>\r\n<ul>\r\n    <li><a href=\"\">Dart Sass</a>: <code>>=1.23.0</code></li>\r\n</ul>\r\n</p>\r\n\r\n<h2>📥 Installations</h2>\r\n\r\n<h3>Node Package Manager (NPM)</h3>\r\n<p>\r\n    <a target=\"_blank\" title=\"NPM Version\" href=\"https://www.npmjs.com/package/@alapnian-sass/throw?activeTab=versions\"><img alt=\"NPM Version\" src=\"https://img.shields.io/npm/v/%40alapnian-sass%2Fthrow?logo=npm&logoColor=CB3837&label=version&link=https%3A%2F%2Fwww.npmjs.com%2Fpackage%2F%40alapnian-sass%2Fthrow%3FactiveTab%3Dversions\" height=\"17\"/></a>\r\n    <a target=\"_blank\" title=\"NPM Downloads\" href=\"javascript:void(0)\"><img alt=\"NPM Downloads\" src=\"https://img.shields.io/npm/dm/%40alapnian-sass%2Fthrow?logo=npm&logoColor=CB3837&label=downloads\" height=\"17\"/></a>\r\n    <pre><code>npm i @alapnian-sass/throw</code></pre>\r\n</pre>\r\n</p>\r\n\r\n<h2>👨🏻‍💻 Usage</h2>\r\n\r\n<p>After the package has been installed, it might already be available for use just like any other Sass module.</p>\r\n\r\n```scss\r\n@use '@alapnian-sass/throw';\r\n```\r\n\r\n<p>However, if Sass can't find the module, your compiler will need to be configured to include the <code>node_modules</code> folder. That should look something like this:</p>\r\n\r\n```js\r\nconst sass = require('sass');\r\n\r\nsass.compile(filePath, {\r\n  loadPaths: ['node_modules']\r\n});\r\n```\r\n\r\n<h2>⚙️ Settings</h2>\r\n\r\n<table>\r\n    <caption>Alapnian Sass Throw Module Settings</caption>\r\n    <thead>\r\n        <tr>\r\n            <th>Name</th>\r\n            <th>Type</th>\r\n            <th>Default</th>\r\n            <th>Description</th>\r\n        </tr>\r\n    </thead>\r\n    <tbody>\r\n        <tr>\r\n            <td><code>$strict-mode</code></td>\r\n            <td>Boolean</td>\r\n            <td><code>true</code></td>\r\n            <td>Toggle strict mode, in which script will throw when not able to cast a value into a certain type (mostly color and number). In non-strict mode, it will return the default value from the given type.</td>\r\n        </tr>\r\n    </tbody>\r\n</table>\r\n\r\n<p>\r\n<details>\r\n    <summary>Customize settings via <a target=\"_blank\" href=\"https://sass-lang.com/documentation/at-rules/forward/\"><code>@forward</code> rule</a></summary>\r\n\r\n```scss\r\n@forward \"@alapnian-sass/throw\" with (\r\n    $strict-mode: false\r\n);\r\n```\r\n</details>\r\n<details>\r\n    <summary>Customize settings via <a target=\"_blank\" href=\"https://sass-lang.com/documentation/at-rules/use/\"><code>@use</code> rule</a></summary>\r\n\r\n```scss\r\n@use \"@alapnian-sass/throw\" with (\r\n    $strict-mode: false\r\n);\r\n```\r\n</details>\r\n</p>\r\n\r\n<picture>\r\n  <source srcset=\"https://fonts.gstatic.com/s/e/notoemoji/latest/1f525/512.webp\" type=\"image/webp\">\r\n  <img src=\"https://fonts.gstatic.com/s/e/notoemoji/latest/1f525/512.gif\" align=\"left\" alt=\"🔥\" width=\"32\" height=\"32\">\r\n</picture>\r\n<picture>\r\n  <source srcset=\"https://fonts.gstatic.com/s/e/notoemoji/latest/1f525/512.webp\" type=\"image/webp\">\r\n  <img src=\"https://fonts.gstatic.com/s/e/notoemoji/latest/1f525/512.gif\" align=\"right\" alt=\"🔥\" width=\"32\" height=\"32\">\r\n</picture>\r\n<h1 align=\"center\">API</h1>\r\n\r\n<h2>🌀 Mixins</h2>\r\n\r\n<h3>variable()</h3>\r\n\r\n```scss\r\nthrow.variable($message, $names...);\r\n\r\nthrow-variable($message, $names...);\r\n```\r\n\r\n<p>An error message stating an issue with one or more variables.</p>\r\n<p>When the <code>$strict-mode</code> parameter (or global <code>$strict-mode</code> setting) is set, the mixin will output errors as comments without stopping compilation.</p>\r\n\r\n<p>\r\n    <strong>Parameters:</strong>\r\n</p>\r\n<p>\r\n<table>\r\n    <caption><code>throw.variable()</code> Mixin Parameters</caption>\r\n    <thead>\r\n        <tr>\r\n            <th>Name</th>\r\n            <th>Type</th>\r\n            <th>Default</th>\r\n            <th>Description</th>\r\n        </tr>\r\n    </thead>\r\n    <tbody>\r\n        <tr>\r\n            <td><code>$message</code></td>\r\n            <td>String</td>\r\n            <td></td>\r\n            <td>The message which describes the issue.</td>\r\n        </tr>\r\n        <tr>\r\n            <td><code>$names</code></td>\r\n            <td>ArgList</td>\r\n            <td></td>\r\n            <td>The names of the variables for which there is an issue.</td>\r\n        </tr>\r\n        <tr>\r\n            <td><code>$strict-mode</code></td>\r\n            <td>Boolean</td>\r\n            <td><code>%derived%</code></td>\r\n            <td>Optionally catch errors and output them as CSS comments without stopping compilation.</td>\r\n        </tr>\r\n    </tbody>\r\n</table>\r\n</p>\r\n\r\n<p>\r\n    <strong>Output:</strong><br>\r\n    A string describing the reason one or more variables are misconfigured.\r\n</p>\r\n\r\n<p>\r\n    <strong>Example:</strong>\r\n    <details>\r\n        <summary>Basic</summary>\r\n\r\n```scss\r\n// Load modules\r\n@use \"@alapnian-sass/throw\";\r\n\r\n// Define vars\r\n$width: 1080px !default;\r\n\r\n// Validate\r\n@if ($width < 0) {\r\n    @include throw.variable(\"Value must not be less than zero, but is `#{$width}`\", \"width\");\r\n}\r\n```\r\n</details>\r\n    <details>\r\n        <summary>Advanced</summary>\r\n\r\n```scss\r\n// Load modules\r\n@use \"@alapnian-sass/throw\";\r\n\r\n// Define vars\r\n$width: 1080px !default;\r\n\r\n// Validate\r\n@if ($width < 0) {\r\n    @include throw.variable(\"Value must not be less than zero, but is `#{$width}`\", \"width\", $strict-mode: false);\r\n}\r\n```\r\n\r\n<p>Or, you can set <code>$strict-mode</code> when u load <code>@use</code> rule with <code>with</code></p>\r\n\r\n```scss\r\n// Load modules\r\n@use \"@alapnian-sass/throw\" with ($strict-mode: false);\r\n\r\n// Define vars\r\n$width: 1080px !default;\r\n\r\n// Validate\r\n@if ($width < 0) {\r\n    @include throw.variable(\"Value must not be less than zero, but is `#{$width}`\", \"width\");\r\n}\r\n```\r\n</details>\r\n</p>\r\n\r\n<h3>variable-type()</h3>\r\n\r\n```scss\r\nthrow.variable-type($name, $value, $types...);\r\n\r\nthrow-variable-type($name, $value, $types...);\r\n```\r\n\r\n<p>An error message stating a variable received the wrong type.</p>\r\n<p>When the <code>$strict-mode</code> parameter (or global <code>$strict-mode</code> setting) is set, the mixin will output errors as comments without stopping compilation.</p>\r\n\r\n<p>\r\n    <strong>Parameters:</strong>\r\n</p>\r\n<p>\r\n    <table>\r\n        <caption><code>throw.variable-type()</code> Mixin Parameters</caption>\r\n        <thead>\r\n            <tr>\r\n                <th>Name</th>\r\n                <th>Type</th>\r\n                <th>Default</th>\r\n                <th>Description</th>\r\n            </tr>\r\n        </thead>\r\n        <tbody>\r\n            <tr>\r\n                <td><code>$name</code></td>\r\n                <td>String</td>\r\n                <td></td>\r\n                <td>The name of the variable which has received the wrong type.</td>\r\n            </tr>\r\n            <tr>\r\n                <td><code>$value</code></td>\r\n                <td>*</td>\r\n                <td></td>\r\n                <td>The value which was received.</td>\r\n            </tr>\r\n            <tr>\r\n                <td><code>$types</code></td>\r\n                <td>ArgList</td>\r\n                <td></td>\r\n                <td>The types which are expected.</td>\r\n            </tr>\r\n            <tr>\r\n                <td><code>$message</code></td>\r\n                <td>String</td>\r\n                <td><code>null</code></td>\r\n                <td>The additional message which describes the issue. Must be passed by name.</td>\r\n            </tr>\r\n            <tr>\r\n                <td><code>$strict-mode</code></td>\r\n                <td>Boolean</td>\r\n                <td><code>%derived%</code></td>\r\n                <td>Optionally catch errors and output them as CSS comments without stopping compilation.</td>\r\n            </tr>\r\n        </tbody>\r\n    </table>\r\n</p>\r\n\r\n<p>\r\n    <strong>Output:</strong><br>\r\n    A string describing what types are acceptable for a variable and the value that is misconfigured.\r\n</p>\r\n\r\n<p>\r\n    <strong>Example:</strong>\r\n    <details>\r\n        <summary>Basic</summary>\r\n\r\n```scss\r\n// Load modules\r\n@use \"@alapnian-sass/meta\";\r\n@use \"@alapnian-sass/throw\";\r\n\r\n// Define vars\r\n$width: 1080px !default;\r\n\r\n// Validate\r\n@if (meta.type-of($width) != \"number\") {\r\n    @include throw.variable(\"width\", $width, \"number\");\r\n}\r\n```\r\n</details>\r\n    <details>\r\n        <summary>Advanced</summary>\r\n\r\n```scss\r\n// Load modules\r\n@use \"@alapnian-sass/throw\";\r\n\r\n// Define vars\r\n$width: 1080px !default;\r\n\r\n// Validate\r\n@if (meta.type-of($width) != \"number\") {\r\n    @include throw.variable(\"width\", $width, \"number\", $strict-mode: false, $message: \"Please use the number value type.\");\r\n}\r\n```\r\n\r\n<p>Or, you can set <code>$strict-mode</code> when u load <code>@use</code> rule with <code>with</code></p>\r\n\r\n```scss\r\n// Load modules\r\n@use \"@alapnian-sass/throw\" with ($strict-mode: false);\r\n\r\n// Define vars\r\n$width: 1080px !default;\r\n\r\n// Validate\r\n@if (meta.type-of($width) != \"number\") {\r\n    @include throw.variable(\"width\", $width, \"number\", $message: \"Please use the number value type.\");\r\n}\r\n```\r\n</details>\r\n</p>\r\n\r\n<h3>parameter()</h3>\r\n\r\n```scss\r\nthrow.parameter($message, $context, $names...);\r\n\r\nthrow-parameter($message, $context, $names...);\r\n```\r\n\r\n<p>An error message stating an issue with one or more parameters.</p>\r\n<p>When the <code>$strict-mode</code> parameter (or global <code>$strict-mode</code> setting) is set, the mixin will output errors as comments without stopping compilation.</p>\r\n\r\n<p>\r\n    <strong>Parameters:</strong>\r\n</p>\r\n<p>\r\n    <table>\r\n        <caption><code>throw.parameter()</code> Mixin Parameters</caption>\r\n        <thead>\r\n            <tr>\r\n                <th>Name</th>\r\n                <th>Type</th>\r\n                <th>Default</th>\r\n                <th>Description</th>\r\n            </tr>\r\n        </thead>\r\n        <tbody>\r\n            <tr>\r\n                <td><code>$message</code></td>\r\n                <td>String</td>\r\n                <td></td>\r\n                <td>The message which describes the issue.</td>\r\n            </tr>\r\n            <tr>\r\n                <td><code>$context</code></td>\r\n                <td>String</td>\r\n                <td></td>\r\n                <td>The name of the mixin issuing the error.</td>\r\n            </tr>\r\n            <tr>\r\n                <td><code>$names</code></td>\r\n                <td>ArgList</td>\r\n                <td></td>\r\n                <td>The names of the parameters for which there is an issue.</td>\r\n            </tr>\r\n            <tr>\r\n                <td><code>$strict-mode</code></td>\r\n                <td>Boolean</td>\r\n                <td><code>%derived%</code></td>\r\n                <td>Optionally catch errors and output them as CSS comments without stopping compilation.</td>\r\n            </tr>\r\n        </tbody>\r\n    </table>\r\n</p>\r\n\r\n<p>\r\n    <strong>Output:</strong><br>\r\n    A string describing the reason one or more parameters are invalid.\r\n</p>\r\n\r\n<p>\r\n    <strong>Example:</strong>\r\n    <details>\r\n        <summary>Basic</summary>\r\n\r\n```scss\r\n// Load modules\r\n@use \"sass:meta\";\r\n@use \"@alapnian-sass/throw\";\r\n\r\n// Reflexive Position Mixin\r\n@mixin reflexive-position($property, $value) {\r\n    @if $property != left and $property != right {\r\n        @include throw.parameter(\"Property #{$property} must be either left or right.\", \"property\")\r\n    } @else {\r\n        @if (meta.type-of($value) != \"number\") {\r\n            @include throw.parameter-type(\"reflexive-position\", \"value\", $value);\r\n        } @else {\r\n            $left-value: $value;\r\n            @if ($property == right) {\r\n                $left-value: initial;\r\n            }\r\n            \r\n            $right-value: initial;\r\n            @if ($property == right) {\r\n                $right-value: $value;\r\n            }\r\n\r\n            left: $left-value;\r\n            right: $right-value;\r\n\r\n            [dir=rtl] & {\r\n                left: $right-value;\r\n                right: $left-value;\r\n            }\r\n        }\r\n    }\r\n}\r\n\r\n.valid-property {\r\n    @include reflexive-position(\"left\", 12px);\r\n}\r\n\r\n.invalid-property {\r\n    @include reflexive-position(\"top\", 12px);\r\n}\r\n```\r\n</details>\r\n    <details>\r\n        <summary>Advanced</summary>\r\n\r\n```scss\r\n// Load modules\r\n@use \"sass:meta\";\r\n@use \"@alapnian-sass/throw\";\r\n\r\n// Reflexive Position Mixin\r\n@mixin reflexive-position($property, $value) {\r\n    @if $property != left and $property != right {\r\n        @include throw.parameter(\"Property #{$property} must be either left or right.\", \"property\", $strict-mode: false)\r\n    } @else {\r\n        @if (meta.type-of($value) != \"number\") {\r\n            @include throw.parameter-type(\"reflexive-position\", \"value\", $value);\r\n        } @else {\r\n            $left-value: $value;\r\n            @if ($property == right) {\r\n                $left-value: initial;\r\n            }\r\n            \r\n            $right-value: initial;\r\n            @if ($property == right) {\r\n                $right-value: $value;\r\n            }\r\n\r\n            left: $left-value;\r\n            right: $right-value;\r\n\r\n            [dir=rtl] & {\r\n                left: $right-value;\r\n                right: $left-value;\r\n            }\r\n        }\r\n    }\r\n}\r\n\r\n.valid-property {\r\n    @include reflexive-position(\"left\", 12px);\r\n}\r\n\r\n.invalid-property {\r\n    @include reflexive-position(\"top\", 12px);\r\n}\r\n```\r\n\r\n<p>Or, you can set <code>$strict-mode</code> when u load <code>@use</code> rule with <code>with</code></p>\r\n\r\n```scss\r\n// Load modules\r\n@use \"sass:meta\";\r\n@use \"@alapnian-sass/throw\" with ($strict-mode: false);\r\n\r\n// Reflexive Position Mixin\r\n@mixin reflexive-position($property, $value) {\r\n    @if $property != left and $property != right {\r\n        @include throw.parameter(\"Property #{$property} must be either left or right.\", \"property\")\r\n    } @else {\r\n        @if (meta.type-of($value) != \"number\") {\r\n            @include throw.parameter-type(\"reflexive-position\", \"value\", $value);\r\n        } @else {\r\n            $left-value: $value;\r\n            @if ($property == right) {\r\n                $left-value: initial;\r\n            }\r\n            \r\n            $right-value: initial;\r\n            @if ($property == right) {\r\n                $right-value: $value;\r\n            }\r\n\r\n            left: $left-value;\r\n            right: $right-value;\r\n\r\n            [dir=rtl] & {\r\n                left: $right-value;\r\n                right: $left-value;\r\n            }\r\n        }\r\n    }\r\n}\r\n\r\n.valid-property {\r\n    @include reflexive-position(\"left\", 12px);\r\n}\r\n\r\n.invalid-property {\r\n    @include reflexive-position(\"top\", 12px);\r\n}\r\n```\r\n</details>\r\n</p>\r\n\r\n<h3>parameter-type()</h3>\r\n\r\n```scss\r\nthrow.parameter-type($context, $name, $value, $types...);\r\n\r\nthrow-parameter-type($context, $name, $value, $types...);\r\n```\r\n\r\n<p>An error message stating a parameter received the wrong type.</p>\r\n<p>When the <code>$strict-mode</code> parameter (or global <code>$strict-mode</code> setting) is set, the mixin will output errors as comments without stopping compilation.</p>\r\n\r\n<p>\r\n    <strong>Parameters:</strong>\r\n</p>\r\n<p>\r\n    <table>\r\n        <caption><code>throw.parameter()</code> Mixin Parameters</caption>\r\n        <thead>\r\n            <tr>\r\n                <th>Name</th>\r\n                <th>Type</th>\r\n                <th>Default</th>\r\n                <th>Description</th>\r\n            </tr>\r\n        </thead>\r\n        <tbody>\r\n            <tr>\r\n                <td><code>$context</code></td>\r\n                <td>String</td>\r\n                <td></td>\r\n                <td>The name of the mixin issuing the error.</td>\r\n            </tr>\r\n            <tr>\r\n                <td><code>$name</code></td>\r\n                <td>String</td>\r\n                <td></td>\r\n                <td>The name of the parameter which has received the wrong type.</td>\r\n            </tr>\r\n            <tr>\r\n                <td><code>$value</code></td>\r\n                <td>*</td>\r\n                <td></td>\r\n                <td>The value which was received.</td>\r\n            </tr>\r\n            <tr>\r\n                <td><code>$types</code></td>\r\n                <td>ArgList</td>\r\n                <td></td>\r\n                <td>The types which are expected.</td>\r\n            </tr>\r\n            <tr>\r\n                <td><code>$message</code></td>\r\n                <td>String</td>\r\n                <td><code>null</code></td>\r\n                <td>The additional message which describes the issue. Must be passed by name.</td>\r\n            </tr>\r\n            <tr>\r\n                <td><code>$strict-mode</code></td>\r\n                <td>Boolean</td>\r\n                <td><code>%derived%</code></td>\r\n                <td>Optionally catch errors and output them as CSS comments without stopping compilation.</td>\r\n            </tr>\r\n        </tbody>\r\n    </table>\r\n</p>\r\n\r\n<p>\r\n    <strong>Output:</strong><br>\r\n    A string describing what types are acceptable for a parameter and the value that is invalid.\r\n</p>\r\n\r\n<p>\r\n    <strong>Example:</strong>\r\n    <details>\r\n        <summary>Basic</summary>\r\n\r\n```scss\r\n// Load modules\r\n@use \"sass:meta\";\r\n@use \"@alapnian-sass/throw\";\r\n\r\n// Reflexive Position Mixin\r\n@mixin reflexive-position($property, $value) {\r\n    @if $property != left and $property != right {\r\n        @include throw.parameter(\"Property #{$property} must be either left or right.\", \"property\")\r\n    } @else {\r\n        @if (meta.type-of($value) != \"number\") {\r\n            @include throw.parameter-type(\"reflexive-position\", \"value\", $value);\r\n        } @else {\r\n            $left-value: $value;\r\n            @if ($property == right) {\r\n                $left-value: initial;\r\n            }\r\n            \r\n            $right-value: initial;\r\n            @if ($property == right) {\r\n                $right-value: $value;\r\n            }\r\n\r\n            left: $left-value;\r\n            right: $right-value;\r\n\r\n            [dir=rtl] & {\r\n                left: $right-value;\r\n                right: $left-value;\r\n            }\r\n        }\r\n    }\r\n}\r\n\r\n.valid-value {\r\n    @include reflexive-position(\"left\", 12px);\r\n}\r\n\r\n.invalid-value {\r\n    @include reflexive-position(\"left\", \"12px\");\r\n}\r\n```\r\n</details>\r\n    <details>\r\n        <summary>Advanced</summary>\r\n\r\n```scss\r\n// Load modules\r\n@use \"sass:meta\";\r\n@use \"@alapnian-sass/throw\";\r\n\r\n// Reflexive Position Mixin\r\n@mixin reflexive-position($property, $value) {\r\n    @if $property != left and $property != right {\r\n        @include throw.parameter(\"Property #{$property} must be either left or right.\", \"property\")\r\n    } @else {\r\n        @if (meta.type-of($value) != \"number\") {\r\n            @include throw.parameter-type(\"reflexive-position\", \"value\", $value, $strict-mode: false, $message: \"Please use the number value type.\");\r\n        } @else {\r\n            $left-value: $value;\r\n            @if ($property == right) {\r\n                $left-value: initial;\r\n            }\r\n            \r\n            $right-value: initial;\r\n            @if ($property == right) {\r\n                $right-value: $value;\r\n            }\r\n\r\n            left: $left-value;\r\n            right: $right-value;\r\n\r\n            [dir=rtl] & {\r\n                left: $right-value;\r\n                right: $left-value;\r\n            }\r\n        }\r\n    }\r\n}\r\n\r\n.valid-value {\r\n    @include reflexive-position(\"left\", 12px);\r\n}\r\n\r\n.invalid-value {\r\n    @include reflexive-position(\"left\", \"12px\");\r\n}\r\n```\r\n\r\n<p>Or, you can set <code>$strict-mode</code> when u load <code>@use</code> rule with <code>with</code></p>\r\n\r\n```scss\r\n// Load modules\r\n@use \"sass:meta\";\r\n@use \"@alapnian-sass/throw\" with($strict-mode: false);\r\n\r\n// Reflexive Position Mixin\r\n@mixin reflexive-position($property, $value) {\r\n    @if $property != left and $property != right {\r\n        @include throw.parameter(\"Property #{$property} must be either left or right.\", \"property\")\r\n    } @else {\r\n        @if (meta.type-of($value) != \"number\") {\r\n            @include throw.parameter-type(\"reflexive-position\", \"value\", $value, $message: \"Please use the number value type.\");\r\n        } @else {\r\n            $left-value: $value;\r\n            @if ($property == right) {\r\n                $left-value: initial;\r\n            }\r\n            \r\n            $right-value: initial;\r\n            @if ($property == right) {\r\n                $right-value: $value;\r\n            }\r\n\r\n            left: $left-value;\r\n            right: $right-value;\r\n\r\n            [dir=rtl] & {\r\n                left: $right-value;\r\n                right: $left-value;\r\n            }\r\n        }\r\n    }\r\n}\r\n\r\n.valid-value {\r\n    @include reflexive-position(\"left\", 12px);\r\n}\r\n\r\n.invalid-value {\r\n    @include reflexive-position(\"left\", \"12px\");\r\n}\r\n```\r\n</details>\r\n</p>\r\n\r\n<h2>🧩 Functions</h2>\r\n\r\n<h3>parameter()</h3>\r\n\r\n```scss\r\nthrow.parameter($message, $context, $names...); //=> String | any\r\n\r\nthrow-parameter($message, $context, $names...); //=> String | any\r\n```\r\n\r\n<p>Returns an error message stating an issue with one or more variables.</p>\r\n<p>When the <code>$strict-mode</code> parameter (or global <code>$strict-mode</code> setting) is set, the function will return errors without stopping compilation.</p>\r\n\r\n<p>\r\n    <strong>Parameters:</strong>\r\n</p>\r\n<p>\r\n    <table>\r\n        <caption><code>throw.parameter()</code> Function Parameters</caption>\r\n        <thead>\r\n            <tr>\r\n                <th>Name</th>\r\n                <th>Type</th>\r\n                <th>Default</th>\r\n                <th>Description</th>\r\n            </tr>\r\n        </thead>\r\n        <tbody>\r\n            <tr>\r\n                <td><code>$message</code></td>\r\n                <td>String</td>\r\n                <td></td>\r\n                <td>The message which describes the issue.</td>\r\n            </tr>\r\n            <tr>\r\n                <td><code>$context</code></td>\r\n                <td>String</td>\r\n                <td></td>\r\n                <td>The name of the function issuing the error.</td>\r\n            </tr>\r\n            <tr>\r\n                <td><code>$names</code></td>\r\n                <td>ArgList</td>\r\n                <td></td>\r\n                <td>The names of the variables for which there is an issue.</td>\r\n            </tr>\r\n            <tr>\r\n                <td><code>$strict-mode</code></td>\r\n                <td>Boolean</td>\r\n                <td><code>%derived%</code></td>\r\n                <td>Optionally catch errors and return them as values without stopping compilation.</td>\r\n            </tr>\r\n            <tr>\r\n                <td><code>$default-value</code></td>\r\n                <td>any</td>\r\n                <td></td>\r\n                <td>Default return value when running in non-strict mode.</td>\r\n            </tr>\r\n        </tbody>\r\n    </table>\r\n</p>\r\n\r\n<p>\r\n    <strong>Return Value:</strong><br>\r\n    <dl>\r\n        <dt><code>String</code> | any</dt>\r\n        <dd>A string describing the reason one or more variables are misconfigured.</dd>\r\n    </dl>\r\n</p>\r\n\r\n<p>\r\n    <strong>Example:</strong>\r\n    <details>\r\n        <summary>Basic</summary>\r\n\r\n```scss\r\n// Load modules\r\n@use \"sass:map\";\r\n@use \"sass:list\";\r\n@use \"@alapnian-sass/throw\";\r\n\r\n@function from($pairs...) {\r\n    @if (list.length($pairs) < 1) {\r\n        @return throw.parameter(\"One or more key/value pairs are required\", \"from\", \"pairs\");\r\n    }\r\n\r\n    $result: ();\r\n\r\n    @each $key, $value in $pairs {\r\n        $result: map.set($result, $key, $value);\r\n    }\r\n\r\n    @return $result;\r\n}\r\n\r\n// Valid\r\n@debug from(01234567890);\r\n@debug from(rgba(19, 7, 24, 1));\r\n@debug from([24px 7px, 19px]);\r\n@debug from((regular: 400, medium: 500, bold: 700));\r\n\r\n// Invalid\r\n@debug from();\r\n```\r\n</details>\r\n    <details>\r\n        <summary>Advanced</summary>\r\n\r\n```scss\r\n// Load modules\r\n@use \"sass:map\";\r\n@use \"sass:list\";\r\n@use \"@alapnian-sass/throw\";\r\n\r\n@function from($pairs...) {\r\n    @if (list.length($pairs) < 1) {\r\n        @return throw.parameter(\"One or more key/value pairs are required\", \"from\", \"pairs\", $strict-mode: false, $default-value: null);\r\n    }\r\n\r\n    $result: ();\r\n\r\n    @each $key, $value in $pairs {\r\n        $result: map.set($result, $key, $value);\r\n    }\r\n\r\n    @return $result;\r\n}\r\n\r\n// Valid\r\n@debug from(01234567890);\r\n@debug from(rgba(19, 7, 24, 1));\r\n@debug from([24px 7px, 19px]);\r\n@debug from((regular: 400, medium: 500, bold: 700));\r\n\r\n// Invalid\r\n@debug from(); //=> null\r\n```\r\n\r\n<p>Or, you can set <code>$strict-mode</code> when u load <code>@use</code> rule with <code>with</code></p>\r\n\r\n```scss\r\n// Load modules\r\n@use \"sass:map\";\r\n@use \"sass:list\";\r\n@use \"@alapnian-sass/throw\" with ($strict-mode: false);\r\n\r\n@function from($pairs...) {\r\n    @if (list.length($pairs) < 1) {\r\n        @return throw.parameter(\"One or more key/value pairs are required\", \"from\", \"pairs\", $default-value: null);\r\n    }\r\n\r\n    $result: ();\r\n\r\n    @each $key, $value in $pairs {\r\n        $result: map.set($result, $key, $value);\r\n    }\r\n\r\n    @return $result;\r\n}\r\n\r\n// Valid\r\n@debug from(01234567890);\r\n@debug from(rgba(19, 7, 24, 1));\r\n@debug from([24px 7px, 19px]);\r\n@debug from((regular: 400, medium: 500, bold: 700));\r\n\r\n// Invalid\r\n@debug from(); //=> null\r\n```\r\n</details>\r\n</p>\r\n\r\n<h3>parameter-type()</h3>\r\n\r\n```scss\r\nthrow.parameter-type($context, $name, $value, $types...); //=> String | any\r\n\r\nthrow-parameter-type($context, $name, $value, $types...); //=> String | any\r\n```\r\n\r\n<p>Returns an error message stating a parameter received the wrong type.</p>\r\n<p>When the <code>$strict-mode</code> parameter (or global <code>$strict-mode</code> setting) is set, the function will return errors without stopping compilation.</p>\r\n\r\n<p>\r\n    <strong>Parameters:</strong>\r\n</p>\r\n<p>\r\n    <table>\r\n        <caption><code>throw.parameter-type()</code> Function Parameters</caption>\r\n        <thead>\r\n            <tr>\r\n                <th>Name</th>\r\n                <th>Type</th>\r\n                <th>Default</th>\r\n                <th>Description</th>\r\n            </tr>\r\n        </thead>\r\n        <tbody>\r\n            <tr>\r\n                <td><code>$context</code></td>\r\n                <td>String</td>\r\n                <td></td>\r\n                <td>The name of the function issuing the error.</td>\r\n            </tr>\r\n            <tr>\r\n                <td><code>$name</code></td>\r\n                <td>String</td>\r\n                <td></td>\r\n                <td>The name of the parameter which has received the wrong type.</td>\r\n            </tr>\r\n            <tr>\r\n                <td><code>$value</code></td>\r\n                <td>*</td>\r\n                <td></td>\r\n                <td>The value which was received.</td>\r\n            </tr>\r\n            <tr>\r\n                <td><code>$types</code></td>\r\n                <td>ArgList</td>\r\n                <td></td>\r\n                <td>The types which are expected.</td>\r\n            </tr>\r\n            <tr>\r\n                <td><code>$strict-mode</code></td>\r\n                <td>Boolean</td>\r\n                <td><code>%derived%</code></td>\r\n                <td>Optionally catch errors and return them as values without stopping compilation.</td>\r\n            </tr>\r\n            <tr>\r\n                <td><code>$message</code></td>\r\n                <td>String</td>\r\n                <td><code>null</code></td>\r\n                <td>The additional message which describes the issue. Must be passed by name.</td>\r\n            </tr>\r\n            <tr>\r\n                <td><code>$default-value</code></td>\r\n                <td>any</td>\r\n                <td></td>\r\n                <td>Default return value when running in non-strict mode.</td>\r\n            </tr>\r\n        </tbody>\r\n    </table>\r\n</p>\r\n\r\n<p>\r\n    <strong>Return Value:</strong><br>\r\n    <dl>\r\n        <dt><code>String</code> | any</dt>\r\n        <dd>A string describing what types are acceptable for a parameter and the value that is invalid.</dd>\r\n    </dl>\r\n</p>\r\n\r\n<p>\r\n    <strong>Example:</strong>\r\n    <details>\r\n        <summary>Basic</summary>\r\n\r\n```scss\r\n// Load modules\r\n@use \"sass:meta\";\r\n@use \"sass:math\";\r\n@use \"sass:color\";\r\n@use \"@alapnian-sass/throw\";\r\n\r\n@function is-dark($color) {\r\n    @if (meta.type-of($color) != \"color\") {\r\n        @return throw.parameter-type(\"is-dark\", \"color\", $color, \"color\");\r\n    }\r\n\r\n    @return math.div(color.red($color) * 299 + color.green($color) * 587 + color.blue($color) * 114, 1000) < 128;\r\n}\r\n\r\n// Valid\r\n@debug is-dark(#000); //=> true\r\n@debug is-dark(#FFF); //=> false\r\n\r\n// Invalid\r\n@debug is-dark(\"#000\");\r\n@debug is-dark(\"rgb(0,0,0)\");\r\n```\r\n</details>\r\n    <details>\r\n        <summary>Advanced</summary>\r\n\r\n```scss\r\n// Load modules\r\n@use \"sass:meta\";\r\n@use \"sass:math\";\r\n@use \"sass:color\";\r\n@use \"@alapnian-sass/throw\";\r\n\r\n@function is-dark($color) {\r\n    @if (meta.type-of($color) != \"color\") {\r\n        @return throw.parameter-type(\"is-dark\", \"color\", $color, \"color\", $strict-mode: false, $message: \"Please use color value types such as `rgb()`, `hsl()`, or other color models.\", $default-value: false);\r\n    }\r\n\r\n    @return math.div(color.red($color) * 299 + color.green($color) * 587 + color.blue($color) * 114, 1000) < 128;\r\n}\r\n\r\n// Valid\r\n@debug is-dark(#000); //=> true\r\n@debug is-dark(#FFF); //=> false\r\n\r\n// Invalid\r\n@debug is-dark(\"#000\"); //=> false\r\n@debug is-dark(\"rgb(0,0,0)\"); //=> false\r\n```\r\n\r\n<p>Or, you can set <code>$strict-mode</code> when u load <code>@use</code> rule with <code>with</code></p>\r\n\r\n```scss\r\n// Load modules\r\n@use \"sass:meta\";\r\n@use \"sass:math\";\r\n@use \"sass:color\";\r\n@use \"@alapnian-sass/throw\" with ($strict-mode: false);\r\n\r\n@function is-dark($color) {\r\n    @if (meta.type-of($color) != \"color\") {\r\n        @return throw.parameter-type(\"is-dark\", \"color\", $color, \"color\", $message: \"Please use color value types such as `rgb()`, `hsl()`, or other color models.\", $default-value: false);\r\n    }\r\n\r\n    @return math.div(color.red($color) * 299 + color.green($color) * 587 + color.blue($color) * 114, 1000) < 128;\r\n}\r\n\r\n// Valid\r\n@debug is-dark(#000); //=> true\r\n@debug is-dark(#FFF); //=> false\r\n\r\n// Invalid\r\n@debug is-dark(\"#000\"); //=> false\r\n@debug is-dark(\"rgb(0,0,0)\"); //=> false\r\n```\r\n</details>\r\n</p>","readmeFilename":"README.md"}