From cb7053a319ec42868e508f1867b6146fdcbb1a1d Mon Sep 17 00:00:00 2001 From: Raine Revere Date: Wed, 15 Jan 2025 19:59:36 +0000 Subject: [PATCH] Inline isPath. --- src/util/isEM.ts | 4 +++- src/util/isPath.ts | 7 ------- 2 files changed, 3 insertions(+), 8 deletions(-) delete mode 100644 src/util/isPath.ts diff --git a/src/util/isEM.ts b/src/util/isEM.ts index 40a5494b676..affb63f4045 100644 --- a/src/util/isEM.ts +++ b/src/util/isEM.ts @@ -1,7 +1,9 @@ import Context from '../@types/Context' import Path from '../@types/Path' import { EM_TOKEN } from '../constants' -import isPath from './isPath' + +/** Checks if an object is of type Path. */ +const isPath = (o: Context | Path): o is Path => o.length > 0 && Object.prototype.hasOwnProperty.call(o[0], 'value') /** Returns true if the Path is the EM_TOKEN. */ const isEM = (thoughts: Context | Path): boolean => diff --git a/src/util/isPath.ts b/src/util/isPath.ts deleted file mode 100644 index ab6af2a659f..00000000000 --- a/src/util/isPath.ts +++ /dev/null @@ -1,7 +0,0 @@ -import Context from '../@types/Context' -import Path from '../@types/Path' - -/** Checks if an object is of type Path. */ -const isPath = (o: Context | Path): o is Path => o.length > 0 && Object.prototype.hasOwnProperty.call(o[0], 'value') - -export default isPath