Skip to content

Commit 5e1a059

Browse files
committed
Remove when library for native promises
1 parent 1392d7b commit 5e1a059

File tree

2 files changed

+3
-5
lines changed

2 files changed

+3
-5
lines changed

lib/nodegen.js

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@
1414
* limitations under the License.
1515
**/
1616

17-
var when = require("when");
1817
var fs = require('fs');
1918
var path = require('path');
2019
var child_process = require('child_process');
@@ -151,7 +150,7 @@ function function2node(data, options) {
151150
// console.log("OPT",options);
152151
// console.log("DATA",data);
153152
"use strict";
154-
return when.promise(function (resolve, reject) {
153+
return new Promise(function (resolve, reject) {
155154
// Read meta data in js file
156155
var meta = {};
157156
var parts = new String(data.src).split('\n');
@@ -290,7 +289,7 @@ function function2node(data, options) {
290289

291290
function swagger2node(data, options) {
292291
"use strict";
293-
return when.promise(function (resolve, reject) {
292+
return new Promise(function (resolve, reject) {
294293
// Modify swagger data
295294
var swagger = JSON.parse(JSON.stringify(data.src), function (key, value) {
296295
if (key === 'consumes' || key === 'produces') { // Filter type of 'Content-Type' and 'Accept' in request header
@@ -613,7 +612,7 @@ function swagger2node(data, options) {
613612

614613

615614
function wottd2node(data, options) {
616-
return when.promise(function (resolve, reject) {
615+
return new Promise(function (resolve, reject) {
617616
let td = data.src;
618617

619618
// validate TD

package.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,6 @@
5454
"mustache": "4.0.1",
5555
"request": "2.88.2",
5656
"swagger-js-codegen-formdata": "0.15.5",
57-
"when": "3.7.8",
5857
"yamljs": "0.3.0"
5958
},
6059
"devDependencies": {

0 commit comments

Comments
 (0)