searchfe / searchfe/ts2php

forEach循环或map循环支持引用

Open
#101 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
TypeScript
Stars
98
Forks
20
Avg merge
5m
Merged PRs (30d)
3

Description

目前还不支持这种写法,希望可以支持:

const data = [
    {a: 1},
    {a: 2}
];

data.forEach((item: TestItem) => {
    item.b = 22;
});

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

No files, tests, or entry points are named. Start by locating the transpiler logic for forEach and map callbacks, then determine how the shown mutation of item should be represented in generated PHP. Done should include support for the example's reference-like behavior and coverage for both loop forms.

Written by the indexing model from the issue text.

Assessment

Tech stack
php, typescript
Domain
compilers
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.