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 |
|
---|
3 | var typeMap = {};
|
---|
4 | var types = require('./types');
|
---|
5 |
|
---|
6 | // load all available handlers
|
---|
7 | types.forEach(function (type) {
|
---|
8 | typeMap[type] = require('./types/' + type).detect;
|
---|
9 | });
|
---|
10 |
|
---|
11 | module.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.