Split darwinBundleDocumentType into two separate functions. The first function is unchanged.
The second function allows you to specify specific names for different groups of extensions while all sharing the same icon. For example, this would allow you to differentiate between a C header and a C source file while using the same icon for both.
Inherently, the second function will generate multiple file type declarations, so it returns an array instead of a single object. As a result we must use the splat operator on it when passing the result to an array literal.
Allow the caller to provide a specific file type description.
The new function will not require source changes to existing calls, but will change how the file type description is generated. An unmodified call to darwinBundleDocumentType will use the given icon name as the file type description. All extensions passed to this function continue to use the same icon as before, and all extensions will have the same file type description as before.
With this change, to define a document type, you need only pass the name (or relative path) of the darwin icon.
So instead of passing 'resources/darwin/css.icns' you would just pass 'css'