Skip to content

Commit

Permalink
feat(helper): add shared export
Browse files Browse the repository at this point in the history
  • Loading branch information
Mister-Hope committed Jan 31, 2024
1 parent 7247c76 commit da50bcf
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 5 deletions.
1 change: 1 addition & 0 deletions tools/helper/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
"./client": "./lib/client/index.js",
"./client/*": "./lib/client/*",
"./node": "./lib/node/index.js",
"./shared": "./lib/shared/index.js",
"./noopComponent": "./lib/client/noopComponent.js",
"./noopModule": "./lib/client/noopModule.js",
"./package.json": "./package.json"
Expand Down
6 changes: 1 addition & 5 deletions tools/helper/src/shared/helper.ts
Original file line number Diff line number Diff line change
@@ -1,15 +1,11 @@
export { isPlainObject } from 'vuepress/shared'
import { isString } from 'vuepress/shared'

/* Type helper */
export const isDef = <T = any>(val?: T | undefined): val is T =>
typeof val !== 'undefined'
export const isBoolean = (val: any): val is boolean => typeof val === 'boolean'
export const isNumber = (val: any): val is number => typeof val === 'number'
export const isString = (val: unknown): val is string => typeof val === 'string'
export const isArray = Array.isArray
// eslint-disable-next-line @typescript-eslint/ban-types
export const isFunction = <T extends Function>(val: any): val is T =>
typeof val === 'function'
export const isRegExp = (val: unknown): val is RegExp => val instanceof RegExp

/* String helper */
Expand Down
1 change: 1 addition & 0 deletions tools/helper/src/shared/index.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
export * from 'vuepress/shared'
export * from './date.js'
export * from './helper.js'
export * from './url.js'

0 comments on commit da50bcf

Please sign in to comment.