<commit_before>'use strict';

const _ = require('lodash');
const { toLower } = require('lodash/fp');

const createRouteScopeGenerator = namespace => route => {
  const prefix = namespace.endsWith('::') ? namespace : `${namespace}.`;

  if (typeof route.handler === 'string') {
    const [controller, action] = route.handler.split('.');

    _.defaultsDeep(route, {
      config: {
        auth: {
          scope: `${prefix}${controller}.${toLower(action)}`,
        },
      },
    });
  }
};

module.exports = strapi => {
  const registerAdminRoutes = () => {
    const generateRouteScope = createRouteScopeGenerator(`admin::`);

    strapi.admin.routes.forEach(route => {
      generateRouteScope(route);
      route.info = { pluginName: 'admin' };
    });<commit_msg>use camelCase comparison for up actions<commit_after>'use strict';

const _ = require('lodash');

const createRouteScopeGenerator = namespace => route => {
  const prefix = namespace.endsWith('::') ? namespace : `${namespace}.`;

  if (typeof route.handler === 'string') {
    const [controller, action] = route.handler.split('.');

    _.defaultsDeep(route, {
      config: {
        auth: {
          scope: `${prefix}${controller}.${action}`,
        },
      },
    });
  }
};

module.exports = strapi => {
  const registerAdminRoutes = () => {
    const generateRouteScope = createRouteScopeGenerator(`admin::`);

    strapi.admin.routes.forEach(route => {
      generateRouteScope(route);
      route.info = { pluginName: 'admin' };
    });
{'fraction_non_alphanumeric': 0.17600527356624918, 'fraction_numerical': 0.0, 'mean_word_length': 3.2521008403361344, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 13, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6340612', 'n_tokens_mistral': 444, 'n_tokens_neox': 443, 'n_words': 84}