@formvk/shared 0.1.0 → 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +12 -0
- package/README.md +40 -0
- package/dist/index.js +149 -1063
- package/dist/index.js.map +1 -1
- package/package.json +6 -2
- package/src/array.ts +0 -200
- package/src/checkers.ts +0 -47
- package/src/clone.ts +0 -66
- package/src/compare.ts +0 -136
- package/src/defaults.ts +0 -44
- package/src/deprecate.ts +0 -21
- package/src/global.ts +0 -23
- package/src/index.ts +0 -15
- package/src/instanceof.ts +0 -14
- package/src/isEmpty.ts +0 -89
- package/src/merge.ts +0 -226
- package/src/middleware.ts +0 -18
- package/src/path.ts +0 -5
- package/src/string.ts +0 -38
- package/src/subscribable.ts +0 -53
- package/src/uid.ts +0 -10
- package/tsconfig.build.json +0 -9
- package/tsconfig.json +0 -4
- package/vite.config.ts +0 -21
package/CHANGELOG.md
ADDED
package/README.md
ADDED
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
# @formvk/shared
|
|
2
|
+
|
|
3
|
+
Low-level utilities shared by the Formvk packages: type checkers, array/object iteration, cloning, deep merge, defaults, `Subscribable`, middleware and uid generation. It is installed transitively by the other packages; use it directly only when building Formvk-compatible tooling.
|
|
4
|
+
|
|
5
|
+
## Install
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
pnpm add @formvk/shared
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
## Usage
|
|
12
|
+
|
|
13
|
+
```ts
|
|
14
|
+
import { clone, isPlainObj, merge, toArr, uid } from '@formvk/shared'
|
|
15
|
+
|
|
16
|
+
isPlainObj({}) // true
|
|
17
|
+
toArr('a') // ['a']
|
|
18
|
+
|
|
19
|
+
const copy = clone({ a: 1 })
|
|
20
|
+
const merged = merge({ a: 1 }, { b: 2 })
|
|
21
|
+
const id = uid()
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
## API
|
|
25
|
+
|
|
26
|
+
- **Checkers** — `isFn`, `isArr`, `isObj`, `isPlainObj`, `isStr`, `isNum`, `isBool`, `isMap`, `isSet`, `isWeakMap`, `isWeakSet`, `isRegExp`, `isNumberLike`, `isReactElement`, `isHTMLElement`, `getType`.
|
|
27
|
+
- **Emptiness** — `isUndef`, `isValid`, `isEmpty`.
|
|
28
|
+
- **Collections** — `toArr`, `each`, `map`, `reduce`, `every`, `some`, `find`, `findIndex`, `includes`, `move`.
|
|
29
|
+
- **Objects** — `clone`, `shallowClone`, `merge`, `lazyMerge`, `defaults`, `instOf`.
|
|
30
|
+
- **Strings** — `stringLength`, `lowerCase`, `pascalCase`.
|
|
31
|
+
- **Path** — `FormPath` (alias of `Path` from `@formvk/path`) and the `FormPathPattern` type.
|
|
32
|
+
- **Infrastructure** — `Subscribable`, `applyMiddleware`, `deprecate`, `uid`, `globalThisPolyfill`, `isEqual`.
|
|
33
|
+
|
|
34
|
+
## Documentation
|
|
35
|
+
|
|
36
|
+
https://formvk.github.io/core/api/core
|
|
37
|
+
|
|
38
|
+
## License
|
|
39
|
+
|
|
40
|
+
MIT
|