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

@turbox3d/shared

Package Overview
Dependencies
Maintainers
1
Versions
27
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@turbox3d/shared - npm Package Compare versions

Comparing version 1.1.11 to 1.1.12

4

dist/index.js

@@ -49,3 +49,3 @@ /*

eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ debounce: () => (/* binding */ debounce)\n/* harmony export */ });\nvar now = Date.now;\nfunction debounce(func) {\n var wait = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 300;\n var lastArgs;\n var lastThis;\n var maxWait;\n var result;\n var timerId;\n var lastCallTime;\n var lastInvokeTime = 0;\n var leading = false;\n var maxing = false;\n var trailing = true;\n if (typeof func !== 'function') {\n throw new TypeError('Expected a function');\n }\n function invokeFunc(time) {\n var args = lastArgs;\n var thisArg = lastThis;\n // eslint-disable-next-line no-multi-assign\n lastArgs = lastThis = undefined;\n lastInvokeTime = time;\n result = func.apply(thisArg, args);\n return result;\n }\n function shouldInvoke(time) {\n var timeSinceLastCall = time - lastCallTime;\n var timeSinceLastInvoke = time - lastInvokeTime;\n // Either this is the first call, activity has stopped and we're at the\n // trailing edge, the system time has gone backwards and we're treating\n // it as the trailing edge, or we've hit the `maxWait` limit.\n return lastCallTime === undefined || timeSinceLastCall >= wait || timeSinceLastCall < 0 || maxing && timeSinceLastInvoke >= maxWait;\n }\n function remainingWait(time) {\n var timeSinceLastCall = time - lastCallTime;\n var timeSinceLastInvoke = time - lastInvokeTime;\n var timeWaiting = wait - timeSinceLastCall;\n return maxing ? Math.min(timeWaiting, maxWait - timeSinceLastInvoke) : timeWaiting;\n }\n function trailingEdge(time) {\n timerId = undefined;\n // Only invoke if we have `lastArgs` which means `func` has been\n // debounced at least once.\n if (trailing && lastArgs) {\n return invokeFunc(time);\n }\n // eslint-disable-next-line no-multi-assign\n lastArgs = lastThis = undefined;\n return result;\n }\n function timerExpired() {\n var time = now();\n if (shouldInvoke(time)) {\n return trailingEdge(time);\n }\n // Restart the timer.\n timerId = setTimeout(timerExpired, remainingWait(time));\n }\n function leadingEdge(time) {\n // Reset any `maxWait` timer.\n lastInvokeTime = time;\n // Start the timer for the trailing edge.\n timerId = setTimeout(timerExpired, wait);\n // Invoke the leading edge.\n return leading ? invokeFunc(time) : result;\n }\n function cancel() {\n if (timerId !== undefined) {\n clearTimeout(timerId);\n }\n lastInvokeTime = 0;\n // eslint-disable-next-line no-multi-assign\n lastArgs = lastCallTime = lastThis = timerId = undefined;\n }\n function flush() {\n return timerId === undefined ? result : trailingEdge(now());\n }\n function debounced() {\n var time = now();\n var isInvoking = shouldInvoke(time);\n // eslint-disable-next-line prefer-rest-params\n lastArgs = arguments;\n lastThis = this;\n lastCallTime = time;\n if (isInvoking) {\n if (timerId === undefined) {\n return leadingEdge(lastCallTime);\n }\n if (maxing) {\n // Handle invocations in a tight loop.\n clearTimeout(timerId);\n timerId = setTimeout(timerExpired, wait);\n return invokeFunc(lastCallTime);\n }\n }\n if (timerId === undefined) {\n timerId = setTimeout(timerExpired, wait);\n }\n return result;\n }\n debounced.cancel = cancel;\n debounced.flush = flush;\n return debounced;\n}\n\n//# sourceURL=webpack://Shared/./es/debounce.js?");
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ debounce: () => (/* binding */ debounce)\n/* harmony export */ });\nvar now = Date.now;\nfunction debounce(func) {\n var wait = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 300;\n var lastArgs;\n var lastThis;\n var maxWait;\n var result;\n var timerId;\n var lastCallTime;\n var lastInvokeTime = 0;\n var leading = false;\n var maxing = false;\n var trailing = true;\n if (typeof func !== 'function') {\n throw new TypeError('Expected a function');\n }\n function invokeFunc(time) {\n var args = lastArgs;\n var thisArg = lastThis;\n // eslint-disable-next-line no-multi-assign\n lastArgs = lastThis = undefined;\n lastInvokeTime = time;\n result = func.apply(thisArg, args);\n return result;\n }\n function shouldInvoke(time) {\n var timeSinceLastCall = time - lastCallTime;\n var timeSinceLastInvoke = time - lastInvokeTime;\n // Either this is the first call, activity has stopped and we're at the\n // trailing edge, the system time has gone backwards and we're treating\n // it as the trailing edge, or we've hit the `maxWait` limit.\n return lastCallTime === undefined || timeSinceLastCall >= wait || timeSinceLastCall < 0 || maxing && timeSinceLastInvoke >= maxWait;\n }\n function remainingWait(time) {\n var timeSinceLastCall = time - lastCallTime;\n var timeSinceLastInvoke = time - lastInvokeTime;\n var timeWaiting = wait - timeSinceLastCall;\n return maxing ? Math.min(timeWaiting, maxWait - timeSinceLastInvoke) : timeWaiting;\n }\n function trailingEdge(time) {\n timerId = undefined;\n // Only invoke if we have `lastArgs` which means `func` has been\n // debounced at least once.\n if (trailing && lastArgs) {\n return invokeFunc(time);\n }\n // eslint-disable-next-line no-multi-assign\n lastArgs = lastThis = undefined;\n return result;\n }\n function timerExpired() {\n var time = now();\n if (shouldInvoke(time)) {\n return trailingEdge(time);\n }\n // Restart the timer.\n timerId = setTimeout(timerExpired, remainingWait(time));\n }\n function leadingEdge(time) {\n // Reset any `maxWait` timer.\n lastInvokeTime = time;\n // Start the timer for the trailing edge.\n timerId = setTimeout(timerExpired, wait);\n // Invoke the leading edge.\n return leading ? invokeFunc(time) : result;\n }\n function cancel() {\n if (timerId !== undefined) {\n clearTimeout(timerId);\n }\n lastInvokeTime = 0;\n // eslint-disable-next-line no-multi-assign\n lastArgs = lastCallTime = lastThis = timerId = undefined;\n }\n function flush() {\n return timerId === undefined ? result : trailingEdge(now());\n }\n function debounced() {\n var time = now();\n var isInvoking = shouldInvoke(time);\n // eslint-disable-next-line prefer-rest-params\n lastArgs = arguments;\n // eslint-disable-next-line @typescript-eslint/no-this-alias\n lastThis = this;\n lastCallTime = time;\n if (isInvoking) {\n if (timerId === undefined) {\n return leadingEdge(lastCallTime);\n }\n if (maxing) {\n // Handle invocations in a tight loop.\n clearTimeout(timerId);\n timerId = setTimeout(timerExpired, wait);\n return invokeFunc(lastCallTime);\n }\n }\n if (timerId === undefined) {\n timerId = setTimeout(timerExpired, wait);\n }\n return result;\n }\n debounced.cancel = cancel;\n debounced.flush = flush;\n return debounced;\n}\n\n//# sourceURL=webpack://Shared/./es/debounce.js?");

@@ -140,3 +140,3 @@ /***/ }),

eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ Task: () => (/* binding */ Task)\n/* harmony export */ });\n/* harmony import */ var _babel_runtime_helpers_esm_classCallCheck__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/esm/classCallCheck */ \"../../node_modules/.pnpm/@babel+runtime@7.23.6/node_modules/@babel/runtime/helpers/esm/classCallCheck.js\");\n/* harmony import */ var _babel_runtime_helpers_esm_createClass__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/esm/createClass */ \"../../node_modules/.pnpm/@babel+runtime@7.23.6/node_modules/@babel/runtime/helpers/esm/createClass.js\");\n\n\nvar Task = /*#__PURE__*/function () {\n // eslint-disable-next-line no-useless-constructor\n function Task(fn, priority) {\n (0,_babel_runtime_helpers_esm_classCallCheck__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(this, Task);\n this.fn = fn;\n this.priority = priority;\n }\n (0,_babel_runtime_helpers_esm_createClass__WEBPACK_IMPORTED_MODULE_1__[\"default\"])(Task, null, [{\n key: \"createTask\",\n value: function createTask(fn, priority) {\n return new Task(fn, priority);\n }\n }]);\n return Task;\n}();\n\n\n//# sourceURL=webpack://Shared/./es/task.js?");
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ Task: () => (/* binding */ Task)\n/* harmony export */ });\n/* harmony import */ var _babel_runtime_helpers_esm_classCallCheck__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/esm/classCallCheck */ \"../../node_modules/.pnpm/@babel+runtime@7.23.6/node_modules/@babel/runtime/helpers/esm/classCallCheck.js\");\n/* harmony import */ var _babel_runtime_helpers_esm_createClass__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/esm/createClass */ \"../../node_modules/.pnpm/@babel+runtime@7.23.6/node_modules/@babel/runtime/helpers/esm/createClass.js\");\n\n\nvar Task = /*#__PURE__*/function () {\n // eslint-disable-next-line no-useless-constructor\n function Task(fn, priority) {\n (0,_babel_runtime_helpers_esm_classCallCheck__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(this, Task);\n this.fn = fn;\n this.priority = priority;\n //\n }\n (0,_babel_runtime_helpers_esm_createClass__WEBPACK_IMPORTED_MODULE_1__[\"default\"])(Task, null, [{\n key: \"createTask\",\n value: function createTask(fn, priority) {\n return new Task(fn, priority);\n }\n }]);\n return Task;\n}();\n\n\n//# sourceURL=webpack://Shared/./es/task.js?");

