Coder Social home page Coder Social logo

henry-sarabia / blank Goto Github PK

View Code? Open in Web Editor NEW
12.0 4.0 1.0 22 KB

Detect blank strings or remove whitespace from strings

License: MIT License

Go 100.00%
golang whitespace blank checker helper whitespace-removal blank-queries unicode character

blank's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

blank's Issues

Add support for slice blank checking

As of now, to check multiple strings for blanks the user needs to create their own for loop. Implement a function to check an entire slice of strings for blanks to solve this issue.

Several unicode whitespace characters are not supported

After some research, it seems the regexp package might not be the best fit for identifying whitespace. Although it does catch some control characters, there are others that are not caught by the regular expression.

The escaped vertical tab character '\v' is whitespace but is not currently identified as such.
The unicode non-breaking space character U+00A0 is also not identified as whitespace.

There are definitely other similar cases. To solve this issue, it may be prudent to replace the regular expression with a more naive but thorough individual rune iteration and inspection.

Explore changing public names

I am relatively content with the package name, but still believe it doesn't quite convey its purpose. It maybe prudent to explore changing it to blank and subsequently changing the public functions as follows:

  • IsBlank -> Is
  • HasBlank -> Has

The thought is that it may increase the ergonomics in regards to using the package.

Package is missing a README

There is no README for this package yet. Add a README file with information on what the package is used for, how to use it and how to contribute. Also add build status, test coverage, and Go report card score.

Package should have tagged releases

Adopting semantic versioning using git tags will allow users to differentiate versions of the package and, more importantly, identify when the package has made a breaking change.

Rename RemoveSpace to Remove

RemoveSpace is a descriptive function name but redundant to a user. A user will type blank.RemoveSpace.

This can be simplified to blank.Remove for less visual noise, less typing, a clear and concise name, and congruence with the other function names (blank.Is and blank.Has).

Improve README readability

The current README explains the function of the package but the explanation is unwieldy. It should be rewritten for clarity and conciseness.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.