{"action":"created","issue":{"url":"https://api.github.com/repos/TypeStrong/atom-typescript/issues/893","repository_url":"https://api.github.com/repos/TypeStrong/atom-typescript","labels_url":"https://api.github.com/repos/TypeStrong/atom-typescript/issues/893/labels{/name}","comments_url":"https://api.github.com/repos/TypeStrong/atom-typescript/issues/893/comments","events_url":"https://api.github.com/repos/TypeStrong/atom-typescript/issues/893/events","html_url":"https://github.com/TypeStrong/atom-typescript/issues/893","id":142151875,"number":893,"title":"Argument of type 'string is not assignable to parameter of type RegExp","user":{"login":"csmrkid","id":430378,"avatar_url":"https://avatars.githubusercontent.com/u/430378?v=3","gravatar_id":"","url":"https://api.github.com/users/csmrkid","html_url":"https://github.com/csmrkid","followers_url":"https://api.github.com/users/csmrkid/followers","following_url":"https://api.github.com/users/csmrkid/following{/other_user}","gists_url":"https://api.github.com/users/csmrkid/gists{/gist_id}","starred_url":"https://api.github.com/users/csmrkid/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/csmrkid/subscriptions","organizations_url":"https://api.github.com/users/csmrkid/orgs","repos_url":"https://api.github.com/users/csmrkid/repos","events_url":"https://api.github.com/users/csmrkid/events{/privacy}","received_events_url":"https://api.github.com/users/csmrkid/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":2,"created_at":"2016-03-20T11:06:46Z","updated_at":"2016-12-16T15:22:59Z","closed_at":null,"body":"Dear developers,\n\nHere is my code\n`public test(url: string, pageSize: number, pageNumber: number, columnName: string, direction: string, term: string): Observable<ResponseData<T[]>> {`\n`return this.http.get(this.getUrl(url)`\n`.replace('{columnName}', columnName)`\n`.replace('{pageSize}', pageSize)` **<-----error** , **Argument of type 'string is not assignable to parameter of type RegExp**\n`.replace('{pageNumber}', pageNumber)`\n`.replace('{direction}', direction)`\n`.replace('{term}', term)`\n`, this.restApioptions`\n`).map(res => <ResponseData<T[]>>res.json())`\n`.catch(this.logger.log);`\n`}`\n\n`public getUrl(url:string):string{`\n    `return this.TargetUrl+url;`\n `}`\nThere is an error message **Argument of type 'string is not assignable to parameter of type RegExp**. However, no matter what I put at **<--error** spot, it will show the same error. \nIf I replace calling **this.getUrl(url)** to a pure string like **\"xx\".replace(....**  then the error will be gone.\nI have no idea why this happened, because the **getURL()** will return a string anyway. I found no error in my compiler console and the script runs without any error.\n"},"comment":{"url":"https://api.github.com/repos/TypeStrong/atom-typescript/issues/comments/267617444","html_url":"https://github.com/TypeStrong/atom-typescript/issues/893#issuecomment-267617444","issue_url":"https://api.github.com/repos/TypeStrong/atom-typescript/issues/893","id":267617444,"user":{"login":"johncoffee","id":4920452,"avatar_url":"https://avatars.githubusercontent.com/u/4920452?v=3","gravatar_id":"","url":"https://api.github.com/users/johncoffee","html_url":"https://github.com/johncoffee","followers_url":"https://api.github.com/users/johncoffee/followers","following_url":"https://api.github.com/users/johncoffee/following{/other_user}","gists_url":"https://api.github.com/users/johncoffee/gists{/gist_id}","starred_url":"https://api.github.com/users/johncoffee/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/johncoffee/subscriptions","organizations_url":"https://api.github.com/users/johncoffee/orgs","repos_url":"https://api.github.com/users/johncoffee/repos","events_url":"https://api.github.com/users/johncoffee/events{/privacy}","received_events_url":"https://api.github.com/users/johncoffee/received_events","type":"User","site_admin":false},"created_at":"2016-12-16T15:22:59Z","updated_at":"2016-12-16T15:22:59Z","body":"The error message is confusing, but I think the problem here is that`pageSize` is a number.\r\n\r\nA workaround that should work in your case:\r\n`.replace('{pageSize}', pageSize+'')` or `.replace('{pageSize}', pageSize.toString())`"}}
{"actor":{"display_login":"johncoffee"}}