Skip to content

dropWhile function skips the error when the functor is a string #88

@singla-shivam

Description

@singla-shivam

Which function does need to have its types refine/fix?

dropWhile

What is the problem you faced with current types?

When the functor is a string (not an array of strings), the predicate is not forced to take the string as the parameter.

import * as Fae from "fae@v1.1.1"

function f(a: number) {
    return a > 10
}

Fae.dropWhile(f, 'df')
Fae.dropLastWhile(f, 'df')

Playground

Expected behavior

It should have result in an error.

Additional context

The same problem was for dropLastWhile but it has been fixed #84. Change

Versions (please complete the following information):

  • Fae: v1.1.1

Metadata

Metadata

Assignees

No one assigned

    Labels

    typesRefine/fix types

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions