From 5bf1a0df59f9e63aba4682d25f9bcd6095eb464a Mon Sep 17 00:00:00 2001 From: Tasso Evangelista Date: Tue, 12 Oct 2021 14:04:05 -0300 Subject: [PATCH] Move isJSON helper --- client/views/admin/mailer/Mailer.js | 2 +- app/utils/lib/isJSON.js => lib/utils/isJSON.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) rename app/utils/lib/isJSON.js => lib/utils/isJSON.ts (57%) diff --git a/client/views/admin/mailer/Mailer.js b/client/views/admin/mailer/Mailer.js index 8a68b3ae4174..5f873f577417 100644 --- a/client/views/admin/mailer/Mailer.js +++ b/client/views/admin/mailer/Mailer.js @@ -11,7 +11,7 @@ import { import React, { useState, useCallback } from 'react'; import { isEmail } from '../../../../app/utils/lib/isEmail.js'; -import { isJSON } from '../../../../app/utils/lib/isJSON.js'; +import { isJSON } from '../../../../lib/utils/isJSON'; import Page from '../../../components/Page'; import { useTranslation } from '../../../contexts/TranslationContext'; diff --git a/app/utils/lib/isJSON.js b/lib/utils/isJSON.ts similarity index 57% rename from app/utils/lib/isJSON.js rename to lib/utils/isJSON.ts index ce5547a312b6..92820cd8c2d1 100644 --- a/app/utils/lib/isJSON.js +++ b/lib/utils/isJSON.ts @@ -1,4 +1,4 @@ -export const isJSON = (value) => { +export const isJSON = (value: string): boolean => { try { return !!JSON.parse(value); } catch {