This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /** | |
| * Returns an array of ad requests. Requires modern browsers. | |
| * [{ | |
| * correlator: '1978064853149162', | |
| * pageTargeting: { | |
| * key1: 'val1', | |
| * key2: 'val2', | |
| * }, | |
| * slots: [{ | |
| * sizes: [ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /** | |
| * We collect this data from the performance entries instead of directly from GPT because the targeting | |
| * can can change between requests. Pulling data from googletag after a refresh will only give you the | |
| * cuurent state of GPT. | |
| */ | |
| (() => { | |
| function getUrlParams(search) { | |
| let hashes = search.split('&').filter(item => { | |
| return /^enc_prev_ius|^iu_parts|^prev_iu_szs|^prev_scp|^cust_params|^correlator/.test(item); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /** | |
| * Gets the value deep within a path of object. | |
| * If at any point in the path the key does not exist. We return undefined. | |
| * If we have a default value and the path does not exist return that default value. | |
| * | |
| * This allows you to avoid constantly checking for properties along the way like | |
| * `this.state.wave && this.state.wave.data && this.state.wave.data.companyName` | |
| * | |
| * @example get(this, "state.wave.data.companyName") // can return undefined | |
| * @example get(this, "state.companyOptions", []); // always returns an array. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /** | |
| * Recursively an ancestor element with a matching attribute. | |
| **/ | |
| const findAncestor = (el, label) => { | |
| while ((el = el.parentElement) && !el.getAttribute(label)); | |
| return el.getAttribute(label); | |
| } | |
| /** | |
| * Retrieve the attribute or its ancestor attribute. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| javascript:(function()%7B var style %3D document.createElement(%27style%27), styleContent %3D document.createTextNode(%27* %7B outline: 1px solid gray !important%3B font-family: system !important%3B %7D body, span %7B background-color: turquoise !important%3B color: white !important%3B %7D a, a:visited, a:active %7B color: yellow !important%3B background-color: white !important%3B %7D a:hover %7B color: White !important%3B background-color: white !important%3B font-family: system !important%3B %7D input, img %7B border: 1px solid red !important%3B %7D input%5Btype%3Dbutton%5D %7B background-color: gray !important%3B font-family: system !important%3B %7D code, blockquote, pre, div, h1, h2, h3, h4, h5, h6 %7B background-color: red !important%3B color: yellow !important%3B %7D input %7B background-color: yellow !important%3B font-family: system !important%3B font-size: 200%25 !important%3B %7D %27)%3B style.appendChild(styleContent )%3B var caput %3D document.getElementsByTagName(%27head%27)%3B caput%5B0%5D.appe |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| describe("slugify()", () => { | |
| it("Must remove url encodings.", () => { | |
| const result = slugify("New%20York, NY"); | |
| expect(result).toBe("new-york-ny"); | |
| }); | |
| it("Must replace non-alphanumerics with dashes.", () => { | |
| const result = slugify("a@b"); | |
| expect(result).toBe("a-b"); | |
| }); |
OlderNewer