1 |
- {"version":3,"sources":["../src/WarnSettings.js"],"names":["WarnSettings","warnedSettings","WeakMap","hasBeenWarned","context","setting","has","get","markSettingAsWarned","set","Set","add"],"mappings":";;;;;;;AAAA,MAAMA,YAAY,GAAG,YAAY;AAC/B;AACA,QAAMC,cAAc,GAAG,IAAIC,OAAJ,EAAvB;AAEA,SAAO;AACL;AACJ;AACA;AACA;AACA;AACA;AACIC,IAAAA,aAAa,CAAEC,OAAF,EAAWC,OAAX,EAAoB;AAC/B,aAAOJ,cAAc,CAACK,GAAf,CAAmBF,OAAnB,KAA+BH,cAAc,CAACM,GAAf,CAAmBH,OAAnB,EAA4BE,GAA5B,CAAgCD,OAAhC,CAAtC;AACD,KATI;;AAWLG,IAAAA,mBAAmB,CAAEJ,OAAF,EAAWC,OAAX,EAAoB;AACrC;AACA,UAAI,CAACJ,cAAc,CAACK,GAAf,CAAmBF,OAAnB,CAAL,EAAkC;AAChCH,QAAAA,cAAc,CAACQ,GAAf,CAAmBL,OAAnB,EAA4B,IAAIM,GAAJ,EAA5B;AACD;;AAEDT,MAAAA,cAAc,CAACM,GAAf,CAAmBH,OAAnB,EAA4BO,GAA5B,CAAgCN,OAAhC;AACD;;AAlBI,GAAP;AAoBD,CAxBD;;eA0BeL,Y","sourcesContent":["const WarnSettings = function () {\n /** @type {WeakMap<object, Set<string>>} */\n const warnedSettings = new WeakMap();\n\n return {\n /**\n * Warn only once for each context and setting\n *\n * @param {object} context\n * @param {string} setting\n */\n hasBeenWarned (context, setting) {\n return warnedSettings.has(context) && warnedSettings.get(context).has(setting);\n },\n\n markSettingAsWarned (context, setting) {\n // istanbul ignore else\n if (!warnedSettings.has(context)) {\n warnedSettings.set(context, new Set());\n }\n\n warnedSettings.get(context).add(setting);\n },\n };\n};\n\nexport default WarnSettings;\n"],"file":"WarnSettings.js"}
|