1package jwx
2
3import "github.com/lestrrat-go/option"
4
5type identUseNumber struct{}
6
7type Option = option.Interface
8
9type JSONOption interface {
10	Option
11	isJSONOption()
12}
13
14type jsonOption struct {
15	Option
16}
17
18func (o *jsonOption) isJSONOption() {}
19
20func newJSONOption(n interface{}, v interface{}) JSONOption {
21	return &jsonOption{option.New(n, v)}
22}
23
24// WithUseNumber controls whether the jwx package should unmarshal
25// JSON objects with the "encoding/json".Decoder.UseNumber feature on.
26//
27// Default is false.
28func WithUseNumber(b bool) JSONOption {
29	return newJSONOption(identUseNumber{}, b)
30}
31