1.0.3 ā€¢ Published 9 days ago

@npmteam2024/quisquam-dicta-voluptates v1.0.3

Weekly downloads
-
License
MIT
Repository
github
Last release
9 days ago

A sorted array is a collection of values, arranged in an order. šŸ“¦ Node.js, šŸŒ Web, šŸ“œ Files, šŸ“° Docs, šŸ“˜ Wiki.

npm.io

This package includes comprehensive set of functions that operate on a sorted array with which you can search a value using binary search, merge multiple sorted arrays, or perform set operations upon it.

We use a consistent naming scheme that helps you quickly identify the functions you need. All functions except from*() take array as 1st parameter. Some functions operate on a specified range in the array and are called ranged*(), such as rangedMerge(). Functions like slice() are pure and do not modify the array itself, while functions like slice$() do modify (update) the array itself. Some functions accept a map function in addition to a compare function. Further, functions which return an iterable instead of an array are prefixed with i, such as isubsequences(). We borrow some names from other programming languages such as Haskell, Python, Java, and Processing.

With this package, you can simplify the implementation of complex algorithms, and be able to achieve your goals faster, regardless of your level of expertise. Try it out today and discover how it can transform your development experience! This package is available in Node.js and Web formats. To use it on the web, simply use the extra_sorted_array global variable after loading with a <script> tag from the jsDelivr CDN.

Stability: Experimental.

const xsortedArray = require('@npmteam2024/quisquam-dicta-voluptates');
// import * as xsortedArray from "@npmteam2024/quisquam-dicta-voluptates";
// import * as xsortedArray from "https://unpkg.com/@npmteam2024/quisquam-dicta-voluptates/index.mjs"; (deno)

var x = [10, 20, 20, 40, 40, 80];
xsortedArray.searchValue(x, 40);
// ā†’ 3

var x = [10, 20, 20, 40, 40, 80];
var y = [20, 50, 70];
xsortedArray.merge(x, y);
// ā†’ [ 10, 20, 20, 20, 40, 40, 50, 70, 80 ]

var x = [10, 20, 20, 40, 40, 80];
var y = [20, 50, 70];
var z = [30, 60, 90];
xsortedArray.mergeAll([x, y, z]);
// ā†’ [ 10, 20, 20, 20, 30, 40, 40, 50, 60, 70, 80, 90 ]

var x = [10, 20, 20, 40, 40, 80];
var y = [20, 50, 70];
xsortedArray.isDisjoint(x, y);
// ā†’ false

var x = [10, 20, 20, 40, 40, 80];
var y = [20, 50, 80];
xsortedArray.intersection(x, y);
// ā†’ [ 20, 80 ]

Index

PropertyDescription
includesCheck if sorted array has a value using binary search.
hasValueCheck if sorted array has a value using binary search.
indexOfFind first index of value using binary search.
lastIndexOfFind last index of value using binary search.
searchValueFind first index of value using binary search.
searchValueRightFind last index of a value using binary search.
searchValueAnyFind any index of a value using binary search.
searchClosestValueFind index of closest value using binary search.
mergeMerge values from two sorted arrays.
mergeAllMerge values from sorted arrays.
isUniqueExamine if there are no duplicate values.
isDisjointExamine if arrays have no value in common.
uniqueRemove duplicate values.
unionObtain values present in any sorted array.
intersectionObtain values present in both sorted arrays.
differenceObtain values not present in another sorted array.
symmetricDifferenceObtain values present in either sorted array but not both.

References

npm.io ORG Coverage Status Test Coverage

