We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 5cf6ed0 commit d22563fCopy full SHA for d22563f
Roadmap/29 - SOLID ISP/javascript/parababire.js
@@ -155,4 +155,15 @@ Object.assign(ColorPrinter.prototype, scanner)
155
const multifuncional = new ColorPrinter()
156
multifuncional.print()
157
multifuncional.sendFax()
158
-multifuncional.scanning()
+multifuncional.scanning()
159
+
160
+function testInterface(object, interface) {
161
+ const prototypeProperties = Object.getOwnPropertyNames(interface.prototype)
162
163
+ for (const method of prototypeProperties) {
164
+ if (!object[method] || typeof object[method] !== 'function') {
165
+ throw new Error(`La clase no implementa el método ${method} de la interface.`)
166
+ }
167
168
+}
169
+testInterface(multifuncional, Printer)
0 commit comments