question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

it is possible?

var typeSet = {

    jBinary.all:'msh',

    msh: {
        artworks: ['string0', 9],
        version: ['array', 'uint8', 8],
        indices: ['array', 'uint8', 8],

        versionName: ['string0', 'indices[4]']
    }
};

‘indices[4]’ as variable

Issue Analytics

  • State:open
  • Created 7 years ago
  • Reactions:1
  • Comments:6 (3 by maintainers)

github_iconTop GitHub Comments

2reactions
RReversercommented, Aug 1, 2016

Now I see. No, you can’t use ['string0', 'indices[4]'] directly, but you can pass a function from context as a second argument, see https://github.com/jDataView/jBinary/wiki/Standard-types#references for an example.

In your case, it will be smth like:

    msh: {
        artworks: ['string0', 9],
        version: ['array', 'uint8', 8],
        indices: ['array', 'uint8', 8],

        versionName: ['string0', function (context) {
            return context.indices[4];
        });
    }

or, if using ES6, ['string0', context => context.indices[4]].

Does this answer your question?

1reaction
RReversercommented, Jul 31, 2016

I don’t know what you’re trying to achieve, so can’t answer your question. Also, please format your code using Markdown for better readability (wrap between ````javascript` and ````` lines).

Read more comments on GitHub >

github_iconTop Results From Across the Web

Im A Noob - Official Fortnite Music Video | Ft. Defaults - YouTube
Im A Noob - Official Fortnite Music Video | Ft. Defaults. 928K views 2 years ago. Placid. Placid. 514K subscribers. Join. Subscribe.
Read more >
I'm A Noob- Fortnite song (Lyrics) - YouTube
Like and Subscribe and press ( ) to join the Notification Squad and stay update with new uploadsI'm A NoobLyrics: I'm a...
Read more >
I'm A Fortnite Noob - YouTube
80K views 1 year ago. 80,556 views • Sep 28, 2021. Provided to YouTube by IIP-DDS I'm A Fortnite Noob · TheFunSongs …...
Read more >
"I'm a Noob" - Minecraft Parody (Music Video) - YouTube
A parody of Fun's 'Some Nights' exploring the life of a regular Minecraft noob and their journey to greatness. This Minecraft parody was ......
Read more >
I'm a noob. (Official Fortnite Music Video) - YouTube
Original song " I'm a noob " Just thought I'd make a music video out of the song called " I'm a noob...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found