@bemedev/decompose 0.3.0 → 0.3.1

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.
Files changed (81) hide show
  1. package/package.json +6 -2
  2. package/.eslintignore +0 -7
  3. package/.eslintrc.yml +0 -19
  4. package/.github/workflows/ci.yml +0 -54
  5. package/.github/workflows/publish-NPM.yml +0 -63
  6. package/.gitpod-config/cleanYaml.sh +0 -2
  7. package/.gitpod-config/dependencies.sh +0 -1
  8. package/.gitpod-config/exec-gitpod.sh +0 -2
  9. package/.gitpod-config/exec-upgrade.sh +0 -2
  10. package/.gitpod-config/exec.sh +0 -3
  11. package/.gitpod-config/globalDependencies.sh +0 -1
  12. package/.gitpod-config/package.js +0 -17
  13. package/.gitpod-config/upgrade.sh +0 -1
  14. package/.gitpod-config/vsix/alexkrechik.cucumberautocomplete-2.15.1.vsix +0 -0
  15. package/.gitpod-config/vsix/commit-message-editor-0.18.1.vsix +0 -0
  16. package/.gitpod-config/vsix/formulahendry.auto-rename-tag-0.1.7.vsix +0 -0
  17. package/.gitpod.yml +0 -25
  18. package/.husky/pre-commit +0 -1
  19. package/.prettierignore +0 -4
  20. package/.prettierrc.yml +0 -18
  21. package/gitpod.temp.yml +0 -25
  22. package/package/lib/constants/strings.cjs +0 -8
  23. package/package/lib/constants/strings.cjs.map +0 -1
  24. package/package/lib/constants/strings.d.ts +0 -3
  25. package/package/lib/constants/strings.d.ts.map +0 -1
  26. package/package/lib/constants/strings.js +0 -5
  27. package/package/lib/constants/strings.js.map +0 -1
  28. package/package/lib/decompose.cjs +0 -31
  29. package/package/lib/decompose.cjs.map +0 -1
  30. package/package/lib/decompose.d.ts +0 -3
  31. package/package/lib/decompose.d.ts.map +0 -1
  32. package/package/lib/decompose.js +0 -29
  33. package/package/lib/decompose.js.map +0 -1
  34. package/package/lib/decomposeSV.cjs +0 -28
  35. package/package/lib/decomposeSV.cjs.map +0 -1
  36. package/package/lib/decomposeSV.d.ts +0 -3
  37. package/package/lib/decomposeSV.d.ts.map +0 -1
  38. package/package/lib/decomposeSV.js +0 -26
  39. package/package/lib/decomposeSV.js.map +0 -1
  40. package/package/lib/helpers.cjs +0 -12
  41. package/package/lib/helpers.cjs.map +0 -1
  42. package/package/lib/helpers.d.ts +0 -4
  43. package/package/lib/helpers.d.ts.map +0 -1
  44. package/package/lib/helpers.js +0 -10
  45. package/package/lib/helpers.js.map +0 -1
  46. package/package/lib/index.cjs +0 -15
  47. package/package/lib/index.cjs.map +0 -1
  48. package/package/lib/index.d.ts +0 -6
  49. package/package/lib/index.d.ts.map +0 -1
  50. package/package/lib/index.js +0 -5
  51. package/package/lib/index.js.map +0 -1
  52. package/package/lib/recompose.cjs +0 -34
  53. package/package/lib/recompose.cjs.map +0 -1
  54. package/package/lib/recompose.d.ts +0 -4
  55. package/package/lib/recompose.d.ts.map +0 -1
  56. package/package/lib/recompose.js +0 -31
  57. package/package/lib/recompose.js.map +0 -1
  58. package/package/lib/sortMap.cjs +0 -8
  59. package/package/lib/sortMap.cjs.map +0 -1
  60. package/package/lib/sortMap.d.ts +0 -2
  61. package/package/lib/sortMap.d.ts.map +0 -1
  62. package/package/lib/sortMap.js +0 -6
  63. package/package/lib/sortMap.js.map +0 -1
  64. package/package/lib/types.d.ts +0 -22
  65. package/package/lib/types.d.ts.map +0 -1
  66. package/rollup.config.mjs +0 -68
  67. package/src/constants/strings.ts +0 -2
  68. package/src/decompose.test.ts +0 -37
  69. package/src/decompose.ts +0 -32
  70. package/src/decomposeSV.test.ts +0 -72
  71. package/src/decomposeSV.ts +0 -31
  72. package/src/helpers.ts +0 -11
  73. package/src/index.ts +0 -5
  74. package/src/recompose.test.ts +0 -163
  75. package/src/recompose.ts +0 -30
  76. package/src/sortMap.ts +0 -3
  77. package/src/types.test-d.ts +0 -45
  78. package/src/types.test.ts +0 -12
  79. package/src/types.ts +0 -57
  80. package/tsconfig.json +0 -26
  81. package/vitest.config.ts +0 -24
