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.

More than one sequential undefined in a sequence gets skipped over

See original GitHub issue

Hi,

The test case below fails because more than one consecutive undefined element in a sequence gets skipped over:

const vals =  ["hello", undefined, undefined, undefined, "world"];
expect(asSequence(vals).toArray()).to.deep.equal(vals);

The result with typescript 2.6.2 is

AssertionError: expected [ 'hello', undefined, 'world' ] to deeply equal [ Array(5) ]
      + expected - actual

       [
         "hello"
         [undefined]
      +  [undefined]
      +  [undefined]
         "world"
       ]

Besides this one quirk, this library has been fantastic

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:6 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
winterbecommented, Jan 3, 2018

Thanks for explaining your usecase. I will look into this next week so we can properly support undefined values in Sequency.

davemasterdave notifications@github.com schrieb am Mi. 3. Jan. 2018 um 02:52:

I am working on a large typescript server application and a lot of the interface definitions have optional parameters. Furthermore, the project has strictNullChecks enabled so all of the optional definitions result in types of T | undefined, resulting in making the null type incompatible.

I ran into this quirk since a lot of the types are possibly also of the type “undefined”. More specifically, I had an iterable fixed length data structure that happened to have several optional types that were not defined in a row. Then, when I was using this library to convert the fixed length object into another iterable object of the same length, I noticed that the output was shorter than what it was supposed to be.

Best Regards

David

— You are receiving this because you commented.

Reply to this email directly, view it on GitHub https://github.com/winterbe/sequency/issues/21#issuecomment-354922245, or mute the thread https://github.com/notifications/unsubscribe-auth/AAdmqd-VR13HoFf9yQ5MMQP3AzBeH6GSks5tGt1mgaJpZM4RQOmK .

0reactions
winterbecommented, Jul 30, 2018

@davemasterdave The issue is fixed with next version 0.19.0 which will be published soon. Sorry for the delay

Read more comments on GitHub >

github_iconTop Results From Across the Web

Are undefined terms allowed in a sequence?
[What I do know is that if the above sequence were valid, it would be convergent (by definition), which would in turn mean...
Read more >
c++ - Undefined behavior and sequence points - Stack Overflow
Informally it means that between two sequence points a variable must not be modified more than once. In an expression statement, the next...
Read more >
1.13. Loops and Sequences — Hands-on Python Tutorial for ...
A dash is shown where a variable is not defined. For instance after line 1 is executed, a value is given to x,...
Read more >
Sequence Points in C | Set 1 - GeeksforGeeks
The reason for undefined behavior in PROGRAM 1 is, the operator '+' doesn't have a standard defined order of evaluation for its operands....
Read more >
4.16.1 Sequences - Racket Documentation
A sequence encapsulates an ordered collection of values. The elements of a sequence can be extracted with one of the for syntactic forms, ......
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