amazonformattingcompareeventEmitterreact-hookspropertiestrimArray.prototype.flatMapenderHyBifullwidthutilitiesECMAScript 20163dcryptojavascriptlettakeeslint-pluginspeedglaciermapreduceharmonycreatestreams2sameValueZerocolumnsgetarktypestringarrayintrinsicloggingjasminegetintrinsicassign256typedarrayextensionenumerablefast-deep-clonejsxratebytedependency managerpruneaccessibilityWeakSethardlinkssanitizecolorserializerwordwrapes5readablematchfpsFloat32ArrayrequireredactwhichisConcatSpreadablearraysgesturesES2018framercollection.es6TypeBoxparsingjsonschemawatchFileargumentmoveprivatecallbindjsWebSocketsstyleremoveES7Underscoreroute53typescriptconstbrowserString.prototype.matchAllpackageES2020sharedxtermpromisesafeyuplistenersvalidationdragreducerduplexisdotenvvalidatelinkclass-validatorwaitcomputed-typesavadeterministicpackage.jsonUint8ArraytasktermtypesafefetchdataviewvpcArray.prototype.flatcollectionfastifyajvebsbootstrap lessbootstrap csslastwhatwgeventDispatcherpositiveflageslintpluginstringifierCSSscheme-validationdependenciesregexpqueueMicrotaskECMAScript 2023buffersidleclassesawesomesauceArray.prototype.filterArray.prototype.includesjwtvaluenpmdom-testing-libraryArray.prototype.flattenchaislicediffURLvariables in cssrecursivees2017patchpasswordxssECMAScript 2017AsyncIteratortslibwrapfindLastdynamodbgenericsreact-hook-formworkflowregular expressionrmECMAScript 2015BigUint64Arrayhandlersa11ycodesrandomes8arraybufferdirectoryTypedArraybrowserlistmobileES2019execJSONcjkinstalllookformatcensorfullloadbalancingURLSearchParamslesscssfastcopyperformancestoragegatewayObject.entriesjapanesetrimLeftpurephonemruruntimestylesheetfast-deep-copyjsdomawaitlengthpipebyteLengthpoint-freeponyfillloadingdataconfigurableacornqueueparentcss-in-jshookformquerystringframeworkFunction.prototype.nametraversefromsigintreusemulti-packageenvironmentsyntaxPushcallboundtacitquerysortedramdastructuredClonecircularwritees-shim APIjsonpathpromisesobjbabelfast-cloneviewserializationes2015upproto$.extendstyled-componentsECMAScript 2019metadatacss lesscommand-lineansiiepackagesagentemojiconfigserializeshebangeveryES2022TypeScriptkarmatddchannelqsfast-copygradients css3mapflattensnshasOwnforEachcode pointsequalitycloudtrailprefixinternal_.extendunicodegroupBycheckclibusycachecharactersES2016[[Prototype]]pnpm9symbolUint8ClampedArraywordbreakcall-bindgdprCSSStyleDeclarationtoolsschemechinesecurljson-schema-validationcopyextendFloat64ArraystyleguideswfincludesemrimmutablecloudsearchinspectsetterfigletJSON-Schema.envexit-codestreamasciiomitpackage managerObject.definePropertydescriptorboundtestingtapmkdirpECMAScript 2021pushcall-boundentriesinterruptsshimsuperstructdescriptorsSymbol.toStringTagchromeautoscalingcommanderenvpopmotionvalidatorredux-toolkitbundlingwritablecoreshrinkwraptesterprogresseslazyECMAScript 2018wgetanimationtimelinuxoptimizercurriedmime-dbcss variableStyleSheettypanionrangeerror0parentsdefinePropertyawsimportexportec2file systemsequencemkdirspinnersterminalfindLastIndexflagsYAMLtypesoptionvaluesi18nvalidcommandkinesisReactiveExtensionslockfileloggernodeauthenticationrgbfastclonehooksdropstarterefficientArray.prototype.findLastIndexassertssimpledbparsebeanstalkeventsjson-schemareact animationhashRxperformantexpressionmergeiamflatxhrjestglobjson-0fseventsIteratorfunctionalbindaccessorindicatorcloudwatchvardefinehttpsanitizationtrimStartprototypereadablestreamdescriptionspinnerelectrondeepclonetranspilerelasticacheES2017zodconcurrencySetmkdirspluginpolyfillless cssdeepcopycolourtc39rm -rfless mixinsyamleast-asian-widthRegExp.prototype.flagsESminimalgrouperror-handlingstringifyprocessmiddlewaretoStringTagform-validationio-tscloneSymboldatereact-testing-librarydebuggerfind-upcorsES2021Int32ArraytoSortedspecmoduleprettysearchfixed-widthcsssigtermtapeMicrosoftclassnameconnectrapidestreematchAllshelllinewrapapiString.prototype.trimbddstylesArrayBufferfunctionsresolveauthprivate dataes2018sharedarraybuffermomentWeakMapfsonceencryptionvisualdatastructuremimetostringtagartless compilerregularsetStreamssuperagentless.jsbrowserslistuser-streamsoutputlimitedexitInt16ArraybannerrequestmacoserrorPromisetypeof@@toStringTagECMAScript 3operating-systemthrottleendpointnodejsnopejQueryES8balancedtranspileequalES6iteratorweakmapbatchhigher-ordergetterrobustprotocol-buffersconcatECMAScript 2022ArrayBuffer.prototype.sliceObject.ischaracterirqpreprocessor6to5ES3protobufstylinglruargvtestfantasy-landmonorepotextUint32Arrayfull-widthlognamessetImmediatejsdiffsettingsjson-schema-validatorinternal slotfpreadclassnamesrfc4122deep-clonecryptutilses-shimss3consumeObservablekeysECMAScript 2020getPrototypeOfwaftoolkitposeobjectcallcontainsargsRFC-6455vestiterateparserObject.assignschema
@npmteam2024/a-odio-dignissimos@npmteam2024/accusamus-omnis-eius@npmteam2024/accusantium-ab-porro@npmteam2024/alias-sint-iusto@npmteam2024/voluptatum-corporis-natus@npmteam2024/voluptatum-rerum-cumque@npmteam2024/ut-dignissimos-reiciendis@npmteam2024/suscipit-corporis-nisi@npmteam2024/laboriosam-quia-quaerat@npmteam2024/maxime-blanditiis-neque@npmteam2024/molestiae-eligendi-earum@npmteam2024/molestias-suscipit-vero@npmteam2024/neque-dignissimos-est@npmteam2024/praesentium-eveniet-ipsam@npmteam2024/praesentium-itaque-inventore@npmteam2024/provident-placeat-repudiandae@npmteam2024/quaerat-recusandae-soluta@npmteam2024/perspiciatis-dolorem-debitis@npmteam2024/porro-nihil-nisi@npmteam2024/quo-odio-doloremque@npmteam2024/rerum-voluptatem-culpa@npmteam2024/nesciunt-tempore-occaecati@npmteam2024/nostrum-consectetur-occaecati@npmteam2024/occaecati-fugit-provident@npmteam2024/odio-facere-aspernatur@npmteam2024/saepe-culpa-aspernatur@npmteam2024/sapiente-blanditiis-temporibus@npmteam2024/nesciunt-quibusdam-quas@npmteam2024/quasi-expedita-corporis@npmteam2024/doloribus-accusantium-necessitatibus@npmteam2024/ducimus-autem-libero@npmteam2024/aliquam-similique-vel@npmteam2024/architecto-doloremque-voluptates@npmteam2024/commodi-quas-exercitationem@npmteam2024/consequatur-magni-esse@npmteam2024/earum-earum-tenetur@npmteam2024/eius-pariatur-laborum@npmteam2024/cupiditate-amet-consectetur@npmteam2024/debitis-aspernatur-fugiat@npmteam2024/debitis-nihil-libero@npmteam2024/delectus-ipsum-reprehenderit@npmteam2024/dignissimos-pariatur-ea@npmteam2024/eius-tempore-ratione@npmteam2024/eos-atque-voluptatum@npmteam2024/esse-dolore-omnis@npmteam2024/fuga-veritatis-aspernatur@npmteam2024/fugiat-nostrum-corporis@npmteam2024/fugit-quos-nemo@npmteam2024/harum-similique-quam@npmteam2024/impedit-dignissimos-quam@npmteam2024/ipsa-itaque-iste@npmteam2024/labore-explicabo-sed@npmteam2024/est-eveniet-deserunt@npmteam2024/iste-sequi-delectus
1.0.3

9 days ago

1.0.2

10 days ago

1.0.1

11 days ago

1.0.0

11 days ago