@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.
- package/package.json +6 -2
- package/.eslintignore +0 -7
- package/.eslintrc.yml +0 -19
- package/.github/workflows/ci.yml +0 -54
- package/.github/workflows/publish-NPM.yml +0 -63
- package/.gitpod-config/cleanYaml.sh +0 -2
- package/.gitpod-config/dependencies.sh +0 -1
- package/.gitpod-config/exec-gitpod.sh +0 -2
- package/.gitpod-config/exec-upgrade.sh +0 -2
- package/.gitpod-config/exec.sh +0 -3
- package/.gitpod-config/globalDependencies.sh +0 -1
- package/.gitpod-config/package.js +0 -17
- package/.gitpod-config/upgrade.sh +0 -1
- package/.gitpod-config/vsix/alexkrechik.cucumberautocomplete-2.15.1.vsix +0 -0
- package/.gitpod-config/vsix/commit-message-editor-0.18.1.vsix +0 -0
- package/.gitpod-config/vsix/formulahendry.auto-rename-tag-0.1.7.vsix +0 -0
- package/.gitpod.yml +0 -25
- package/.husky/pre-commit +0 -1
- package/.prettierignore +0 -4
- package/.prettierrc.yml +0 -18
- package/gitpod.temp.yml +0 -25
- package/package/lib/constants/strings.cjs +0 -8
- package/package/lib/constants/strings.cjs.map +0 -1
- package/package/lib/constants/strings.d.ts +0 -3
- package/package/lib/constants/strings.d.ts.map +0 -1
- package/package/lib/constants/strings.js +0 -5
- package/package/lib/constants/strings.js.map +0 -1
- package/package/lib/decompose.cjs +0 -31
- package/package/lib/decompose.cjs.map +0 -1
- package/package/lib/decompose.d.ts +0 -3
- package/package/lib/decompose.d.ts.map +0 -1
- package/package/lib/decompose.js +0 -29
- package/package/lib/decompose.js.map +0 -1
- package/package/lib/decomposeSV.cjs +0 -28
- package/package/lib/decomposeSV.cjs.map +0 -1
- package/package/lib/decomposeSV.d.ts +0 -3
- package/package/lib/decomposeSV.d.ts.map +0 -1
- package/package/lib/decomposeSV.js +0 -26
- package/package/lib/decomposeSV.js.map +0 -1
- package/package/lib/helpers.cjs +0 -12
- package/package/lib/helpers.cjs.map +0 -1
- package/package/lib/helpers.d.ts +0 -4
- package/package/lib/helpers.d.ts.map +0 -1
- package/package/lib/helpers.js +0 -10
- package/package/lib/helpers.js.map +0 -1
- package/package/lib/index.cjs +0 -15
- package/package/lib/index.cjs.map +0 -1
- package/package/lib/index.d.ts +0 -6
- package/package/lib/index.d.ts.map +0 -1
- package/package/lib/index.js +0 -5
- package/package/lib/index.js.map +0 -1
- package/package/lib/recompose.cjs +0 -34
- package/package/lib/recompose.cjs.map +0 -1
- package/package/lib/recompose.d.ts +0 -4
- package/package/lib/recompose.d.ts.map +0 -1
- package/package/lib/recompose.js +0 -31
- package/package/lib/recompose.js.map +0 -1
- package/package/lib/sortMap.cjs +0 -8
- package/package/lib/sortMap.cjs.map +0 -1
- package/package/lib/sortMap.d.ts +0 -2
- package/package/lib/sortMap.d.ts.map +0 -1
- package/package/lib/sortMap.js +0 -6
- package/package/lib/sortMap.js.map +0 -1
- package/package/lib/types.d.ts +0 -22
- package/package/lib/types.d.ts.map +0 -1
- package/rollup.config.mjs +0 -68
- package/src/constants/strings.ts +0 -2
- package/src/decompose.test.ts +0 -37
- package/src/decompose.ts +0 -32
- package/src/decomposeSV.test.ts +0 -72
- package/src/decomposeSV.ts +0 -31
- package/src/helpers.ts +0 -11
- package/src/index.ts +0 -5
- package/src/recompose.test.ts +0 -163
- package/src/recompose.ts +0 -30
- package/src/sortMap.ts +0 -3
- package/src/types.test-d.ts +0 -45
- package/src/types.test.ts +0 -12
- package/src/types.ts +0 -57
- package/tsconfig.json +0 -26
- 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
|
-
});
|