File tree Expand file tree Collapse file tree 3 files changed +26
-3
lines changed Expand file tree Collapse file tree 3 files changed +26
-3
lines changed Original file line number Diff line number Diff line change @@ -18,6 +18,12 @@ unsafeMkProps :: forall val. String -> val -> Props
18
18
unsafeUnfoldProps :: forall vals. String -> { | vals } -> Props
19
19
```
20
20
21
+ #### ` unsafePrefixProps `
22
+
23
+ ``` purescript
24
+ unsafePrefixProps :: forall vals. String -> { | vals } -> Props
25
+ ```
26
+
21
27
#### ` unsafeFromPropsArray `
22
28
23
29
``` purescript
Original file line number Diff line number Diff line change @@ -22,7 +22,7 @@ function unsafeUnfoldProps(key) {
22
22
23
23
for ( var subprop in value ) {
24
24
if ( value . hasOwnProperty ( subprop ) ) {
25
- result [ subprop ] = value [ subprop ] ;
25
+ result [ subprop ] = value [ subprop ] ;
26
26
}
27
27
}
28
28
@@ -31,6 +31,21 @@ function unsafeUnfoldProps(key) {
31
31
}
32
32
exports . unsafeUnfoldProps = unsafeUnfoldProps ;
33
33
34
+ function unsafePrefixProps ( prefix ) {
35
+ return function ( value ) {
36
+ var result = { } ;
37
+
38
+ for ( var prop in value ) {
39
+ if ( value . hasOwnProperty ( prop ) ) {
40
+ result [ prefix + prop ] = value [ prop ] ;
41
+ }
42
+ }
43
+
44
+ return result ;
45
+ } ;
46
+ }
47
+ exports . unsafePrefixProps = unsafePrefixProps ;
48
+
34
49
function unsafeFromPropsArray ( props ) {
35
50
var result = { } ;
36
51
Original file line number Diff line number Diff line change @@ -8,13 +8,15 @@ foreign import unsafeMkProps :: forall val. String -> val -> Props
8
8
9
9
foreign import unsafeUnfoldProps :: forall vals . String -> { | vals } -> Props
10
10
11
+ foreign import unsafePrefixProps :: forall vals . String -> { | vals } -> Props
12
+
11
13
foreign import unsafeFromPropsArray :: forall props . Array Props -> props
12
14
13
15
aria :: forall ariaAttrs . { | ariaAttrs } -> Props
14
- aria = unsafeUnfoldProps " aria"
16
+ aria = unsafePrefixProps " aria- "
15
17
16
18
_data :: forall dataAttrs . { | dataAttrs } -> Props
17
- _data = unsafeUnfoldProps " data"
19
+ _data = unsafePrefixProps " data- "
18
20
19
21
style :: forall style . { | style } -> Props
20
22
style = unsafeUnfoldProps " style"
You can’t perform that action at this time.
0 commit comments