UNPKG

413 BJavaScriptView Raw
1const getFirstChar = require("./char").getFirstChar;
2const typeMap = require("./type-map");
3
4exports.isProcessor = function(data) {
5 return typeof data === "string" && getFirstChar(data) === "@";
6};
7
8exports.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};