@@ -143,0 +143,0 @@ /***/ }),

@@ -83,2 +83,3 @@ var now = Date.now;

lastArgs = arguments;
// eslint-disable-next-line @typescript-eslint/no-this-alias
lastThis = this;

@@ -85,0 +86,0 @@ lastCallTime = time;

@@ -9,2 +9,3 @@ import _classCallCheck from "@babel/runtime/helpers/esm/classCallCheck";

this.priority = priority;
//
}

@@ -11,0 +12,0 @@ _createClass(Task, null, [{

@@ -89,2 +89,3 @@ "use strict";

lastArgs = arguments;
// eslint-disable-next-line @typescript-eslint/no-this-alias
lastThis = this;

@@ -91,0 +92,0 @@ lastCallTime = time;

@@ -16,2 +16,3 @@ "use strict";

this.priority = priority;
//
}

@@ -18,0 +19,0 @@ (0, _createClass2["default"])(Task, null, [{

{
"name": "@turbox3d/shared",
"version": "1.1.11",
"version": "1.1.12",
"description": "turbox shared internal utility",

@@ -29,5 +29,4 @@ "main": "./lib/index.js",

"@babel/preset-env": "^7.23.6",
"@babel/runtime": "^7.23.6",
"@types/node": "~20.10.5",
"typescript": "4.6.4"
"typescript": "^5.3.3"
},

@@ -34,0 +33,0 @@ "files": [

@@ -101,2 +101,3 @@ const now = Date.now;

lastArgs = arguments;
// eslint-disable-next-line @typescript-eslint/no-this-alias
lastThis = this;

@@ -103,0 +104,0 @@ lastCallTime = time;

@@ -7,5 +7,7 @@ class Task {

// eslint-disable-next-line no-useless-constructor
constructor(public fn: Function, public priority: number) { }
constructor(public fn: Function, public priority: number) {
//
}
}
export { Task };

@@ -7,3 +7,3 @@ export interface IConstructorOf<T> {

}
export declare type Nullable<T> = {
export type Nullable<T> = {
[K in keyof T]?: T[K] | null;

@@ -10,0 +10,0 @@ };

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