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

Print number #588

Merged
merged 6 commits into from
Sep 2, 2018
Merged

Print number #588

merged 6 commits into from
Sep 2, 2018

Conversation

hipstersmoothie
Copy link
Collaborator

What's Changing and Why

Allow print to print any type.

closes #568

What else might be affected

Tasks

  • Add tests
  • Update Documentation
  • Update jimp.d.ts
  • Add SemVer Label

@@ -263,13 +259,14 @@ export default () => ({
let alignmentX;
let alignmentY;

if (typeof text === 'object') {
if (typeof text === 'object' && text.text) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it should be :

      if (typeof text === 'object' && typeof text.text === "string") {

since we would want : {text:''} , to not error.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

or maybe text.text != null

@hipstersmoothie
Copy link
Collaborator Author

@edi9999 I changed it it !== null so a user could still provide non string in the text object

@hipstersmoothie hipstersmoothie mentioned this pull request Sep 1, 2018
@edi9999 edi9999 merged commit a639273 into jimp-dev:master Sep 2, 2018
@hipstersmoothie hipstersmoothie deleted the print-number branch September 2, 2018 07:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement a request for a new feature or change in behavior
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Error: text must be a string or an object
2 participants