INNER CODE UNIT · JavaScript
getSelectedMethods
diegohaz/rest · generators/api/index.js:23
var getSelectedMethods = function (props) {
return methods.filter(function (method) {
return props.methods.indexOf(method.value) !== -1;
});
};
var prompts = [{
type: 'input',
name: 'kebab',
message: 'What\'s the API name?',
default: 'some-entity'
}, {
type: 'input',
name: 'lowerSuffix',
message: 'Name is a reserved word, add suffix for lowercase identifier',
default: 'Obj',
when: function (props) {
return reservedWords.check(_.lowerCase(props.kebab), 6);