move isObject into utils

Signed-off-by: Paul Cowan <paul.cowan@cutting.scot>
This commit is contained in:
Paul Cowan
2023-02-06 20:37:22 +00:00
parent 79dac4ac1e
commit ba1f98a038
2 changed files with 7 additions and 5 deletions
@@ -15,15 +15,12 @@
*/
import { FieldValidation } from '@rjsf/utils';
import type { JsonObject, JsonValue } from '@backstage/types';
import type { JsonObject } from '@backstage/types';
import { ApiHolder } from '@backstage/core-plugin-api';
import { Draft07 as JSONSchema } from 'json-schema-library';
import { createFieldValidation } from '../../lib';
import { NextCustomFieldValidator } from '../../extensions';
function isObject(value: JsonValue | undefined): value is JsonObject {
return typeof value === 'object' && value !== null && !Array.isArray(value);
}
import { isObject } from './utils';
/**
* @internal
@@ -13,6 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import type { JsonObject, JsonValue } from '@backstage/types';
import type { FieldValidation } from '@rjsf/utils';
import { FormValidation } from './createAsyncValidators';
@@ -35,3 +36,7 @@ export function hasErrors(errors?: FormValidation): boolean {
return false;
}
export function isObject(value: JsonValue | undefined): value is JsonObject {
return typeof value === 'object' && value !== null && !Array.isArray(value);
}