clone method

  1. @override
ObjectNode clone({
  1. required bool keepParent,
  2. I18nLocale? locale,
})
override

Deep clones the node.

Implementation

@override
ObjectNode clone({required bool keepParent, I18nLocale? locale}) {
  final node = ObjectNode(
    path: path,
    rawPath: rawPath,
    modifiers: modifiers,
    comment: comment,
    entries: entries.map(
      (key, value) => MapEntry(
        key,
        value.clone(keepParent: keepParent, locale: locale),
      ),
    ),
    isMap: isMap,
  );
  if (keepParent && parent != null) {
    node.setParent(parent!);
  }
  node.setGenericType(genericType);
  if (interface != null) {
    node.setInterface(interface!);
  }
  return node;
}