Move more components to shlink-web-component when applicable

This commit is contained in:
Alejandro Celaya
2023-07-29 10:43:15 +02:00
parent 275745fd3a
commit 8d24116859
94 changed files with 224 additions and 209 deletions

View File

@@ -1,18 +1,20 @@
import { compare } from 'compare-versions';
import { identity, memoizeWith } from 'ramda';
import type { Empty } from '../utils';
import { hasValue } from '../utils';
import { identity, isEmpty, isNil, memoizeWith } from 'ramda';
type Empty = null | undefined | '' | never[];
const hasValue = <T>(value: T | Empty): value is T => !isNil(value) && !isEmpty(value);
type SemVerPatternFragment = `${bigint | '*'}`;
export type SemVerPattern = SemVerPatternFragment
type SemVerPattern = SemVerPatternFragment
| `${SemVerPatternFragment}.${SemVerPatternFragment}`
| `${SemVerPatternFragment}.${SemVerPatternFragment}.${SemVerPatternFragment}`;
export interface Versions {
type Versions = {
maxVersion?: SemVerPattern;
minVersion?: SemVerPattern;
}
};
export type SemVer = `${bigint}.${bigint}.${bigint}` | 'latest';