From 0e6deab9c97062d050560910e750b82f5aacfe54 Mon Sep 17 00:00:00 2001 From: Kevin Jahns Date: Wed, 22 Jan 2020 16:44:30 +0100 Subject: [PATCH] type toJSON returns --- src/types/YText.js | 3 +-- src/types/YXmlFragment.js | 3 +++ src/types/YXmlText.js | 3 +++ 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/src/types/YText.js b/src/types/YText.js index 5da027dd..2f87e9ed 100644 --- a/src/types/YText.js +++ b/src/types/YText.js @@ -676,8 +676,7 @@ export class YText extends AbstractType { /** * Returns the unformatted string representation of this YText type. * - * Avoids undefined being returned when called as a nested type. - * + * @return {string} * @public */ toJSON () { diff --git a/src/types/YXmlFragment.js b/src/types/YXmlFragment.js index af946233..d692c8f6 100644 --- a/src/types/YXmlFragment.js +++ b/src/types/YXmlFragment.js @@ -242,6 +242,9 @@ export class YXmlFragment extends AbstractType { return typeListMap(this, xml => xml.toString()).join('') } + /** + * @return {string} + */ toJSON () { return this.toString() } diff --git a/src/types/YXmlText.js b/src/types/YXmlText.js index 5a05fe2c..e4ef8f24 100644 --- a/src/types/YXmlText.js +++ b/src/types/YXmlText.js @@ -70,6 +70,9 @@ export class YXmlText extends YText { }).join('') } + /** + * @return {string} + */ toJSON () { return this.toString() }