swagger-mock-parser
Advanced tools
Comparing version 1.0.4 to 1.0.5
'use strict'; | ||
var _createClass = require('babel-runtime/helpers/create-class')['default']; | ||
var _classCallCheck = require('babel-runtime/helpers/class-call-check')['default']; | ||
var _interopRequireDefault = require('babel-runtime/helpers/interop-require-default')['default']; | ||
Object.defineProperty(exports, '__esModule', { | ||
@@ -13,2 +7,8 @@ value: true | ||
var _createClass = (function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ('value' in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; })(); | ||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } | ||
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError('Cannot call a class as a function'); } } | ||
var _ParsersStringParser = require('./Parsers/StringParser'); | ||
@@ -50,4 +50,2 @@ | ||
require("babel-polyfill"); | ||
var chance = new _chance2['default'](); | ||
@@ -63,2 +61,24 @@ | ||
value: function getParser(node) { | ||
if (!Array.prototype.find) { | ||
Array.prototype.find = function (predicate) { | ||
if (this === null) { | ||
throw new TypeError('Array.prototype.find called on null or undefined'); | ||
} | ||
if (typeof predicate !== 'function') { | ||
throw new TypeError('predicate must be a function'); | ||
} | ||
var list = Object(this); | ||
var length = list.length >>> 0; | ||
var thisArg = arguments[1]; | ||
var value; | ||
for (var i = 0; i < length; i++) { | ||
value = list[i]; | ||
if (predicate.call(thisArg, value, i, list)) { | ||
return value; | ||
} | ||
} | ||
return undefined; | ||
}; | ||
} | ||
var parser = this.parsers.find(function (p) { | ||
@@ -65,0 +85,0 @@ return p.canParse(node); |
'use strict'; | ||
var _createClass = require('babel-runtime/helpers/create-class')['default']; | ||
Object.defineProperty(exports, '__esModule', { | ||
value: true | ||
}); | ||
var _classCallCheck = require('babel-runtime/helpers/class-call-check')['default']; | ||
var _createClass = (function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ('value' in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; })(); | ||
var _Object$assign = require('babel-runtime/core-js/object/assign')['default']; | ||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } | ||
var _interopRequireDefault = require('babel-runtime/helpers/interop-require-default')['default']; | ||
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError('Cannot call a class as a function'); } } | ||
Object.defineProperty(exports, '__esModule', { | ||
value: true | ||
}); | ||
var _chance = require('chance'); | ||
@@ -44,3 +42,3 @@ | ||
return node.allOf.reduce(function (s, o) { | ||
return _Object$assign(s, _this.parser.parse(o)); | ||
return Object.assign(s, _this.parser.parse(o)); | ||
}, {}); | ||
@@ -47,0 +45,0 @@ } |
'use strict'; | ||
var _createClass = require('babel-runtime/helpers/create-class')['default']; | ||
var _classCallCheck = require('babel-runtime/helpers/class-call-check')['default']; | ||
var _interopRequireDefault = require('babel-runtime/helpers/interop-require-default')['default']; | ||
Object.defineProperty(exports, '__esModule', { | ||
@@ -13,2 +7,8 @@ value: true | ||
var _createClass = (function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ('value' in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; })(); | ||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } | ||
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError('Cannot call a class as a function'); } } | ||
var _chance = require('chance'); | ||
@@ -15,0 +15,0 @@ |
'use strict'; | ||
var _createClass = require('babel-runtime/helpers/create-class')['default']; | ||
var _classCallCheck = require('babel-runtime/helpers/class-call-check')['default']; | ||
var _interopRequireDefault = require('babel-runtime/helpers/interop-require-default')['default']; | ||
Object.defineProperty(exports, '__esModule', { | ||
@@ -13,2 +7,8 @@ value: true | ||
var _createClass = (function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ('value' in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; })(); | ||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } | ||
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError('Cannot call a class as a function'); } } | ||
var _chance = require('chance'); | ||
@@ -15,0 +15,0 @@ |
'use strict'; | ||
var _createClass = require('babel-runtime/helpers/create-class')['default']; | ||
var _classCallCheck = require('babel-runtime/helpers/class-call-check')['default']; | ||
var _interopRequireDefault = require('babel-runtime/helpers/interop-require-default')['default']; | ||
Object.defineProperty(exports, '__esModule', { | ||
@@ -13,2 +7,8 @@ value: true | ||
var _createClass = (function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ('value' in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; })(); | ||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } | ||
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError('Cannot call a class as a function'); } } | ||
var _chance = require('chance'); | ||
@@ -15,0 +15,0 @@ |
'use strict'; | ||
var _createClass = require('babel-runtime/helpers/create-class')['default']; | ||
var _classCallCheck = require('babel-runtime/helpers/class-call-check')['default']; | ||
var _interopRequireDefault = require('babel-runtime/helpers/interop-require-default')['default']; | ||
Object.defineProperty(exports, '__esModule', { | ||
@@ -13,2 +7,8 @@ value: true | ||
var _createClass = (function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ('value' in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; })(); | ||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } | ||
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError('Cannot call a class as a function'); } } | ||
var _chance = require('chance'); | ||
@@ -15,0 +15,0 @@ |
'use strict'; | ||
var _createClass = require('babel-runtime/helpers/create-class')['default']; | ||
var _classCallCheck = require('babel-runtime/helpers/class-call-check')['default']; | ||
var _interopRequireDefault = require('babel-runtime/helpers/interop-require-default')['default']; | ||
Object.defineProperty(exports, '__esModule', { | ||
@@ -13,2 +7,8 @@ value: true | ||
var _createClass = (function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ('value' in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; })(); | ||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } | ||
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError('Cannot call a class as a function'); } } | ||
var _chance = require('chance'); | ||
@@ -15,0 +15,0 @@ |
'use strict'; | ||
var _createClass = require('babel-runtime/helpers/create-class')['default']; | ||
Object.defineProperty(exports, '__esModule', { | ||
value: true | ||
}); | ||
var _classCallCheck = require('babel-runtime/helpers/class-call-check')['default']; | ||
var _createClass = (function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ('value' in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; })(); | ||
var _Number$MIN_SAFE_INTEGER = require('babel-runtime/core-js/number/min-safe-integer')['default']; | ||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } | ||
var _Number$MAX_SAFE_INTEGER = require('babel-runtime/core-js/number/max-safe-integer')['default']; | ||
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError('Cannot call a class as a function'); } } | ||
var _Object$assign = require('babel-runtime/core-js/object/assign')['default']; | ||
var _interopRequireDefault = require('babel-runtime/helpers/interop-require-default')['default']; | ||
Object.defineProperty(exports, '__esModule', { | ||
value: true | ||
}); | ||
var _chance = require('chance'); | ||
@@ -51,5 +45,5 @@ | ||
value: function resolveBounds(node) { | ||
var bounds = { min: _Number$MIN_SAFE_INTEGER, max: _Number$MAX_SAFE_INTEGER }; | ||
var bounds = { min: Number.MIN_SAFE_INTEGER, max: Number.MAX_SAFE_INTEGER }; | ||
_Object$assign(bounds, node['x-type-options']); | ||
Object.assign(bounds, node['x-type-options']); | ||
@@ -56,0 +50,0 @@ if (node.multipleOf < 1) { |
'use strict'; | ||
var _createClass = require('babel-runtime/helpers/create-class')['default']; | ||
var _classCallCheck = require('babel-runtime/helpers/class-call-check')['default']; | ||
var _interopRequireDefault = require('babel-runtime/helpers/interop-require-default')['default']; | ||
Object.defineProperty(exports, '__esModule', { | ||
@@ -13,2 +7,8 @@ value: true | ||
var _createClass = (function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ('value' in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; })(); | ||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } | ||
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError('Cannot call a class as a function'); } } | ||
var _chance = require('chance'); | ||
@@ -15,0 +15,0 @@ |
'use strict'; | ||
var _createClass = require('babel-runtime/helpers/create-class')['default']; | ||
var _classCallCheck = require('babel-runtime/helpers/class-call-check')['default']; | ||
var _interopRequireDefault = require('babel-runtime/helpers/interop-require-default')['default']; | ||
Object.defineProperty(exports, '__esModule', { | ||
@@ -13,2 +7,8 @@ value: true | ||
var _createClass = (function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ('value' in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; })(); | ||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } | ||
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError('Cannot call a class as a function'); } } | ||
var _StringParser = require('./StringParser'); | ||
@@ -15,0 +15,0 @@ |
'use strict'; | ||
var _createClass = require('babel-runtime/helpers/create-class')['default']; | ||
var _classCallCheck = require('babel-runtime/helpers/class-call-check')['default']; | ||
var _interopRequireDefault = require('babel-runtime/helpers/interop-require-default')['default']; | ||
Object.defineProperty(exports, '__esModule', { | ||
@@ -13,2 +7,8 @@ value: true | ||
var _createClass = (function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ('value' in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; })(); | ||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } | ||
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError('Cannot call a class as a function'); } } | ||
var _chance = require('chance'); | ||
@@ -15,0 +15,0 @@ |
{ | ||
"name": "swagger-mock-parser", | ||
"version": "1.0.4", | ||
"version": "1.0.5", | ||
"description": "use chance.js to parse definition schema to mock data", | ||
@@ -20,3 +20,3 @@ "keywords": [ | ||
"scripts": { | ||
"build": "babel --optional runtime src --out-dir dist" | ||
"build": "babel src --out-dir dist" | ||
}, | ||
@@ -26,4 +26,2 @@ "author": "weihanqing", | ||
"dependencies": { | ||
"babel-polyfill": "^6.9.1", | ||
"babel-runtime": "^5.5.6", | ||
"chance": "~0.7.5", | ||
@@ -30,0 +28,0 @@ "hoek": "~2.14.0", |
@@ -10,3 +10,2 @@ import StringParser from './Parsers/StringParser' | ||
import Chance from 'chance'; | ||
import "babel-polyfill"; | ||
const chance = new Chance(); | ||
@@ -31,2 +30,24 @@ | ||
getParser(node) { | ||
if (!Array.prototype.find) { | ||
Array.prototype.find = function (predicate) { | ||
if (this === null) { | ||
throw new TypeError('Array.prototype.find called on null or undefined'); | ||
} | ||
if (typeof predicate !== 'function') { | ||
throw new TypeError('predicate must be a function'); | ||
} | ||
var list = Object(this); | ||
var length = list.length >>> 0; | ||
var thisArg = arguments[1]; | ||
var value; | ||
for (var i = 0; i < length; i++) { | ||
value = list[i]; | ||
if (predicate.call(thisArg, value, i, list)) { | ||
return value; | ||
} | ||
} | ||
return undefined; | ||
}; | ||
} | ||
let parser = this.parsers.find(p => p.canParse(node)); | ||
@@ -33,0 +54,0 @@ |
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
35147
3
758
- Removedbabel-polyfill@^6.9.1
- Removedbabel-runtime@^5.5.6
- Removedbabel-polyfill@6.26.0(transitive)
- Removedbabel-runtime@5.8.386.26.0(transitive)
- Removedcore-js@1.2.72.6.12(transitive)
- Removedregenerator-runtime@0.11.1(transitive)