@xstate/codemod 0.1.0-beta.1 → 0.1.0-beta.2
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/xstate-codemod.js +2 -2
- package/package.json +2 -2
package/dist/xstate-codemod.js
CHANGED
|
@@ -3567,7 +3567,7 @@ function toJson(value, stats, seen = new Set(), maxDepth = Infinity) {
|
|
|
3567
3567
|
if (value === null) return null;
|
|
3568
3568
|
const obj = value;
|
|
3569
3569
|
if (isActorRef(obj)) return {
|
|
3570
|
-
|
|
3570
|
+
'@actor': normalizeId(obj.id)
|
|
3571
3571
|
};
|
|
3572
3572
|
if (obj instanceof Error) return String(obj);
|
|
3573
3573
|
if (typeof obj.toJSON === 'function') return toJson(obj.toJSON(), stats, seen, maxDepth);
|
|
@@ -3667,7 +3667,7 @@ function mapDeep(value, fn) {
|
|
|
3667
3667
|
return value;
|
|
3668
3668
|
}
|
|
3669
3669
|
const stripAnonSuffix = value => mapDeep(value, (key, item) => (key === 'id' || key === 'to') && typeof item === 'string' ? item.replace(/(:\d+|\[\d+\])$/, '').replace(/^(x:\d+|\d+\.)/, '') : item);
|
|
3670
|
-
const isActorMarker = item => !!item && typeof item === 'object' && '
|
|
3670
|
+
const isActorMarker = item => !!item && typeof item === 'object' && '@actor' in item;
|
|
3671
3671
|
const stripErrorPrefix = message => message.replace(/^(\w*Error:\s*)+/, '').trim();
|
|
3672
3672
|
const INTENTIONAL_DELTAS = [{
|
|
3673
3673
|
rule: 'anonymous-child-id',
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@xstate/codemod",
|
|
3
|
-
"version": "0.1.0-beta.
|
|
3
|
+
"version": "0.1.0-beta.2",
|
|
4
4
|
"description": "Codemods for migrating XState source between versions (v5 → v6)",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"xstate",
|
|
@@ -36,7 +36,7 @@
|
|
|
36
36
|
"ts-morph": "^24.0.0",
|
|
37
37
|
"tsx": "^4.23.13",
|
|
38
38
|
"xstate5": "npm:xstate@^5.33.0",
|
|
39
|
-
"xstate": "^6.0.0-beta.
|
|
39
|
+
"xstate": "^6.0.0-beta.2"
|
|
40
40
|
},
|
|
41
41
|
"devDependencies": {
|
|
42
42
|
"vitest": "^3.2.2"
|