Rename translateKeys to translateDataTypeKeys.
This commit is contained in:
parent
3ce35e1431
commit
781ac2bd12
|
@ -4,7 +4,7 @@
|
|||
* Module dependencies.
|
||||
*/
|
||||
var _cloneDeep = require('lodash.clonedeep');
|
||||
var translateKeys = require('./translate-keys');
|
||||
var translateDataTypeKeys = require('./translate-data-type-keys');
|
||||
|
||||
/**
|
||||
* Export the modelHelper singleton.
|
||||
|
@ -41,7 +41,7 @@ var modelHelper = module.exports = {
|
|||
}
|
||||
|
||||
// Change mismatched keys.
|
||||
prop = translateKeys(prop);
|
||||
prop = translateDataTypeKeys(prop);
|
||||
|
||||
// Assign this back to the properties object.
|
||||
properties[key] = prop;
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
|
||||
var debug = require('debug')('loopback-explorer:routeHelpers');
|
||||
var _cloneDeep = require('lodash.clonedeep');
|
||||
var translateKeys = require('./translate-keys');
|
||||
var translateDataTypeKeys = require('./translate-data-type-keys');
|
||||
var modelHelper = require('./model-helper');
|
||||
|
||||
/**
|
||||
|
@ -65,7 +65,7 @@ var routeHelper = module.exports = {
|
|||
});
|
||||
|
||||
// Translate LDL keys to Swagger keys.
|
||||
route.accepts = (route.accepts || []).map(translateKeys);
|
||||
route.accepts = (route.accepts || []).map(translateDataTypeKeys);
|
||||
|
||||
return route;
|
||||
},
|
||||
|
@ -91,7 +91,7 @@ var routeHelper = module.exports = {
|
|||
}
|
||||
|
||||
// Translate LDL keys to Swagger keys.
|
||||
route.returns = (route.returns || []).map(translateKeys);
|
||||
route.returns = (route.returns || []).map(translateDataTypeKeys);
|
||||
|
||||
// Convert `returns` into a single object for later conversion into an
|
||||
// operation object.
|
||||
|
|
|
@ -21,7 +21,7 @@ var KEY_TRANSLATIONS = {
|
|||
* @param {Object} object Object on which to change keys.
|
||||
* @return {Object} Translated object.
|
||||
*/
|
||||
module.exports = function translateKeys(object) {
|
||||
module.exports = function translateDataTypeKeys(object) {
|
||||
object = _cloneDeep(object);
|
||||
Object.keys(KEY_TRANSLATIONS).forEach(function(LDLKey){
|
||||
var val = object[LDLKey];
|
Loading…
Reference in New Issue