NET-Web-API-w-Angular/my-app/node_modules/image-size/lib/detector.js

20 lines
376 B
JavaScript
Raw Normal View History

2024-02-09 00:38:41 +00:00
'use strict';
var typeMap = {};
var types = require('./types');
// load all available handlers
types.forEach(function (type) {
typeMap[type] = require('./types/' + type).detect;
});
module.exports = function (buffer, filepath) {
var type, result;
for (type in typeMap) {
result = typeMap[type](buffer, filepath);
if (result) {
return type;
}
}
};