UNPKG

nanoid-good

Version:

Obscene words filter for nanoid

14 lines (12 loc) 336 B
var hasProfanity = require("./hasProfanity"); var wrapper = function (fn) { return function (locales) { return function () { while (true) { var id = fn.apply(this, arguments); if (!hasProfanity(locales)(id)) return id; } } }; }; module.exports = wrapper;