source: trip-planner-front/node_modules/image-size/lib/detector.js@ 1ad8e64

Last change on this file since 1ad8e64 was 6a3a178, checked in by Ema <ema_spirova@…>, 3 years ago

initial commit

  • Property mode set to 100644
File size: 376 bytes
Line 
1'use strict';
2
3var typeMap = {};
4var types = require('./types');
5
6// load all available handlers
7types.forEach(function (type) {
8 typeMap[type] = require('./types/' + type).detect;
9});
10
11module.exports = function (buffer, filepath) {
12 var type, result;
13 for (type in typeMap) {
14 result = typeMap[type](buffer, filepath);
15 if (result) {
16 return type;
17 }
18 }
19};
Note: See TracBrowser for help on using the repository browser.