diff --git a/.eslintrc b/.eslintrc index 3aa1e91..b482cce 100644 --- a/.eslintrc +++ b/.eslintrc @@ -3,21 +3,6 @@ "parserOptions": { "sourceType": "module" }, - "rules": { - "no-undef": "error", - "no-new": "off", - "max-len": ["warn", 120], - "@typescript-eslint/explicit-member-accessibility": "off", - "@typescript-eslint/explicit-function-return-type": "off", - "@typescript-eslint/interface-name-prefix": "off", - "@typescript-eslint/no-empty-interface": "off", - "@typescript-eslint/no-parameter-properties": "off", - "@typescript-eslint/ban-types": "off", - "@typescript-eslint/no-empty-function": "warn", - "no-unused-vars": "off", - "no-shadow": "off", - "indent": ["warn", 2] - }, "env": { "es6": true, "mocha": true, diff --git a/rete.config.ts b/rete.config.ts index 2bd5444..1454bda 100644 --- a/rete.config.ts +++ b/rete.config.ts @@ -1,9 +1,9 @@ import { ReteOptions } from 'rete-cli' export default { - input: 'src/index.ts', - name: 'Rete', - globals: { - crypto: 'crypto' - } + input: 'src/index.ts', + name: 'Rete', + globals: { + crypto: 'crypto' + } } diff --git a/src/index.ts b/src/index.ts index 541e951..bd40831 100644 --- a/src/index.ts +++ b/src/index.ts @@ -4,5 +4,3 @@ export * from './scope' export * from './types' export * from './utility-types' export * from './utils' - -console.log('rete') diff --git a/src/scope.ts b/src/scope.ts index 4e49fbb..6e62f84 100644 --- a/src/scope.ts +++ b/src/scope.ts @@ -23,7 +23,7 @@ export class Signal { export class Scope { signal = new Signal>() - parent?: any//Parents['length'] extends 0 ? undefined : Scope> + parent?: any // Parents['length'] extends 0 ? undefined : Scope> constructor(public name: string) {} diff --git a/src/utility-types.ts b/src/utility-types.ts index d9e90b7..a1023bb 100644 --- a/src/utility-types.ts +++ b/src/utility-types.ts @@ -2,39 +2,38 @@ export type AcceptPartialUnion = T | any -export type Tail = ((...args: T) => void) extends (head: any, ...tail: infer U) => any ? U : never; - +export type Tail = ((...args: T) => void) extends (head: any, ...tail: infer U) => any ? U : never type UnionToIntersection = ( U extends never ? never : (arg: U) => never ) extends (arg: infer I) => void ? I - : never; + : never type StrictExcludeInner = 0 extends ( U extends T ? [T] extends [U] ? 0 : never : never -) ? never : T; -type StrictExclude = T extends unknown ? StrictExcludeInner : never; +) ? never : T +type StrictExclude = T extends unknown ? StrictExcludeInner : never type UnionToTuple = UnionToIntersection< T extends never ? never : (t: T) => T > extends (_: never) => infer W ? [...UnionToTuple>, W] - : []; + : [] -type FilterMatch = T extends [infer Head, ...infer Tail] +type FilterMatch = T extends [infer Head, ...infer _Tail] ? ([Head] extends [V] - ? [Head, ...FilterMatch] - : FilterMatch + ? [Head, ...FilterMatch<_Tail, V>] + : FilterMatch<_Tail, V> ): [] type CanAssignToAnyOf = FilterMatch, Requires> extends [] ? false : true -type CanAssignEachTupleElemmentToAnyOf = Requires extends [infer Head, ...infer Tail] +type CanAssignEachTupleElemmentToAnyOf = Requires extends [infer Head, ...infer _Tail] ? CanAssignToAnyOf extends true ? - (Tail extends [] + (_Tail extends [] ? true - : CanAssignEachTupleElemmentToAnyOf + : CanAssignEachTupleElemmentToAnyOf ): false : false diff --git a/src/utils.ts b/src/utils.ts index 7116d0c..8eeb92b 100644 --- a/src/utils.ts +++ b/src/utils.ts @@ -1,4 +1,4 @@ -/*global globalThis*/ +/* global globalThis*/ const nodeCrypto = () => import('node:crypto')