ac-file-extensions 1.2.0 → 2.0.2

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.
package/.acsemver.js CHANGED
@@ -1,9 +1,9 @@
1
1
  module.exports = {
2
2
  repository: {
3
- url: 'https://github.com/mmpro/ac-file-extensions'
3
+ url: 'https://github.com/admiralcloud/ac-file-extensions'
4
4
  },
5
5
  jira: {
6
- url: 'https://mmpro.atlassian.net'
6
+ url: 'https://admiralcloud.atlassian.net'
7
7
  },
8
8
  changelogFile: __dirname + '/CHANGELOG.md',
9
9
  sections: [
package/CHANGELOG.md CHANGED
@@ -0,0 +1,43 @@
1
+ <a name="2.0.2"></a>
2
+
3
+ ## [2.0.2](https://github.com/admiralcloud/ac-file-extensions/compare/v2.0.1..v2.0.2) (2022-01-20 15:25:01)
4
+
5
+
6
+ ### Bug Fix
7
+
8
+ * **App:** Add support for avif extension | VD | [064b109d53237f32bbeeb1dc70c51d107a76e694](https://github.com/admiralcloud/ac-file-extensions/commit/064b109d53237f32bbeeb1dc70c51d107a76e694)
9
+ Add support for avif extension
10
+ <a name="2.0.1"></a>
11
+
12
+ ## [2.0.1](https://github.com/admiralcloud/ac-file-extensions/compare/v2.0.0..v2.0.1) (2022-01-20 13:21:55)
13
+
14
+
15
+ ### Bug Fix
16
+
17
+ * **App:** Add support for webp extension | VD | [8dc0e60eafb745130ad6e0e209d19c73a47218d6](https://github.com/admiralcloud/ac-file-extensions/commit/8dc0e60eafb745130ad6e0e209d19c73a47218d6)
18
+ Add support for webp extension
19
+ Related issues: [browse/AC-2507#AC-2507](https://admiralcloud.atlassian.net/browse/AC-2507)
20
+ <a name="2.0.0"></a>
21
+
22
+ # [2.0.0](https://github.com/admiralcloud/ac-file-extensions/compare/v1.2.1..v2.0.0) (2021-11-06 14:48:05)
23
+
24
+
25
+ ### Feature
26
+
27
+ * **App:** Package now supports query and list function | MP | [4072a0aca84f0546c0c8b2bf1f1f9d96037879a7](https://github.com/admiralcloud/ac-file-extensions/commit/4072a0aca84f0546c0c8b2bf1f1f9d96037879a7)
28
+ Package now supports query and list functions - please read README
29
+ ### Chores
30
+
31
+ * **App:** Moved to Github AC account | MP | [6fb3176947580bdf11223036d4dea0b347c27bde](https://github.com/admiralcloud/ac-file-extensions/commit/6fb3176947580bdf11223036d4dea0b347c27bde)
32
+ Moved to Github AC account
33
+ ## BREAKING CHANGES
34
+ * **App:** Package now supports query and list function
35
+ <a name="1.2.1"></a>
36
+
37
+ ## [1.2.1](https://github.com/mmpro/ac-file-extensions/compare/v1.2.0..v1.2.1) (2021-10-09 10:04:37)
38
+
39
+
40
+ ### Bug Fix
41
+
42
+ * **App:** Package updates | MP | [d042d418bbff2fe14e61972a4cdd0c05ba73cef0](https://github.com/mmpro/ac-file-extensions/commit/d042d418bbff2fe14e61972a4cdd0c05ba73cef0)
43
+ Package updates
package/README.md CHANGED
@@ -5,26 +5,31 @@ Use it to determine mimetype from extenstion, a prettyfied name or vice versa.
5
5
 
6
6
  Currently support more than 300 file types.
7
7
 
8
- # ac-file-extensions vs file-extensions
9
- Please note, that this package is the successor of file-extensions. That's why it starts with version 1.2.0.
10
-
11
- Please do not use package file-extensions any longer.
8
+ # BREAKING CHANGES Version 2
9
+ 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
10
 
13
11
  # Installation
14
12
  Use yarn add ac-file-extensions or npm install ac-file-extensions.
15
13
 
16
- After installation this package will automatically create the index.js file from sources.
14
+ After installation this package will automatically create the collection.js file from sources.
17
15
 
18
16
  # Usage
19
17
  ```
20
18
  const fileExtensions = require('ac-file-extensions')
21
19
 
22
- const result = fileExtensions.find( ext => ext.ext === 'mp4' )
23
-
20
+ // search from mp4
21
+ const result = fileExtensions.query({ ext: 'mp4' })
24
22
  console.log(result)
25
23
  // { "ext": "mp4", "name": "MPEG-4 Video", "mimetype": "video/mp4" }
24
+
25
+ // retrieve the whole list
26
+ fileExtensions.list()
26
27
  ```
27
28
 
29
+ You can use query with parameter:
30
+ + ext -> will return an object for this extension
31
+ + mimeType -> will return an array of objects matching this mimetype
32
+
28
33
  # Contribution
29
34
  If you want to add a new file extension, choose the right folder and add it like the other file extension. Use pull requests to send updates.
30
35
 
@@ -32,10 +37,16 @@ To commit, add it with git-add (or any GUI) and then use "make commit" on the CL
32
37
 
33
38
  Publishing to npm must be done manually.
34
39
 
40
+ # ac-file-extensions vs file-extensions
41
+ Please note, that this package is the successor of file-extensions. That's why it starts with version 1.2.0.
42
+
43
+ Please do not use package file-extensions any longer.
44
+
45
+
35
46
  ## Links
36
47
  - [Website](https://www.admiralcloud.com/)
37
48
  - [Twitter (@admiralcloud)](https://twitter.com/admiralcloud)
38
49
  - [Facebook](https://www.facebook.com/MediaAssetManagement/)
39
50
 
40
51
  ## License
41
- [MIT License](https://opensource.org/licenses/MIT) Copyright © 2009-present, AdmiralCloud, Mark Poepping
52
+ [MIT License](https://opensource.org/licenses/MIT) Copyright © 2009-present, AdmiralCloud AG, Mark Poepping
package/createFile.js CHANGED
@@ -3,7 +3,7 @@ const _ = require('lodash')
3
3
 
4
4
  const index = _.last(__filename.split('/'))
5
5
  const sourceFiles = _.pull(fs.readdirSync('./sources'), index)
6
- const fileToWrite = './index.js'
6
+ const fileToWrite = './collection.js'
7
7
 
8
8
  let sources = []
9
9