UNPKG
@mason-api/javascript-sdk
Version:
latest (3.3.0)
3.3.0
3.2.12
1.0.2
1.0.1
1.0.0
Mason component rendering library
@mason-api/javascript-sdk
/
src
/
transformations
/
submitForm.js
16 lines
(15 loc)
•
327 B
JavaScript
View Raw
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
import
_
from
'lodash'
;
import
update
from
'immutability-helper'
;
export
default
() =>
node
=>
{
if
(node.
p
.
_function
===
'submitForm'
) {
// we should replace this with type=submit attribute
return
update
(node, {
p
: {
$merge
: {
type
:
'submit'
, }, }, }); }
return
node; }