File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -45,7 +45,7 @@ func ComponentSerialize(component interface{}) string {
4545 if cmap , ok := component .(map [string ]interface {}); ok {
4646 _component := map [string ]interface {}{}
4747 for k , v := range cmap {
48- if ! strings .HasPrefix (k , "internal:" ) {
48+ if ! strings .HasPrefix (k , "internal:" ) && ! strings . HasPrefix ( k , "private:" ) {
4949 _component [k ] = v
5050 }
5151 }
Original file line number Diff line number Diff line change @@ -55,13 +55,19 @@ func TestComponentSerialize(t *testing.T) {
5555 "internal:name" : "testcomponent" ,
5656 }
5757 obj2 := map [string ]interface {}{
58+ "private:name" : "testcomponent" ,
59+ }
60+ obj3 := map [string ]interface {}{
5861 "Foo" : "Bar" ,
5962 }
6063 // Check serialization
6164 if ComponentSerialize (obj1 ) == "eyJpbnRlcm5hbDpuYW1lIjoidGVzdGNvbXBvbmVudCJ9" {
6265 t .Error ("ComponentSerialize is not clearing internal variables" )
6366 }
64- if ComponentSerialize (obj2 ) != "eyJGb28iOiJCYXIifQ==" {
67+ if ComponentSerialize (obj2 ) == "eyJwcml2YXRlOm5hbWUiOiJ0ZXN0Y29tcG9uZW50In0=" {
68+ t .Error ("ComponentSerialize is not clearing internal variables" )
69+ }
70+ if ComponentSerialize (obj3 ) != "eyJGb28iOiJCYXIifQ==" {
6571 t .Error ("ComponentSerialize is not working correctly" )
6672 }
6773}
You can’t perform that action at this time.
0 commit comments