UNPKG

feathers-solr-node

Version:

Solr Adapter for Feathersjs. Base on Solr-client, so can also used as a Solr-client

24 lines (19 loc) 519 B
const util = {}; util.has = function(obj, key) { return key.split('.').every(function(x) { if (typeof obj !== 'object' || obj === null || !(x in obj)) { return false; } obj = obj[x]; return true; }); }; util.get = function get(obj, key) { return key.split('.').reduce(function(o, x) { return typeof o === 'undefined' || o === null ? o : o[x]; }, obj); }; util.isObject = function(item) { return item && typeof item === 'object' && !Array.isArray(item); }; module.exports = util;