Skip to content

Latest commit

 

History

History
25 lines (16 loc) · 728 Bytes

api.attr.sort.md

File metadata and controls

25 lines (16 loc) · 728 Bytes

Sort Attributes Module

createOrderedAttributesComparator()

@mcaskill/html-build-attributes/attr/sort-ordered-attributes.js

Creates a comparison function to sort attributes alphabetically with support for regular expressions and a wildcard.

A standalone * represents all unspecified attributes, useful for inserting these at a specific index among the ordered attributes.

Syntax

import {
  createOrderedAttributesComparator
} from '@mcaskill/html-build-attributes/attr/sort-ordered-attributes.js';

createOrderedAttributesComparator(expectedOrder: string[]): function

Example

View example of sorting.