Skip to content

Commit 737f03f

Browse files
philipp-spiessadamwathan
authored andcommitted
Change context type
1 parent 7fda819 commit 737f03f

File tree

3 files changed

+7
-7
lines changed

3 files changed

+7
-7
lines changed

packages/tailwindcss/src/ast.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ export type Comment = {
1818

1919
export type Context = {
2020
kind: 'context'
21-
context: Record<string, unknown>
21+
context: Record<string, string>
2222
nodes: AstNode[]
2323
}
2424

@@ -48,7 +48,7 @@ export function comment(value: string): Comment {
4848
}
4949
}
5050

51-
export function context(context: Record<string, unknown>, nodes: AstNode[]): Context {
51+
export function context(context: Record<string, string>, nodes: AstNode[]): Context {
5252
return {
5353
kind: 'context',
5454
context,
@@ -74,11 +74,11 @@ export function walk(
7474
utils: {
7575
parent: AstNode | null
7676
replaceWith(newNode: AstNode | AstNode[]): void
77-
context: Record<string, unknown>
77+
context: Record<string, string>
7878
},
7979
) => void | WalkAction,
8080
parent: AstNode | null = null,
81-
context: Record<string, unknown> = {},
81+
context: Record<string, string> = {},
8282
) {
8383
for (let i = 0; i < ast.length; i++) {
8484
let node = ast[i]

packages/tailwindcss/src/compat/apply-compat-hooks.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ export async function applyCompatibilityHooks({
8989
}
9090

9191
pluginPaths.push([
92-
{ id: pluginPath, base: (context as any).base },
92+
{ id: pluginPath, base: context.base },
9393
Object.keys(options).length > 0 ? options : null,
9494
])
9595

@@ -107,7 +107,7 @@ export async function applyCompatibilityHooks({
107107
throw new Error('`@config` cannot be nested.')
108108
}
109109

110-
configPaths.push({ id: node.selector.slice(9, -1), base: (context as any).base })
110+
configPaths.push({ id: node.selector.slice(9, -1), base: context.base })
111111
replaceWith([])
112112
return
113113
}

packages/tailwindcss/src/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@ async function parseCss(
126126
) {
127127
throw new Error('`@source` paths must be quoted.')
128128
}
129-
globs.push({ base: context.base as string, pattern: path.slice(1, -1) })
129+
globs.push({ base: context.base, pattern: path.slice(1, -1) })
130130
replaceWith([])
131131
return
132132
}

0 commit comments

Comments
 (0)