小编Cla*_*gos的帖子

javascript中表达式函数后面的括号有什么作用?

我在 NodeJS 上有这个模块:

const { cloneDeep, mapValues } = require('lodash');

module.exports = function(Sequelize) {
  return new ( function(Sequelize) {
    /* Preserve this pointer into forEach callbacks scope */
    var self = this;

    this.types = {
      'string'  : Sequelize.STRING,
      'text'    : Sequelize.TEXT,
      'integer' : Sequelize.INTEGER,
      'int'     : Sequelize.INTEGER,
      'decimal' : Sequelize.DECIMAL,
      'date'    : Sequelize.DATE,
      'boolean' : Sequelize.BOOLEAN,
    };

    /* Convert the Agence model Syntax to Sequelize syntax */

    this.parse = function(model) {

      /* Convert model Agence attributes to Sequelize types attribs …
Run Code Online (Sandbox Code Playgroud)

javascript function parentheses node.js sequelize.js

1
推荐指数
1
解决办法
88
查看次数