Skip to content

Commit 8c66726

Browse files
committed
init
1 parent cef9ae8 commit 8c66726

File tree

6 files changed

+49
-12
lines changed

6 files changed

+49
-12
lines changed

โ€ŽCHANGELOG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,6 @@
22

33
## 1.0.0
44

5-
`2021.xx.xx`
5+
`2021.05.28`
66

77
๐ŸŽ‰ Init

โ€ŽREADME.md

Lines changed: 26 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,30 @@
1-
# Ts Template
1+
# Random Smiley
22

3-
xxxx
3+
Randomly get smiley emojis.
4+
5+
## Usage
6+
7+
```bash
8+
yarn add random-smiley
9+
10+
# or
11+
12+
npm i random-smiley
13+
```
14+
15+
```ts
16+
import randomSmiley from 'random-smiley';
17+
18+
randomSmiley();
19+
randomSmiley(3);
20+
```
21+
22+
```js
23+
const randomSmiley = require(random-smiley);
24+
25+
randomSmiley();
26+
randomSmiley(3);
27+
```
428

529
## Changelog
630

โ€Žpackage.json

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"private": false,
3-
"name": "xx",
3+
"name": "random-smiley",
44
"version": "0.0.1",
55
"scripts": {
66
"build": "father-build",
@@ -14,13 +14,14 @@
1414
"typings": "dist/index.d.ts",
1515
"repository": {
1616
"type": "git",
17-
"url": "https://github.com/ant-js/ts",
17+
"url": "https://github.com/ant-js/random-smiley",
1818
"branch": "main"
1919
},
2020
"author": "xrkffgg",
21-
"homepage": "https://github.com/ant-js/ts",
21+
"homepage": "https://github.com/ant-js/random-smiley",
2222
"keywords": [
23-
"ts"
23+
"ts",
24+
"emoji"
2425
],
2526
"files": [
2627
"dist",
@@ -29,9 +30,11 @@
2930
],
3031
"license": "MIT",
3132
"dependencies": {
32-
"@babel/runtime": "^7.12.5"
33+
"@babel/runtime": "^7.12.5",
34+
"lodash": "^4.17.21"
3335
},
3436
"devDependencies": {
37+
"@types/lodash": "^4.14.170",
3538
"@umijs/fabric": "^2.2.2",
3639
"eslint": "^7.15.0",
3740
"father-build": "^1.17.2",

โ€Žsrc/emojis.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
const SMILEY_EMOJIS = [
2+
'๐Ÿ˜€','๐Ÿ˜ƒ','๐Ÿ˜„','๐Ÿ˜','๐Ÿ˜†','๐Ÿ˜…','๐Ÿ˜‚','๐Ÿคฃ','๐Ÿฅฒ','โ˜บ๏ธ','๐Ÿ˜Š','๐Ÿ˜‡','๐Ÿ™‚','๐Ÿ™ƒ','๐Ÿ˜‰','๐Ÿ˜Œ','๐Ÿ˜','๐Ÿฅฐ','๐Ÿ˜˜','๐Ÿ˜—','๐Ÿ˜™','๐Ÿ˜š','๐Ÿ˜‹','๐Ÿ˜›','๐Ÿ˜','๐Ÿ˜œ','๐Ÿคช','๐Ÿคจ','๐Ÿง','๐Ÿค“','๐Ÿ˜Ž','๐Ÿฅธ','๐Ÿคฉ','๐Ÿฅณ','๐Ÿ˜','๐Ÿ˜’','๐Ÿ˜ž','๐Ÿ˜”','๐Ÿ˜Ÿ','๐Ÿ˜•','๐Ÿ™','โ˜น๏ธ','๐Ÿ˜ฃ','๐Ÿ˜–','๐Ÿ˜ซ','๐Ÿ˜ฉ','๐Ÿฅบ','๐Ÿ˜ข','๐Ÿ˜ญ','๐Ÿ˜ค','๐Ÿ˜ ','๐Ÿ˜ก','๐Ÿคฌ','๐Ÿคฏ','๐Ÿ˜ณ','๐Ÿฅต','๐Ÿฅถ','๐Ÿ˜ฑ','๐Ÿ˜จ','๐Ÿ˜ฐ','๐Ÿ˜ฅ','๐Ÿ˜“','๐Ÿค—','๐Ÿค”','๐Ÿคญ','๐Ÿคซ','๐Ÿคฅ','๐Ÿ˜ถ','๐Ÿ˜','๐Ÿ˜‘','๐Ÿ˜ฌ','๐Ÿ™„','๐Ÿ˜ฏ','๐Ÿ˜ฆ','๐Ÿ˜ง','๐Ÿ˜ฎ','๐Ÿ˜ฒ','๐Ÿฅฑ','๐Ÿ˜ด','๐Ÿคค','๐Ÿ˜ช','๐Ÿ˜ต','๐Ÿค','๐Ÿฅด','๐Ÿคข','๐Ÿคฎ','๐Ÿคง','๐Ÿ˜ท','๐Ÿค’','๐Ÿค•','๐Ÿค‘','๐Ÿค ','๐Ÿ‘ฝ','๐Ÿ‘พ','๐Ÿค–','๐ŸŽƒ',
3+
];
4+
5+
export default SMILEY_EMOJIS;

โ€Žsrc/index.ts

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1-
const A: string = 'A';
1+
import sampleSize from 'lodash/sampleSize';
2+
import SMILEY_EMOJIS from './emojis';
23

3-
export default A;
4+
const randomSmiley = (c: number = 1) => {
5+
return sampleSize(SMILEY_EMOJIS, c)
6+
};
7+
8+
export default randomSmiley;

โ€Žtsconfig.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"compilerOptions": {
3-
"target": "esnext",
4-
"module": "esnext",
3+
"target": "es6",
4+
"lib": ["dom", "es2017"],
55
"moduleResolution": "node",
66
"importHelpers": true,
77
"jsx": "react",

0 commit comments

Comments
ย (0)