processDelta static method

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

Implementation

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