@contember/utilities
Advanced tools
Comparing version 1.2.0-rc.16 to 1.2.0-rc.17
function px(value) { | ||
return typeof value === "number" && !isNaN(value) ? value + "px" : ""; | ||
return typeof value === "number" && !(isNaN(value) || value === Infinity || value === -Infinity) ? value + "px" : ""; | ||
} | ||
@@ -4,0 +4,0 @@ export { |
@@ -26,2 +26,3 @@ import { AssertionError } from "./assert-types/AssertionError.js"; | ||
import { pick } from "./functional/pick.js"; | ||
import { range } from "./functional/range.js"; | ||
import { setHasOneOf } from "./functional/setHasOneOf.js"; | ||
@@ -79,2 +80,3 @@ import { capitalize } from "./string-utilities/capitalize.js"; | ||
px, | ||
range, | ||
satisfiesOneOfFactory, | ||
@@ -81,0 +83,0 @@ setHasOneOf, |
function px(value) { | ||
return typeof value === "number" && !isNaN(value) ? value + "px" : ""; | ||
return typeof value === "number" && !(isNaN(value) || value === Infinity || value === -Infinity) ? value + "px" : ""; | ||
} | ||
@@ -4,0 +4,0 @@ export { |
@@ -26,2 +26,3 @@ import { AssertionError } from "./assert-types/AssertionError.js"; | ||
import { pick } from "./functional/pick.js"; | ||
import { range } from "./functional/range.js"; | ||
import { setHasOneOf } from "./functional/setHasOneOf.js"; | ||
@@ -79,2 +80,3 @@ import { capitalize } from "./string-utilities/capitalize.js"; | ||
px, | ||
range, | ||
satisfiesOneOfFactory, | ||
@@ -81,0 +83,0 @@ setHasOneOf, |
@@ -1,2 +0,1 @@ | ||
import { PropsWithChildren } from 'react'; | ||
import { KebabCase } from 'type-fest'; | ||
@@ -7,6 +6,6 @@ export type NestedClassName = string | false | null | undefined | (string | false | null | undefined)[] | NestedClassName[]; | ||
}; | ||
export type ComponentClassNameProps = PropsWithChildren<{ | ||
export interface ComponentClassNameProps { | ||
className?: NestedClassName; | ||
componentClassName?: string | string[]; | ||
}>; | ||
} | ||
export type ColorSchemeClassName<T extends KebabCase<string> = KebabCase<string>> = `scheme-${T}`; | ||
@@ -13,0 +12,0 @@ export type ThemeContentClassName<T extends KebabCase<string> = KebabCase<string>, S extends `:${KebabCase<string>}` | null | undefined = undefined> = S extends string ? `theme-${T}-content${S}` : `theme-${T}-content`; |
export * from './extend'; | ||
export * from './omit'; | ||
export * from './pick'; | ||
export * from './range'; | ||
export * from './setHasOneOf'; | ||
//# sourceMappingURL=index.d.ts.map |
{ | ||
"name": "@contember/utilities", | ||
"license": "Apache-2.0", | ||
"version": "1.2.0-rc.16", | ||
"version": "1.2.0-rc.17", | ||
"type": "module", | ||
@@ -6,0 +6,0 @@ "sideEffects": false, |
import { KebabCase } from 'type-fest' | ||
import { colorSchemeClassName } from './colorSchemeClassName' | ||
import { ThemeContentClassName, ThemeControlsClassName } from './types' | ||
@@ -4,0 +3,0 @@ |
@@ -1,2 +0,1 @@ | ||
import { PropsWithChildren } from 'react' | ||
import { KebabCase } from 'type-fest' | ||
@@ -7,6 +6,6 @@ | ||
export type ComponentClassNameProps = PropsWithChildren<{ | ||
export interface ComponentClassNameProps { | ||
className?: NestedClassName; | ||
componentClassName?: string | string[]; | ||
}> | ||
} | ||
@@ -13,0 +12,0 @@ export type ColorSchemeClassName<T extends KebabCase<string> = KebabCase<string>> = `scheme-${T}` |
@@ -15,3 +15,3 @@ export function px<V extends number>(value: V): `${V}px`; | ||
export function px<V extends number | false | null | undefined>(value?: V): string { | ||
return typeof value === 'number' && !isNaN(value) ? value + 'px' : '' | ||
return typeof value === 'number' && !(isNaN(value) || value === Infinity || value === -Infinity) ? value + 'px' : '' | ||
} |
export * from './extend' | ||
export * from './omit' | ||
export * from './pick' | ||
export * from './range' | ||
export * from './setHasOneOf' |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
232453
286
2583