Skip to content

refactor(system): replace mime db with common dataset #1788

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 13 commits into from
Jan 29, 2023
Merged
Show file tree
Hide file tree
Changes from 12 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions docs/guide/upgrading.md
Original file line number Diff line number Diff line change
Expand Up @@ -118,3 +118,7 @@ For the old `faker.datatype.number` method you should replace with `faker.number
### `allowLeadingZeros` behavior change in `faker.string.numeric`

The `allowLeadingZeros` boolean parameter in `faker.string.numeric` (in the new `string` module) now defaults to `true`. `faker.string.numeric` will now generate numeric strings that could have leading zeros by default.

### Simplified MIME type data

The functions `faker.system.mimeType`, `faker.system.fileType` and `faker.system.fileExt` now return data from a smaller set of more common MIME types, filetypes and extensions.
2 changes: 0 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,6 @@
"build": "run-s build:clean build:code build:types",
"generate:api-docs": "tsx ./scripts/apidoc.ts",
"generate:locales": "tsx ./scripts/generateLocales.ts",
"copy:mime-types": "tsx ./scripts/copyMimeTypes.ts",
"docs:build": "run-s docs:prepare docs:build:run",
"docs:build:run": "vitepress build docs",
"docs:build:ci": "run-s build docs:build",
Expand Down Expand Up @@ -107,7 +106,6 @@
"eslint-plugin-jsdoc": "~39.6.7",
"eslint-plugin-prettier": "~4.2.1",
"glob": "~8.1.0",
"mime-db": "~1.52.0",
"npm-run-all": "~4.1.5",
"picocolors": "~1.0.0",
"prettier": "2.8.3",
Expand Down
2 changes: 0 additions & 2 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

37 changes: 0 additions & 37 deletions scripts/copyMimeTypes.ts

This file was deleted.

5 changes: 1 addition & 4 deletions src/definitions/system.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,5 @@ export type SystemDefinitions = LocaleEntry<{
* The mime-type entry details.
*/
export interface SystemMimeTypeEntryDefinitions {
source?: string;
extensions?: string[];
compressible?: boolean;
charset?: string;
extensions: string[];
}
Loading