https://github.com/yanyue404/rainbow-shared
rainbow 的 实用函数, 基于 @vue/shared
https://github.com/yanyue404/rainbow-shared
Last synced: about 1 month ago
JSON representation
rainbow 的 实用函数, 基于 @vue/shared
- Host: GitHub
- URL: https://github.com/yanyue404/rainbow-shared
- Owner: yanyue404
- Created: 2023-03-15T17:14:52.000Z (about 2 years ago)
- Default Branch: main
- Last Pushed: 2024-08-23T16:03:26.000Z (9 months ago)
- Last Synced: 2024-10-30T12:25:35.461Z (7 months ago)
- Language: TypeScript
- Size: 99.6 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# rainbow-shared
[](https://www.npmjs.com/package/rainbow-shared) [ ](https://npmjs.org/package/rainbow-shared) [](https://npmjs.org/package/rainbow-shared)
Utility functions for rainbow, based on @vue/shared
## Install
```bash
npm i rainbow-shared -S
```## Usage
**ES module**
```js
import { looseEqual } from "rainbow-shared";console.log(looseEqual(["Hello, world!"], ["Hello, world!"])); // true
```**CommonJS**
```js
const { looseEqual } = require("rainbow-shared");console.log(looseEqual(["Hello, world!"], ["Hello, world!"])); // true
```**CDN link**
> Packaged in `iife` mode to generate a global object `R`.
- https://cdn.jsdelivr.net/npm/rainbow-shared/dist/index.iife.js
- https://unpkg.com/rainbow-shared/dist/index.iife.js```html
rainbow-shared use cdn
console.log(R.looseEqual(["Hello,world!"], ["Hello,world!"])); // true
```
## Support utils
You can check the function source code through [cdn link](https://cdn.jsdelivr.net/npm/rainbow-shared/dist/index.iife.js) for usage.
```js
export {
EMPTY_ARR,
EMPTY_OBJ,
NO,
NOOP,
addParamsToUrl,
cacheObj,
cacheStaticFn,
camelize,
capitalize,
curry,
debounce,
deepClone,
def,
escapeHtml,
escapeHtmlComment,
extend,
get,
getGlobalThis,
getObjValByAge,
getQueryJson,
getQueryString,
hasChanged,
hasOwn,
hyphenate,
invokeArrayFns,
isArray,
isDate,
isDef,
isEmpty,
isFalse,
isFunction,
isHTMLTag,
isMap,
isModelListener,
isObject,
isOn,
isPlainObject,
isPrimitive,
isPromise,
isRegExp,
isSet,
isString,
isSymbol,
isTrue,
isUndef,
isUrl,
loadCss,
loadJs,
looseEqual,
looseIndexOf,
makeMap,
normalizeClass,
normalizeProps,
normalizeStyle,
objectToString,
once,
parseStringStyle,
promiseWrapper,
remove,
stringifyStyle,
throttle,
toArray,
toDisplayString,
toHandlerKey,
toNumber,
toObject,
toRawType,
toString,
toTypeString,
warn,
};
```## Reference
- https://github.com/vuejs/core/tree/main/packages/shared
- https://github.com/slorber/awesome-only-resolves-last-promise