Skip to content

Use Array.isArray instead of instanceof Array for assertion - #1841

Merged
liamqma merged 1 commit into
masterfrom
mszczepanski/use-more-reliable-array-instance-check
Jul 7, 2025
Merged

Use Array.isArray instead of instanceof Array for assertion#1841
liamqma merged 1 commit into
masterfrom
mszczepanski/use-more-reliable-array-instance-check

Conversation

@marcins

@marcins marcins commented Jul 7, 2025

Copy link
Copy Markdown
Contributor

What is this change?

Changing assert(rules instanceof Array) to assert(Array.isArray(rules)).

Why are we making this change?

The previous check can fail in an environment where the array was created in a different "context" (i.e. workers)


PR checklist

Don't delete me!

I have...

  • Updated or added applicable tests
  • Updated the documentation in website/
  • Added a changeset (if making any changes that affect Compiled's behaviour)

@changeset-bot

changeset-bot Bot commented Jul 7, 2025

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: f3b87ab

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@compiled/parcel-optimizer Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@netlify

netlify Bot commented Jul 7, 2025

Copy link
Copy Markdown

Deploy Preview for compiled-css-in-js canceled.

Name Link
🔨 Latest commit f3b87ab
🔍 Latest deploy log https://app.netlify.com/projects/compiled-css-in-js/deploys/686b41fb9dae020008f6a9bb

@liamqma
liamqma merged commit d7b0505 into master Jul 7, 2025
15 checks passed
@liamqma
liamqma deleted the mszczepanski/use-more-reliable-array-instance-check branch July 7, 2025 05:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants