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

@bloks/utils

Package Overview
Dependencies
Maintainers
3
Versions
167
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@bloks/utils - npm Package Compare versions

Comparing version 3.5.68 to 3.5.69

4

package.json
{
"name": "@bloks/utils",
"version": "3.5.68",
"version": "3.5.69",
"description": "",

@@ -21,3 +21,3 @@ "publishConfig": {

},
"gitHead": "974f11b00bd54ebdd985bb30a9d4d2fabc0613e4"
"gitHead": "b0fbc27eee82b507ce105cde2cbf1a3905f2bdf3"
}

@@ -1,18 +0,25 @@

const regex = /^([a-z]*)(\d*)/i
function* zip(...args) {
const iterators = args.map(x => x[Symbol.iterator]())
while (true) {
const current = iterators.map(x => x.next())
if (current.some(x => x.done)) {
break;
}
yield current.map(x => x.value)
}
}
export function sortAlphaNum(a, b) {
const _a = a.match(regex)
const _b = b.match(regex)
let toCompare = [...zip(a, b)]
// if the alphabetic part of a is less than that of b => -1
if (_a[1] < _b[1]) return -1
// if the alphabetic part of a is greater than that of b => 1
if (_a[1] > _b[1]) return 1
for (const item of toCompare) {
if (item[0] < item[1]) return -1
if (item[0] > item[1]) return 1
}
// if the alphabetic parts are equal, check the number parts
const _n = parseInt(_a[2]) - parseInt(_b[2])
if (_n == 0) // if the number parts are equal start a recursive test on the rest
return sortFn(a.substr(_a[0].length), b.substr(_b[0].length))
// else, just sort using the numbers parts
return _n
}
return a.length === b.length
? 0
: a.length > b.length
? 1
: -1
}
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