From e4249d054d793e777390b694f49b7e72513a2bf7 Mon Sep 17 00:00:00 2001 From: Jonathan Siler Date: Tue, 3 Mar 2020 16:31:04 -0600 Subject: [PATCH] Replace string prototype implementation for format. --- src/components/ui/pagination/pagination.tsx | 2 +- src/global.d.ts | 2 +- src/utils/index.ts | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/components/ui/pagination/pagination.tsx b/src/components/ui/pagination/pagination.tsx index 0c318170..ad73f563 100644 --- a/src/components/ui/pagination/pagination.tsx +++ b/src/components/ui/pagination/pagination.tsx @@ -138,7 +138,7 @@ export class Pagination { } formatUrl(pageNumber) { - return this.url.format(pageNumber); + return this.url.formatReplace(pageNumber); } renderFirstPageButton () { diff --git a/src/global.d.ts b/src/global.d.ts index a344e7ca..82137179 100644 --- a/src/global.d.ts +++ b/src/global.d.ts @@ -18,7 +18,7 @@ declare interface TweenInstance { } declare interface String { - format(args: any): () => string; + formatReplace(args: any): () => string; } declare interface FormResult { diff --git a/src/utils/index.ts b/src/utils/index.ts index bc7eef29..73ed32ea 100644 --- a/src/utils/index.ts +++ b/src/utils/index.ts @@ -117,7 +117,7 @@ export var shuffle = function (array) { return array; }; -String.prototype['format'] = function() { +String.prototype['formatReplace'] = function() { var formatted = this; for( var arg in arguments ) { formatted = formatted.replace("{" + arg + "}", arguments[arg]);