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

Commit 28224cc3 by sdepold

toDefaultValue method

1 parent 586a854c
Showing with 9 additions and 0 deletions
var client = new (require("mysql").Client)()
, util = require("util")
, DataTypes = require("./data-types")
var Utils = module.exports = {
_: (function() {
......@@ -71,23 +72,31 @@ var Utils = module.exports = {
combineTableNames: function(tableName1, tableName2) {
return (tableName1.toLowerCase() < tableName2.toLowerCase()) ? (tableName1 + tableName2) : (tableName2 + tableName1)
},
singularize: function(s) {
return Utils.Lingo.en.isSingular(s) ? s : Utils.Lingo.en.singularize(s)
},
pluralize: function(s) {
return Utils.Lingo.en.isPlural(s) ? s : Utils.Lingo.en.pluralize(s)
},
merge: function(a, b){
for(var key in b) {
a[key] = b[key]
}
return a
},
removeCommentsFromFunctionString: function(s) {
s = s.replace(/\s*(\/\/.*)/g, '')
s = s.replace(/(\/\*[\n\r\s\S]*?\*\/)/mg, '')
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!