• Creates a tag from a string.

    Parameters

    • str: string

      String to convert

    • Optionaloptions: {
          allowInitialNumbers: undefined | boolean;
          allowUnderScore: undefined | boolean;
          allowUpperCase: undefined | boolean;
          camelCase: undefined | boolean;
          replacement: undefined | string | Function;
      } = {}

      Additional options

      • allowInitialNumbers: undefined | boolean

        If false, number prefix is removed.

      • allowUnderScore: undefined | boolean

        If false, underscore is removed.

      • allowUpperCase: undefined | boolean

        Do not forcibly lowercase everything.

      • camelCase: undefined | boolean

        Automatic camel case

      • replacement: undefined | string | Function

        Replacement for disallowed characters.

    Returns string

    • String suitable as a tag
    pf1.utils.createTag("Wizard of Oz 2"); // => "wizardOfOz2"
    pf1.utils.createTag("Wizard of Oz 2", {camelCase:false}); // => wizardofoz2
    pf1.utils.createTag("Wizard of Oz 2", {camelCase:false,allowUpperCase:true}); // => WizardofOz2
    pf1.utils.createTag("d'Artagnan"); // => dartagnan
    pf1.utils.createTag("d'Artagnan", {allowUpperCase:true}); // => dArtagnan