@nevware21/tripwire - v0.1.8
    Preparing search index...

    Function startsWithMembersFunc

    Export assertion functions

    • Asserts that the target starts with the expected members in order (consecutive from the beginning). Uses strict equality (===) for comparison. Both the target and expected values must conform to ArrayLikeOrSizedIterable but can be different concrete types.

      Type Parameters

      • R

      Parameters

      Returns R

      • The assert scope.

      0.1.5

      import { assert } from "@nevware21/tripwire";

      assert([1, 2, 3, 4]).has.startsWithMembers([1, 2]); // Passes - starts with [1, 2]
      assert([1, 2, 3, 4]).has.startsWithMembers([1, 2, 3]); // Passes - starts with [1, 2, 3]
      assert([1, 2, 3, 4]).has.startsWithMembers([2, 3]); // Fails - doesn't start with [2, 3]
      assert([1, 2, 3, 4]).has.startsWithMembers([1, 3]); // Fails - not consecutive from start
      assert(new Set([1, 2, 3, 4])).has.startsWithMembers([1, 2]); // Passes - different types