Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

namirasoft-core

Package Overview
Dependencies
Maintainers
0
Versions
158
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

namirasoft-core - npm Package Compare versions

Comparing version 1.4.23 to 1.4.24

1

dist/BaseUUID.d.ts
export declare class BaseUUID {
private static SIZE;
static isValid(id: any): boolean;
static getShort(id: string): string;

@@ -4,0 +5,0 @@ short: string;

@@ -6,4 +6,22 @@ "use strict";

class BaseUUID {
static isValid(id) {
let value = id + "";
if (value.length != BaseUUID.SIZE)
return false;
let parts = id.split("@")[0].split("-");
if (parts.length < 2)
return false;
return /^[a-z][a-z][a-z]$/.test(parts[0]);
}
static getShort(id) {
return id.split("-")[0];
let parts = id.split("@")[0].split("-");
let ans = [];
for (let index = 0; index < parts.length - 1; index++) {
const part = parts[index];
if (/^[a-z][a-z][a-z]$/.test(part))
ans.push(part);
else
break;
}
return ans.join("-");
}

@@ -10,0 +28,0 @@ constructor(short) {

2

package.json

@@ -11,3 +11,3 @@ {

"private": false,
"version": "1.4.23",
"version": "1.4.24",
"author": "Amir Abolhasani",

@@ -14,0 +14,0 @@ "license": "MIT",

@@ -6,5 +6,25 @@ import { v4 } from "uuid";

private static SIZE = 20;
static isValid(id: any)
{
let value = id + "";
if (value.length != BaseUUID.SIZE)
return false;
let parts = id.split("@")[0].split("-");
if (parts.length < 2)
return false;
return /^[a-z][a-z][a-z]$/.test(parts[0]);
}
static getShort(id: string)
{
return id.split("-")[0];
let parts = id.split("@")[0].split("-");
let ans = [];
for (let index = 0; index < parts.length - 1; index++)
{
const part = parts[index];
if (/^[a-z][a-z][a-z]$/.test(part))
ans.push(part);
else
break;
}
return ans.join("-");
}

@@ -11,0 +31,0 @@ short: string;

Sorry, the diff of this file is not supported yet

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