@metreeca/keep
    Preparing search index...
    • Mints a fresh, isolated clone of a sample resource.

      Lets conformance tests mint isolated fixtures whose identifiers are unlikely to collide with the sample dataset or with other generated fixtures sharing the same store.

      Derives the resource identity from shape: the kind: "id" property names the identifier entry and the trailing {code} slot of the id pattern names the code entry. The clone carries a random code of the same character classes as the original, a matching identifier, and reset audit timestamps.

      Type Parameters

      • R extends Resource

        The resource type of the sample, carried through to the clone

      Parameters

      • sample: R

        The resource to clone; an instance of shape

      • shape: Lazy<ResourceShape>

        The resource shape whose id entry and id pattern drive identity derivation

      Returns R

      The validated clone, carrying a freshly generated code, a matching identifier, and reset audit timestamps

      Error When shape declares no id entry or id pattern, the id pattern has no trailing slot, or sample is missing its identifier or code value

      TraceError When the clone fails validation against shape