• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

ringcentral / ringcentral-js-widgets / 21017357600

15 Jan 2026 02:19AM UTC coverage: 61.994% (-1.1%) from 63.06%
21017357600

push

github

web-flow
misc: sync features and bugfixes from 8f9fbb5dfe (#1784)

* misc: sync crius

* chore: update babel-setting deps

* feat(core): update logger and add fromWatch

* misc: fix tsconfig

* misc: fix tsconfig

* misc: update eslint-settings and new eslint-plugin-crius package

* chore: remove ci and nx from package.json

* feat(i18n): new getAcceptLocaleMap and preudo string support

* chore: add preudo i18n

* misc(locale-loader): convert to ts, new format support

* misc(locale-settings): use ts

* chore: add format test in phone number lib

* feat(react-hooks): add more hooks

* chore: add comments

* misc: add more mock files

* misc: update test utils

* misc: update utils

* chore: update tsconfig

* misc: update i18n string, and convert to ts

* feat: update ui components, support emoji input, new video setting ui

* feat: new rcvideo v2 module

* feat: use new subscription register api

* misc(commons): update enums/interfaces

* misc: update Analytics lib

* misc: upgrade uuid and update import

* misc(commons): update formatDuration lib

* misc(test): add test steps

* chore: update tests and more feature tests

* misc: update demo project

* misc: update cli template

* misc: fix deps issue

* misc: remove glip widgets package

* misc: fix wrong import path

* misc: limit jest worker memory

* chore: use npm trusted-publishers

10285 of 18150 branches covered (56.67%)

Branch coverage included in aggregate %.

986 of 2186 new or added lines in 228 files covered. (45.11%)

44 existing lines in 23 files now uncovered.

17404 of 26514 relevant lines covered (65.64%)

167640.7 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

21.05
/packages/utils/src/utils/fileHandler/fileHandler.ts
1
import {
2
  CONTENT_TYPE_TO_EXTENSION,
3
  EXTENSION_TO_CONTENT_TYPE,
4
} from './constant';
5

6
/**
7
 * get file name with extension.
8
 */
9
export function getFilename(fullPath: string) {
10
  return fullPath.substring(fullPath.lastIndexOf('/') + 1);
×
11
}
12

13
/**
14
 * remove file path extension.
15
 */
16
export const removeExtension = (str: string) => {
304✔
17
  return str.split('.').slice(0, -1).join('.');
×
18
};
19

20
/**
21
 * get file extension.
22
 */
23
export const getFileExtension = (fileName: string) => {
304✔
24
  const splitArrays = fileName.toLowerCase().split('.');
×
25
  return splitArrays.length > 1 ? splitArrays.pop()! : '';
×
26
};
27

28
/**
29
 * get file extension from content type
30
 *
31
 * @example
32
 * ```ts
33
 * console.log(getFileExtensionFromContentType('image/gif')) // gif
34
 * ```
35
 */
36
export const getFileExtensionFromContentType = (contentType?: string) => {
304✔
37
  return contentType
×
38
    ? CONTENT_TYPE_TO_EXTENSION[contentType.toLowerCase()] ??
×
39
        contentType.split('/')[1]
40
    : undefined;
41
};
42

43
/**
44
 * get content type from file extension
45
 *
46
 * @example
47
 * ```ts
48
 * console.log(getFileContentTypeFromExtension('gif')) // image/gif
49
 * ```
50
 */
51
export const getFileContentTypeFromExtension = (extensionName?: string) => {
304✔
52
  return extensionName
×
53
    ? EXTENSION_TO_CONTENT_TYPE[extensionName.toLowerCase()]
54
    : undefined;
55
};
56

57
/**
58
 * get file name with extension, and no url params.
59
 */
60
export function getFilenameWithNoUrlParams(fullPath: string) {
NEW
61
  return fullPath.substring(fullPath.lastIndexOf('/') + 1).split('?')[0];
×
62
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc