@oazmi/kitchensink - v0.9.13
    Preparing search index...

    Function commonSuffix

    • find the longest common suffix among a list of inputs.

      for efficiency, this function simply reverses the character ordering of each input, and then uses commonPrefix.

      Parameters

      • inputs: string[]

      Returns string

      import { assertEquals as assertEq } from "jsr:@std/assert"

      assertEq(commonSuffix([
      "file:///C:/Hello/World/This/Is/An/Example/Bla.cs",
      "file:///C:/Hello/Users/This/Is-An/Example/Bla.cs",
      "file:///C:/Hello/Users/This/Is/YetAnother-An/Example/Bla.cs",
      "file:///C:/Hello/Earth/This/Is/Not/An/Example/Bla.cs",
      ]), "An/Example/Bla.cs")