Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

fluture-sanctuary-types

Package Overview
Dependencies
Maintainers
3
Versions
24
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

fluture-sanctuary-types

Fluture type definitions for Sanctuary

  • 7.1.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
29K
increased by45.17%
Maintainers
3
Weekly downloads
 
Created
Source

fluture-sanctuary-types

Fluture type definitions for Sanctuary.

Usage

Node

$ npm install --save fluture-sanctuary-types

Note that you also need Fluture and sanctuary-def installed. Sanctuary-def comes preinstalled with Sanctuary, so you could install either one. Fluture has to be installed separately. See package.json for compatible versions (defined in peerDependencies).

On Node 12 and up, this module can be loaded directly with import or require. On Node versions below 12, require or the esm-loader can be used.

import $ from 'sanctuary-def';
import sanctuary from 'sanctuary';
import {env, FutureType} from 'fluture-sanctuary-types/index.js';
import {resolve} from 'fluture/index.js';

const S = sanctuary.create ({
  checkTypes: process.env.NODE_ENV !== 'production',
  env: sanctuary.env.concat (env)
});

S.is (FutureType ($.String) ($.Number)) (resolve (42));

Deno and Modern Browsers

You can load the EcmaScript module from various content delivery networks:

Old Browsers and Code Pens

There's a UMD file included in the NPM package, also available via jsDelivr: https://cdn.jsdelivr.net/npm/fluture-sanctuary-types@7.1.0/dist/umd.js

This file adds flutureSanctuaryTypes to the global scope, or use CommonJS/AMD when available.

const $ = require ('sanctuary-def');
const sanctuary = require ('sanctuary');
const {env, FutureType} = require ('fluture-sanctuary-types');
const {resolve} = require ('fluture');

const S = sanctuary.create ({
  checkTypes: process.env.NODE_ENV !== 'production',
  env: sanctuary.env.concat (env)
});

S.is (FutureType ($.String) ($.Number)) (resolve (42));
FutureType :: Type -⁠> Type -⁠> Type

The binary type constructor for members of Future.

> $.test (env)
.        (FutureType ($.String) ($.Number))
.        (Future['fantasy-land/of'] (1));
true
ConcurrentFutureType :: Type -⁠> Type -⁠> Type

The binary type constructor for members of ConcurrentFuture.

> $.test (env)
.        (ConcurrentFutureType ($.String) ($.Number))
.        (Par['fantasy-land/of'] (1));
true
env :: Array Type

An Array containing all types applied to $.Unknown for direct use as a Sanctuary environment, as shown in Usage.

Keywords

FAQs

Package last updated on 06 Apr 2021

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

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc