chore: update prettier (#5412)
This commit is contained in:
committed by
GitHub
parent
46738492a0
commit
39f113715a
@ -601,7 +601,7 @@ describe('joi', () => {
|
||||
} as express.Request;
|
||||
const json = jest.fn();
|
||||
const status = jest.fn(() => ({ json }));
|
||||
const res: express.Response = ({ status } as unknown) as express.Response;
|
||||
const res: express.Response = { status } as unknown as express.Response;
|
||||
|
||||
joi(defaultSchema())(req, res, next);
|
||||
|
||||
|
@ -132,9 +132,7 @@ export function defaultSchema({ path = requiredString } = {}) {
|
||||
cmsLabelPrefix: Joi.string().optional(),
|
||||
entry: dataFile, // entry is kept for backwards compatibility
|
||||
dataFiles: Joi.array().items(dataFile),
|
||||
assets: Joi.array()
|
||||
.items(asset)
|
||||
.required(),
|
||||
assets: Joi.array().items(asset).required(),
|
||||
options: Joi.object({
|
||||
collectionName: Joi.string(),
|
||||
commitMessage: requiredString,
|
||||
@ -207,10 +205,7 @@ export function defaultSchema({ path = requiredString } = {}) {
|
||||
is: 'deleteFiles',
|
||||
then: defaultParams
|
||||
.keys({
|
||||
paths: Joi.array()
|
||||
.items(path)
|
||||
.min(1)
|
||||
.required(),
|
||||
paths: Joi.array().items(path).min(1).required(),
|
||||
options: Joi.object({
|
||||
commitMessage: requiredString,
|
||||
}).required(),
|
||||
|
@ -24,7 +24,7 @@ type FsOptions = {
|
||||
};
|
||||
|
||||
export function localFsMiddleware({ repoPath, logger }: FsOptions) {
|
||||
return async function(req: express.Request, res: express.Response) {
|
||||
return async function (req: express.Request, res: express.Response) {
|
||||
try {
|
||||
const { body } = req;
|
||||
|
||||
|
@ -123,7 +123,7 @@ describe('localGitMiddleware', () => {
|
||||
describe('localGitMiddleware', () => {
|
||||
const json = jest.fn();
|
||||
const status = jest.fn(() => ({ json }));
|
||||
const res: express.Response = ({ status } as unknown) as express.Response;
|
||||
const res: express.Response = { status } as unknown as express.Response;
|
||||
|
||||
const repoPath = '.';
|
||||
|
||||
|
@ -173,7 +173,7 @@ export function localGitMiddleware({ repoPath, logger }: GitOptions) {
|
||||
// we can only perform a single git operation at any given time
|
||||
const mutex = withTimeout(new Mutex(), 3000, new Error('Request timed out'));
|
||||
|
||||
return async function(req: express.Request, res: express.Response) {
|
||||
return async function (req: express.Request, res: express.Response) {
|
||||
let release;
|
||||
try {
|
||||
release = await mutex.acquire();
|
||||
@ -345,12 +345,8 @@ export function localGitMiddleware({ repoPath, logger }: GitOptions) {
|
||||
break;
|
||||
}
|
||||
case 'updateUnpublishedEntryStatus': {
|
||||
const {
|
||||
collection,
|
||||
slug,
|
||||
newStatus,
|
||||
cmsLabelPrefix,
|
||||
} = body.params as UpdateUnpublishedEntryStatusParams;
|
||||
const { collection, slug, newStatus, cmsLabelPrefix } =
|
||||
body.params as UpdateUnpublishedEntryStatusParams;
|
||||
const contentKey = generateContentKey(collection, slug);
|
||||
const cmsBranch = branchFromContentKey(contentKey);
|
||||
const description = statusToLabel(newStatus, cmsLabelPrefix || '');
|
||||
|
@ -3,10 +3,7 @@ import path from 'path';
|
||||
import { promises as fs } from 'fs';
|
||||
|
||||
function sha256(buffer: Buffer) {
|
||||
return crypto
|
||||
.createHash('sha256')
|
||||
.update(buffer)
|
||||
.digest('hex');
|
||||
return crypto.createHash('sha256').update(buffer).digest('hex');
|
||||
}
|
||||
|
||||
// normalize windows os path format
|
||||
|
Reference in New Issue
Block a user