From 47ef4b48cccafb4fd6c0baa9a61b9e818c404eb4 Mon Sep 17 00:00:00 2001 From: Stefan Zerkalica Date: Fri, 15 Nov 2024 23:03:00 +0300 Subject: [PATCH] $mol_file fix root dir detection --- file/base/base.ts | 4 ++-- view/tree2/to/dts/dts.ts | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/file/base/base.ts b/file/base/base.ts index c25481b98f..8be3104fd5 100644 --- a/file/base/base.ts +++ b/file/base/base.ts @@ -30,8 +30,8 @@ namespace $ { const path = this.path() const base = (this.constructor as typeof $mol_file_base).base - // Если путь выше или равен base - считаем это корнем - return base.startsWith(path) + // Если путь выше или равен base или если parent такойже как и this - считаем это корнем + return base.startsWith(path) || this == this.parent() } @ $mol_mem diff --git a/view/tree2/to/dts/dts.ts b/view/tree2/to/dts/dts.ts index a68edfc448..0dc861ddfd 100644 --- a/view/tree2/to/dts/dts.ts +++ b/view/tree2/to/dts/dts.ts @@ -178,7 +178,7 @@ namespace $ { if (prop_parts.key) { types.push( type_enforce.call( this, - method.data(`${method.type}_${klass_name}_${++assert_count}`), + method.data(`${method.type}__${klass_name}_${++assert_count}`), parameters.call(this, main, prop, 0), parameters.call(this, second_main, second_key, 0), ) ) @@ -187,7 +187,7 @@ namespace $ { if (prop_parts.next) { types.push( type_enforce.call( this, - method.data(`${method.type}_${klass_name}_${++assert_count}`), + method.data(`${method.type}__${klass_name}_${++assert_count}`), parameters.call(this, main, prop, prop_parts.key ? 1 : 0), parameters.call(this, second_main, second_key, (left_parts.next ? left_parts : right_parts).key ? 1 : 0), ) ) @@ -281,7 +281,7 @@ namespace $ { types.push( type_enforce.call( this, - input.data(`${ klass.type }_${prop.type.replace(/[\?\*]*/g, '')}_${++assert_count}`), + input.data(`${ klass.type }_${prop.type.replace(/[\?\*]*/g, '')}__${++assert_count}`), result, array_type ) @@ -305,7 +305,7 @@ namespace $ { types.push( type_enforce.call( this, - first.data(`${input.type}_${klass_name}_${++assert_count}`), + first.data(`${input.type}__${klass_name}_${++assert_count}`), [ first.data('[ '), ...args,