@whisklabs/grpc
Version:
gRPC generator and http library for typescript
22 lines • 827 B
JavaScript
import { SYMBOLS } from './tokenizer';
import { cutStr } from './utils';
export function isStr(str) {
return isText(str)
? (str.slice(0, 1) === '"' && str.slice(-1) === '"') || (str.slice(0, 1) === "'" && str.slice(-1) === "'")
: false;
}
isStr.toString = function () { return ' string with quotes "..." or \'...\' '; };
export function isText(str) {
return typeof str === 'string' && !SYMBOLS[str];
}
isText.toString = function () { return 'string'; };
export function isNumber(str) {
return !isNaN(Number(str));
}
isNumber.toString = function () { return 'number'; };
export function isProto(str) {
var s = cutStr(str);
return s === 'proto2' || s === 'proto3';
}
isProto.toString = function () { return ' string with quotes "proto2" or "proto3" '; };
//# sourceMappingURL=validators.js.map