mirror of
https://github.com/zitadel/zitadel.git
synced 2024-12-15 04:18:01 +00:00
15 lines
337 B
Go
15 lines
337 B
Go
|
package object
|
||
|
|
||
|
import "github.com/dop251/goja"
|
||
|
|
||
|
func objectFromFirstArgument(call goja.FunctionCall, runtime *goja.Runtime) *goja.Object {
|
||
|
if len(call.Arguments) != 1 {
|
||
|
panic("exactly one argument expected")
|
||
|
}
|
||
|
object := call.Arguments[0].ToObject(runtime)
|
||
|
if object == nil {
|
||
|
panic("unable to unmarshal arg")
|
||
|
}
|
||
|
return object
|
||
|
}
|