New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

vehicles

Package Overview
Dependencies
Maintainers
1
Versions
167
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

vehicles - npm Package Compare versions

Comparing version 7.0.26 to 8.0.0

216

build/es5/bundle.js

@@ -7,14 +7,6 @@ (function (global, factory) {

function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
var _asyncToGenerator__default = /*#__PURE__*/_interopDefaultLegacy(_asyncToGenerator);
var _classCallCheck__default = /*#__PURE__*/_interopDefaultLegacy(_classCallCheck);
var _createClass__default = /*#__PURE__*/_interopDefaultLegacy(_createClass);
var _regeneratorRuntime__default = /*#__PURE__*/_interopDefaultLegacy(_regeneratorRuntime);
var Decimal__default = /*#__PURE__*/_interopDefaultLegacy(Decimal);
var MAX_SAFE_INTEGER = Number.MAX_SAFE_INTEGER === undefined ? Math.pow(2, 53) - 1 : Number.MAX_SAFE_INTEGER;
var DeLorean = /*#__PURE__*/function () {
function DeLorean() {
_classCallCheck__default["default"](this, DeLorean);
_classCallCheck(this, DeLorean);
this._definitions = [];

@@ -25,3 +17,3 @@ this._definitions = [];

}
_createClass__default["default"](DeLorean, [{
_createClass(DeLorean, [{
key: "nextStopover",

@@ -72,50 +64,48 @@ get: function get() {

value: function () {
var _travel = _asyncToGenerator__default["default"]( /*#__PURE__*/_regeneratorRuntime__default["default"].mark(function _callee(distance) {
var _travel = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee(distance) {
var journey, position, _this$_definitions$sh, func, pstn, functions;
return _regeneratorRuntime__default["default"].wrap(function _callee$(_context) {
while (1) {
switch (_context.prev = _context.next) {
case 0:
if (!(this._ongoingJourney !== null)) {
_context.next = 2;
break;
}
throw new Error('There is currently another journey going on.');
case 2:
journey = Symbol();
position = new Decimal__default["default"](this._position).plus(distance).toNumber();
this._ongoingJourney = journey;
case 5:
if (!(this._ongoingJourney === journey && this._definitions.length > 0 && this._definitions[0].position <= position)) {
_context.next = 14;
break;
}
return _regeneratorRuntime.wrap(function _callee$(_context) {
while (1) switch (_context.prev = _context.next) {
case 0:
if (!(this._ongoingJourney !== null)) {
_context.next = 2;
break;
}
throw new Error('There is currently another journey going on.');
case 2:
journey = Symbol();
position = new Decimal(this._position).plus(distance).toNumber();
this._ongoingJourney = journey;
case 5:
if (!(this._ongoingJourney === journey && this._definitions.length > 0 && this._definitions[0].position <= position)) {
_context.next = 14;
break;
}
// TypeScript needs to be convinced that the definition is not undefined.
_this$_definitions$sh = this._definitions.shift(), func = _this$_definitions$sh.func, pstn = _this$_definitions$sh.position;
functions = [func];
while (this._definitions.length > 0 && this._definitions[0].position === pstn) {
// TypeScript needs to be convinced that the definition is not undefined.
_this$_definitions$sh = this._definitions.shift(), func = _this$_definitions$sh.func, pstn = _this$_definitions$sh.position;
functions = [func];
while (this._definitions.length > 0 && this._definitions[0].position === pstn) {
// TypeScript needs to be convinced that the definition is not undefined.
functions.push(this._definitions.shift().func);
}
this._position = pstn;
_context.next = 12;
return Promise.all(functions.map(function (fnc) {
return Promise.race([new Promise(function (_, reject) {
return setTimeout(function () {
reject(new Error("Sorry, it's not allowed to initialize a promise within a scheduled function."));
});
}), fnc()]);
}));
case 12:
_context.next = 5;
break;
case 14:
if (this._ongoingJourney === journey) {
this._ongoingJourney = null;
this._position = position;
}
case 15:
case "end":
return _context.stop();
}
functions.push(this._definitions.shift().func);
}
this._position = pstn;
_context.next = 12;
return Promise.all(functions.map(function (fnc) {
return Promise.race([new Promise(function (_, reject) {
return setTimeout(function () {
reject(new Error("Sorry, it's not allowed to initialize a promise within a scheduled function."));
});
}), fnc()]);
}));
case 12:
_context.next = 5;
break;
case 14:
if (this._ongoingJourney === journey) {
this._ongoingJourney = null;
this._position = position;
}
case 15:
case "end":
return _context.stop();
}

@@ -147,3 +137,3 @@ }, _callee, this);

function Platoon() {
_classCallCheck__default["default"](this, Platoon);
_classCallCheck(this, Platoon);
this._ongoingJourney = null;

@@ -155,3 +145,3 @@ for (var _len = arguments.length, vehicles = new Array(_len), _key = 0; _key < _len; _key++) {

}
_createClass__default["default"](Platoon, [{
_createClass(Platoon, [{
key: "join",

@@ -187,60 +177,56 @@ value: function join(deLorean, scale) {

value: function () {
var _travel = _asyncToGenerator__default["default"]( /*#__PURE__*/_regeneratorRuntime__default["default"].mark(function _callee(distance) {
var _travel = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee(distance) {
var _this = this;
var journey, distanceAsDecimal, _loop;
return _regeneratorRuntime__default["default"].wrap(function _callee$(_context2) {
while (1) {
switch (_context2.prev = _context2.next) {
case 0:
if (!(this._ongoingJourney !== null)) {
_context2.next = 2;
break;
}
throw new Error('There is currently another journey going on.');
case 2:
journey = Symbol();
this._ongoingJourney = journey;
distanceAsDecimal = new Decimal__default["default"](distance);
_loop = /*#__PURE__*/_regeneratorRuntime__default["default"].mark(function _loop() {
var distanceToNextStopover;
return _regeneratorRuntime__default["default"].wrap(function _loop$(_context) {
while (1) {
switch (_context.prev = _context.next) {
case 0:
distanceToNextStopover = _this._vehicles.reduce(function (dstncSDcml, _ref3) {
var deLorean = _ref3.deLorean,
scale = _ref3.scale;
var nextStopoverAsDecimal = new Decimal__default["default"](deLorean.nextStopover);
return Decimal__default["default"].min(nextStopoverAsDecimal.minus(deLorean.position).dividedBy(scale), dstncSDcml);
}, distanceAsDecimal);
_context.next = 3;
return Promise.all(_this._vehicles.map(function (_ref4) {
var deLorean = _ref4.deLorean,
scale = _ref4.scale;
return deLorean.travel(distanceToNextStopover.times(scale).toNumber());
}));
case 3:
distanceAsDecimal = distanceAsDecimal.minus(distanceToNextStopover);
case 4:
case "end":
return _context.stop();
}
}
}, _loop);
});
case 6:
return _context2.delegateYield(_loop(), "t0", 7);
case 7:
if (this._ongoingJourney === journey && distanceAsDecimal.greaterThan(0)) {
_context2.next = 6;
break;
}
case 8:
if (this._ongoingJourney === journey) {
this._ongoingJourney = null;
}
case 9:
case "end":
return _context2.stop();
}
return _regeneratorRuntime.wrap(function _callee$(_context2) {
while (1) switch (_context2.prev = _context2.next) {
case 0:
if (!(this._ongoingJourney !== null)) {
_context2.next = 2;
break;
}
throw new Error('There is currently another journey going on.');
case 2:
journey = Symbol();
this._ongoingJourney = journey;
distanceAsDecimal = new Decimal(distance);
_loop = /*#__PURE__*/_regeneratorRuntime.mark(function _loop() {
var distanceToNextStopover;
return _regeneratorRuntime.wrap(function _loop$(_context) {
while (1) switch (_context.prev = _context.next) {
case 0:
distanceToNextStopover = _this._vehicles.reduce(function (dstncSDcml, _ref3) {
var deLorean = _ref3.deLorean,
scale = _ref3.scale;
var nextStopoverAsDecimal = new Decimal(deLorean.nextStopover);
return Decimal.min(nextStopoverAsDecimal.minus(deLorean.position).dividedBy(scale), dstncSDcml);
}, distanceAsDecimal);
_context.next = 3;
return Promise.all(_this._vehicles.map(function (_ref4) {
var deLorean = _ref4.deLorean,
scale = _ref4.scale;
return deLorean.travel(distanceToNextStopover.times(scale).toNumber());
}));
case 3:
distanceAsDecimal = distanceAsDecimal.minus(distanceToNextStopover);
case 4:
case "end":
return _context.stop();
}
}, _loop);
});
case 6:
return _context2.delegateYield(_loop(), "t0", 7);
case 7:
if (this._ongoingJourney === journey && distanceAsDecimal.greaterThan(0)) {
_context2.next = 6;
break;
}
case 8:
if (this._ongoingJourney === journey) {
this._ongoingJourney = null;
}
case 9:
case "end":
return _context2.stop();
}

@@ -261,4 +247,2 @@ }, _callee, this);

Object.defineProperty(exports, '__esModule', { value: true });
}));

@@ -13,3 +13,3 @@ {

"dependencies": {
"@babel/runtime": "^7.20.6",
"@babel/runtime": "^7.20.7",
"decimal.js": "^10.4.3",

@@ -20,4 +20,4 @@ "tslib": "^2.4.1"

"devDependencies": {
"@babel/cli": "^7.19.3",
"@babel/core": "^7.20.5",
"@babel/cli": "^7.20.7",
"@babel/core": "^7.20.12",
"@babel/plugin-external-helpers": "^7.18.6",

@@ -27,15 +27,15 @@ "@babel/plugin-transform-runtime": "^7.19.6",

"@babel/register": "^7.18.9",
"@commitlint/cli": "^17.3.0",
"@commitlint/config-angular": "^17.3.0",
"@rollup/plugin-babel": "^5.3.1",
"@commitlint/cli": "^17.4.2",
"@commitlint/config-angular": "^17.4.2",
"@rollup/plugin-babel": "^6.0.3",
"@types/sinon": "^10.0.13",
"chai": "^4.3.7",
"commitizen": "^4.2.5",
"commitizen": "^4.2.6",
"cz-conventional-changelog": "^3.3.0",
"eslint": "^8.29.0",
"eslint-config-holy-grail": "^52.0.33",
"eslint": "^8.32.0",
"eslint-config-holy-grail": "^55.0.2",
"grunt": "^1.5.3",
"grunt-cli": "^1.4.3",
"grunt-sh": "^0.2.0",
"husky": "^8.0.2",
"husky": "^8.0.3",
"karma": "^6.4.1",

@@ -50,18 +50,18 @@ "karma-chrome-launcher": "^3.1.1",

"load-grunt-config": "^4.0.1",
"mocha": "^10.1.0",
"prettier": "^2.8.0",
"mocha": "^10.2.0",
"prettier": "^2.8.3",
"pretty-quick": "^3.1.3",
"rimraf": "^3.0.2",
"rollup": "^2.79.1",
"sinon": "^14.0.2",
"rimraf": "^4.0.7",
"rollup": "^3.10.0",
"sinon": "^15.0.1",
"sinon-chai": "^3.7.0",
"ts-loader": "^9.4.2",
"tsconfig-holy-grail": "^11.1.36",
"tsconfig-holy-grail": "^12.0.0",
"tslint": "^6.1.3",
"tslint-config-holy-grail": "^53.2.34",
"typescript": "^4.9.3",
"tslint-config-holy-grail": "^54.0.0",
"typescript": "^4.9.4",
"webpack": "^5.75.0"
},
"engines": {
"node": ">=12.20.1"
"node": ">=14.15.4"
},

@@ -94,3 +94,3 @@ "files": [

"types": "build/es2019/module.d.ts",
"version": "7.0.26"
"version": "8.0.0"
}

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc