Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/jsutils/defineToJSON.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@
*/

/**
* The `applyToJSON()` function defines toJSON() and inspect() prototype
* The `defineToJSON()` function defines toJSON() and inspect() prototype
* methods which are aliases for toString().
*/
export default function applyToJSON(classObject: Class<any>): void {
export default function defineToJSON(classObject: Class<any>): void {
classObject.prototype.toJSON = classObject.prototype.inspect =
classObject.prototype.toString;
}
6 changes: 3 additions & 3 deletions src/jsutils/defineToStringTag.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,19 +8,19 @@
*/

/**
* The `applyToStringTag()` function checks first to see if the runtime
* The `defineToStringTag()` function checks first to see if the runtime
* supports the `Symbol` class and then if the `Symbol.toStringTag` constant
* is defined as a `Symbol` instance. If both conditions are met, the
* Symbol.toStringTag property is defined as a getter that returns the
* supplied class constructor's name.
*
* @method applyToStringTag
* @method defineToStringTag
*
* @param {Class<any>} classObject a class such as Object, String, Number but
* typically one of your own creation through the class keyword; `class A {}`,
* for example.
*/
export default function applyToStringTag(classObject: Class<any>): void {
export default function defineToStringTag(classObject: Class<any>): void {
if (typeof Symbol === 'function' && Symbol.toStringTag) {
Object.defineProperty(classObject.prototype, Symbol.toStringTag, {
get() {
Expand Down