code: function stringToBundle(str: string, metadata: BundleMetadata): Bundle {
    const pre = str.slice(0, metadata.pre);
    const [offset, modules] = sliceModules(
      metadata.modules,
      str,
      // There's a line break after the pre segment, when it exists.
      pre.length > 0 ? pre.length + 1 : 0,
    );
    // We technically don't need the bundle post segment length, since it should
    // normally continue until the end.
    const post = str.slice(offset, offset + metadata.post);
  
    return {
      pre,
      post,
      modules,
    };
  }
docs: Parses a bundle from an embedded delta bundle.