UNPKG

@jbrowse/core

Version:

JBrowse 2 core libraries used by plugins

25 lines (24 loc) 707 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.default = idMaker; const _1 = require("./"); function idMaker(args, id = '', len = 5000) { const stack = [args]; while (stack.length) { const obj = stack.pop(); for (const [key, val] of Object.entries(obj)) { if (id.length > len) { return (0, _1.hashCode)(id); } else { if (typeof val === 'object' && val !== null) { stack.push(val); } else { id += `${key}-${val}`; } } } } return `adp-${(0, _1.hashCode)(id)}`; }