-
Notifications
You must be signed in to change notification settings - Fork 1
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
32 changed files
with
1,120 additions
and
61 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
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
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,37 @@ | ||
[[toc]] | ||
|
||
## 引入 | ||
|
||
```ts | ||
import { getI18nToken } from 't-comm'; | ||
|
||
// or | ||
|
||
import { getI18nToken} from 't-comm/lib/i18n/index'; | ||
``` | ||
|
||
|
||
## `getI18nToken(appId, appKey)` | ||
|
||
|
||
**描述**:<p>获取 i18n token</p> | ||
|
||
**参数**: | ||
|
||
|
||
| 参数名 | 类型 | 描述 | | ||
| --- | --- | --- | | ||
| appId | <code>string</code> | <p>appId</p> | | ||
| appKey | <code>string</code> | <p>appKey</p> | | ||
|
||
**返回**: <code>Promise.<string></code><br> | ||
|
||
<p>token</p> | ||
|
||
**示例** | ||
|
||
```ts | ||
getI18nToken('appId', 'appKey').then(token => { | ||
console.log('token', token) | ||
}) | ||
``` |
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,94 @@ | ||
[[toc]] | ||
|
||
## 引入 | ||
|
||
```ts | ||
import { | ||
removeFirstSlash, | ||
removeLastSlash, | ||
removeFirstAndLastSlash | ||
} from 't-comm'; | ||
|
||
// or | ||
|
||
import { | ||
removeFirstSlash, | ||
removeLastSlash, | ||
removeFirstAndLastSlash | ||
} from 't-comm/lib/slash/index'; | ||
``` | ||
|
||
|
||
## `removeFirstSlash([str])` | ||
|
||
|
||
**描述**:<p>移除第一个反斜杠</p> | ||
|
||
**参数**: | ||
|
||
|
||
| 参数名 | 类型 | 默认值 | 描述 | | ||
| --- | --- | --- | --- | | ||
| [str] | <code>string</code> | <code>"''"</code> | <p>输入字符串</p> | | ||
|
||
**返回**: <code>string</code><br> | ||
|
||
<p>字符串</p> | ||
|
||
**示例** | ||
|
||
```ts | ||
removeFirstSlash('/abc/ddd/') | ||
|
||
'abc/ddd/' | ||
``` | ||
<a name="removeLastSlash"></a> | ||
|
||
## `removeLastSlash([str])` | ||
|
||
|
||
**描述**:<p>移除最后一个反斜杠</p> | ||
|
||
**参数**: | ||
|
||
|
||
| 参数名 | 类型 | 默认值 | 描述 | | ||
| --- | --- | --- | --- | | ||
| [str] | <code>string</code> | <code>"''"</code> | <p>输入字符串</p> | | ||
|
||
**返回**: <code>string</code><br> | ||
|
||
<p>字符串</p> | ||
|
||
**示例** | ||
|
||
```ts | ||
removeLastSlash('/abc/') | ||
|
||
'/abc' | ||
``` | ||
<a name="removeFirstAndLastSlash"></a> | ||
|
||
## `removeFirstAndLastSlash([str])` | ||
|
||
|
||
**描述**:<p>移除第一个和最后一个反斜杠</p> | ||
|
||
**参数**: | ||
|
||
|
||
| 参数名 | 类型 | 默认值 | 描述 | | ||
| --- | --- | --- | --- | | ||
| [str] | <code>string</code> | <code>"''"</code> | <p>输入字符串</p> | | ||
|
||
**返回**: <code>string</code><br> | ||
|
||
<p>字符串</p> | ||
|
||
**示例** | ||
|
||
```ts | ||
removeFirstAndLastSlash('/abc/') | ||
|
||
'abc' | ||
``` |
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,18 @@ | ||
const { getOneProjectDetail } = require('../../../lib'); | ||
require('../../utils/env'); | ||
|
||
console.log('process.env', process.env); | ||
function main() { | ||
getOneProjectDetail({ | ||
projectName: 'pmd-mobile/match/pro', | ||
privateToken: process.env.GIT_WOA_PRIVATE_TOKEN, | ||
baseUrl: process.env.GIT_WOA_BASE_URL, | ||
}).then((res) => { | ||
console.log('res', res); | ||
}) | ||
.catch((err) => { | ||
console.log('err', err); | ||
}); | ||
} | ||
|
||
main(); |
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,3 @@ | ||
export { IImportType } from './types'; | ||
export { parseReplaceConfig } from './parse-config-list'; | ||
export { replaceDependencies } from './replace-dependencies'; |
Oops, something went wrong.