How to use the ramda-adjunct.isString function in ramda-adjunct

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

github ahdinosaur / gyne / resources / util / generic.js View on Github external
const { name: resourceName, hasUpdate, idField, listField } = options

  assert(
    isString(resourceName),
    `docker-up/resources/generic.js: required string 'name', given: ${resourceName}`
  )
  assert(
    isBoolean(hasUpdate),
    `docker-up/resources/generic.js: required boolean 'hasUpdate', given: ${hasUpdate}`
  )
  assert(
    isString(idField),
    `docker-up/resources/generic.js: required string 'idField', given: ${idField}`
  )
  assert(
    isNil(listField) || isString(listField),
    `docker-up/resources/generic.js: optional string 'listField', given: ${listField}`
  )

  return function Resource (context) {
    const { docker, log } = context

    return {
      name: resourceName,
      create,
      down,
      inspect,
      list,
      up,
      // TODO implement update using remove and create
      update: hasUpdate ? update : () => Future.of(null),
      remove
github ahdinosaur / gyne / resources / util / generic.js View on Github external
function GenericResource (options) {
  const { name: resourceName, hasUpdate, idField, listField } = options

  assert(
    isString(resourceName),
    `docker-up/resources/generic.js: required string 'name', given: ${resourceName}`
  )
  assert(
    isBoolean(hasUpdate),
    `docker-up/resources/generic.js: required boolean 'hasUpdate', given: ${hasUpdate}`
  )
  assert(
    isString(idField),
    `docker-up/resources/generic.js: required string 'idField', given: ${idField}`
  )
  assert(
    isNil(listField) || isString(listField),
    `docker-up/resources/generic.js: optional string 'listField', given: ${listField}`
  )

  return function Resource (context) {
    const { docker, log } = context

    return {
      name: resourceName,
      create,
      down,
      inspect,
      list,
github ahdinosaur / gyne / resources / util / generic.js View on Github external
function GenericResource (options) {
  const { name: resourceName, hasUpdate, idField, listField } = options

  assert(
    isString(resourceName),
    `docker-up/resources/generic.js: required string 'name', given: ${resourceName}`
  )
  assert(
    isBoolean(hasUpdate),
    `docker-up/resources/generic.js: required boolean 'hasUpdate', given: ${hasUpdate}`
  )
  assert(
    isString(idField),
    `docker-up/resources/generic.js: required string 'idField', given: ${idField}`
  )
  assert(
    isNil(listField) || isString(listField),
    `docker-up/resources/generic.js: optional string 'listField', given: ${listField}`
  )

  return function Resource (context) {