<h1 align="center">DSC JS Utils</h1>
<h5 align="center">Browser JS utility scripts</h5>

---

<p align="center">
  <a href="https://github.com/dollarshaveclub/js-utils/#folders">Folders</a>&nbsp;&nbsp;
  <a href="https://github.com/dollarshaveclub/js-utils/#usage">Usage</a>&nbsp;&nbsp;
  <a href="https://github.com/dollarshaveclub/js-utils/#analytics">Analytics</a>&nbsp;&nbsp;
  <a href="https://github.com/dollarshaveclub/js-utils/#publishing">Publishing</a>&nbsp;&nbsp;
  <a href="https://github.com/dollarshaveclub/js-utils/tree/master/isomorphic/README.md">Isomorphic Docs</a>&nbsp;&nbsp;
   <a href="https://github.com/dollarshaveclub/js-utils/">Back</a>
</p>

---

### Browser Scripts

The files listed below are scripts located within the [browser folder](https://github.com/dollarshaveclub/js-utils/tree/master/browser) of this repository. They're meant for being used within a web browser.

---

- **analytics (Folder)**
  - Scripts in the analytics folder and specific for analytics.
  - **`conditionals.js`**
    - conditional functions
  - **`index.js`**
    - loads analytics
  - **`scripts.js`**
    - loads staging or production DTM scripts
- **`bootstrap-data.js`**
  - loads data—like study a/b tests
- **`cookie-banner.js`**
  - loads banner
- **`features.js`**
  - `gets` and `sets` features
- **`format-date-text.js`**
  - Format Date Text (formatDateText) formats a [date](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date) based on date for any locale using JavaScript's native [INTL](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl) api
- **`format-price-text.js`**
  - Format Price Text (formatPriceText) formats a [price number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/NumberFormat) based on price for any locale using JavaScript's native [INTL](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl) api
- **`konami.js`**
  - allows us to use the Konami Code
- **`load-scripts.js`**
  - adds scripts in `<script>` tags to the document
- **`local-storage.js`**, **`local-storage.d.ts`**
  - gets, checks, gets, sets, or removes localStorage items
- **`preferred-country-code.js`**
  - loads the correct country code
- **`resolve-from-fixtures-or-context.js`**
  - resolves environment and shop code
