s-tablename
v0.4.0
Published
Normalize a string for use as a Redshift table
Downloads
4
Readme
tablename
Normalize a string or event for use as a Redshift table.
Installation
$ npm install s-tablename
Examples
describe('tablename(str)', function(){
it('should normalize the string', function(){
tablename('foo bar baz').should.equal('foo_bar_baz');
tablename('foo bar-baz').should.equal('foo_bar_baz');
tablename('foo bar baz').should.equal('foo_bar_baz');
tablename('View a Page').should.equal('View_a_Page');
})
})
describe('tablename(event)', function(){
it('should return tablename with schema', function(){
var s = tablename({
projectId: '12345',
action: 'Track',
event: 'View a Page'
});
s.should.equal('12345.View_a_Page');
})
})
License
MIT