wallet-core/node_modules/cache-base/utils.js

39 lines
675 B
JavaScript
Raw Normal View History

2017-08-14 05:01:11 +02:00
'use strict';
/**
* Module dependencies
*/
var utils = require('lazy-cache')(require);
var fn = require;
require = utils;
/**
* Lazily required module dependencies
*/
require('component-emitter', 'Emitter');
require('collection-visit', 'visit');
require('isobject', 'isObject');
require('unset-value', 'del');
require('get-value', 'get');
require('has-value', 'has');
require('set-value', 'set');
require('union-value', 'union');
require('to-object-path', 'toPath');
require = fn;
/**
* Cast val to an array
*/
utils.arrayify = function(val) {
return val ? (Array.isArray(val) ? val : [val]) : [];
};
/**
* Expose `utils` modules
*/
module.exports = utils;