# lich-king2

> web

Latest version **1.1.1** (published 2024-06-05) · ISC license · 0 weekly downloads

## Install

```sh
npm install lich-king2
pnpm add lich-king2
yarn add lich-king2
bun add lich-king2
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.1.1 |
| Published | 2024-06-05 |
| First published | 2018-10-31 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 6 |
| Unpacked size | 51.7 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | yuchao2016 |
| Maintainers | yuchao2016 |
| Keywords | web |

## Links

- npm: https://www.npmjs.com/package/lich-king2
- Repository: git@git.bk:weixin-static/lich-king2
- Homepage: http://git.bk/weixin-static/lich-king2
- Issues: http://git.bk/weixin-static/lich-king2/issues
- npm.io page: https://npm.io/package/lich-king2

## Dependencies (6)

- [lodash](https://npm.io/package/lodash.md) ^4.17.4
- [moment](https://npm.io/package/moment.md) ^2.18.1
- [inversify](https://npm.io/package/inversify.md) ^4.13.0
- [reflect-metadata](https://npm.io/package/reflect-metadata.md) ^0.1.12
- [inversify-inject-decorators](https://npm.io/package/inversify-inject-decorators.md) ^3.1.0
- [inversify-binding-decorators](https://npm.io/package/inversify-binding-decorators.md) ^3.2.0

## Alternatives

- [@opentelemetry/exporter-zipkin](https://npm.io/package/@opentelemetry/exporter-zipkin.md) — 14.8M weekly downloads
- [pusher-js](https://npm.io/package/pusher-js.md) — 2.0M weekly downloads
- [browserify](https://npm.io/package/browserify.md) — 1.7M weekly downloads
- [sqs-consumer](https://npm.io/package/sqs-consumer.md) — 1.7M weekly downloads
- [@sanity/eventsource](https://npm.io/package/@sanity/eventsource.md) — 930.8K weekly downloads

## Recent versions

- 1.1.1 (latest) — 2024-06-05
- 1.1.0 — 2024-05-28
- 1.0.0 — 2018-11-01
- 0.0.3 — 2018-10-31
- 0.0.2 — 2018-10-31

## README

#### LICK-KING2

+ CommonUtils

```
class CommonUtils {
       /**
        * 判断环境打印日志
        * @param msg
        * @param optionalParams
        */
       static log(msg: any, ...optionalParams: any[]): void;
       /**
        * Set page title in wechat webview.
        * @param {String} title the new title for the current page
        */
       static setDocumentTitle(title: any): void;
       /**
        * 判断是否为微信浏览器
        * @returns {boolean}
        */
       static isWeiXinBrowser(): boolean;
   }
```

+ CookieUtils
```
 class CookieUtils {
        /**
         * 保存Cookie
         * @param name  key
         * @param value value
         * @param min   有效时间（min）
         */
        static saveCookie(name: any, value: any, min: any): void;
        /**
         * 读取cookie
         * @param name
         * @returns {any}
         */
        static readCookie(name: any): string;
        /**
         * 移除Cookie
         * @param name
         */
        static removeCookie(name: any): void;
    }
```

+ DateUtils
```
class DateUtils {
       class DateUtils {
           static FORMAT_DATE: string;
           static FORMAT_DATETIME: string;
           static FORMAT_TIME: string;
           /**
            * 获取格式化时间 YYYY-MM-DD
            * @param date
            */
           static getDateString(date: any): string;
           /**
            * 获取格式化时间 YYYY-MM-DD HH:mm:ss
            * @param date
            */
           static getDateTimeString(date: any): string;
           /**
            * 获取格式化时间 HH:mm:ss
            * @param date
            */
           static getTimeString(date: any): string;
           /**
            * 获取时间戳
            * @param date
            */
           static getTimeStamp(date: any): number;
           /**
            * 获取自定义的格式化时间
            * @param date
            * @param format
            */
           static getCustomStr(date: any, format: any): string;
       }
   }
```

+ FormRule
```
class FormRule {
        static RULE_REQUIRED: {
            required: boolean;
            message: string;
        };
        static RULE_INTEGER: {
            pattern: RegExp;
            message: string;
        };
        static RULE_POSITIVE_INTEGER: {
            pattern: RegExp;
            message: string;
        };
        static RULE_NOT_ZERO_POSITIVE_INTEGER: {
            pattern: RegExp;
            message: string;
        };
        static RULE_TWO_BITS_POSITIVE_INTEGER: {
            pattern: RegExp;
            message: string;
        };
        static RULE_TWO_BITS_DECIMALS: {
            pattern: RegExp;
            message: string;
        };
        static RULE_NOT_ZERO_TWO_BITS_INTEGER: {
            pattern: RegExp;
            message: string;
        };
        static RULE_ZERO_TWO_BITS_INTEGER: {
            pattern: RegExp;
            message: string;
        };
        static RULE_PHONE: {
            pattern: RegExp;
            message: string;
        };
        static RULE_TEL_MOBILE: {
            pattern: RegExp;
            message: string;
        };
        static RULE_TEL: {
            pattern: RegExp;
            message: string;
        };
        static RULE_DISCOUNT: {
            pattern: RegExp;
            message: string;
        };
        static RULE_POSTAL_CODE: {
            pattern: RegExp;
            message: string;
        };
        static RULE_EMAIL: {
            pattern: RegExp;
            message: string;
        };
        static RULE_URL: {
            pattern: RegExp;
            message: string;
        };
        static RULE_MAX(ct: any): {
            max: any;
            message: string;
        };
        static RULE_N_BITS_POSITIVE_INTEGER(n: any): {
            pattern: RegExp;
            message: string;
        };
        static RULE_REQUIRED_MSG(msg: any): {
            required: boolean;
            message: any;
        };
        static checkChineseLength: (rule: any, value: any, callback: any, length: any) => void;
    }
```

+ RegUtils
```
class RegUtils {
    static REG_INTEGER: RegExp;
    static REG_TWO_FRACTION: RegExp;
    static REG_NOT_ZERO_TWO_BITS_INTEGER: RegExp;
    static REG_ZERO_TWO_BITS_INTEGER: RegExp;
    static REG_MOBILE: RegExp;
    static REG_DISCOUNT: RegExp;
    static REG_POSITIVE_INTEGER: RegExp;
    static REG_NOT_ZERO_POSITIVE_INTEGER: RegExp;
    static REG_TWO_BITS_POSITIVE_INTEGER: RegExp;
    static REG_POSTAL_CODE: RegExp;
    static REG_TEL: RegExp;
    static REG_TEL_MOBILE: RegExp;
    static REG_EMAIL: RegExp;
    static REG_URL: RegExp;
    static checkReg(reg: RegExp, value: any): boolean;
    static checkRegPort(port: any): boolean;
    static checkRegIP(ip: any): boolean;
}
```

+ HtmlUtils
```
class HtmlUtils {
    /**
     * 用于处理高清适配后富文本显示异常
     * @param richText
     * @constructor
     */
    static FormatRichText(richText: any): any;
    /**
     * 获取相对颜色
     * @param col
     * @param amt
     * @returns {string}
     * @constructor
     */
    static convertColor(col: any, amt: any): string;
    /**
     * 16进制color转rgba
     * @param col
     * @param opacity
     * @returns {string}
     * @constructor
     */
    static colorConvertRGBA(col: any, opacity: any): string;
    /**
     * 拨打电话
     * @param phone
     */
    static callPhone(phone: any): void;
    /**
     * 模糊手机号
     * @param phone
     */
    static mockPhone(phone: any): any;
}
```

---
_Source: https://npm.io/package/lich-king2 · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
