1 | const getFirstChar = require("./char").getFirstChar;
|
2 | const typeMap = require("./type-map");
|
3 |
|
4 | exports.isProcessor = function(data) {
|
5 | return typeof data === "string" && getFirstChar(data) === "@";
|
6 | };
|
7 |
|
8 | exports.whichType = function(data) {
|
9 | let typeData = typeof data;
|
10 |
|
11 | if (Array.isArray(data)) {
|
12 | typeData = "array";
|
13 | }
|
14 |
|
15 | if (typeMap[typeData]) {
|
16 | return typeMap[typeData];
|
17 | }
|
18 | return "undefined";
|
19 | };
|