不要怂,就是干,撸起袖子干!

Commit 28224cc3 by sdepold

toDefaultValue method

1 parent 586a854c
Showing with 11 additions and 2 deletions
var client = new (require("mysql").Client)() var client = new (require("mysql").Client)()
, util = require("util") , util = require("util")
, DataTypes = require("./data-types")
var Utils = module.exports = { var Utils = module.exports = {
_: (function() { _: (function() {
...@@ -71,23 +72,31 @@ var Utils = module.exports = { ...@@ -71,23 +72,31 @@ var Utils = module.exports = {
combineTableNames: function(tableName1, tableName2) { combineTableNames: function(tableName1, tableName2) {
return (tableName1.toLowerCase() < tableName2.toLowerCase()) ? (tableName1 + tableName2) : (tableName2 + tableName1) return (tableName1.toLowerCase() < tableName2.toLowerCase()) ? (tableName1 + tableName2) : (tableName2 + tableName1)
}, },
singularize: function(s) { singularize: function(s) {
return Utils.Lingo.en.isSingular(s) ? s : Utils.Lingo.en.singularize(s) return Utils.Lingo.en.isSingular(s) ? s : Utils.Lingo.en.singularize(s)
}, },
pluralize: function(s) { pluralize: function(s) {
return Utils.Lingo.en.isPlural(s) ? s : Utils.Lingo.en.pluralize(s) return Utils.Lingo.en.isPlural(s) ? s : Utils.Lingo.en.pluralize(s)
}, },
merge: function(a, b){ merge: function(a, b){
for(var key in b) { for(var key in b) {
a[key] = b[key] a[key] = b[key]
} }
return a return a
}, },
removeCommentsFromFunctionString: function(s) { removeCommentsFromFunctionString: function(s) {
s = s.replace(/\s*(\/\/.*)/g, '') s = s.replace(/\s*(\/\/.*)/g, '')
s = s.replace(/(\/\*[\n\r\s\S]*?\*\/)/mg, '') s = s.replace(/(\/\*[\n\r\s\S]*?\*\/)/mg, '')
return s return s
},
toDefaultValue: function(value) {
return (value == DataTypes.NOW) ? new Date() : value
} }
} }
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!