-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
12 changed files
with
1,142 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
{ | ||
"root": true, | ||
"ignorePatterns": ["lib", "coverage"], | ||
"extends": ["@varlet"] | ||
"ignorePatterns": ["lib", "coverage", "docs/.vitepress/cache", "docs/.vitepress/dist"], | ||
"extends": ["@varlet"], | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,4 +2,6 @@ | |
node_modules | ||
lib | ||
coverage | ||
.DS_Store | ||
.DS_Store | ||
docs/.vitepress/cache | ||
docs/.vitepress/dist |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
import { defineConfig } from 'vitepress' | ||
|
||
export default defineConfig({ | ||
title: 'Rattail', | ||
description: 'A utilities library for front-end developers, lightweight and ts-friendly', | ||
locales: { | ||
root: { | ||
label: 'English', | ||
lang: 'en', | ||
}, | ||
zh: { | ||
label: '简体中文', | ||
lang: 'zh', | ||
link: '/zh', | ||
themeConfig: { | ||
nav: [{ text: '首页', link: '/zh' }], | ||
|
||
sidebar: [ | ||
{ | ||
text: '简介', | ||
items: [{ text: '快速开始', link: '/zh/getting-started' }], | ||
}, | ||
{ | ||
text: '通用', | ||
items: [{ text: 'isString', link: '/zh/general/is-string' }], | ||
}, | ||
], | ||
|
||
socialLinks: [{ icon: 'github', link: 'https://github.com/varletjs/rattail' }], | ||
}, | ||
}, | ||
}, | ||
themeConfig: { | ||
nav: [{ text: 'Home', link: '/' }], | ||
|
||
sidebar: [ | ||
{ | ||
text: 'Introduction', | ||
items: [{ text: 'Getting Started', link: '/getting-started' }], | ||
}, | ||
{ | ||
text: 'General', | ||
items: [{ text: 'isString', link: '/general/is-string' }], | ||
}, | ||
], | ||
|
||
socialLinks: [{ icon: 'github', link: 'https://github.com/varletjs/rattail' }], | ||
}, | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
# isString | ||
|
||
Determine whether the input value is a string | ||
|
||
### Usage | ||
|
||
```ts | ||
import { isString } from 'rattail' | ||
|
||
console.log(isString('rattail')) // return true | ||
console.log(isString(123)) // return false | ||
``` | ||
|
||
### Arguments | ||
|
||
| Arg | Type | Defaults | | ||
| ------- | :---: | -------: | | ||
| `value` | `any` | | | ||
|
||
### Return | ||
|
||
| Type | | ||
| :--: | | ||
| `boolean` | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
# Getting Started | ||
|
||
### Installation | ||
|
||
::: code-group | ||
```shell [npm] | ||
npm i rattail -S | ||
``` | ||
|
||
```shell [yarn] | ||
yarn add rattail | ||
``` | ||
|
||
```shell [pnpm] | ||
pnpm add rattail | ||
``` | ||
::: | ||
|
||
### Usage | ||
|
||
```ts | ||
import { isString } from 'rattail' | ||
|
||
console.log(isString('rattail')) | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
--- | ||
layout: home | ||
|
||
hero: | ||
name: 'Rattail' | ||
text: 'A Utilities Library' | ||
tagline: A utilities library for front-end developers, lightweight and ts-friendly | ||
actions: | ||
- theme: brand | ||
text: Get Started | ||
link: /getting-started | ||
|
||
features: | ||
- title: General | ||
details: Provide utilities frequently used in daily development | ||
- title: Lightweight | ||
details: Utilities implementation is very lightweight | ||
- title: Ts-friendly | ||
details: Written based on ts, providing complete ts types | ||
--- |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
# isString | ||
|
||
判断输入值是否是字符串 | ||
|
||
### 使用 | ||
|
||
```ts | ||
import { isString } from 'rattail' | ||
|
||
console.log(isString('rattail')) // return true | ||
console.log(isString(123)) // return false | ||
``` | ||
|
||
### 参数列表 | ||
|
||
| 参数 | 类型 | 默认值 | | ||
| ------- | :---: | -----: | | ||
| `value` | `any` | | | ||
|
||
### 返回值 | ||
|
||
| 类型 | | ||
| :-------: | | ||
| `boolean` | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
# 快速开始 | ||
|
||
### 安装 | ||
|
||
::: code-group | ||
```shell [npm] | ||
npm i rattail -S | ||
``` | ||
|
||
```shell [yarn] | ||
yarn add rattail | ||
``` | ||
|
||
```shell [pnpm] | ||
pnpm add rattail | ||
``` | ||
::: | ||
|
||
### 使用 | ||
|
||
```ts | ||
import { isString } from 'rattail' | ||
|
||
console.log(isString('rattail')) | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
--- | ||
layout: home | ||
|
||
hero: | ||
name: 'Rattail' | ||
text: '实用工具库' | ||
tagline: 面向前端开发人员的实用工具库,轻量级且 ts 友好 | ||
actions: | ||
- theme: brand | ||
text: 快速开始 | ||
link: /zh/getting-started | ||
|
||
features: | ||
- title: 通用 | ||
details: 提供日常开发中经常使用的实用程序 | ||
- title: 轻量 | ||
details: 工具实现非常轻量 | ||
- title: Ts 友好 | ||
details: 实用 ts 编写,提供完善的类型支持 | ||
--- |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.