Skip to content

Commit c4bbc19

Browse files
author
pedro
committed
feat:添加一些util函数
1 parent 8288bad commit c4bbc19

2 files changed

Lines changed: 8 additions & 1 deletion

File tree

lib/util.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import { routeMetaInfo } from "./core";
44
import { get, unset } from "lodash";
55
import { config } from "./config";
66
import { ParametersException } from "./exception";
7+
import { extendedValidator } from "./extended-validator";
78
import { __decorate, __metadata } from "tslib";
89

910
export const isUndefined = (obj: any): obj is undefined =>
@@ -32,6 +33,12 @@ export const isSymbol = (fn: any): fn is symbol => typeof fn === "symbol";
3233
export const strVal = (value: any) =>
3334
typeof value === "string" ? value : String(value);
3435

36+
export const isNotEmpty = extendedValidator.isNotEmpty;
37+
38+
export const isNegative = extendedValidator.isNegative;
39+
40+
export const isPositive = extendedValidator.isPositive;
41+
3542
/**
3643
* Assertion utility.
3744
*/

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "lin-mizar",
3-
"version": "0.0.1-alpha.23",
3+
"version": "0.0.1-alpha.24",
44
"description": "The core library of Lin CMS",
55
"main": "lin/index.js",
66
"scripts": {

0 commit comments

Comments
 (0)