Skip to content

Commit

Permalink
fix(nitro): update dot-prop import
Browse files Browse the repository at this point in the history
  • Loading branch information
pi0 committed Jan 21, 2022
1 parent 620eb74 commit 81f51d5
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/utils/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import defu from 'defu'
import { mergeHooks } from 'hookable'
import consola from 'consola'
import chalk from 'chalk'
import dotProp from 'dot-prop'
import { getProperty } from 'dot-prop'
import type { NitroPreset, NitroInput } from '../context'

export function hl (str: string) {
Expand All @@ -20,7 +20,7 @@ export function prettyPath (p: string, highlight = true) {

export function compileTemplate (contents: string) {
return (params: Record<string, any>) => contents.replace(/{{ ?([\w.]+) ?}}/g, (_, match) => {
const val = dotProp.get(params, match)
const val = getProperty(params, match)
if (!val) {
consola.warn(`cannot resolve template param '${match}' in ${contents.slice(0, 20)}`)
}
Expand Down

0 comments on commit 81f51d5

Please sign in to comment.