1 (function (GCN) { 2 3 'use strict'; 4 5 /** 6 * Only grows, never shrinks. 7 * @private 8 * @type {number} 9 */ 10 var uniqueIdCounter = 0; 11 12 /** 13 * Generates a unique id with an optional prefix. 14 * 15 * The returned value is only unique among other returned values, 16 * not globally. 17 * 18 * @public 19 * @param {string} 20 * Optional prefix for the id to be generated. 21 * @return {string} 22 * Never the same string more than once. 23 */ 24 function uniqueId(prefix) { 25 return (prefix || '') + (++uniqueIdCounter); 26 } 27 28 function escapePropertyName(name) { 29 return name.replace(/\./g, '\\.'); 30 } 31 32 GCN.uniqueId = uniqueId; 33 GCN.escapePropertyName = escapePropertyName; 34 35 }(GCN)); 36