Socket
Book a DemoInstallSign in
Socket

cerebral-url-scheme-compiler

Package Overview
Dependencies
Maintainers
1
Versions
16
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

cerebral-url-scheme-compiler

A url scheme compiler for Cerebral

latest
Source
npmnpm
Version
0.5.3
Version published
Maintainers
1
Created
Source

cerebral-url-scheme-compiler Build Status

The url scheme compiler for Cerebral

getCompiler

converts a path URL into an efficient getter function

import getCompiler from 'cerebral-url-scheme-compiler/get';

// some action factory
export default function (fromPath) {
  // "compile" the fromPath into a getValue function
  const getValue = getCompiler(fromPath);
  // return an action
  return function myAction (args) {
    let value = getValue(args);
    // do something with value ...
  }
}

setCompiler

converts a path URL into an efficient setter function

import setCompiler from 'cerebral-url-scheme-compiler/set';

// some action factory
export default function (toPath) {
  // "compile" the toPath into a setValue function
  const setValue = setCompiler(toPath);
  // return an action
  return function myAction (args) {
    // do something to get the value
    setValue(args, value);
  }
}

Contribute

Fork repo

  • npm install
  • npm start runs dev mode which watches for changes and auto lints, tests and builds
  • npm test runs the tests
  • npm run lint lints the code
  • npm run build compiles es6 to es5

Keywords

cerebral

FAQs

Package last updated on 18 Oct 2016

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