string-overlap-one-on-another examples

Table of Contents

Quick Take

import { strict as assert } from "assert";
import { overlap } from "string-overlap-one-on-another";

assert.equal(
  overlap("aaa", "bbb", { offset: -2 }),
  "bbbaa"
);

Empty Strings

import { strict as assert } from "assert";
import { overlap } from "string-overlap-one-on-another";

assert.equal(
  overlap("", "456", {
    offset: 99,
    offsetFillerCharacter: "zzzz",
  }),
  "456"
);
// even though offset is long enough to warrant the filler, no characters
// are added to the "456" because the first argument string is empty.