mirror of
https://github.com/hexastack/hexabot
synced 2025-06-26 18:27:28 +00:00
fix: feedback updates
This commit is contained in:
parent
e0508b388e
commit
73d9020455
@ -11,7 +11,7 @@
|
|||||||
import fs from 'fs';
|
import fs from 'fs';
|
||||||
import path from 'path';
|
import path from 'path';
|
||||||
|
|
||||||
import _ from 'lodash';
|
import escapeRegExp from 'lodash/escapeRegExp';
|
||||||
|
|
||||||
// Get the argument passed (e.g., "all-users-fr")
|
// Get the argument passed (e.g., "all-users-fr")
|
||||||
const arg: string | undefined = process.argv[2];
|
const arg: string | undefined = process.argv[2];
|
||||||
@ -27,7 +27,7 @@ const templatePath: string = path.join(__dirname, '../config/template.ts');
|
|||||||
|
|
||||||
// Check if a migration with the same name (excluding timestamp) already exists
|
// Check if a migration with the same name (excluding timestamp) already exists
|
||||||
const migrationExists: boolean = fs.readdirSync(migrationsDir).some((file) => {
|
const migrationExists: boolean = fs.readdirSync(migrationsDir).some((file) => {
|
||||||
const regex = new RegExp(`^[0-9]+-${_.escapeRegExp(arg)}\\.ts$`);
|
const regex = new RegExp(`^[0-9]+-${escapeRegExp(arg)}\\.ts$`);
|
||||||
return regex.test(file);
|
return regex.test(file);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -13,7 +13,7 @@ import {
|
|||||||
ArgumentMetadata,
|
ArgumentMetadata,
|
||||||
Logger,
|
Logger,
|
||||||
} from '@nestjs/common';
|
} from '@nestjs/common';
|
||||||
import _ from 'lodash';
|
import escapeRegExp from 'lodash/escapeRegExp';
|
||||||
import { TFilterQuery, Types } from 'mongoose';
|
import { TFilterQuery, Types } from 'mongoose';
|
||||||
|
|
||||||
import {
|
import {
|
||||||
@ -37,7 +37,7 @@ export class SearchFilterPipe<T>
|
|||||||
}
|
}
|
||||||
|
|
||||||
private getRegexValue(val: string) {
|
private getRegexValue(val: string) {
|
||||||
const escapedRegExp = _.escapeRegExp(val);
|
const escapedRegExp = escapeRegExp(val);
|
||||||
return new RegExp(escapedRegExp, 'i');
|
return new RegExp(escapedRegExp, 'i');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user