]> gerrit.simantics Code Review - simantics/district.git/blob - org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/fstream/lib/get-type.js
Adding integrated tile server
[simantics/district.git] / org.simantics.maps.server / node / node-v4.8.0-win-x64 / node_modules / npm / node_modules / fstream / lib / get-type.js
1 module.exports = getType
2
3 function getType (st) {
4   var types = [
5     'Directory',
6     'File',
7     'SymbolicLink',
8     'Link', // special for hardlinks from tarballs
9     'BlockDevice',
10     'CharacterDevice',
11     'FIFO',
12     'Socket'
13   ]
14   var type
15
16   if (st.type && types.indexOf(st.type) !== -1) {
17     st[st.type] = true
18     return st.type
19   }
20
21   for (var i = 0, l = types.length; i < l; i++) {
22     type = types[i]
23     var is = st[type] || st['is' + type]
24     if (typeof is === 'function') is = is.call(st)
25     if (is) {
26       st[type] = true
27       st.type = type
28       return type
29     }
30   }
31
32   return null
33 }