<commit_before>'use strict';

const { has, omit, isArray } = require('lodash/fp');
const { ApplicationError } = require('@strapi/utils').errors;
const { getService } = require('../utils');

const LOCALE_QUERY_FILTER = 'locale';
const SINGLE_ENTRY_ACTIONS = ['findOne', 'update', 'delete'];
const BULK_ACTIONS = ['delete'];

const paramsContain = (key, params) => {
  return (
    has(key, params.filters) ||
    (isArray(params.filters) && params.filters.some(clause => has(key, clause)))
  );
};
<commit_msg>Fix bulk delete for non-default locales<commit_after>'use strict';

const { has, get, omit, isArray } = require('lodash/fp');
const { ApplicationError } = require('@strapi/utils').errors;
const { getService } = require('../utils');

const LOCALE_QUERY_FILTER = 'locale';
const SINGLE_ENTRY_ACTIONS = ['findOne', 'update', 'delete'];
const BULK_ACTIONS = ['delete'];

const paramsContain = (key, params) => {
  return (
    has(key, params.filters) ||
    (isArray(params.filters) && params.filters.some(clause => has(key, clause))) ||
    (isArray(get('$and', params.filters)) && params.filters.$and.some(clause => has(key, clause)))
  );
};

{'fraction_non_alphanumeric': 0.1894005212858384, 'fraction_numerical': 0.0, 'mean_word_length': 5.193548387096774, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 8, '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': '1115500', 'n_tokens_mistral': 382, 'n_tokens_neox': 378, 'n_words': 81}