@putout/printer
Advanced tools
Comparing version 8.38.0 to 8.39.0
@@ -6,19 +6,10 @@ 'use strict'; | ||
const {maybeDecorators} = require('../../maybe/maybe-decorators'); | ||
const {printKey} = require('./kind'); | ||
const ClassMethod = { | ||
print: maybeDecorators((path, printer, semantics) => { | ||
const {print, maybe} = printer; | ||
const {print} = printer; | ||
const {node} = path; | ||
const { | ||
kind, | ||
computed, | ||
generator, | ||
accessibility, | ||
returnType, | ||
} = node; | ||
const {accessibility, returnType} = node; | ||
const isConstructor = kind === 'constructor'; | ||
const isMethod = kind === 'method'; | ||
const isGetter = /get|set/.test(kind); | ||
if (accessibility) { | ||
@@ -39,17 +30,3 @@ print(accessibility); | ||
maybe.print(generator, '*'); | ||
maybe.print(isConstructor, kind); | ||
if (isMethod) { | ||
maybe.print(computed, '['); | ||
print('__key'); | ||
maybe.print(computed, ']'); | ||
} | ||
if (isGetter) { | ||
print(kind); | ||
print(' '); | ||
print('__key'); | ||
} | ||
printKey(path, printer); | ||
printParams(path, printer, semantics); | ||
@@ -56,0 +33,0 @@ |
@@ -5,2 +5,3 @@ 'use strict'; | ||
const {printParams} = require('./params'); | ||
const {printKey} = require('./kind'); | ||
@@ -15,19 +16,5 @@ module.exports.ObjectMethod = { | ||
print(path, printer, semantics) { | ||
const {print, maybe} = printer; | ||
const {print} = printer; | ||
const { | ||
kind, | ||
generator, | ||
computed, | ||
} = path.node; | ||
const notMethod = kind !== 'method'; | ||
maybe.print(notMethod, `${kind} `); | ||
maybe.print(generator, '*'); | ||
maybe.print(computed, '['); | ||
print('__key'); | ||
maybe.print(computed, ']'); | ||
printKey(path, printer); | ||
printParams(path, printer, semantics); | ||
@@ -34,0 +21,0 @@ |
'use strict'; | ||
const {printParams} = require('../../expressions/function/params'); | ||
const {printKey} = require('../../expressions/function/kind'); | ||
const { | ||
@@ -11,5 +11,5 @@ hasReturnType, | ||
module.exports.TSMethodSignature = (path, printer, semantics) => { | ||
const {traverse, write} = printer; | ||
const {write} = printer; | ||
traverse(path.get('key')); | ||
printKey(path, printer); | ||
printParams(path, printer, semantics); | ||
@@ -16,0 +16,0 @@ |
{ | ||
"name": "@putout/printer", | ||
"version": "8.38.0", | ||
"version": "8.39.0", | ||
"type": "commonjs", | ||
@@ -5,0 +5,0 @@ "author": "coderaiser <mnemonic.enemy@gmail.com> (https://github.com/coderaiser)", |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
131
221121
4887