processDelta static method

Delta? processDelta(
  1. Delta? delta,
  2. DeltaAttributesOptions options,
  3. bool overrideAttributesPassedByUser
)

Implementation

static Delta? processDelta(Delta? delta, qpdf.DeltaAttributesOptions options,
    bool overrideAttributesPassedByUser) {
  if (delta == null) return null;
  if (delta.isEmpty) return delta;
  final String json = qpdf
      .applyAttributesIfNeeded(
          json: jsonEncode(delta.toJson()),
          attr: options,
          overrideAttributes: overrideAttributesPassedByUser)
      .fixCommonErrorInsertsInRawDelta
      .withBrackets;
  return Delta.fromJson(jsonDecode(json));
}