How to use the baobab.Cursor function in baobab

To help you get started, we’ve selected a few baobab 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 Yomguithereal / baobab-react / src / utils / type.js View on Github external
/**
 * Baobab-React Type Checking
 * ===========================
 *
 * Some helpers to perform runtime validations.
 */
var Baobab = require('baobab');

var Cursor = Baobab.Cursor;

var type = {};

type.object = function(value) {
  return value &&
         typeof value === 'object' &&
         !Array.isArray(value) &&
         !(value instanceof Date) &&
         !(value instanceof RegExp);
};

type.baobab = function(value) {
  return value instanceof Baobab;
};

type.cursor = function(value) {

baobab

JavaScript persistent data tree with cursors.

MIT
Latest version published 4 years ago

Package Health Score

56 / 100
Full package analysis