Socket
Book a DemoInstallSign in
Socket

maasglobal-prelude-ts

Package Overview
Dependencies
Maintainers
1
Versions
14
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

maasglobal-prelude-ts

The maasglobal-prelude-ts npm package is a bundle of essential imports for TypeScript projects.

latest
Source
npmnpm
Version
0.0.13
Version published
Maintainers
1
Created
Source

MaaS Global Prelude for TypeScript Projects

The maasglobal-prelude-ts npm package is a bundle of essential imports for TypeScript projects.

Some convenience tools

import * as P from 'maasglobal-prelude-ts';

const x = 2;
const limit = 10;
const isOverLimit = P.ii(() => {
  if (x > limit) {
    return true;
  }
  return false;
});

Some basic tools from fp-ts

import * as P from 'maasglobal-prelude-ts';

const numbers = [1, 2, 3];
const doubled = P.pipe(
  numbers,
  P.Array_.map((x) => 2 * x),
);

const twoIsEven = P.do(P.Identity__)
  .bind('x', 2)
  .bindL('p', ({ x }) => (x % 2 ? 'odd' : 'even'))
  .return(({ x, p }) => `Number ${x} is ${p}.`);

Some basic codecs from io-ts

import * as P from 'maasglobal-prelude-ts';

const NumberArray = P.Array(P.number);
const onTheWire = JSON.stringify(NumberArray.encode([1, 2, 3]));
const atTheServer = NumberArray.decode(JSON.parse(onTheWire));

Keywords

prelude

FAQs

Package last updated on 19 Apr 2022

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.