@verdocs/js-sdk 3.9.7 → 3.9.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,8 +1,17 @@
1
+ import { IProfile } from '../Users/Types';
1
2
  /**
2
3
  * Create an array containing a sequence of integers, e.g. [START, START+1, START+2, ...] This is frequently useful
3
4
  * in rendering operations when there is no source array to .map() across.
4
5
  */
5
6
  export declare const integerSequence: (start: number, count: number) => number[];
7
+ /**
8
+ * Format a profile's full name
9
+ */
10
+ export declare const formatFullName: (profile?: IProfile) => string;
11
+ /**
12
+ * Format a profile's initials
13
+ */
14
+ export declare const formatInitials: (profile?: IProfile) => string;
6
15
  /**
7
16
  * Generate suggested initials for a full name, e.g. "John Doe" will yield "JD".
8
17
  */
@@ -1,3 +1,4 @@
1
+ import { capitalize } from './Strings';
1
2
  /**
2
3
  * Create an array containing a sequence of integers, e.g. [START, START+1, START+2, ...] This is frequently useful
3
4
  * in rendering operations when there is no source array to .map() across.
@@ -7,6 +8,18 @@ export var integerSequence = function (start, count) {
7
8
  .fill(1)
8
9
  .map(function (_, index) { return index + start; });
9
10
  };
11
+ /**
12
+ * Format a profile's full name
13
+ */
14
+ export var formatFullName = function (profile) {
15
+ return profile ? "".concat(capitalize(profile.first_name), " ").concat(capitalize(profile.last_name)) : 'Invalid User';
16
+ };
17
+ /**
18
+ * Format a profile's initials
19
+ */
20
+ export var formatInitials = function (profile) {
21
+ return profile ? "".concat(capitalize(profile.first_name).charAt(0), " ").concat(capitalize(profile.last_name).charAt(0)) : '--';
22
+ };
10
23
  /**
11
24
  * Generate suggested initials for a full name, e.g. "John Doe" will yield "JD".
12
25
  */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@verdocs/js-sdk",
3
- "version": "3.9.7",
3
+ "version": "3.9.8",
4
4
  "private": false,
5
5
  "homepage": "https://github.com/Verdocs/js-sdk",
6
6
  "description": "Verdocs JS SDK",