@lingui/babel-plugin-extract-messages 5.1.2 → 5.2.0

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/dist/index.cjs CHANGED
@@ -1,7 +1,5 @@
1
1
  'use strict';
2
2
 
3
- const types = require('@babel/types');
4
-
5
3
  function collectMessage(path, props, ctx) {
6
4
  if (props.id === void 0)
7
5
  return;
@@ -88,7 +86,7 @@ function extractFromObjectExpression(t, exp, hub) {
88
86
  const textKeys = ["id", "message", "comment", "context"];
89
87
  exp.properties.forEach(({ key, value }, i) => {
90
88
  const name = key.name;
91
- if (name === "values" && types.isObjectExpression(value)) {
89
+ if (name === "values" && t.isObjectExpression(value)) {
92
90
  props.placeholders = valuesObjectExpressionToPlaceholdersRecord(
93
91
  t,
94
92
  value,
@@ -154,7 +152,7 @@ function index({ types: t }) {
154
152
  acc[key] = item.value.expression.value;
155
153
  }
156
154
  }
157
- if (key === "values" && t.isJSXExpressionContainer(item.value) && types.isObjectExpression(item.value.expression)) {
155
+ if (key === "values" && t.isJSXExpressionContainer(item.value) && t.isObjectExpression(item.value.expression)) {
158
156
  acc.placeholders = valuesObjectExpressionToPlaceholdersRecord(
159
157
  t,
160
158
  item.value.expression,
package/dist/index.mjs CHANGED
@@ -1,5 +1,3 @@
1
- import { isObjectExpression } from '@babel/types';
2
-
3
1
  function collectMessage(path, props, ctx) {
4
2
  if (props.id === void 0)
5
3
  return;
@@ -86,7 +84,7 @@ function extractFromObjectExpression(t, exp, hub) {
86
84
  const textKeys = ["id", "message", "comment", "context"];
87
85
  exp.properties.forEach(({ key, value }, i) => {
88
86
  const name = key.name;
89
- if (name === "values" && isObjectExpression(value)) {
87
+ if (name === "values" && t.isObjectExpression(value)) {
90
88
  props.placeholders = valuesObjectExpressionToPlaceholdersRecord(
91
89
  t,
92
90
  value,
@@ -152,7 +150,7 @@ function index({ types: t }) {
152
150
  acc[key] = item.value.expression.value;
153
151
  }
154
152
  }
155
- if (key === "values" && t.isJSXExpressionContainer(item.value) && isObjectExpression(item.value.expression)) {
153
+ if (key === "values" && t.isJSXExpressionContainer(item.value) && t.isObjectExpression(item.value.expression)) {
156
154
  acc.placeholders = valuesObjectExpressionToPlaceholdersRecord(
157
155
  t,
158
156
  item.value.expression,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lingui/babel-plugin-extract-messages",
3
- "version": "5.1.2",
3
+ "version": "5.2.0",
4
4
  "description": "Babel plugin for collecting messages from source code for internationalization",
5
5
  "main": "./dist/index.cjs",
6
6
  "module": "./dist/index.mjs",
@@ -43,9 +43,9 @@
43
43
  "@babel/core": "^7.21.0",
44
44
  "@babel/traverse": "^7.20.12",
45
45
  "@babel/types": "^7.20.7",
46
- "@lingui/babel-plugin-lingui-macro": "5.1.2",
46
+ "@lingui/babel-plugin-lingui-macro": "5.2.0",
47
47
  "@lingui/jest-mocks": "3.0.3",
48
48
  "unbuild": "2.0.0"
49
49
  },
50
- "gitHead": "e45a2af5dfc1c88131fa8196d596e0f0f25678ea"
50
+ "gitHead": "9c50b4877ca8b134d0d96c09a8055221ca70b095"
51
51
  }