How to use the sanctuary.env.concat function in sanctuary

To help you get started, we’ve selected a few sanctuary examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github node-gh / gh / src / cmd.ts View on Github external
import { getConfig, getUser } from './base'
import * as logger from './logger'
import {
    createGlobalConfig,
    getGlobalPackageJson,
    getUserHomePath,
    addPluginConfig,
} from './configs'
import { prepend, safeReaddir, safeImport, safeRealpath, safeWhich } from './fp'
import * as git from './git'
import { getGitHubInstance } from './github'

const testing = process.env.NODE_ENV === 'testing'

// Make Fluture Play nicely with Sanctuary
const S = create({ checkTypes: true, env: env.concat(flutureEnv) })

// Allow mutation of options when not testing
// https://immerjs.github.io/immer/docs/freezing
setAutoFreeze(testing)

Future.debugMode(testing)

interface CommandInterface {
    name: string
    isPlugin?: boolean
    DETAILS: {
        alias: string
        description: string
        commands: string
        options: object
        shorthands: object
github node-gh / gh / src / cmd.ts View on Github external
import { create, env } from 'sanctuary'
import * as updateNotifier from 'update-notifier'

import { getConfig, getUser } from './base'
import { createGlobalConfig, getGlobalPackageJson, getUserHomePath } from './configs'
import { prepend, safeReaddir, safeImport, safeRealpath, safeWhich } from './fp'
import * as git from './git'
import { getGitHubInstance } from './github'
import { spawnSync, execSyncInteractiveStream } from './exec'
import { readFileSync, writeFileSync } from 'fs'
import * as userhome from 'userhome'

const testing = process.env.NODE_ENV === 'testing'

// Make Fluture Play nicely with Sanctuary
const S = create({ checkTypes: true, env: env.concat(flutureEnv) })

// Allow mutation of options when not testing
// https://immerjs.github.io/immer/docs/freezing
setAutoFreeze(testing)

Future.debugMode(testing)

interface CommandInterface {
    name: string
    isPlugin?: boolean
    DETAILS: {
        alias: string
        description: string
        commands: string
        options: object
        shorthands: object
github Huemul / chimi / src / sanctuary.js View on Github external
const checkProps = R.allPass([
  propIsString('module'),
  optionalPropIsString('name'),
  optionalPropIsString('type'),
])

const isDepObject = R.both(isObject, checkProps)

const isDep = R.either(isString, isDepObject)

const chimiDependency = NullaryType('chimi/Dependency', '#', isDep)

const S = create({
  checkTypes: true,
  env: env.concat([chimiDependency]),
})

module.exports = S