This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function mapToJson(map) { | |
return JSON.stringify([...map]); | |
} | |
function jsonToMap(jsonStr) { | |
return new Map(JSON.parse(jsonStr)); | |
} | |
function strMapToObj(strMap) { | |
let obj = Object.create(null); | |
for (let [k,v] of strMap) { | |
// We don’t escape the key '__proto__' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var knex = require('knex')({ | |
client: 'postgres', | |
connection: { | |
database: "bookshelf_487" | |
} | |
}); | |
var bookshelf = require('bookshelf')(knex); | |
var Model = bookshelf.Model.extend({ | |
tableName: 'test_table' | |
}); |