Getting error -
error: Expected Comma, got Some(Str { value: Atom('./type.ts' type=dynamic), has_escape: false }) at file: <home>/jozty/Fae/equals.ts:4:17
Importing type.ts
in equals.ts
. It is giving this when type
function is exported default, it works fine otherwise. This error is occurring only in this equals.ts
. It is imported default successfully in other files.
equals.ts
import curryN from './utils/curry_n.ts'
import { Curry2 } from './utils/types.ts'
import { isFunction } from './utils/is.ts'
import type from './type.ts'
function equals(a: any, b: any) {
if(Object.is(a, b)) return true
if(type(a) === type(b)) return true
if(isFunction(a.equals)) {
return(
isFunction(a.equals)
&& isFunction(b.equals)
&& a.equals(b)
&& b.equals(a)
)
}
}
export default curryN(2, equals) as Curry2<any, any, boolean>
type.ts
import slice from "./slice.ts"
import { AllTypes } from "./utils/types.ts"
export default function type(a: any): AllTypes {
if(a === null) return 'Null'
if(a === undefined) return 'Undefined'
return slice(8, -1, Object.prototype.toString.call(a)) as unknown as AllTypes
}
AllTypes
export type AllTypes = 'Null'
| 'Undefined'
| 'Object'
| 'Number'
| 'Boolean'
| 'String'
| 'Array'
| 'RegExp'
| 'Function'
| 'Arguments'
| 'Date'
| 'Error'
| 'Map'
| 'Set'
| 'WeakMap'
| 'WeakSet'
| 'Int8Array'
| 'Uint8Array'
| 'Uint8ClampedArray'
| 'Int16Array'
| 'Uint16Array'
| 'Int32Array'
| 'Uint32Array'
| 'Float32Array'
| 'Float64Array'
| 'ArrayBuffer'