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

@storyous/common-utils

Package Overview
Dependencies
Maintainers
5
Versions
147
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@storyous/common-utils - npm Package Compare versions

Comparing version 6.8.2 to 6.8.3

7

lib/externalId.js
'use strict';
const { AppError } = require('../lib/appError');
const AppError = require('../lib/appError');

@@ -13,7 +13,8 @@ module.exports = {

encode (number, prefix = '') {
if (String(number).length > 16 || number < 1) {
const mod = number % 36;
if (Number.isNaN(mod) || String(number).length > 16 || Number(number) < 1) {
throw new AppError('Invalid input number');
}
const mod = number % 36;
let res = ((number + 9876543) * (73 - mod)).toString(30);

@@ -20,0 +21,0 @@ while (res.length % 3 !== 0) {

{
"name": "@storyous/common-utils",
"version": "6.8.2",
"version": "6.8.3",
"description": "Common utils for storyous microservices",

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

@@ -35,2 +35,6 @@ 'use strict';

});
it('should throw an AppError, when pass wrong argument', () => {
assert.throws(() => (ID.encode('someString', 'p')), {});
});
});
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