@charset "UTF-8";

// @description
// * has-pos function.
// * It checks if the provided argument has one of the position values.

// @access private

// @version 1.4.0

// @author Khaled Mohamed

// @license MIT

// @repository: https://github.com/Black-Axis/sass-pire

// @namespace global

// @module type-checks/has-pos

// @dependencies:
// * - meta.type-of (SASS function).
// * - list.index (SASS function).
// * - Error.throw (function).

// @param {string} $val
// * The provided value of the position.

// @throws {string}
// * Throws an error if @param is not a string or param is not
// * in $position-values list.

// @example
// * .example {
// *   content: has-pos(right);
// * }

// @output
// * .example {
// *   content: true;
// * }

// @returns {boolean} - Returns true if the argument has one of the
// * position units, otherwise false.

@use "sass:meta";
@use "sass:list";
@use "../../development-utils/toggle-error-message" as Error;

@function has-pos($val) {
    $position-values: (top, right, bottom, left) !default;
    $flag: true !default;

    @if meta.type-of($val) != string {
        @return Error.throw("The parameter of has-pos function must be in a string type.");
    }

    @if not list.index($position-values, $val) {
        $flag: false;
    }

    @return $flag;
}
