ac-file-extensions 2.0.21 → 2.0.24

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,47 @@
1
+ ## [2.0.24](https://github.com/admiralcloud/ac-file-extensions/compare/v2.0.23..v2.0.24) (2026-05-24 06:00:49)
2
+
3
+
4
+ ### Bug Fix
5
+
6
+
7
+ * **App:** Package updates | MP | [1285e96af7994733bf7c2f3bb767dae81ad5f620](https://github.com/admiralcloud/ac-file-extensions/commit/1285e96af7994733bf7c2f3bb767dae81ad5f620)
8
+ Package updates
9
+ Related issues: [browse/master#master](https://admiralcloud.atlassian.net/browse/master)
10
+ ### Tests
11
+
12
+
13
+ * **App:** Added initial tests | MP | [d5e299b34784141da6d861d1b06b0d933853b54c](https://github.com/admiralcloud/ac-file-extensions/commit/d5e299b34784141da6d861d1b06b0d933853b54c)
14
+ Added initial tests
15
+ Related issues: [browse/master#master](https://admiralcloud.atlassian.net/browse/master)
16
+ ### Documentation
17
+
18
+
19
+ * **App:** Added test badge | MP | [f37b714fede046bdf2be1a08415a1942e6f64aef](https://github.com/admiralcloud/ac-file-extensions/commit/f37b714fede046bdf2be1a08415a1942e6f64aef)
20
+ Added test badge
21
+ Related issues: [browse/master#master](https://admiralcloud.atlassian.net/browse/master)
22
+ ### Chores
23
+
24
+
25
+ * **App:** Added workflow for tests | MP | [f0fd5fae4ac0a57fbdc902a3e5847737cb4bd978](https://github.com/admiralcloud/ac-file-extensions/commit/f0fd5fae4ac0a57fbdc902a3e5847737cb4bd978)
26
+ Added Github workflow for tests
27
+ Related issues: [browse/master#master](https://admiralcloud.atlassian.net/browse/master)
28
+ ## [2.0.23](https://github.com/admiralcloud/ac-file-extensions/compare/v2.0.22..v2.0.23) (2026-04-24 18:54:26)
29
+
30
+
31
+ ### Bug Fix
32
+
33
+
34
+ * **App:** Package updates | MP | [d34a783a3381b98f02124abd2e14288a10932cea](https://github.com/admiralcloud/ac-file-extensions/commit/d34a783a3381b98f02124abd2e14288a10932cea)
35
+ Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
36
+ ## [2.0.22](https://github.com/admiralcloud/ac-file-extensions/compare/v2.0.21..v2.0.22) (2026-04-04 08:57:17)
37
+
38
+
39
+ ### Bug Fix
40
+
41
+
42
+ * **App:** Package updates | MP | [63bfe612705a52fdfe51229be009674a9e428efc](https://github.com/admiralcloud/ac-file-extensions/commit/63bfe612705a52fdfe51229be009674a9e428efc)
43
+ Package updates
44
+ Related issues: [browse/master#master](https://admiralcloud.atlassian.net/browse/master)
1
45
 
2
46
  ## [2.0.21](https://github.com/admiralcloud/ac-file-extensions/compare/v2.0.20..v2.0.21) (2026-03-21 11:41:21)
3
47
 
package/README.md CHANGED
@@ -1,4 +1,7 @@
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.
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.21",
4
+ "version": "2.0.24",
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)",
@@ -14,12 +14,12 @@
14
14
  ],
15
15
  "license": "MIT",
16
16
  "dependencies": {
17
- "ac-semantic-release": "^0.4.10",
18
- "lodash": "^4.17.23"
17
+ "ac-semantic-release": "^1.0.2",
18
+ "lodash": "^4.18.1"
19
19
  },
20
20
  "devDependencies": {
21
- "eslint": "^10.1.0",
22
- "globals": "^17.4.0"
21
+ "eslint": "^10.4.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
+ })