Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/ylzon/handwriting-javascript
手写 currify / promise / bind / Deep Clone / EventHub
https://github.com/ylzon/handwriting-javascript
bind currify deep-clone eventhub promise
Last synced: 25 days ago
JSON representation
手写 currify / promise / bind / Deep Clone / EventHub
- Host: GitHub
- URL: https://github.com/ylzon/handwriting-javascript
- Owner: ylzon
- License: mit
- Created: 2020-03-21T04:46:27.000Z (almost 5 years ago)
- Default Branch: master
- Last Pushed: 2023-05-09T02:39:19.000Z (over 1 year ago)
- Last Synced: 2024-07-30T20:04:22.313Z (5 months ago)
- Topics: bind, currify, deep-clone, eventhub, promise
- Language: TypeScript
- Homepage:
- Size: 132 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 4
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# 手写JavaScript常见代码
手写 currify / promise / bind / Deep copy / EventHub## TodoList
* [x] [Currify](https://github.com/ylzon/handwriting-javascript/blob/master/src/currify/index.ts)
* [x] [EventHub](https://github.com/ylzon/handwriting-javascript/blob/master/src/enent-bus/index.ts)
* [x] [DeepCopy](https://github.com/ylzon/handwriting-javascript/blob/master/src/deep-clone/index.ts)
* [x] [bind](https://github.com/ylzon/handwriting-javascript/blob/master/src/bind/index.ts)
* [ ] Promise/A+## Install
```shell
npm install
```## Test
```shell
npm run test
``````
Bind
✓ should Bind is Function
✓ should function bind exist
✓ should bind this success
✓ should bind multiple parameters
✓ should Pass the second parameter after the first parameter is bound successfully
✓ should bind parameters when new
✓ should bind parameters when new and fn has a prototype
✓ should bind no new but with a similar objectCurrify
✓ should Currify is Function
✓ should Currify accept single parameter
✓ should Currify accept multiple parametersDeep Clone
✓ should Deep Clone is Function
✓ should Deep Clone be possible to copy basic types
Object
✓ should be copy Ordinary object
✓ should be copy Array object
✓ should be copy Function object
✓ should be copy loop object
✓ should be copy date object
✓ should be copy RegExp object
✓ should be Auto-skipping prototype properties
✓ should be possible to copy very complex objectsEvanHub
✓ should EvenHub is Object
✓ should .emit have be work
✓ should .emit can pass parameters
✓ should .off have be work
```## LICENSE
[MIT](LICENSE)