Skip to content

Consider exposing calculateSpecificityOfSelectorObject #17

@bramus

Description

@bramus

As per request by @bartveneman on Twitter:

Would be nice to expose calculateSpecificityOfSelectorObject so we can avoid convertToAST -> typeof source -> source instanceof Object -> source.type == 'Selector'

const calculateSpecificityOfSelectorObject = (selectorObj) => {

This adds up quickly on several thousands of selectors like on our website.

Considered this in the past but hadn’t done set yet because I’m not too happy with the name of the function. Open to suggestions for a shorter - yet also clear - name. If no alternative can be found, then I’m fine with exposing as is.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions