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

@snack-uikit/avatar

Package Overview
Dependencies
Maintainers
3
Versions
43
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@snack-uikit/avatar - npm Package Compare versions

Comparing version 0.5.1 to 0.6.0

11

CHANGELOG.md

@@ -6,2 +6,13 @@ # Change Log

# 0.6.0 (2024-03-02)
### Features
* **FF-4448:** avatar accept decimals ([8800f1d](https://github.com/cloud-ru-tech/snack-uikit/commit/8800f1d760231c19bec6a76eac641e4cc1d890d7))
## 0.5.1 (2024-02-20)

@@ -8,0 +19,0 @@

6

dist/components/utils.js
const SPACE = ' ';
export const getAbbreviation = (str, abbreviationLength) => {
var _a, _b;
const trimStr = (_a = str.replace(/[^a-zа-яё\s]/gi, '').trim()) !== null && _a !== void 0 ? _a : str.replace(/[^\d]/gi, '');
var _a;
const trimStr = str.replace(/[^a-zа-яё\d\s]/gi, '').trim();
if (!trimStr || trimStr.length < abbreviationLength) {

@@ -12,3 +12,3 @@ return trimStr.toUpperCase();

const firstLetter = strParts[0].charAt(0);
const secondLetter = (_b = strParts[strParts.length - 1]) === null || _b === void 0 ? void 0 : _b.charAt(0);
const secondLetter = (_a = strParts[strParts.length - 1]) === null || _a === void 0 ? void 0 : _a.charAt(0);
abbreviation = `${firstLetter}${secondLetter}`.toUpperCase();

@@ -15,0 +15,0 @@ }

@@ -7,3 +7,3 @@ {

"title": "Avatar",
"version": "0.5.1",
"version": "0.6.0",
"sideEffects": [

@@ -39,3 +39,3 @@ "*.css",

},
"gitHead": "fd079dd3acbfe935d0b88d9efd863047f25e5824"
"gitHead": "0f018cde9f359a061d753c9ecc6e560dce35c4b6"
}
const SPACE = ' ';
export const getAbbreviation = (str: string, abbreviationLength: 1 | 2): string => {
const trimStr = str.replace(/[^a-zа-яё\s]/gi, '').trim() ?? str.replace(/[^\d]/gi, '');
const trimStr = str.replace(/[^a-zа-яё\d\s]/gi, '').trim();

@@ -6,0 +6,0 @@ if (!trimStr || trimStr.length < abbreviationLength) {

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