Skip to content
This repository was archived by the owner on Jul 4, 2021. It is now read-only.

Commit 07e0ce5

Browse files
committed
refactor
1 parent 84b1319 commit 07e0ce5

File tree

2 files changed

+6
-5
lines changed

2 files changed

+6
-5
lines changed

.github/workflows/test.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ jobs:
1313
runs-on: ${{ matrix.os }}
1414
strategy:
1515
matrix:
16-
os: [ubuntu-latest]
16+
os: [ubuntu-latest, windows-latest, macos-latest]
1717
node: [12, 14]
1818
steps:
1919
- name: Checkout

src/index.ts

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,13 +10,14 @@
1010

1111
import { promises as fs } from 'fs'
1212
import path from 'path'
13-
import { isBoolean, isEmptyObject, isString } from '@intlify/shared'
13+
import { isArray, isBoolean, isEmptyObject, isString } from '@intlify/shared'
1414
import { createFilter } from '@rollup/pluginutils'
1515
import { generateJSON, generateYAML } from '@intlify/cli'
1616
import { debug as Debug } from 'debug'
1717
import { parseVueRequest } from './query'
18+
import { normalizePath } from 'vite'
1819

19-
import { normalizePath, Plugin, ResolvedConfig } from 'vite'
20+
import type { Plugin, ResolvedConfig } from 'vite'
2021
import type { CodeGenOptions, DevEnv } from '@intlify/cli'
2122
import type { VitePluginVueI18nOptions } from './options'
2223

@@ -30,9 +31,9 @@ function pluginI18n(
3031
// use `normalizePath` for `options.include`
3132
let include = options.include
3233
if (include) {
33-
if (Array.isArray(include)) {
34+
if (isArray(include)) {
3435
include = include.map(item => normalizePath(item))
35-
} else if (typeof include === 'string') {
36+
} else if (isString(include)) {
3637
include = normalizePath(include)
3738
}
3839
}

0 commit comments

Comments
 (0)