How to use the inflection.capitalize function in inflection

To help you get started, we’ve selected a few inflection examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github bootstrap-styled / ra-ui / src / components / detail / ShowGuesser.js View on Github external
const inferredElements = getElementsFromRecords(
        [record],
        showFieldTypes
      );
      const inferredChild = new InferredElement(
        showFieldTypes.show,
        null,
        inferredElements
      );

      process.env.NODE_ENV !== 'production' // eslint-disable-line
      // eslint-disable-next-line no-console
      && console.log(
        `Guessed Show:

export const ${inflection.capitalize(
    inflection.singularize(resource)
  )}Show = props => (
    
${inferredChild.getRepresentation()}
    
);`
      );
      this.setState({ inferredChild: inferredChild.getElement() }); // eslint-disable-line
    }
  }
github madhums / node-genem / lib / genem.js View on Github external
'    }',
    '  ))',
    '}'
  ];

  var consumerkey = 'consumerKey';
  var consumersec = 'consumerSecret';
  if (auth === 'facebook' || auth === 'github') {
    consumerkey = 'clientID';
    consumersec = 'clientSecret';
  }

  var authStrategy = [
    '',
    '  // use '+ auth +' strategy',
    '  passport.use(new '+ inflection.capitalize(auth) +'Strategy({',
    '      '+ consumerkey +': config.'+ auth +'.clientID,',
    '      '+ consumersec +': config.'+ auth +'.clientSecret,',
    '      callbackURL: config.'+ auth +'.callbackURL',
    '    },',
    '    function(token, tokenSecret, profile, done) {',
    '      User.findOne({ \''+ auth +'.id\': profile.id }, function (err, user) {',
    '        if (err) { return done(err) }',
    '        if (!user) {',
    '          user = new User({',
    '            name: profile.displayName,',
    '            username: profile.username,',
    '            provider: \''+ auth +'\',',
    '            '+ auth +': profile._json',
    '          })',
    '          user.save(function (err, user) {',
    '            if (err) console.log(err)',
github plus3network / hyena / test / document-getters-setters.js View on Github external
name: { type: 'string', set: function (v) {
         return inflection.capitalize(v);
       }}
      });
github plus3network / hyena / lib / document.js View on Github external
var buildStateGetter = function (state) {
  state = 'is'+inflection.capitalize(state);
  return function (path) {
    if(/\./.test(path) && this.constructor.validatePath(path)) {
      var parts = path.split('.');
      path = parts[0];
      var newPath = _.last(parts, parts.length-1).join('.');
      var subdoc = this.get(path);
      if (subdoc instanceof Document) {
        return subdoc[state](newPath);
      }
    }
    return this.pathStates[state](path);
  };
};
github MikeFielden / The-MEAN-Stack / db / controllers / AppController.js View on Github external
} else {
		switch (method) {
			case 'get':
				fn = 'getOne';
				break;

			case 'post':
				fn = 'update';
				break;

			case 'delete':
				fn = 'destroy';
				break;
		}

		controllerName = './' + inflection.capitalize(controller) + 'Controller';
	}

	controllerLibrary = require(controllerName);

	try {
		if (typeof controllerLibrary[fn] === 'function') {
			controllerLibrary[fn](req, res, next);
		} else {
			console.log(controllerName + " not a function");

			res.send(404);
		}
	} catch (error) {
		console.log(error);
		res.send(404);
	}
github madhums / node-genem / lib / genem.js View on Github external
function model (name, fields) {
  name = inflection.capitalize(name)

  var model = [
    '',
    '/**',
    ' * Module dependencies',
    ' */',
    '',
    'var mongoose = require(\'mongoose\')',
    '  , Schema = mongoose.Schema',
    '',
    'var '+ name +'Schema = new Schema({'
  ];

  var last = '';
  var schema = fields.map(function (field, index) {
    last = index == (fields.length - 1) ? '' : ',';
github postlight / lux / src / packages / compiler / utils / create-manifest.js View on Github external
    const formatSymbol = compose(str => str + capitalize(type), formatName)