"use strict"; // TODO: Move this to a stand-alone package, so that it can be reused elsewhere if (global.__objectID_map == null) { // Yes, these are deliberately global - we want to ensure that the same value gets the same assigned ID, regardless of where in the dependency tree this ID is obtained global.__objectID_map = new WeakMap(); global.__objectID_i = 0; } module.exports = function objectID(value) { if (!global.__objectID_map.has(value)) { global.__objectID_map.set(value, global.__objectID_i++); } return global.__objectID_map.get(value); };