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

@shopify/name

Package Overview
Dependencies
Maintainers
0
Versions
10
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@shopify/name - npm Package Compare versions

Comparing version 1.2.0 to 1.3.0

build/cjs/utilities/nonEmptyOrUndefined.js

29

build/cjs/formatName.js

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

var constants = require('./constants.js');
var nonEmptyOrUndefined = require('./utilities/nonEmptyOrUndefined.js');
var languageFromLocale = require('./utilities/languageFromLocale.js');

@@ -15,19 +16,23 @@

}) {
if (!name.givenName) {
return name.familyName || '';
const givenName = nonEmptyOrUndefined.nonEmptyOrUndefined(name === null || name === void 0 ? void 0 : name.givenName);
const familyName = nonEmptyOrUndefined.nonEmptyOrUndefined(name === null || name === void 0 ? void 0 : name.familyName);
if (familyName && !givenName) {
return familyName;
}
if (!name.familyName) {
return name.givenName;
if (givenName && !familyName) {
return givenName;
}
const isFullName = Boolean(options && options.full);
const customNameFormatter = constants.FAMILY_NAME_GIVEN_NAME_ORDERING_INDEXED_BY_LANGUAGE.get(languageFromLocale.languageFromLocale(locale));
if (customNameFormatter) {
return customNameFormatter(name.givenName, name.familyName, isFullName);
if (givenName && familyName) {
const isFullName = Boolean(options && options.full);
const customNameFormatter = constants.FAMILY_NAME_GIVEN_NAME_ORDERING_INDEXED_BY_LANGUAGE.get(languageFromLocale.languageFromLocale(locale));
if (customNameFormatter) {
return customNameFormatter(givenName, familyName, isFullName);
}
if (isFullName) {
return `${givenName} ${familyName}`;
}
}
if (isFullName) {
return `${name.givenName} ${name.familyName}`;
}
return name.givenName;
return givenName;
}
exports.formatName = formatName;

@@ -10,3 +10,3 @@ export declare function abbreviateName({ name, locale, options, }: {

};
}): string;
}): string | undefined;
export declare function tryAbbreviateName({ givenName, familyName, idealMaxLength, }: {

@@ -13,0 +13,0 @@ givenName?: string;

export declare function formatName({ name, locale, options, }: {
name: {
givenName?: string;
familyName?: string;
givenName?: string | null;
familyName?: string | null;
};

@@ -10,3 +10,3 @@ locale: string;

};
}): string;
}): string | undefined;
//# sourceMappingURL=formatName.d.ts.map
{
"name": "@shopify/name",
"version": "1.2.0",
"version": "1.3.0",
"license": "MIT",

@@ -5,0 +5,0 @@ "description": "Name-related utilities",

# `@shopify/name`
> [!CAUTION]
>
> `@shopify/name` is deprecated.
>
> Shopifolk, see
> [Shopify/quilt-internal](https://github.com/shopify/quilt-internal) for
> information on the latest packages available for use internally.
[![Build Status](https://github.com/Shopify/quilt/workflows/Node-CI/badge.svg?branch=main)](https://github.com/Shopify/quilt/actions?query=workflow%3ANode-CI)

@@ -4,0 +12,0 @@ [![Build Status](https://github.com/Shopify/quilt/workflows/Ruby-CI/badge.svg?branch=main)](https://github.com/Shopify/quilt/actions?query=workflow%3ARuby-CI)

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

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