Skip to content

Commit ec2f143

Browse files
xDivisionByZeroxmatthewmayer
authored andcommitted
refactor(system): replace mime db with common dataset (faker-js#1788)
1 parent a3c1575 commit ec2f143

File tree

7 files changed

+179
-8584
lines changed

7 files changed

+179
-8584
lines changed

docs/guide/upgrading.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -118,3 +118,7 @@ For the old `faker.datatype.number` method you should replace with `faker.number
118118
### `allowLeadingZeros` behavior change in `faker.string.numeric`
119119

120120
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.
121+
122+
### Simplified MIME type data
123+
124+
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.

package.json

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,6 @@
5959
"build": "run-s build:clean build:code build:types",
6060
"generate:api-docs": "tsx ./scripts/apidoc.ts",
6161
"generate:locales": "tsx ./scripts/generateLocales.ts",
62-
"copy:mime-types": "tsx ./scripts/copyMimeTypes.ts",
6362
"docs:build": "run-s docs:prepare docs:build:run",
6463
"docs:build:run": "vitepress build docs",
6564
"docs:build:ci": "run-s build docs:build",
@@ -107,7 +106,6 @@
107106
"eslint-plugin-jsdoc": "~39.6.7",
108107
"eslint-plugin-prettier": "~4.2.1",
109108
"glob": "~8.1.0",
110-
"mime-db": "~1.52.0",
111109
"npm-run-all": "~4.1.5",
112110
"picocolors": "~1.0.0",
113111
"prettier": "2.8.3",

pnpm-lock.yaml

Lines changed: 0 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

scripts/copyMimeTypes.ts

Lines changed: 0 additions & 37 deletions
This file was deleted.

src/definitions/system.ts

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,5 @@ export type SystemDefinitions = LocaleEntry<{
1919
* The mime-type entry details.
2020
*/
2121
export interface SystemMimeTypeEntryDefinitions {
22-
source?: string;
23-
extensions?: string[];
24-
compressible?: boolean;
25-
charset?: string;
22+
extensions: string[];
2623
}

0 commit comments

Comments
 (0)