mirror of
https://github.com/gohugoio/hugo.git
synced 2025-08-18 21:11:19 +02:00
@@ -54,7 +54,7 @@ func New(fs *filesystems.SourceFilesystem, rs *resources.Spec) *Client {
|
||||
}
|
||||
|
||||
type buildTransformation struct {
|
||||
optsm map[string]interface{}
|
||||
optsm map[string]any
|
||||
c *Client
|
||||
}
|
||||
|
||||
@@ -205,7 +205,7 @@ func (t *buildTransformation) Transform(ctx *resources.ResourceTransformationCtx
|
||||
}
|
||||
|
||||
// Process process esbuild transform
|
||||
func (c *Client) Process(res resources.ResourceTransformer, opts map[string]interface{}) (resource.Resource, error) {
|
||||
func (c *Client) Process(res resources.ResourceTransformer, opts map[string]any) (resource.Resource, error) {
|
||||
return res.Transform(
|
||||
&buildTransformation{c: c, optsm: opts},
|
||||
)
|
||||
|
@@ -71,14 +71,14 @@ type Options struct {
|
||||
Inject []string
|
||||
|
||||
// User defined symbols.
|
||||
Defines map[string]interface{}
|
||||
Defines map[string]any
|
||||
|
||||
// Maps a component import to another.
|
||||
Shims map[string]string
|
||||
|
||||
// User defined params. Will be marshaled to JSON and available as "@params", e.g.
|
||||
// import * as params from '@params';
|
||||
Params interface{}
|
||||
Params any
|
||||
|
||||
// What to use instead of React.createElement.
|
||||
JSXFactory string
|
||||
@@ -106,7 +106,7 @@ type Options struct {
|
||||
tsConfig string
|
||||
}
|
||||
|
||||
func decodeOptions(m map[string]interface{}) (Options, error) {
|
||||
func decodeOptions(m map[string]any) (Options, error) {
|
||||
var opts Options
|
||||
|
||||
if err := mapstructure.WeakDecode(m, &opts); err != nil {
|
||||
@@ -269,7 +269,7 @@ func createBuildPlugins(c *Client, opts Options) ([]api.Plugin, error) {
|
||||
params := opts.Params
|
||||
if params == nil {
|
||||
// This way @params will always resolve to something.
|
||||
params = make(map[string]interface{})
|
||||
params = make(map[string]any)
|
||||
}
|
||||
|
||||
b, err := json.Marshal(params)
|
||||
|
@@ -33,7 +33,7 @@ import (
|
||||
func TestOptionKey(t *testing.T) {
|
||||
c := qt.New(t)
|
||||
|
||||
opts := map[string]interface{}{
|
||||
opts := map[string]any{
|
||||
"TargetPath": "foo",
|
||||
"Target": "es2018",
|
||||
}
|
||||
|
Reference in New Issue
Block a user