// Copyright (c) 2024-2026 Celestino Amoroso (celestino.amoroso@gmail.com).
// All rights reserved.

// cloner.go
package kern

type Cloner interface {
	Clone() Cloner
}

func IsCloner(v any) (ok bool) {
	_, ok = v.(Cloner)
	return
}

func Clone(a any) (clone any) {
	if IsCloner(a) {
		clone = a.(Cloner).Clone()
	} else {
		clone = a
	}
	return
}
