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

@amaui/amaui-binary-tree

Package Overview
Dependencies
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@amaui/amaui-binary-tree - npm Package Compare versions

Comparing version 1.0.111 to 1.0.1111

2

esm/index.js

@@ -1,2 +0,2 @@

/** @license AmauiBinaryTree v1.0.111
/** @license AmauiBinaryTree v1.0.1111
*

@@ -3,0 +3,0 @@ * This source code is licensed under the MIT license found in the

{
"name": "@amaui/amaui-binary-tree",
"version": "1.0.111",
"version": "1.0.1111",
"description": "Binary tree",

@@ -30,3 +30,3 @@ "repository": "https://github.com/amaui-org/amaui-binary-tree.git",

"dependencies": {
"@amaui/utils": "^1.0.11111",
"@amaui/utils": "^1.0.11114",
"@babel/runtime": "^7.18.3"

@@ -33,0 +33,0 @@ },

@@ -22,3 +22,3 @@

<sub>Production ready&nbsp;&nbsp;&nbsp;&nbsp;</sub>
<sub>UMD 2.2kb gzipped&nbsp;&nbsp;&nbsp;&nbsp;</sub>
<sub>UMD 2kb gzipped&nbsp;&nbsp;&nbsp;&nbsp;</sub>
<sub>100% test cov&nbsp;&nbsp;&nbsp;&nbsp;</sub>

@@ -25,0 +25,0 @@ <sub>Browser and Nodejs</sub>

@@ -1,2 +0,2 @@

/** @license AmauiBinaryTree v1.0.111
/** @license AmauiBinaryTree v1.0.1111
*

@@ -31,5 +31,2 @@ * This source code is licensed under the MIT license found in the

function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
const optionsDefault = {}; // Multiple is methods instead of one,

@@ -43,5 +40,5 @@ // so it's lighter for tree shaking usability reasons

let options_ = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : optionsDefault;
const options = _objectSpread(_objectSpread({}, optionsDefault), options_);
const options = { ...optionsDefault,
...options_
};
const {

@@ -48,0 +45,0 @@ variant

@@ -1,2 +0,2 @@

/** @license AmauiBinaryTree v1.0.111
/** @license AmauiBinaryTree v1.0.1111
*

@@ -6,2 +6,2 @@ * This source code is licensed under the MIT license found in the

*/
!function(e,r){"object"==typeof exports&&"undefined"!=typeof module?r(exports):"function"==typeof define&&define.amd?define(["exports"],r):r((e="undefined"!=typeof globalThis?globalThis:e||self).AmauiBinaryTree={})}(this,(function(e){"use strict";function r(e,r,t){return r in e?Object.defineProperty(e,r,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[r]=t,e}var t="undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{};function o(e,r){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);r&&(o=o.filter((function(r){return Object.getOwnPropertyDescriptor(e,r).enumerable}))),t.push.apply(t,o)}return t}function n(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?o(Object(n),!0).forEach((function(t){r(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):o(Object(n)).forEach((function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))}))}return e}const a={},i=function(e){var r;let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:void 0,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:a;const u=n(n({},a),o),{variant:c}=u,l=t&&"object"==typeof t&&Object.getPrototypeOf(t);switch(e){case"string":return"string"==typeof t;case"number":return"number"==typeof t&&!Number.isNaN(t);case"boolean":return"boolean"==typeof t;case"array":return Array.isArray(t);case"object":return"object"==typeof t&&!!t&&t.constructor===Object;case"object-like":return"object"==typeof t&&(null===t||t.constructor!==Object);case"class":return("object"==typeof t||"function"==typeof t)&&(/class/gi.test(String(t))||/class/gi.test(String(null==t?void 0:t.constructor)));case"function":return!!(t&&t instanceof Function);case"async":return!(!i("function",t)||!(s("browser")?"AsyncFunction"===t.constructor.name:t()instanceof Promise));case"map":return!(l!==Map.prototype);case"weakmap":return!(l!==WeakMap.prototype);case"set":return!(l!==Set.prototype);case"weakset":return!(l!==WeakSet.prototype);case"promise":return!(l!==Promise.prototype);case"int8array":return!(l!==Int8Array.prototype);case"uint8array":return!(l!==Uint8Array.prototype);case"uint8clampedarray":return!(l!==Uint8ClampedArray.prototype);case"int16array":return!(l!==Int16Array.prototype);case"uint16array":return!(l!==Uint16Array.prototype);case"int32array":return!(l!==Int32Array.prototype);case"uint32array":return!(l!==Uint32Array.prototype);case"float32array":return!(l!==Float32Array.prototype);case"float64array":return!(l!==Float64Array.prototype);case"bigint64array":return!(l!==BigInt64Array.prototype);case"biguint64array":return!(l!==BigUint64Array.prototype);case"typedarray":return i("int8array",t)||i("uint8array",t)||i("uint8clampedarray",t)||i("int16array",t)||i("uint16array",t)||i("int32array",t)||i("uint32array",t)||i("float32array",t)||i("float64array",t)||i("bigint64array",t)||i("biguint64array",t);case"dataview":return!(l!==DataView.prototype);case"arraybuffer":return!(l!==ArrayBuffer.prototype);case"sharedarraybuffer":return"undefined"!=typeof SharedArrayBuffer&&!(l!==SharedArrayBuffer.prototype);case"symbol":return!("symbol"!=typeof t);case"error":return!!(t&&t instanceof Error);case"date":return!!(t&&t instanceof Date);case"regexp":return!!(t&&t instanceof RegExp);case"arguments":return!(!t||"[object Arguments]"!==t.toString());case"null":return null===t;case"undefined":return void 0===t;case"blob":return s("browser")&&t instanceof Blob;case"buffer":return!(!s("nodejs")||"function"!=typeof(null==t||null===(r=t.constructor)||void 0===r?void 0:r.isBuffer)||!t.constructor.isBuffer(t));case"element":if(t)switch(c){case void 0:case"html":case"element":return s("browser")&&("object"==typeof HTMLElement?t instanceof HTMLElement:t&&"object"==typeof t&&null!==t&&1===t.nodeType&&"string"==typeof t.nodeName);case"node":return s("browser")&&("object"==typeof Node?t instanceof Node:t&&"object"==typeof t&&null!==t&&"number"==typeof t.nodeType&&"string"==typeof t.nodeName);case"react":return t.elementType||t.hasOwnProperty("$$typeof");default:return!1}return!1;case"simple":return i("string",t,u)||i("number",t,u)||i("boolean",t,u)||i("undefined",t,u)||i("null",t,u);case"not-array-object":return!i("array",t,u)&&!i("object",t,u);default:return!1}},s=function(e){let r,o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:void 0;switch(e){case"browser":return"undefined"!=typeof window&&void 0!==window.document;case"worker":return"undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope;case"nodejs":return!(void 0===t||"undefined"==typeof module||!module.exports);case"localhost":return r=void 0!==o?o:s("browser")&&window.location.hostname,i("string",r)&&["localhost","127.0.0.1"].some((e=>r.indexOf(e)>-1));default:return!1}};class u{constructor(e,r,t){this.value=e,this.left=r,this.right=t}}class c{constructor(){r(this,"root",void 0)}static make(e){return(new c).make(e)}static lowestCommonAncestor(e,r,t){let o;const n=t=>{if(!t)return;const a=t.value===(e instanceof u?e.value:e)||t.value===(r instanceof u?r.value:r),i=n(t.left),s=n(t.right);return(a&&i||a&&s||i&&s)&&(o=t),i||s||a};return n(t),o}static maxDepth(e){const r=e=>void 0===e?0:Math.max(1+r(e.left),1+r(e.right));return r(e)}static valid(e){const r=e=>{var t,o;return void 0===e||!((null===(t=e.left)||void 0===t?void 0:t.value)>=e.value)&&(!((null===(o=e.right)||void 0===o?void 0:o.value)<=e.value)&&(r(e.left)&&r(e.right)))};return r(e.root)}static preorder(e,r){void 0!==e&&i("function",r)&&(r(e,e.left,e.right),this.preorder(e.left,r),this.preorder(e.right,r))}static inorder(e,r){void 0!==e&&i("function",r)&&(this.inorder(e.left,r),r(e,e.left,e.right),this.inorder(e.right,r))}static postorder(e,r){void 0!==e&&i("function",r)&&(this.postorder(e.left,r),this.postorder(e.right,r),r(e,e.left,e.right))}static min(e){let r=e;for(;void 0!==(null===(t=r)||void 0===t?void 0:t.left);){var t;r=r.left}return r}static max(e){let r=e;for(;void 0!==(null===(t=r)||void 0===t?void 0:t.right);){var t;r=r.right}return r}array(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"preorder";const r=[];return c[e]&&c[e](this.root,(e=>r.push(e.value))),r}make(e){return i("array",e)&&e.forEach((e=>this.add(e))),this}add(e){const r=e instanceof u?e:new u(e);if(!this.root)return this.root=r,this;let t=this.root;for(;t;){if(r.value===t.value)return this;if(r.value<t.value){if(void 0===t.left)return t.left=r,this;t=t.left}if(r.value>t.value){if(void 0===t.right)return t.right=r,this;t=t.right}}}find(e){if(!this.root)return;let r,t=this.root;for(;t&&!r;)e<t.value?t=t.left:e>t.value?t=t.right:r=t;return r}remove(e){this.root=this.removeNode(this.root,e)}removeNode(e,r){if(void 0!==e){if(r===e.value){if(void 0===e.left&&void 0===e.right)return;if(void 0===e.left)return e.right;if(void 0===e.right)return e.left;const r=c.min(e.right);return e.value=r.value,e.right=this.removeNode(e.right,r.value),e}return r<e.value?(e.left=this.removeNode(e.left,r),e):(e.right=this.removeNode(e.right,r),e)}}}e.AmauiBinaryTree=c,e.AmauiNode=u,Object.defineProperty(e,"__esModule",{value:!0})}));
!function(e,r){"object"==typeof exports&&"undefined"!=typeof module?r(exports):"function"==typeof define&&define.amd?define(["exports"],r):r((e="undefined"!=typeof globalThis?globalThis:e||self).AmauiBinaryTree={})}(this,(function(e){"use strict";var r="undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{};const t={},o=function(e){var r;let a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:void 0,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:t;const s={...t,...i},{variant:u}=s,c=a&&"object"==typeof a&&Object.getPrototypeOf(a);switch(e){case"string":return"string"==typeof a;case"number":return"number"==typeof a&&!Number.isNaN(a);case"boolean":return"boolean"==typeof a;case"array":return Array.isArray(a);case"object":return"object"==typeof a&&!!a&&a.constructor===Object;case"object-like":return"object"==typeof a&&(null===a||a.constructor!==Object);case"class":return("object"==typeof a||"function"==typeof a)&&(/class/gi.test(String(a))||/class/gi.test(String(null==a?void 0:a.constructor)));case"function":return!!(a&&a instanceof Function);case"async":return!(!o("function",a)||!(n("browser")?"AsyncFunction"===a.constructor.name:a()instanceof Promise));case"map":return!(c!==Map.prototype);case"weakmap":return!(c!==WeakMap.prototype);case"set":return!(c!==Set.prototype);case"weakset":return!(c!==WeakSet.prototype);case"promise":return!(c!==Promise.prototype);case"int8array":return!(c!==Int8Array.prototype);case"uint8array":return!(c!==Uint8Array.prototype);case"uint8clampedarray":return!(c!==Uint8ClampedArray.prototype);case"int16array":return!(c!==Int16Array.prototype);case"uint16array":return!(c!==Uint16Array.prototype);case"int32array":return!(c!==Int32Array.prototype);case"uint32array":return!(c!==Uint32Array.prototype);case"float32array":return!(c!==Float32Array.prototype);case"float64array":return!(c!==Float64Array.prototype);case"bigint64array":return!(c!==BigInt64Array.prototype);case"biguint64array":return!(c!==BigUint64Array.prototype);case"typedarray":return o("int8array",a)||o("uint8array",a)||o("uint8clampedarray",a)||o("int16array",a)||o("uint16array",a)||o("int32array",a)||o("uint32array",a)||o("float32array",a)||o("float64array",a)||o("bigint64array",a)||o("biguint64array",a);case"dataview":return!(c!==DataView.prototype);case"arraybuffer":return!(c!==ArrayBuffer.prototype);case"sharedarraybuffer":return"undefined"!=typeof SharedArrayBuffer&&!(c!==SharedArrayBuffer.prototype);case"symbol":return!("symbol"!=typeof a);case"error":return!!(a&&a instanceof Error);case"date":return!!(a&&a instanceof Date);case"regexp":return!!(a&&a instanceof RegExp);case"arguments":return!(!a||"[object Arguments]"!==a.toString());case"null":return null===a;case"undefined":return void 0===a;case"blob":return n("browser")&&a instanceof Blob;case"buffer":return!(!n("nodejs")||"function"!=typeof(null==a||null===(r=a.constructor)||void 0===r?void 0:r.isBuffer)||!a.constructor.isBuffer(a));case"element":if(a)switch(u){case void 0:case"html":case"element":return n("browser")&&("object"==typeof HTMLElement?a instanceof HTMLElement:a&&"object"==typeof a&&null!==a&&1===a.nodeType&&"string"==typeof a.nodeName);case"node":return n("browser")&&("object"==typeof Node?a instanceof Node:a&&"object"==typeof a&&null!==a&&"number"==typeof a.nodeType&&"string"==typeof a.nodeName);case"react":return a.elementType||a.hasOwnProperty("$$typeof");default:return!1}return!1;case"simple":return o("string",a,s)||o("number",a,s)||o("boolean",a,s)||o("undefined",a,s)||o("null",a,s);case"not-array-object":return!o("array",a,s)&&!o("object",a,s);default:return!1}},n=function(e){let t,a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:void 0;switch(e){case"browser":return"undefined"!=typeof window&&void 0!==window.document;case"worker":return"undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope;case"nodejs":return!(void 0===r||"undefined"==typeof module||!module.exports);case"localhost":return t=void 0!==a?a:n("browser")&&window.location.hostname,o("string",t)&&["localhost","127.0.0.1"].some((e=>t.indexOf(e)>-1));default:return!1}};class a{constructor(e,r,t){this.value=e,this.left=r,this.right=t}}class i{constructor(){var e,r,t;t=void 0,(r="root")in(e=this)?Object.defineProperty(e,r,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[r]=t}static make(e){return(new i).make(e)}static lowestCommonAncestor(e,r,t){let o;const n=t=>{if(!t)return;const i=t.value===(e instanceof a?e.value:e)||t.value===(r instanceof a?r.value:r),s=n(t.left),u=n(t.right);return(i&&s||i&&u||s&&u)&&(o=t),s||u||i};return n(t),o}static maxDepth(e){const r=e=>void 0===e?0:Math.max(1+r(e.left),1+r(e.right));return r(e)}static valid(e){const r=e=>{var t,o;return void 0===e||!((null===(t=e.left)||void 0===t?void 0:t.value)>=e.value)&&(!((null===(o=e.right)||void 0===o?void 0:o.value)<=e.value)&&(r(e.left)&&r(e.right)))};return r(e.root)}static preorder(e,r){void 0!==e&&o("function",r)&&(r(e,e.left,e.right),this.preorder(e.left,r),this.preorder(e.right,r))}static inorder(e,r){void 0!==e&&o("function",r)&&(this.inorder(e.left,r),r(e,e.left,e.right),this.inorder(e.right,r))}static postorder(e,r){void 0!==e&&o("function",r)&&(this.postorder(e.left,r),this.postorder(e.right,r),r(e,e.left,e.right))}static min(e){let r=e;for(;void 0!==(null===(t=r)||void 0===t?void 0:t.left);){var t;r=r.left}return r}static max(e){let r=e;for(;void 0!==(null===(t=r)||void 0===t?void 0:t.right);){var t;r=r.right}return r}array(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"preorder";const r=[];return i[e]&&i[e](this.root,(e=>r.push(e.value))),r}make(e){return o("array",e)&&e.forEach((e=>this.add(e))),this}add(e){const r=e instanceof a?e:new a(e);if(!this.root)return this.root=r,this;let t=this.root;for(;t;){if(r.value===t.value)return this;if(r.value<t.value){if(void 0===t.left)return t.left=r,this;t=t.left}if(r.value>t.value){if(void 0===t.right)return t.right=r,this;t=t.right}}}find(e){if(!this.root)return;let r,t=this.root;for(;t&&!r;)e<t.value?t=t.left:e>t.value?t=t.right:r=t;return r}remove(e){this.root=this.removeNode(this.root,e)}removeNode(e,r){if(void 0!==e){if(r===e.value){if(void 0===e.left&&void 0===e.right)return;if(void 0===e.left)return e.right;if(void 0===e.right)return e.left;const r=i.min(e.right);return e.value=r.value,e.right=this.removeNode(e.right,r.value),e}return r<e.value?(e.left=this.removeNode(e.left,r),e):(e.right=this.removeNode(e.right,r),e)}}}e.AmauiBinaryTree=i,e.AmauiNode=a,Object.defineProperty(e,"__esModule",{value:!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