Util

Utility functions

Source:

Methods

(static) getCssRules(elements) → {Array}

Get all the CSS rules that match the given elements Adapted from: https://stackoverflow.com/questions/2952667/find-all-css-rules-that-apply-to-an-element

Parameters:
Name Type Description
elements Array

Array of elements to get rules for

Source:

(static) sortForSlotting(links)

Sort some given array of Links in preparation for determining their slots (vertical intervals for overlapping/crossing Links). Needed because the order that the Parser puts Links in might not be the order we actually want:

  1. Primary sort by index of left endpoint, ascending
  2. Secondary sort by number of Words covered, descending
Parameters:
Name Type Description
links
Source:

(inner) difference(object, base) → {Object}

Deep diff between two object, using lodash

Parameters:
Name Type Description
object Object

Object compared

base Object

Object to compare with

Source: