UNPKG

@jbrowse/core

Version:

JBrowse 2 core libraries used by plugins

20 lines (19 loc) 604 B
export function getDependencyArrayRef(obj) { if (!(obj instanceof Object) || typeof obj === 'function') { return obj; } const arr = []; for (const key in obj) { const value = obj[key]; const typeofValue = typeof value; if (!(typeofValue === 'string' || (typeofValue === 'number' && !isNaN(value)) || typeofValue === 'boolean' || value === undefined || value === null)) { return obj; } arr.push(`${key}:${typeofValue}_${value}`); } return `xSqLiJdLMd9s${arr.join('|')}`; }