{"action":"created","issue":{"url":"https://api.github.com/repos/eugeneware/replacestream/issues/27","repository_url":"https://api.github.com/repos/eugeneware/replacestream","labels_url":"https://api.github.com/repos/eugeneware/replacestream/issues/27/labels{/name}","comments_url":"https://api.github.com/repos/eugeneware/replacestream/issues/27/comments","events_url":"https://api.github.com/repos/eugeneware/replacestream/issues/27/events","html_url":"https://github.com/eugeneware/replacestream/pull/27","id":171726365,"number":27,"title":"Fix replace of captures","user":{"login":"martinpetlus","id":11678507,"avatar_url":"https://avatars.githubusercontent.com/u/11678507?v=3","gravatar_id":"","url":"https://api.github.com/users/martinpetlus","html_url":"https://github.com/martinpetlus","followers_url":"https://api.github.com/users/martinpetlus/followers","following_url":"https://api.github.com/users/martinpetlus/following{/other_user}","gists_url":"https://api.github.com/users/martinpetlus/gists{/gist_id}","starred_url":"https://api.github.com/users/martinpetlus/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/martinpetlus/subscriptions","organizations_url":"https://api.github.com/users/martinpetlus/orgs","repos_url":"https://api.github.com/users/martinpetlus/repos","events_url":"https://api.github.com/users/martinpetlus/events{/privacy}","received_events_url":"https://api.github.com/users/martinpetlus/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2016-08-17T18:22:36Z","updated_at":"2016-08-17T18:23:42Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/eugeneware/replacestream/pulls/27","html_url":"https://github.com/eugeneware/replacestream/pull/27","diff_url":"https://github.com/eugeneware/replacestream/pull/27.diff","patch_url":"https://github.com/eugeneware/replacestream/pull/27.patch"},"body":"The issue is when we have multiple same captures in the replacement string like:\r\n\r\n`replaceStream(/(a)/, '$1-$1')`\r\n\r\nIn the current implementation only the first occurrence of the capture in replacement string is replaced. This is caused by using the string `replace` method, that replaces only first match in target string given string pattern argument.\r\n\r\nThis fix is using Regex to replace all occurrences of same captures in replacement string.\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/eugeneware/replacestream/issues/comments/240501922","html_url":"https://github.com/eugeneware/replacestream/pull/27#issuecomment-240501922","issue_url":"https://api.github.com/repos/eugeneware/replacestream/issues/27","id":240501922,"user":{"login":"coveralls","id":2354108,"avatar_url":"https://avatars.githubusercontent.com/u/2354108?v=3","gravatar_id":"","url":"https://api.github.com/users/coveralls","html_url":"https://github.com/coveralls","followers_url":"https://api.github.com/users/coveralls/followers","following_url":"https://api.github.com/users/coveralls/following{/other_user}","gists_url":"https://api.github.com/users/coveralls/gists{/gist_id}","starred_url":"https://api.github.com/users/coveralls/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/coveralls/subscriptions","organizations_url":"https://api.github.com/users/coveralls/orgs","repos_url":"https://api.github.com/users/coveralls/repos","events_url":"https://api.github.com/users/coveralls/events{/privacy}","received_events_url":"https://api.github.com/users/coveralls/received_events","type":"User","site_admin":false},"created_at":"2016-08-17T18:23:41Z","updated_at":"2016-08-17T18:23:41Z","body":"\n[![Coverage Status](https://coveralls.io/builds/7492545/badge)](https://coveralls.io/builds/7492545)\n\nCoverage remained the same at 97.333% when pulling **aaf39e70893c3a572f10603eb9c87b9c70c119ed on martinpetlus:fix-replace-of-captures** into **7f9bd191659fbb480a5c845ca8871c99b0eb74c0 on eugeneware:master**.\n"}}
{"actor":{"display_login":"coveralls"}}