in packages/dynamodb-auto-marshaller/src/Marshaller.ts [140:161]
public marshallValue(value: any): AttributeValue|undefined {
switch (typeof value) {
case 'boolean':
return {BOOL: value};
case 'number':
return {N: value.toString(10)};
case 'object':
return this.marshallComplexType(value);
case 'string':
return value ? {S: value} : this.handleEmptyString(value);
case 'undefined':
return undefined;
case 'function':
case 'symbol':
default:
if (this.onInvalid === 'throw') {
throw new Error(
`Cannot serialize values of the ${typeof value} type`
);
}
}
}