@pyreon/attrs 0.11.5 → 0.11.7
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/README.md +18 -13
- package/package.json +22 -22
- package/src/__tests__/attrs.test.ts +177 -177
- package/src/__tests__/attrsHoc.test.ts +39 -39
- package/src/__tests__/utils.test.ts +69 -69
- package/src/attrs.ts +13 -13
- package/src/hoc/attrsHoc.ts +4 -4
- package/src/hoc/index.ts +1 -1
- package/src/index.ts +9 -9
- package/src/init.ts +7 -7
- package/src/isAttrsComponent.ts +2 -2
- package/src/types/AttrsComponent.ts +6 -6
- package/src/types/InitAttrsComponent.ts +3 -3
- package/src/types/config.ts +1 -1
- package/src/types/configuration.ts +1 -1
- package/src/types/hoc.ts +1 -1
- package/src/types/utils.ts +1 -1
- package/src/utils/attrs.ts +1 -1
- package/src/utils/chaining.ts +2 -2
- package/src/utils/compose.ts +1 -1
- package/src/utils/statics.ts +1 -1
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import type { AttrsComponent } from
|
|
2
|
-
import type { Configuration } from
|
|
3
|
-
import type { ElementType, ExtractProps } from
|
|
1
|
+
import type { AttrsComponent } from './AttrsComponent'
|
|
2
|
+
import type { Configuration } from './configuration'
|
|
3
|
+
import type { ElementType, ExtractProps } from './utils'
|
|
4
4
|
|
|
5
5
|
/**
|
|
6
6
|
* Type of the internal `attrsComponent` factory function.
|
package/src/types/config.ts
CHANGED
package/src/types/hoc.ts
CHANGED
package/src/types/utils.ts
CHANGED
package/src/utils/attrs.ts
CHANGED
package/src/utils/chaining.ts
CHANGED
|
@@ -14,8 +14,8 @@ type ChainOptions = (opts: Obj | Func | undefined, defaultOpts: Func[]) => Func[
|
|
|
14
14
|
export const chainOptions: ChainOptions = (opts, defaultOpts = []) => {
|
|
15
15
|
const result = [...defaultOpts]
|
|
16
16
|
|
|
17
|
-
if (typeof opts ===
|
|
18
|
-
else if (typeof opts ===
|
|
17
|
+
if (typeof opts === 'function') result.push(opts)
|
|
18
|
+
else if (typeof opts === 'object') result.push(() => opts)
|
|
19
19
|
|
|
20
20
|
return result
|
|
21
21
|
}
|
package/src/utils/compose.ts
CHANGED
|
@@ -10,5 +10,5 @@ type CalculateHocsFuncs = (options: Record<string, any>) => ((arg: any) => any)[
|
|
|
10
10
|
|
|
11
11
|
export const calculateHocsFuncs: CalculateHocsFuncs = (options = {}) =>
|
|
12
12
|
Object.values(options)
|
|
13
|
-
.filter((item) => typeof item ===
|
|
13
|
+
.filter((item) => typeof item === 'function')
|
|
14
14
|
.reverse()
|
package/src/utils/statics.ts
CHANGED