ac-file-extensions 2.0.23 → 2.0.25

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,19 @@
1
+ name: Test
2
+
3
+ on:
4
+ push:
5
+ pull_request:
6
+
7
+ permissions:
8
+ contents: read
9
+
10
+ jobs:
11
+ test:
12
+ runs-on: ubuntu-latest
13
+ steps:
14
+ - uses: actions/checkout@v4
15
+ - uses: actions/setup-node@v4
16
+ with:
17
+ node-version: 24
18
+ - run: yarn install --frozen-lockfile
19
+ - run: yarn test
package/CHANGELOG.md CHANGED
@@ -1,3 +1,38 @@
1
+ ## [2.0.25](https://github.com/admiralcloud/ac-file-extensions/compare/v2.0.24..v2.0.25) (2026-06-22 15:08:10)
2
+
3
+
4
+ ### Bug Fix
5
+
6
+
7
+ * **App:** Package updates | MP | [736a406f708b4c4c677ace17b0725fe1def4e41e](https://github.com/admiralcloud/ac-file-extensions/commit/736a406f708b4c4c677ace17b0725fe1def4e41e)
8
+ Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
9
+ ## [2.0.24](https://github.com/admiralcloud/ac-file-extensions/compare/v2.0.23..v2.0.24) (2026-05-24 06:00:49)
10
+
11
+
12
+ ### Bug Fix
13
+
14
+
15
+ * **App:** Package updates | MP | [1285e96af7994733bf7c2f3bb767dae81ad5f620](https://github.com/admiralcloud/ac-file-extensions/commit/1285e96af7994733bf7c2f3bb767dae81ad5f620)
16
+ Package updates
17
+ Related issues: [browse/master#master](https://admiralcloud.atlassian.net/browse/master)
18
+ ### Tests
19
+
20
+
21
+ * **App:** Added initial tests | MP | [d5e299b34784141da6d861d1b06b0d933853b54c](https://github.com/admiralcloud/ac-file-extensions/commit/d5e299b34784141da6d861d1b06b0d933853b54c)
22
+ Added initial tests
23
+ Related issues: [browse/master#master](https://admiralcloud.atlassian.net/browse/master)
24
+ ### Documentation
25
+
26
+
27
+ * **App:** Added test badge | MP | [f37b714fede046bdf2be1a08415a1942e6f64aef](https://github.com/admiralcloud/ac-file-extensions/commit/f37b714fede046bdf2be1a08415a1942e6f64aef)
28
+ Added test badge
29
+ Related issues: [browse/master#master](https://admiralcloud.atlassian.net/browse/master)
30
+ ### Chores
31
+
32
+
33
+ * **App:** Added workflow for tests | MP | [f0fd5fae4ac0a57fbdc902a3e5847737cb4bd978](https://github.com/admiralcloud/ac-file-extensions/commit/f0fd5fae4ac0a57fbdc902a3e5847737cb4bd978)
34
+ Added Github workflow for tests
35
+ Related issues: [browse/master#master](https://admiralcloud.atlassian.net/browse/master)
1
36
  ## [2.0.23](https://github.com/admiralcloud/ac-file-extensions/compare/v2.0.22..v2.0.23) (2026-04-24 18:54:26)
2
37
 
3
38
 
package/README.md CHANGED
@@ -1,12 +1,13 @@
1
1
  # AdmiralCloud File Extension List
2
+
3
+ [![Test](https://github.com/AdmiralCloud/ac-file-extensions/actions/workflows/test.yml/badge.svg)](https://github.com/AdmiralCloud/ac-file-extensions/actions/workflows/test.yml) [![CodeQL](https://github.com/AdmiralCloud/ac-file-extensions/actions/workflows/github-code-scanning/codeql/badge.svg)](https://github.com/AdmiralCloud/ac-file-extensions/actions/workflows/github-code-scanning/codeql)
4
+
2
5
  This little helper creates a list of file extensions including their "real" name and mimetype.
3
6
 
4
7
  Use it to determine mimetype from extenstion, a prettyfied name or vice versa.
5
8
 
6
9
  Currently support more than 300 file types.
7
10
 
8
- [![CodeQL](https://github.com/AdmiralCloud/ac-file-extensions/actions/workflows/github-code-scanning/codeql/badge.svg)](https://github.com/AdmiralCloud/ac-file-extensions/actions/workflows/github-code-scanning/codeql)
9
-
10
11
  # BREAKING CHANGES Version 2
11
12
  If you upgrade to version 2, please note that there a breaking changes. While version 1 only provided a list of file extensions, version 2 can be used to easily query extensions.
12
13
 
package/package.json CHANGED
@@ -1,11 +1,11 @@
1
1
  {
2
2
  "name": "ac-file-extensions",
3
3
  "repository": "https://github.com/AdmiralCloud/ac-file-extensions",
4
- "version": "2.0.23",
4
+ "version": "2.0.25",
5
5
  "description": "Creates a list of file extensions and their \"real\" names",
6
6
  "main": "index.js",
7
7
  "scripts": {
8
- "test": "echo \"Error: no test specified\" && exit 1",
8
+ "test": "node --test test.js",
9
9
  "postinstall": "node createFile.js"
10
10
  },
11
11
  "author": "Mark Poepping (https://www.admiralcloud.com)",
@@ -18,8 +18,8 @@
18
18
  "lodash": "^4.18.1"
19
19
  },
20
20
  "devDependencies": {
21
- "eslint": "^10.2.1",
22
- "globals": "^17.5.0"
21
+ "eslint": "^10.5.0",
22
+ "globals": "^17.6.0"
23
23
  },
24
24
  "packageManager": "yarn@1.22.22+sha512.a6b2f7906b721bba3d67d4aff083df04dad64c399707841b7acf00f6b133b7ac24255f2652fa22ae3534329dc6180534e98d17432037ff6fd140556e2bb3137e"
25
25
  }
package/test.js ADDED
@@ -0,0 +1,30 @@
1
+ const { test } = require('node:test')
2
+ const assert = require('node:assert/strict')
3
+
4
+ const acFileExtensions = require('./index')
5
+
6
+ test('query by ext returns correct entry', () => {
7
+ const result = acFileExtensions.query({ ext: 'jpg' })
8
+ assert.ok(result, 'should return a result')
9
+ assert.equal(result.ext, 'jpg')
10
+ assert.equal(result.mimetype, 'image/jpeg')
11
+ })
12
+
13
+ test('query by mimeType returns array of matching entries', () => {
14
+ const result = acFileExtensions.query({ mimeType: 'image/jpeg' })
15
+ assert.ok(Array.isArray(result), 'should return an array')
16
+ assert.ok(result.length > 0, 'should have at least one result')
17
+ assert.ok(result.every(r => r.mimetype === 'image/jpeg'), 'all entries should match mimeType')
18
+ })
19
+
20
+ test('query by unknown ext returns undefined', () => {
21
+ const result = acFileExtensions.query({ ext: 'thisdoesnotexist' })
22
+ assert.equal(result, undefined)
23
+ })
24
+
25
+ test('list returns full collection as array', () => {
26
+ const result = acFileExtensions.list()
27
+ assert.ok(Array.isArray(result), 'should return an array')
28
+ assert.ok(result.length > 0, 'collection should not be empty')
29
+ assert.ok(result.every(r => r.ext && r.mimetype), 'every entry should have ext and mimetype')
30
+ })