MCPcopy Create free account
hub / github.com/couchbase/sync_gateway / ottoValueToStringArray

Function ottoValueToStringArray

channels/sync_runner.go:265–274  ·  view source on GitHub ↗

Converts a JS string or array into a Go string array.

(ctx context.Context, value otto.Value)

Source from the content-addressed store, hash-verified

263
264// Converts a JS string or array into a Go string array.
265func ottoValueToStringArray(ctx context.Context, value otto.Value) []string {
266 nativeValue, _ := value.Export()
267
268 result, nonStrings := base.ValueToStringArray(nativeValue)
269
270 if !value.IsNull() && !value.IsUndefined() && nonStrings != nil {
271 base.WarnfCtx(ctx, "Channel names must be string values only. Ignoring non-string channels: %s", base.UD(nonStrings))
272 }
273 return result
274}
275
276func wrappedFuncSource(funcSource string) string {
277 return fmt.Sprintf(

Callers 3

NewSyncRunnerWithLoggingFunction · 0.85
addValueForUserMethod · 0.85

Calls 3

ValueToStringArrayFunction · 0.92
WarnfCtxFunction · 0.92
UDFunction · 0.92

Tested by 1