|
14 | 14 | * limitations under the License. |
15 | 15 | **/ |
16 | 16 |
|
17 | | -var when = require("when"); |
18 | 17 | var fs = require('fs'); |
19 | 18 | var path = require('path'); |
20 | 19 | var child_process = require('child_process'); |
@@ -151,7 +150,7 @@ function function2node(data, options) { |
151 | 150 | // console.log("OPT",options); |
152 | 151 | // console.log("DATA",data); |
153 | 152 | "use strict"; |
154 | | - return when.promise(function (resolve, reject) { |
| 153 | + return new Promise(function (resolve, reject) { |
155 | 154 | // Read meta data in js file |
156 | 155 | var meta = {}; |
157 | 156 | var parts = new String(data.src).split('\n'); |
@@ -290,7 +289,7 @@ function function2node(data, options) { |
290 | 289 |
|
291 | 290 | function swagger2node(data, options) { |
292 | 291 | "use strict"; |
293 | | - return when.promise(function (resolve, reject) { |
| 292 | + return new Promise(function (resolve, reject) { |
294 | 293 | // Modify swagger data |
295 | 294 | var swagger = JSON.parse(JSON.stringify(data.src), function (key, value) { |
296 | 295 | if (key === 'consumes' || key === 'produces') { // Filter type of 'Content-Type' and 'Accept' in request header |
@@ -613,7 +612,7 @@ function swagger2node(data, options) { |
613 | 612 |
|
614 | 613 |
|
615 | 614 | function wottd2node(data, options) { |
616 | | - return when.promise(function (resolve, reject) { |
| 615 | + return new Promise(function (resolve, reject) { |
617 | 616 | let td = data.src; |
618 | 617 |
|
619 | 618 | // validate TD |
|
0 commit comments