This package has been deprecated

    Author message:

    This package has been renamed to '@sass-fairy/map'.

    sass-module-map

    1.0.0 • Public • Published

    sass-module-map

    Release Version License

    This Sass module provides more advanced map functions.

    Install

    Requires

    • Dart Sass: >=1.33.0

    Install the package:

    npm install sass-module-map

    Use the package like any other Sass module:

    @use 'sass-module-map';

    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']
    });

    Public API

    Functions

    empty ()
    Creates an empty map.
    from ( $key-value... )
    Creates a map from the provided key/value pairs.
    to-string ( $map )
    Returns a string representing the specified map and its key/value pairs.

    Don't see the function you're looking for? Request a new feature describing a use case.

    Comparison Functions

    compare-key (), compare-key-desc ()
    Returns a function reference to the map key comparison method used by the sort function.
    compare-key ( $first-pair, $second-pair )
    Used to compare two key/value pairs' keys by converting them to strings, then comparing the value's sequences of UTF-16 code units values in ascending order. All null items are shifted right.
    compare-key-desc ( $first-pair, $second-pair )
    Used to compare two key/value pairs' keys by converting them to strings, then comparing the value's sequences of UTF-16 code units values in descending order. All null items are shifted left.
    compare-numeric-value (), compare-numeric-value-desc ()
    Returns a function reference to the numeric map value comparison method used by the sort function.
    compare-numeric-value ( $first-pair, $second-pair [, $center] )
    Used to compare two key/value pairs' values as numbers in ascending order. All non-numeric items are shifted right.
    compare-numeric-value-desc ( $first-pair, $second-pair [, $center] )
    Used to compare two key/value pairs' values as numbers in descending order. All non-numeric items are shifted left.
    compare-value (), compare-value-desc ()
    Returns a function reference to the map value comparison method used by the sort function.
    compare-value ( $first-pair, $second-pair )
    Used to compare two key/value pairs' values by converting them to strings, then comparing the value's sequences of UTF-16 code units values in ascending order. All null items are shifted right.
    compare-value-desc ( $first-pair, $second-pair )
    Used to compare two key/value pairs' values by converting them to strings, then comparing the value's sequences of UTF-16 code units values in descending order. All null items are shifted left.

    Combined API

    In order to avoid constantly declaring both the native 'sass:map' module and this library, the combined API has been added which merges the two.

    // Rather than using both modules separately...
    @use 'sass-module-map';
    @use 'sass:map';
    
    // ...this statement will accomplish the same thing.
    @use 'sass-module-map/map';

    Install

    npm i sass-module-map

    DownloadsWeekly Downloads

    2

    Version

    1.0.0

    License

    MIT

    Unpacked Size

    21 kB

    Total Files

    25

    Last publish

    Collaborators

    • roydukkey