@guardian/editorial-newsletters-ts

0.0.1 • Public • Published

editorial-newsletters-ts

This library exports types and validation functions for the objects published by the Guardian editorial newsletters API.

The three type of "newsletter" objects, each with an "is" validation function:

  • NewsletterData - the full newsletter data model, as published on the /api/newsletters route
  • LegacyNewsletter - the legacy format for newsletter data, still consumed by existing projects and published on /api/legacy/newsletters
  • LegacyCancelledNewsletter - a variant the legacy format for newsletter data, representing a newsletter which is cancelled.

Running unit tests

Run nx test editorial-newsletters-ts to execute the unit tests via Jest.

Running lint

Run nx lint editorial-newsletters-ts to execute the lint via ESLint.

/@guardian/editorial-newsletters-ts/

    Package Sidebar

    Install

    npm i @guardian/editorial-newsletters-ts

    Weekly Downloads

    4

    Version

    0.0.1

    License

    none

    Unpacked Size

    4.61 kB

    Total Files

    12

    Last publish

    Collaborators

    • joecowton1
    • guardian-developers
    • akash1810
    • reetta
    • sndrs
    • mxdvl