I could only imagine what the default:‘friend’ actually is on the backend.

  • lime!@feddit.nu
    link
    fedilink
    English
    arrow-up
    0
    ·
    1 month ago

    that format would mangle so many names. my legal name is my middle name, so it would fail. my grandfather’s first name was Jan Erik (with a space, it’s still a single name), it would fail on that. i know a guy named Göran, it would fail on that (ö is not an accented o, it is a separate letter, but it will slugify to o due to browsers being browsers).

    actually, come to think of it, wouldn’t this also mangle the default due to ‘friend’ not being properly capitalized?

    basically, we’ve learned nothing since ‘falsehoods programmers believe about names’. that was 14 years ago.

    • paraphrand@lemmy.world
      link
      fedilink
      English
      arrow-up
      0
      ·
      edit-2
      1 month ago

      Some systems define a slug as the part of a URL that identifies a page in human-readable keywords. It is usually the end part of the URL (specifically of the path / pathinfo part), which can be interpreted as the name of the resource, similar to the basename in a filename or the title of a page. The name is based on the use of the word slug in the news media to indicate a short name given to an article for internal use.

      • Sanctus@lemmy.worldOP
        link
        fedilink
        English
        arrow-up
        0
        ·
        1 month ago

        I’m really learning a lot by posting this! Thats interesting for sure. I think I’m just more than happy my own career never involves me in this side of tech lol

    • Sanctus@lemmy.worldOP
      link
      fedilink
      English
      arrow-up
      0
      ·
      1 month ago

      This is my best guess. I have never used it. NPM and JS are not fun for me. Like look at those dependencies.

      • SickDisturbence@lemmynsfw.com
        link
        fedilink
        English
        arrow-up
        0
        ·
        1 month ago

        Hmm, I see zero direct dependencies in that npm page. Were you looking at dependants? Packages that need the slug package?

  • dohpaz42@lemmy.world
    link
    fedilink
    English
    arrow-up
    0
    ·
    1 month ago

    There is no default:’friend on the backend. This is a template language that basically takes a first name, returns the first word, replaces any special characters with ASCII equivalent ones (e.g., ö => o), title cases it, and if it’s blank it will return ‘friend’ instead of an empty string.