arguments de-constructing babel6

u.go
2016-02-28T08:14:27Z

de-constructing.js

|
| function isMessageAttributeValid ({DataType} = {}) {
|
| console.log(arguments)
|
| if (!DataType) {
|
| // throw new Error('A MessageAttribute must have a DataType key')
| }
| if (typeof DataType !== 'string') {
| // throw new Error('The DataType key of a MessageAttribute must be a String')
| }
| return true
| }
|
| isMessageAttributeValid(1)
| // {"0":1}