react-hook-form 7.27.0 → 7.27.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -909,7 +909,9 @@ function unset(object, path) {
909
909
  if (currentPathsLength === index &&
910
910
  ((isObject(objectRef) && isEmptyObject(objectRef)) ||
911
911
  (Array.isArray(objectRef) &&
912
- !objectRef.filter((data) => (isObject(data) && !isEmptyObject(data)) || isBoolean(data)).length))) {
912
+ !objectRef.filter((data) => (isObject(data) && !isEmptyObject(data)) ||
913
+ isBoolean(data) ||
914
+ (Array.isArray(data) && data.length)).length))) {
913
915
  previousObjRef ? delete previousObjRef[item] : delete object[item];
914
916
  }
915
917
  previousObjRef = objectRef;