Hello community,

here is the log from the commit of package nodejs-mime-types for 
openSUSE:Factory checked in at 2015-08-05 06:51:34
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/nodejs-mime-types (Old)
 and      /work/SRC/openSUSE:Factory/.nodejs-mime-types.new (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "nodejs-mime-types"

Changes:
--------
--- /work/SRC/openSUSE:Factory/nodejs-mime-types/nodejs-mime-types.changes      
2015-07-03 00:10:58.000000000 +0200
+++ /work/SRC/openSUSE:Factory/.nodejs-mime-types.new/nodejs-mime-types.changes 
2015-08-05 06:51:35.000000000 +0200
@@ -1,0 +2,10 @@
+Thu Jul 30 12:06:55 UTC 2015 - i...@marguerite.su
+
+- update version 2.1.3
+
+-------------------------------------------------------------------
+Thu Jul 30 09:52:44 UTC 2015 - i...@marguerite.su
+
+- update version 2.1.2
+
+-------------------------------------------------------------------

Old:
----
  mime-types-2.0.12.tgz

New:
----
  mime-types-2.1.3.tgz

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ nodejs-mime-types.spec ++++++
--- /var/tmp/diff_new_pack.jIFsTo/_old  2015-08-05 06:51:36.000000000 +0200
+++ /var/tmp/diff_new_pack.jIFsTo/_new  2015-08-05 06:51:36.000000000 +0200
@@ -19,7 +19,7 @@
 %define base_name mime-types
 
 Name:           nodejs-mime-types
-Version:        2.0.12
+Version:        2.1.3
 Release:        0
 Summary:        The ultimate javascript content-type utility
 License:        MIT
@@ -37,17 +37,18 @@
 
 %prep
 %setup -q -n package
+%nodejs_fixdep mime-db '~1.16.0'
 
 %build
 
 %install
-mkdir -p %{buildroot}%{nodejs_modulesdir}/%{base_name}
+mkdir -p %{buildroot}%{nodejs_sitelib}/%{base_name}
 cp -pr package.json index.js \
-        %{buildroot}%{nodejs_modulesdir}/%{base_name}/
+        %{buildroot}%{nodejs_sitelib}/%{base_name}/
 
 %files
 %defattr(-,root,root,-)
 %doc README.md LICENSE HISTORY.md
-%{nodejs_modulesdir}/%{base_name}
+%{nodejs_sitelib}/%{base_name}
 
 %changelog

++++++ mime-types-2.0.12.tgz -> mime-types-2.1.3.tgz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/package/HISTORY.md new/package/HISTORY.md
--- old/package/HISTORY.md      2015-05-20 05:07:57.000000000 +0200
+++ new/package/HISTORY.md      2015-07-13 23:58:26.000000000 +0200
@@ -1,3 +1,47 @@
+2.1.3 / 2015-07-13
+==================
+
+  * deps: mime-db@~1.15.0
+    - Add new mime types
+
+2.1.2 / 2015-06-25
+==================
+
+  * deps: mime-db@~1.14.0
+    - Add new mime types
+
+2.1.1 / 2015-06-08
+==================
+
+  * perf: fix deopt during mapping
+
+2.1.0 / 2015-06-07
+==================
+
+  * Fix incorrectly treating extension-less file name as extension
+    - i.e. `'path/to/json'` will no longer return `application/json`
+  * Fix `.charset(type)` to accept parameters
+  * Fix `.charset(type)` to match case-insensitive
+  * Improve generation of extension to MIME mapping
+  * Refactor internals for readability and no argument reassignment
+  * Prefer `application/*` MIME types from the same source
+  * Prefer any type over `application/octet-stream`
+  * deps: mime-db@~1.13.0
+    - Add nginx as a source
+    - Add new mime types
+
+2.0.14 / 2015-06-06
+===================
+
+  * deps: mime-db@~1.12.0
+    - Add new mime types
+
+2.0.13 / 2015-05-31
+===================
+
+  * deps: mime-db@~1.11.0
+    - Add new mime types
+
 2.0.12 / 2015-05-19
 ===================
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/package/LICENSE new/package/LICENSE
--- old/package/LICENSE 2014-05-12 22:21:48.000000000 +0200
+++ new/package/LICENSE 2015-06-08 07:32:06.000000000 +0200
@@ -1,22 +1,23 @@
+(The MIT License)
 
-The MIT License (MIT)
+Copyright (c) 2014 Jonathan Ong <m...@jongleberry.com>
+Copyright (c) 2015 Douglas Christopher Wilson <d...@somethingdoug.com>
 
-Copyright (c) 2014 Jonathan Ong m...@jongleberry.com
+Permission is hereby granted, free of charge, to any person obtaining
+a copy of this software and associated documentation files (the
+'Software'), to deal in the Software without restriction, including
+without limitation the rights to use, copy, modify, merge, publish,
+distribute, sublicense, and/or sell copies of the Software, and to
+permit persons to whom the Software is furnished to do so, subject to
+the following conditions:
 
-Permission is hereby granted, free of charge, to any person obtaining a copy
-of this software and associated documentation files (the "Software"), to deal
-in the Software without restriction, including without limitation the rights
-to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-copies of the Software, and to permit persons to whom the Software is
-furnished to do so, subject to the following conditions:
+The above copyright notice and this permission notice shall be
+included in all copies or substantial portions of the Software.
 
-The above copyright notice and this permission notice shall be included in
-all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-THE SOFTWARE.
+THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
+EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
+CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
+TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
+SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/package/README.md new/package/README.md
--- old/package/README.md       2015-04-20 03:59:01.000000000 +0200
+++ new/package/README.md       2015-06-08 07:32:06.000000000 +0200
@@ -42,10 +42,11 @@
 Lookup the content-type associated with a file.
 
 ```js
-mime.lookup('json')           // 'application/json'
-mime.lookup('.md')            // 'text/x-markdown'
-mime.lookup('file.html')      // 'text/html'
-mime.lookup('folder/file.js') // 'application/javascript'
+mime.lookup('json')             // 'application/json'
+mime.lookup('.md')              // 'text/x-markdown'
+mime.lookup('file.html')        // 'text/html'
+mime.lookup('folder/file.js')   // 'application/javascript'
+mime.lookup('folder/.htaccess') // false
 
 mime.lookup('cats') // false
 ```
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/package/index.js new/package/index.js
--- old/package/index.js        2014-09-08 06:40:45.000000000 +0200
+++ new/package/index.js        2015-06-08 07:32:09.000000000 +0200
@@ -1,63 +1,188 @@
+/*!
+ * mime-types
+ * Copyright(c) 2014 Jonathan Ong
+ * Copyright(c) 2015 Douglas Christopher Wilson
+ * MIT Licensed
+ */
+
+'use strict'
+
+/**
+ * Module dependencies.
+ * @private
+ */
 
 var db = require('mime-db')
+var extname = require('path').extname
 
-// types[extension] = type
-exports.types = Object.create(null)
-// extensions[type] = [extensions]
+/**
+ * Module variables.
+ * @private
+ */
+
+var extractTypeRegExp = /^\s*([^;\s]*)(?:;|\s|$)/
+var textTypeRegExp = /^text\//i
+
+/**
+ * Module exports.
+ * @public
+ */
+
+exports.charset = charset
+exports.charsets = { lookup: charset }
+exports.contentType = contentType
+exports.extension = extension
 exports.extensions = Object.create(null)
+exports.lookup = lookup
+exports.types = Object.create(null)
 
-Object.keys(db).forEach(function (name) {
-  var mime = db[name]
-  var exts = mime.extensions
-  if (!exts || !exts.length) return
-  exports.extensions[name] = exts
-  exts.forEach(function (ext) {
-    exports.types[ext] = name
-  })
-})
+// Populate the extensions/types maps
+populateMaps(exports.extensions, exports.types)
 
-exports.lookup = function (string) {
-  if (!string || typeof string !== "string") return false
-  // remove any leading paths, though we should just use path.basename
-  string = string.replace(/.*[\.\/\\]/, '').toLowerCase()
-  if (!string) return false
-  return exports.types[string] || false
-}
+/**
+ * Get the default charset for a MIME type.
+ *
+ * @param {string} type
+ * @return {boolean|string}
+ */
+
+function charset(type) {
+  if (!type || typeof type !== 'string') {
+    return false
+  }
 
-exports.extension = function (type) {
-  if (!type || typeof type !== "string") return false
-  // to do: use media-typer
-  type = type.match(/^\s*([^;\s]*)(?:;|\s|$)/)
-  if (!type) return false
-  var exts = exports.extensions[type[1].toLowerCase()]
-  if (!exts || !exts.length) return false
-  return exts[0]
-}
+  // TODO: use media-typer
+  var match = extractTypeRegExp.exec(type)
+  var mime = match && db[match[1].toLowerCase()]
 
-// type has to be an exact mime type
-exports.charset = function (type) {
-  var mime = db[type]
-  if (mime && mime.charset) return mime.charset
+  if (mime && mime.charset) {
+    return mime.charset
+  }
 
   // default text/* to utf-8
-  if (/^text\//.test(type)) return 'UTF-8'
+  if (match && textTypeRegExp.test(match[1])) {
+    return 'UTF-8'
+  }
 
   return false
 }
 
-// backwards compatibility
-exports.charsets = {
-  lookup: exports.charset
+/**
+ * Create a full Content-Type header given a MIME type or extension.
+ *
+ * @param {string} str
+ * @return {boolean|string}
+ */
+
+function contentType(str) {
+  // TODO: should this even be in this module?
+  if (!str || typeof str !== 'string') {
+    return false
+  }
+
+  var mime = str.indexOf('/') === -1
+    ? exports.lookup(str)
+    : str
+
+  if (!mime) {
+    return false
+  }
+
+  // TODO: use content-type or other module
+  if (mime.indexOf('charset') === -1) {
+    var charset = exports.charset(mime)
+    if (charset) mime += '; charset=' + charset.toLowerCase()
+  }
+
+  return mime
+}
+
+/**
+ * Get the default extension for a MIME type.
+ *
+ * @param {string} type
+ * @return {boolean|string}
+ */
+
+function extension(type) {
+  if (!type || typeof type !== 'string') {
+    return false
+  }
+
+  // TODO: use media-typer
+  var match = extractTypeRegExp.exec(type)
+
+  // get extensions
+  var exts = match && exports.extensions[match[1].toLowerCase()]
+
+  if (!exts || !exts.length) {
+    return false
+  }
+
+  return exts[0]
 }
 
-// to do: maybe use set-type module or something
-exports.contentType = function (type) {
-  if (!type || typeof type !== "string") return false
-  if (!~type.indexOf('/')) type = exports.lookup(type)
-  if (!type) return false
-  if (!~type.indexOf('charset')) {
-    var charset = exports.charset(type)
-    if (charset) type += '; charset=' + charset.toLowerCase()
+/**
+ * Lookup the MIME type for a file path/extension.
+ *
+ * @param {string} path
+ * @return {boolean|string}
+ */
+
+function lookup(path) {
+  if (!path || typeof path !== 'string') {
+    return false
+  }
+
+  // get the extension ("ext" or ".ext" or full path)
+  var extension = extname('x.' + path)
+    .toLowerCase()
+    .substr(1)
+
+  if (!extension) {
+    return false
   }
-  return type
+
+  return exports.types[extension] || false
+}
+
+/**
+ * Populate the extensions and types maps.
+ * @private
+ */
+
+function populateMaps(extensions, types) {
+  // source preference (least -> most)
+  var preference = ['nginx', 'apache', undefined, 'iana']
+
+  Object.keys(db).forEach(function forEachMimeType(type) {
+    var mime = db[type]
+    var exts = mime.extensions
+
+    if (!exts || !exts.length) {
+      return
+    }
+
+    // mime -> extensions
+    extensions[type] = exts
+
+    // extension -> mime
+    for (var i = 0; i < exts.length; i++) {
+      var extension = exts[i]
+
+      if (types[extension]) {
+        var from = preference.indexOf(db[types[extension]].source)
+        var to = preference.indexOf(mime.source)
+
+        if (types[extension] !== 'application/octet-stream'
+          && from > to || (from === to && types[extension].substr(0, 12) === 
'application/')) {
+          // skip the remapping
+          return
+        }
+      }
+
+      // set the extension -> mime
+      types[extension] = type
+    }
+  })
 }
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/package/package.json new/package/package.json
--- old/package/package.json    2015-05-20 05:07:48.000000000 +0200
+++ new/package/package.json    2015-07-13 23:59:53.000000000 +0200
@@ -1,7 +1,7 @@
 {
   "name": "mime-types",
   "description": "The ultimate javascript content-type utility.",
-  "version": "2.0.12",
+  "version": "2.1.3",
   "contributors": [
     "Douglas Christopher Wilson <d...@somethingdoug.com>",
     "Jeremiah Senkpiel <fishrock...@rocketmail.com> 
(https://searchbeam.jit.su)",
@@ -14,10 +14,10 @@
   ],
   "repository": "jshttp/mime-types",
   "dependencies": {
-    "mime-db": "~1.10.0"
+    "mime-db": "~1.15.0"
   },
   "devDependencies": {
-    "istanbul": "0.3.9",
+    "istanbul": "0.3.17",
     "mocha": "~1.21.5"
   },
   "files": [


Reply via email to