An open API service indexing awesome lists of open source software.

https://github.com/uniquexiaobai/snippets

代码片段
https://github.com/uniquexiaobai/snippets

js snippets

Last synced: 2 months ago
JSON representation

代码片段

Awesome Lists containing this project

README

        

# Snippets

### function

- [x] [bind](./function/bind.js)
- [x] [call](./function/call.js)
- [x] [debounce](./function/debounce.js)
- [x] [memoize](./function/memoize.js)
- [x] [new](./function/new.js)
- [x] [once](./function/once.js)
- [x] [throttle](./function/throttle.js)

### number

- [x] [decimal](./number/decimal.js)
- [x] [random](./number/random.js)
- [x] [range](./number/range.js)

### string

- [x] [randomId](./string/random-id.js)
- [x] [repeat](./string/repeat.js)
- [x] [separate](./string/separate.js)

### array

- [x] [flatten](./array/flatten.js)
- [x] [groupBy](./array/group-by.js)
- [x] [isSorted](./array/is-sorted.js)
- [x] [shuffle](./array/shuffle.js)
- [x] [unique](./array/unique.js)

### object

- [x] [deepCopy](./object/deep-copy.js)
- [x] [instanceof](./object/instanceof.js)
- [x] [ObjectCreate](./object/object-create.js)
- [x] [ObjectIs](./object/object-is.js)
- [x] [pathOr](./object/path-or.js)
- [x] [propOr](./object/prop-or.js)
- [x] [shallowEqual](./object/shallow-equal.js)

### date

- [x] [ageOfYear](./date/age-of-year.js)
- [x] [format](./date/format.js)
- [x] [getMonthDays](./date/getMonthDays.js)
- [x] [timeAgo](./date/time-ago.js)

### regexp

- [x] [isEmail](./regexp/is-email.js)
- [x] [isNumeric]('./regexp/is-number.js)
- [x] [isUrl]('./regexp/is-url.js)

### browser

- [x] [cookie](./browser/cookie.js)
- [x] [isBrowser](./browser/is-browser.js)
- [x] [isNative](./browser/is-native.js)
- [ ] [iswifi](./browser/is-wifi.js)
- [x] [jsonp](./browser/jsonp.js)
- [x] [nextTick](./browser/next-tick.js)
- [x] [request](./browser/request.js)
- [x] [requestBatch](./browser/request-batch.js)
- [x] [requestRetry](./browser/request-retry.js)
- [x] [requestIdleCallback](./browser/requestIdleCallback.js)
- [x] [serviceWorker](./browser/servie-worker.js)
- [x] [worker](./browser/worker.js)

### dom

- [ ] [clipboard](./dom/clipboard.js)
- [x] [imgToBase64](./dom/img-to-base64.js)
- [x] [isInViewport](./dom/is-in-viewport.js)
- [x] [lazyImg](./dom/lazy-img.js)
- [x] [triggerEvent](./dom/trigger-event.js)

### fp

- [x] [allPass](./fp/all-pass.js)
- [x] [batch](./fp/batch.js)
- [x] [compose](./fp/compose.js)
- [x] [curry](./fp/curry.js)
- [x] [flip](./fp/flip.js)
- [x] [head](./fp/head.js)
- [x] [partial](./fp/partial.js)
- [x] [pick](./fp/pick.js)
- [x] [unary](./fp/unary.js)
- [x] [uncurry](./fp/uncurry.js)

### design platterns

- [x] [decorator](./design-patterns/decorator.js) 装饰者模式
- [x] [observer](./design-patterns/observer.js) 观察者模式
- [x] [proxy](./design-patterns/proxy.js) 代理模式
- [x] [pubsub](./design-patterns/pubsub.js) 订阅模式
- [x] [singleton](./design-patterns/singleton.js) 单例模式
- [x] [strategy](./design-patterns/strategy.js) 策略模式