-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
Closes #3 GalleryModal: Добавлена возможность реагировать на события видео
- Loading branch information
Showing
9 changed files
with
111 additions
and
32 deletions.
There are no files selected for viewing
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,9 @@ | ||
import pipe from 'lodash/fp/pipe'; | ||
import toString from 'lodash/toString'; | ||
|
||
/** | ||
* Очищает строку от любых символов, кроме цифр и удаляет лишние нули вначале. | ||
* @param {string} str Строка. | ||
* @return {string} Возвращает очищенную строку. | ||
* @param value Строка. | ||
* @return Возвращает очищенную строку. | ||
*/ | ||
export const cleanNumString = pipe( | ||
str => toString(str) && str.replace(/[^0-9]/g, ''), | ||
str => str === '' ? '' : Number(str).toString() | ||
); | ||
export const cleanNumString = (value: unknown): string => { | ||
const string = String(value).replace(/\D/g, ''); | ||
return string.length > 0 ? Number(string).toString() : ''; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters