Skip to content

Bug in Data.String.Unsafe.char #36

@stkb

Description

@stkb

The js code for Data.String.Unsafe.char looks like this:

exports.char = function (s) {
  if (s.length !== 1) return s.charAt(0);
  throw new Error("Data.String.Unsafe.char: Expected string of length 1.");
};

I'm pretty sure that line on line 21 that !== is meant to be an ===; atm the function's bugging out for good inputs & vice versa. Should be:

if (s.length === 1) return s.charAt(0);

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    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