wildstar
    Preparing search index...

    Function relative

    • Returns the relative path from base to source, or null if not a subpath

      Parameters

      • base: string

        The base path

      • target: string

        The target path

      • OptionalcharCompare: CharCompare

        Optional custom code point comparison function

      Returns null | string

      The relative normalized path, or null if not a subpath

      • This function uses matches for subpath matching
      • Unlike standard implementations, this functions returns null when target is not a direct subpath of base
      relative('foo/bar', 'foo/bar/baz') // returns 'baz'
      relative('baz', 'foo/bar') // returns null