github-pages-deploy-action/node_modules/eslint-plugin-jsdoc/dist/WarnSettings.js
2020-03-31 08:40:00 -04:00

36 lines
857 B
JavaScript

"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = void 0;
const WarnSettings = function WarnSettings() {
/** @type {WeakMap<object, Set<string>>} */
const warnedSettings = new WeakMap();
return {
/**
* Warn only once for each context and setting
*
* @param {object} context
* @param {string} setting
*/
hasBeenWarned(context, setting) {
return warnedSettings.has(context) && warnedSettings.get(context).has(setting);
},
markSettingAsWarned(context, setting) {
if (!warnedSettings.has(context)) {
warnedSettings.set(context, new Set());
}
warnedSettings.get(context).add(setting);
}
};
};
var _default = WarnSettings;
exports.default = _default;
module.exports = exports.default;
//# sourceMappingURL=WarnSettings.js.map