2018-10-05 21:27:34 -04:00
|
|
|
package arrays
|
|
|
|
|
|
|
|
import (
|
|
|
|
"context"
|
2018-10-14 20:06:27 +03:00
|
|
|
|
2018-10-05 21:27:34 -04:00
|
|
|
"github.com/MontFerret/ferret/pkg/runtime/core"
|
|
|
|
)
|
|
|
|
|
2020-08-07 21:49:29 -04:00
|
|
|
// OUTERSECTION return the values that occur only once across all arrays specified.
|
2018-10-14 20:06:27 +03:00
|
|
|
// The element order is random.
|
2020-08-07 21:49:29 -04:00
|
|
|
// @param {Any[], repeated} arrays - An arbitrary number of arrays as multiple arguments (at least 2).
|
|
|
|
// @return {Any[]} - A single array with only the elements that exist only once across all provided arrays.
|
2018-10-05 21:27:34 -04:00
|
|
|
func Outersection(_ context.Context, args ...core.Value) (core.Value, error) {
|
|
|
|
return sections(args, 1)
|
|
|
|
}
|