diff --git a/lib/hook.js b/lib/hook.js index 31835cc..e53f8c8 100644 --- a/lib/hook.js +++ b/lib/hook.js @@ -2,8 +2,8 @@ module.exports = function flagpoleHook(sails) { - let moduleUtils = require('./utils/module-utils'); - let _ = require('lodash'); + var moduleUtils = require('./utils/module-utils'); + var _ = require('lodash'); return { @@ -25,7 +25,7 @@ module.exports = function flagpoleHook(sails) { }, loadModules: function (cb) { - let hook = this; + var hook = this; moduleUtils.loadResponses(sails, function loadedflagpoleResponseModules(err, responseDefs) { if (err) return cb(err); // Register responses as middleware diff --git a/lib/utils/model-utils.js b/lib/utils/model-utils.js index d3bad51..c8d119f 100644 --- a/lib/utils/model-utils.js +++ b/lib/utils/model-utils.js @@ -1,10 +1,10 @@ 'use strict'; -let pluralize = require('pluralize'); +var pluralize = require('pluralize'); // Only attributes which are not primary key ('id') or have an alias (relationship) exports.getOwnAttributes = function (Model) { - let ownAttrs = []; + var ownAttrs = []; Object.keys(Model.definition).forEach(function (key) { if (!Model.definition[key].primaryKey && !Model.definition[key].alias) { ownAttrs.push(key); @@ -24,7 +24,7 @@ exports.getRef = function (Model, cb) { // Only strips primary key ('id') exports.getAttributes = function (Model) { - let attrs = []; + var attrs = []; Object.keys(Model._attributes).forEach(function (key) { if (!Model._attributes[key].primaryKey) { attrs.push(key); @@ -40,9 +40,9 @@ exports.getModelName = function (req) { // Returns singular-ized model names of related models exports.getRelatedModelNames = function (req) { - let rels = []; + var rels = []; req.options.associations.forEach(function (assoc) { - let model = pluralize(assoc.alias, 1); + var model = pluralize(assoc.alias, 1); rels.push(model); }); return rels; diff --git a/lib/utils/module-utils.js b/lib/utils/module-utils.js index a34f021..10861e7 100644 --- a/lib/utils/module-utils.js +++ b/lib/utils/module-utils.js @@ -1,8 +1,8 @@ 'use strict'; -let buildDictionary = require('sails-build-dictionary'); -let path = require('path'); -let _ = require('lodash'); +var buildDictionary = require('sails-build-dictionary'); +var path = require('path'); +var _ = require('lodash'); function bindToSails(sails, cb) { return function (err, modules) {