Skip to content

Commit

Permalink
run prettier
Browse files Browse the repository at this point in the history
  • Loading branch information
dcousens committed Sep 20, 2023
1 parent 66da629 commit 8350057
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions packages/core/src/lib/assets/createFilesContext.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import { s3FileAssetsAPI } from './s3';
import type { FileAdapter } from './types';

// appends a random identifier to the filename so that people can't brute-force guess stored filenames
function defaultTransformName (path: string) {
function defaultTransformName(path: string) {
// this regex lazily matches for any characters that aren't a new line
// it then optionally matches the last instance of a "." symbol
// followed by any alphanumerical character before the end of the string
Expand All @@ -17,7 +17,7 @@ function defaultTransformName (path: string) {
const urlSafeName = name.replace(/[^A-Za-z0-9]/g, '-');
if (ext) return `${urlSafeName}-${id}${ext}`;
return `${urlSafeName}-${id}`;
};
}

export function createFilesContext(config: KeystoneConfig): FilesContext {
const adaptersMap = new Map<string, FileAdapter>();
Expand Down
4 changes: 2 additions & 2 deletions packages/core/src/lib/assets/createImagesContext.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@ import { localImageAssetsAPI } from './local';
import { s3ImageAssetsAPI } from './s3';
import { streamToBuffer } from './utils';

function defaultTransformName (path: string) {
function defaultTransformName(path: string) {
return randomBytes(12).toString('base64url').slice(0, 12);
};
}

async function getImageMetadataFromBuffer(buffer: Buffer) {
const fileType = await fileTypeFromBuffer(buffer);
Expand Down

0 comments on commit 8350057

Please sign in to comment.