Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix the issue #1195 #1196

Open
wants to merge 1 commit into
base: legacy
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
12 changes: 12 additions & 0 deletions packages/shared-utils/src/util.js
Expand Up @@ -390,6 +390,7 @@ function reviver (key, val) {
function sanitize (data) {
if (
!isPrimitive(data) &&
!isPrimitiveWrapper(data) &&
!Array.isArray(data) &&
!isPlainObject(data)
) {
Expand Down Expand Up @@ -417,6 +418,17 @@ function isPrimitive (data) {
)
}

function isPrimitiveWrapper (data) {
if (data == null) {
return false
}
return (
data instanceof String ||
data instanceof Number ||
data instanceof Boolean
)
}

/**
* Searches a key or value in the object, with a maximum deepness
* @param {*} obj Search target
Expand Down