{"action":"opened","issue":{"url":"https://api.github.com/repos/dominictarr/varstruct/issues/7","repository_url":"https://api.github.com/repos/dominictarr/varstruct","labels_url":"https://api.github.com/repos/dominictarr/varstruct/issues/7/labels{/name}","comments_url":"https://api.github.com/repos/dominictarr/varstruct/issues/7/comments","events_url":"https://api.github.com/repos/dominictarr/varstruct/issues/7/events","html_url":"https://github.com/dominictarr/varstruct/issues/7","id":136599852,"number":7,"title":"varstruct doesn't copy structure","user":{"login":"fanatid","id":2633065,"avatar_url":"https://avatars.githubusercontent.com/u/2633065?v=3","gravatar_id":"","url":"https://api.github.com/users/fanatid","html_url":"https://github.com/fanatid","followers_url":"https://api.github.com/users/fanatid/followers","following_url":"https://api.github.com/users/fanatid/following{/other_user}","gists_url":"https://api.github.com/users/fanatid/gists{/gist_id}","starred_url":"https://api.github.com/users/fanatid/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fanatid/subscriptions","organizations_url":"https://api.github.com/users/fanatid/orgs","repos_url":"https://api.github.com/users/fanatid/repos","events_url":"https://api.github.com/users/fanatid/events{/privacy}","received_events_url":"https://api.github.com/users/fanatid/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2016-02-26T05:12:38Z","updated_at":"2016-02-26T05:12:38Z","closed_at":null,"body":"```js\r\nvar vstruct = require('varstruct')\r\n\r\nvar obj = {\r\n  x: vstruct.DoubleBE,\r\n  y: vstruct.DoubleBE,\r\n  z: vstruct.DoubleBE\r\n}\r\n\r\n//create a vector codec.\r\nvar vector = vstruct(obj)\r\n\r\nvar buffer = vector.encode({\r\n  x: 93.1, y: 87.3, z: 10.39\r\n})\r\n\r\nobj.e = vstruct.UInt8\r\n\r\nvar v = vector.decode(buffer) // undefined\r\n```"}}