mirror of
https://github.com/zoriya/v10.git
synced 2026-08-05 05:37:21 +00:00
chore(packages): move dom types down
This commit is contained in:
@@ -1,6 +1,8 @@
|
||||
{
|
||||
"extends": "../../tsconfig.base.json",
|
||||
"compilerOptions": {
|
||||
// This will be removed.
|
||||
"lib": ["ES2020", "DOM", "DOM.Iterable"],
|
||||
"baseUrl": ".",
|
||||
"paths": {
|
||||
"@/*": ["src/*"]
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
{
|
||||
"extends": "../../tsconfig.base.json",
|
||||
"compilerOptions": {
|
||||
"lib": ["ES2020", "DOM", "DOM.Iterable"],
|
||||
"baseUrl": ".",
|
||||
"paths": {
|
||||
"@/*": ["src/*"]
|
||||
|
||||
@@ -63,6 +63,7 @@
|
||||
"devDependencies": {
|
||||
"@svgr/babel-plugin-add-jsx-attribute": "^8.0.0",
|
||||
"@svgr/cli": "^8.1.0",
|
||||
"@svgr/core": "^8.1.0",
|
||||
"@svgr/plugin-jsx": "^8.1.0",
|
||||
"@tailwindcss/cli": "^4.1.0",
|
||||
"@types/postcss-prefix-selector": "^1.16.3",
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
import path from 'node:path';
|
||||
|
||||
/** @type {import('@svgr/core').Config & { indexTemplate: (filePaths: { path: string }[]) => string }} */
|
||||
export default {
|
||||
plugins: ['@svgr/plugin-jsx'],
|
||||
typescript: true,
|
||||
|
||||
@@ -3,6 +3,7 @@
|
||||
"compilerOptions": {
|
||||
"jsx": "react-jsx",
|
||||
"jsxImportSource": "react",
|
||||
"lib": ["ES2020", "DOM", "DOM.Iterable"],
|
||||
"baseUrl": ".",
|
||||
"paths": {
|
||||
"@/*": ["src/*"]
|
||||
|
||||
@@ -0,0 +1,8 @@
|
||||
{
|
||||
"extends": "../../tsconfig.json",
|
||||
"compilerOptions": {
|
||||
"composite": true,
|
||||
"lib": ["ES2020", "DOM", "DOM.Iterable"]
|
||||
},
|
||||
"include": ["./**/*.ts"]
|
||||
}
|
||||
@@ -3,7 +3,7 @@
|
||||
* so we may treat them specifically as unequal if they are not a) both arrays
|
||||
* or b) don't contain the same (shallowly compared) elements.
|
||||
*/
|
||||
export function shallowEqual(objA: any, objB: any): boolean {
|
||||
export function shallowEqual(objA: object, objB: object): boolean {
|
||||
// Using Object.is as a first pass, as it covers a lot of the "simple" cases that are
|
||||
// more complex than strict equality and is a built-in. For discussion, see, e.g.:
|
||||
// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/is#description
|
||||
|
||||
@@ -1,9 +1,8 @@
|
||||
|
||||
/**
|
||||
* Checks if a value is a valid number (not NaN, null, undefined, or Infinity)
|
||||
*/
|
||||
function isValidNumber(value: unknown): value is number {
|
||||
return typeof value === 'number' && isFinite(value);
|
||||
return typeof value === 'number' && Number.isFinite(value);
|
||||
}
|
||||
|
||||
const UnitLabels = [
|
||||
@@ -29,7 +28,7 @@ function toTimeUnitPhrase(timeUnitValue: number, unitIndex: number): string {
|
||||
|
||||
/**
|
||||
* Converts numeric seconds into a human-readable phrase for accessibility.
|
||||
*
|
||||
*
|
||||
* @param seconds - A (positive or negative) time, represented as seconds
|
||||
* @returns The time, represented as a phrase of hours, minutes, and seconds
|
||||
*
|
||||
@@ -96,7 +95,7 @@ export function formatTime(seconds: number, guide?: number): string {
|
||||
const gh = guide ? Math.floor(guide / 3600) : 0;
|
||||
|
||||
// Handle invalid times
|
||||
if (isNaN(seconds) || seconds === Infinity) {
|
||||
if (Number.isNaN(seconds) || seconds === Infinity) {
|
||||
// '-' is false for all relational operators (e.g. <, >=) so this setting
|
||||
// will add the minimum number of fields specified by the guide
|
||||
h = m = s = '0';
|
||||
@@ -118,7 +117,7 @@ export function formatTime(seconds: number, guide?: number): string {
|
||||
|
||||
/**
|
||||
* Formats a time value with fallback handling for invalid values.
|
||||
*
|
||||
*
|
||||
* @param time - The time value to format in seconds (duration, currentTime, etc.)
|
||||
* @param guide - Optional guide time for consistent formatting
|
||||
* @param fallback - Fallback text when time is invalid (default: "--:--")
|
||||
|
||||
@@ -1,10 +1,12 @@
|
||||
{
|
||||
"extends": "../../tsconfig.base.json",
|
||||
"compilerOptions": {
|
||||
"composite": true,
|
||||
"baseUrl": ".",
|
||||
"paths": {
|
||||
"@/*": ["src/*"]
|
||||
}
|
||||
},
|
||||
"references": [{ "path": "./src/dom" }],
|
||||
"include": ["src"]
|
||||
}
|
||||
|
||||
Generated
+3
@@ -211,6 +211,9 @@ importers:
|
||||
'@svgr/cli':
|
||||
specifier: ^8.1.0
|
||||
version: 8.1.0(typescript@5.9.3)
|
||||
'@svgr/core':
|
||||
specifier: ^8.1.0
|
||||
version: 8.1.0(typescript@5.9.3)
|
||||
'@svgr/plugin-jsx':
|
||||
specifier: ^8.1.0
|
||||
version: 8.1.0(@svgr/core@8.1.0(typescript@5.9.3))
|
||||
|
||||
+1
-1
@@ -3,7 +3,7 @@
|
||||
"incremental": true,
|
||||
"composite": true,
|
||||
"target": "ES2020",
|
||||
"lib": ["ES2020", "DOM", "DOM.Iterable"],
|
||||
"lib": ["ES2020"],
|
||||
"module": "ESNext",
|
||||
"moduleResolution": "bundler",
|
||||
"resolveJsonModule": true,
|
||||
|
||||
Reference in New Issue
Block a user