GithubHelp home page GithubHelp logo

Comments (4)

lramos15 avatar lramos15 commented on May 28, 2024 9

https://www.npmjs.com/package/@joaomoreno/unique-names-generator is a forked version Microsoft uses for the VS Code project with some of the more commonly offensive words removed. Feel free to use that instead, but there is no guarantees it will always be completely synced with the upstream project.

from unique-names-generator.

flavioespinoza avatar flavioespinoza commented on May 28, 2024 8

That is a very Woke opinion, but it is by no means fact.

If you want to exclude words on your apps you can do this:

import { uniqueNamesGenerator, Config, adjectives, animals } from 'unique-names-generator';
import stringHash from 'string-hash';

export function uniqueName(param1: string, param2: string | number, wordToExclude: string) {
  const seed = stringHash(`${param1}${param2}`);
  const customConfig: Config = {
    dictionaries: [adjectives, animals],
    separator: ' ',
    length: 2,
    style: 'capital',
    seed,
  };

  let name = uniqueNamesGenerator(customConfig);

  console.log(name); // Purring Swordfish <-------------------------------

  const split = name.split(' ');

  if (split[0] === wordToExclude) {
    name = `Woke ${split[1]}`;
  }

  return name;
}

const param1 = '4rq8r50988Fsdfaxcjvhlnxq1t4g379-rqeorg32';
const param2 = 1234565;

const appropriateWokeChildRandomName = uniqueName(param1, param2, 'Purring');

console.log(appropriateWokeChildRandomName); // Woke Swordfish <-------------------------------

My issue with your request is that you ask to remove sexual and any other similar (e.g. offensive) words.

It's not the job of an open source project to know which words you find offensive and then exclude them for the benefit of your app. Take responsibility for your needs, code a solution, or create your own NPM module where you control the words allowed.

from unique-names-generator.

flavioespinoza avatar flavioespinoza commented on May 28, 2024 5

Please leave the word sexual and any other words you see fit. I think adults can handle Sexual Damselfly.

from unique-names-generator.

burmecia avatar burmecia commented on May 28, 2024

But that will cause concerns for customer facing apps, imaging a children app send notification contains that word in url to users...

from unique-names-generator.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.