package/src/types.ts DELETED
@@ -1,57 +0,0 @@
1
- export type StateMatching<
2
- T extends Record<string, unknown> | string,
3
- Key = keyof T,
4
- > =
5
- T extends Record<string, unknown>
6
- ? Key extends string
7
- ? T[Key] extends Record<string, unknown>
8
- ? `${Key}.${StateMatching<T[Key]>}` | (Key & string)
9
- : Key & string
10
- : never
11
- : T;
12
-
13
- export type LengthOf<T> =
14
- T extends ReadonlyArray<unknown> ? T['length'] : number;
15
-
16
- export type DecomposeOptions = {
17
- delimiter?: string;
18
- sorter?: (a: string, b: string) => number;
19
- };
20
-
21
- export type StateValue = string | StateValueMap;
22
-
23
- export interface StateValueMap {
24
- [key: string]: StateValue;
25
- }
26
-
27
- export type Ru = Record<string, unknown>;
28
-
29
- // #region Recompose
30
- // #region Preparation
31
- type _SplitString<T extends Ru> = {
32
- [key in keyof T]: key extends `${string}.${infer A}`
33
- ? A extends `${string}.${string}`
34
- ? _SplitString<Record<A, T[key]>>
35
- : Record<A, T[key]>
36
- : T[key];
37
- };
38
-
39
- type UnionToIntersection<U> = (
40
- U extends unknown ? (k: U) => void : never
41
- ) extends (k: infer I) => void
42
- ? I
43
- : never;
44
-
45
- type SplitSeparator<S extends string> = S extends `${infer A}.${string}`
46
- ? A
47
- : S;
48
-
49
- type SplitKeys<T extends Ru> = {
50
- [key in keyof T as SplitSeparator<key & string>]: T[key] extends Ru
51
- ? UnionToIntersection<SplitKeys<T[key]>>
52
- : T[key];
53
- };
54
- // #endregion
55
-
56
- export type Recompose<T extends Ru> = SplitKeys<_SplitString<T>>;
57
- // #endregion
package/tsconfig.json DELETED
@@ -1,26 +0,0 @@
1
- {
2
- "include": ["src/**/*"],
3
- "compilerOptions": {
4
- "lib": ["dom", "esnext"],
5
- "importHelpers": true,
6
- "target": "ESNext",
7
- "declaration": true,
8
- "sourceMap": true,
9
- "rootDir": "./src",
10
- "outDir": "./lib",
11
- "resolveJsonModule": true,
12
- "strict": true,
13
- "noImplicitReturns": true,
14
- "noFallthroughCasesInSwitch": true,
15
- "noUnusedLocals": true,
16
- "noUnusedParameters": true,
17
- "moduleResolution": "Bundler",
18
- "jsx": "react",
19
- "esModuleInterop": true,
20
- "skipLibCheck": true,
21
- "forceConsistentCasingInFileNames": true,
22
- "isolatedModules": true,
23
- "noEmit": true,
24
- "declarationMap": true
25
- }
26
- }
package/vitest.config.ts DELETED
@@ -1,24 +0,0 @@
1
- import { aliasTs } from '@bemedev/vitest-alias';
2
- import { defineConfig } from 'vitest/config';
3
- import tsconfig from './tsconfig.json';
4
-
5
- export default defineConfig({
6
- plugins: [aliasTs(tsconfig as never)],
7
-
8
- test: {
9
- environment: 'node',
10
- globals: true,
11
- coverage: {
12
- enabled: true,
13
- extension: 'ts',
14
- all: true,
15
- include: [
16
- 'src/decompose.ts',
17
- 'src/helpers.ts',
18
- 'src/decomposeSV.ts',
19
- 'src/recompose.ts',
20
- ],
21
- provider: 'v8',
22
- },
23
- },
24
- });