UNPKG

kibana-123

Version:

Kibana is an open source (Apache Licensed), browser based analytics and search dashboard for Elasticsearch. Kibana is a snap to setup and start using. Kibana strives to be easy to get started with, while also being flexible and powerful, just like Elastic

16 lines (13 loc) 447 B
import { isPlainObject } from 'lodash'; export default function setHeaders(originalHeaders, newHeaders) { if (!isPlainObject(originalHeaders)) { throw new Error(`Expected originalHeaders to be an object, but ${typeof originalHeaders} given`); } if (!isPlainObject(newHeaders)) { throw new Error(`Expected newHeaders to be an object, but ${typeof newHeaders} given`); } return { ...originalHeaders, ...newHeaders }; }