diff --git a/src/destructure-box-shadow.test.ts b/src/destructure-box-shadow.test.ts index 8b722ca..aad5eb2 100644 --- a/src/destructure-box-shadow.test.ts +++ b/src/destructure-box-shadow.test.ts @@ -1,6 +1,6 @@ import { test, expect, describe } from 'vitest' import { destructure_box_shadow } from './destructure-box-shadow.js' -import { ColorValue, EXTENSION_AUTHORED_AS } from './types.js' +import type { ColorValue } from './types.js' import { color_to_token } from './colors.js' function create_px_length(value: number): { value: number, unit: string } { diff --git a/src/index.test.ts b/src/index.test.ts index 71f45a5..740f5b3 100644 --- a/src/index.test.ts +++ b/src/index.test.ts @@ -155,6 +155,13 @@ describe('css_to_tokens', () => { `) expect(actual.color).toEqual({}) }) + + test('extensions[css-properties] does not yield a type error', () => { + let actual = css_to_tokens('a { color: green; }') + // Not so much interested in the test result, more looking that this isn't giving a type error + let properties = actual.color['green-5e0cf03']!['$extensions'][EXTENSION_CSS_PROPERTIES] + expect(properties).toEqual(['color']) + }) }) describe('font sizes', () => { diff --git a/src/index.ts b/src/index.ts index 2d050fe..ba928ab 100644 --- a/src/index.ts +++ b/src/index.ts @@ -50,7 +50,7 @@ type ItemsPerContext = Record + color: Record font_size: Record font_family: Record line_height: Record @@ -86,7 +86,7 @@ function get_count(collection_item: number | CssLocation[]) { export function analysis_to_tokens(analysis: CssAnalysis): Tokens { return { color: (() => { - let colors = Object.create(null) as Record + let colors = Object.create(null) as Record let unique = get_unique(analysis.values.colors) let color_groups = group_colors(unique) diff --git a/tsconfig.json b/tsconfig.json index 3904641..59e2b2c 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -27,6 +27,5 @@ ], "exclude": [ "node_modules", - "src/**/*.test.ts" ] } \ No newline at end of file