[generate] handle methods with more than one namespace
This commit is contained in:
@ -75,11 +75,11 @@ module.exports = function (branch, done) {
|
|||||||
|
|
||||||
// collect the namespaces from the action locations
|
// collect the namespaces from the action locations
|
||||||
var namespaces = _.filter(_.map(actions, function (action) {
|
var namespaces = _.filter(_.map(actions, function (action) {
|
||||||
if (~action.location.indexOf('.')) {
|
return action.location
|
||||||
var path = action.location.split('.').slice(0, -1);
|
.split('.')
|
||||||
_.pull(path, 'prototype');
|
.slice(0, -1)
|
||||||
return path.join('.');
|
.filter(step => step !== 'prototype')
|
||||||
}
|
.join('.prototype.')
|
||||||
}));
|
}));
|
||||||
|
|
||||||
// seperate the proxy actions
|
// seperate the proxy actions
|
||||||
|
|||||||
@ -10,7 +10,12 @@ var api = module.exports = {};
|
|||||||
api._namespaces = <%= stringify(namespaces) %>;<%
|
api._namespaces = <%= stringify(namespaces) %>;<%
|
||||||
|
|
||||||
_.each(actions, function (action) {
|
_.each(actions, function (action) {
|
||||||
var namespace = action.location.split('.').shift();
|
const namespace = action.location
|
||||||
|
.split('.')
|
||||||
|
.slice(0, -1)
|
||||||
|
.filter(step => step !== 'prototype')
|
||||||
|
.join('.prototype.');
|
||||||
|
|
||||||
if (_.include(namespaces, namespace)) {
|
if (_.include(namespaces, namespace)) {
|
||||||
_.pull(namespaces, namespace);
|
_.pull(namespaces, namespace);
|
||||||
%>
|
%>
|
||||||
|
|||||||
Reference in New Issue
Block a user