• Creates a tag from a string.

    Parameters

    • str: string

      String to convert

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

      Additional options

      • OptionalallowInitialNumbers?: boolean

        If false, number prefix is removed.

      • OptionalallowUnderScore?: boolean

        If false, underscore is removed.

      • OptionalallowUpperCase?: boolean

        Do not forcibly lowercase everything.

      • OptionalcamelCase?: boolean

        Automatic camel case

      • Optionalreplacement?: 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