Skip to content

Commit 9ee63e8

Browse files
committed
fix: rename isObject to isPlainObject, close #104
1 parent 66733f4 commit 9ee63e8

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

plugin/src/core/transform.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import {
33
isArray,
44
isEmptyObject,
55
isFunction,
6-
isObject,
6+
isPlainObject,
77
sortBy,
88
toArray,
99
} from '@pengzhanbo/utils'
@@ -52,7 +52,7 @@ export function transformMockData(
5252
const mocks: Record<string, MockOptions> = {}
5353

5454
list
55-
.filter(mock => isObject(mock) && mock.enabled !== false && mock.url)
55+
.filter(mock => isPlainObject(mock) && mock.enabled !== false && mock.url)
5656
.forEach((mock) => {
5757
const { pathname, query } = urlParse(mock.url)
5858
const list = (mocks[pathname!] ??= [])

plugin/src/core/validator.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import type { ExtraRequest } from '../types'
2-
import { isArray, isObject } from '@pengzhanbo/utils'
2+
import { isArray, isPlainObject } from '@pengzhanbo/utils'
33

44
export function validate(
55
request: ExtraRequest,
@@ -50,7 +50,7 @@ function isIncluded(source: unknown, target: unknown): boolean {
5050
}),
5151
)
5252
}
53-
if (isObject(source) && isObject(target))
53+
if (isPlainObject(source) && isPlainObject(target))
5454
return isObjectSubset(source, target)
5555

5656
// 相比于 === , 该方法能够正确的处理 NaN、 0、 +0、 -0 等特殊情况

0 commit comments

Comments
 (0)