Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cats are big #1

Open
callumacrae opened this issue Sep 28, 2016 · 7 comments
Open

Cats are big #1

callumacrae opened this issue Sep 28, 2016 · 7 comments

Comments

@callumacrae
Copy link

callumacrae commented Sep 28, 2016

Cats take up twice the width of a normal character.

screen shot 2016-09-28 at 09 24 52

I'd suggest padding the string with half a cat, instead.

@sindresorhus
Copy link
Owner

I'd suggest padding the string with half a cat, instead.

Are you sure you want that? 😜

half-cat

@mk-pmb
Copy link

mk-pmb commented Apr 1, 2017

Well, the Readme states

Padding cats are truncated if they exceed length.

which contradicts the example:

catPad('Meow', 6);
//=> '🐈🐈Meow'

because

'🐈🐈Meow'.length === 8

I'd say let's use UCS-2 characters for the length, and in the odd case, prefer the front half of the cat so it can still purr and make funny faces.

@sindresorhus
Copy link
Owner

What if we used half an avocado when it's half? → 🥑

@mk-pmb
Copy link

mk-pmb commented Apr 1, 2017

My Unicode catalog's avocado uses 2 UCS-2 characters so that won't help. :-(

@sindresorhus
Copy link
Owner

const cats = new String('🐈🐈Meow');
Object.defineProperty(cats, 'meowlength', {value: 6});

cats.meowlength === 6;
//=> true

@unitof
Copy link

unitof commented Oct 29, 2019

This is preventing me from using this in production. Is there a fix yet?

@mk-pmb
Copy link

mk-pmb commented Oct 30, 2019

This is preventing me from using this in production. Is there a fix yet?

My apologies for the continuing lack of progress with this severe malfunction.
I summoned my emergency advisors panel today, and the expert cats seemed to almost have reached a consensus for using U+264C leo (♌) as a first stage workaround. Unfortunately, they then discovered U+2653 pisces (♓) and adjourned the meeting to visit the nearby creek.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants