Skip to content

Instantly share code, notes, and snippets.

@maowug
Created February 28, 2016 08:14
Show Gist options
  • Save maowug/ea115b6766a3e5fe5e73 to your computer and use it in GitHub Desktop.
Save maowug/ea115b6766a3e5fe5e73 to your computer and use it in GitHub Desktop.
arguments de-constructing babel6
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}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment