@jsenv/ast 1.2.2 → 1.3.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jsenv/ast",
3
- "version": "1.2.2",
3
+ "version": "1.3.1",
4
4
  "description": "Parse and transform HTML,CSS and JS",
5
5
  "license": "MIT",
6
6
  "repository": {
@@ -33,8 +33,8 @@
33
33
  "test": "node --conditions=development ./scripts/test.mjs"
34
34
  },
35
35
  "dependencies": {
36
- "@babel/parser": "7.19.0",
37
- "@parcel/css": "1.13.1",
36
+ "@babel/parser": "7.19.1",
37
+ "@parcel/css": "1.14.0",
38
38
  "acorn": "8.8.0",
39
39
  "acorn-import-assertions": "1.8.0",
40
40
  "acorn-walk": "8.2.0",
@@ -78,6 +78,9 @@ const analyzeUrlNodeType = (secondArgNode, { isJsModule }) => {
78
78
  if (isImportMetaUrl(secondArgNode)) {
79
79
  return "import.meta.url"
80
80
  }
81
+ if (isWindowLocation(secondArgNode)) {
82
+ return "window.location"
83
+ }
81
84
  if (isWindowOrigin(secondArgNode)) {
82
85
  return "window.origin"
83
86
  }
@@ -99,6 +102,16 @@ const isImportMetaUrl = (node) => {
99
102
  )
100
103
  }
101
104
 
105
+ const isWindowLocation = (node) => {
106
+ return (
107
+ node.type === "MemberExpression" &&
108
+ node.object.type === "Identifier" &&
109
+ node.object.name === "window" &&
110
+ node.property.type === "Identifier" &&
111
+ node.property.name === "location"
112
+ )
113
+ }
114
+
102
115
  const isWindowOrigin = (node) => {
103
116
  return (
104
117
  node.type === "MemberExpression" &&