hongfangze-verify
v1.0.0
Published
comm.verify
Readme
数据验证操作类
介绍
验证各类数据的合法有效性
开始使用
npm install hongfangze-verify
// import { isEmailAddress } from "hongfangze-verify";
// import * as verify from "hongfangze-verify";
/**
* 是否中国手机号码
* @param {string} tel 要验证的数据
* @return {*} {boolean}
*/
export declare const isChineseCellphone: (tel: string) => boolean;
/**
* 是否邮箱地址
* @param {string} email 要验证的数据
* @return {*} {boolean}
*/
export declare const isEmailAddress: (email: string) => boolean;
/**
* 是否QQ号码
* @param {string} qq 需要验证的数据
* @return {*} {boolean}
*/
export declare const isQqNumber: (qq: string) => boolean;
/**
* 是否MD5值
* @param {string} md5 要验证的数据
* @return {*} {boolean}
*/
export declare const isMd5: (md5: string) => boolean;
/**
* 是否HTTP(HTTPS)的标准协议格式的URL
* @param {string} url 要验证的数据
* @return {*} {boolean}
*/
export declare const isUrl: (url: string) => boolean;
/**
* 是否标准的32位/36位/38位的Guid格式的值(22位位特殊格式,该函数无法验证)
* @param {string} guid 要验证的数据
* @return {*} {boolean}
*/
export declare const isGuid: (guid: string) => boolean;
/**
* 是否JSON对象或JSON对象数组
* @param {*} obj 要验证的数据
* @return {*} {boolean}
*/
export declare const isJsonOrJsonArray: (obj: any) => boolean;
/**
* 是否JSON对象
* @param {*} json 要验证的数据
* @return {*} {boolean}
*/
export declare const isJson: (json: any) => boolean;
/**
* 是否JSON对象数组
* @param {*} obj 要验证的数据
* @return {*} {boolean}
*/
export declare const isJsonArray: (obj: any) => boolean;
/**
* 是否Object对象
* @param {*} obj 要验证的数据
* @return {*} {boolean}
*/
export declare const isObject: (obj: any) => boolean;
/**
* 是否是Error对象
* @param {*} obj 要验证的数据
* @return {*} {boolean}
*/
export declare const isError: (obj: any) => boolean;
/**
* 是否是字符串
* @param {*} obj 要验证的数据
* @return {*} {boolean}
*/
export declare const isString: (obj: any) => boolean;
/**
* 是否是数字
* @param {*} obj 要验证的数据
* @return {*} {boolean}
*/
export declare const isNumber: (obj: any) => boolean;
/**
* 是否Date类型
* @param {*} obj 要验证的数据
* @return {*} {boolean}
*/
export declare const isDate: (obj: any) => boolean;
/**
* 是否NULL类型
* @param {*} obj 要验证的数据
* @return {*} {boolean}
*/
export declare const isNull: (obj: any) => boolean;
/**
* 是否Undefined类型
* @param {*} obj 要验证的数据
* @return {*} {boolean}
*/
export declare const isUndefined: (obj: any) => boolean;
/**
* 是否为中国公民身份证号码
* @param {string} idcard 要验证的数据
* @return {{ errcode: number, errmsg: string }} errorcode==0代表成功,否则为失败,并附上errmsg错误原因
*/
export declare const isChineseCitizenIdCardNumber2: (idcard: string) => {
errcode: number;
errmsg: string;
};
/**
* 是否为中国公民身份证号码
* @param {string} idcard 要验证的数据
* @return {*} {boolean}
*/
export declare const isChineseCitizenIdCardNumber: (idcard: string) => boolean;
/**
* 是否数组对象
* @param {*} obj 要验证的数据
* @return {*} {boolean}
*/
export declare const isArray: (obj: any) => boolean;
/**
* 检查端口是否已经被占用
* @param {number} port 端口号
* @return {*} {Promise<boolean>}
*/
export declare const portIsUsed: (port: number) => Promise<boolean>;版本迭代记录
2025-04-11 v1.0.0
- 被移除后更名发布。
