MCPcopy
hub / github.com/faker-js/faker / symbol

Method symbol

src/modules/string/index.ts:900–951  ·  view source on GitHub ↗

* Returns a string containing only special characters from the following list: * * ```txt * ! " # $ % & ' ( ) * + , - . / : ; < = > ? @ [ \ ] ^ _ ` { | } ~ * ``` * * @param length The length of the string to generate either as a fixed length or as a length range. Defaults to `1`.

(
    length:
      | number
      | {
          /**
           * The minimum length of the string to generate.
           */
          min: number;
          /**
           * The maximum length of the string to generate.
           */
          max: number;
        } = 1
  )

Source from the content-addressed store, hash-verified

898 * @since 8.0.0
899 */
900 symbol(
901 length:
902 | number
903 | {
904 /**
905 * The minimum length of the string to generate.
906 */
907 min: number;
908 /**
909 * The maximum length of the string to generate.
910 */
911 max: number;
912 } = 1
913 ): string {
914 return this.fromCharacters(
915 [
916 '!',
917 '"',
918 '#',
919 '$',
920 '%',
921 '&',
922 "'",
923 '(',
924 ')',
925 '*',
926 '+',
927 ',',
928 '-',
929 '.',
930 '/',
931 ':',
932 ';',
933 '<',
934 '=',
935 '>',
936 '?',
937 '@',
938 '[',
939 '\\',
940 ']',
941 '^',
942 '_',
943 '`',
944 '{',
945 '|',
946 '}',
947 '~',
948 ],
949 length
950 );
951 }
952}

Callers 1

string.spec.tsFile · 0.80

Calls 1

fromCharactersMethod · 0.95

Tested by

no test coverage detected