Hierarchy

  • Map<string, string>
    • Node

Constructors

  • New Node instance.

    Example

    const node = new Node;
    

    Parameters

    • Optional node: null | Node | IterableIterator<[string, string]> | readonly (readonly [string, string])[]

    Returns Node

Properties

#containSelectors: ProcessedAttributeSelectorI[] = []

Attribute selectors for names containing the value.

#endSelectors: ProcessedAttributeSelectorI[] = []

Attribute selectors for names ending with the value.

#last: string = ""

Last generated name.

#startSelectors: ProcessedAttributeSelectorI[] = []

Attribute selectors for names starting with the value.

[toStringTag]: string
size: number
[species]: MapConstructor

Methods

  • Private

    Generates a new string based on the last one in the current node instance.

    Returns string

  • Returns an iterable of entries in the map.

    Returns IterableIterator<[string, string]>

  • Add an attribute selector to be applied to the renaming process after this call.

    Example

    node = node.addAttributeSelector({
    operator: OPERATOR.EXACT_OR_BEGINS_FOLLOWED_BY_HYPHEN,
    value : "col",
    });

    Parameters

    Returns Node

  • Brings the node to its initial empty state.

    Example

    node = node.clear();
    

    Returns Node

  • Creates a clone of the current node instance.

    Example

    const clone = node.clone();
    

    Returns Node

  • Deletes the given name and returns true if it existed, otherwise returns false.

    Example

    const bool = node.delete("name");
    

    Parameters

    • name: string

    Returns boolean

  • Returns an iterable of key, value pairs for every entry in the map.

    Returns IterableIterator<[string, string]>

  • Parameters

    • callbackfn: ((value: string, key: string, map: Map<string, string>) => void)
        • (value: string, key: string, map: Map<string, string>): void
        • Parameters

          • value: string
          • key: string
          • map: Map<string, string>

          Returns void

    • Optional thisArg: any

    Returns void

  • Maps the given name to an already generated one or return the given name parameter.

    Example

    const name = node.get("name");
    

    Parameters

    • name: string

    Returns string

  • Checks whether the given name is already generated or not.

    Example

    const bool = node.has("name");
    

    Parameters

    • name: string

    Returns boolean

  • Returns an iterable of keys in the map

    Returns IterableIterator<string>

  • Optimize attribute selectors and name maps.

    Example

    node = node.optimize();
    

    Returns Node

  • Maps the given name to an already generated one or generate a new one.

    Example

    const name = node.rename("name");
    

    Parameters

    • name: string

    Returns string

  • Sets a replacement for the given name.

    Example

    node = node.set("name", "replacement");
    

    Parameters

    • name: string
    • replacement: string

    Returns Node

  • Returns an iterable of values in the map

    Returns IterableIterator<string>

Generated using TypeDoc