11#!/usr/bin/env node
22/**
3- RTJSCOMP by L3P3, 2017-2025
3+ @preserve RTJSCOMP by L3P3, 2017-2025
44*/
55
66"use strict" ;
@@ -474,7 +474,7 @@ const service_start = async service_object => {
474474 service_object . status = SERVICE_STATUS_ACTIVE ;
475475 }
476476 catch ( err ) {
477- if ( ! err instanceof Error ) {
477+ if ( ! ( err instanceof Error ) ) {
478478 err = new Error ( err + '?! wtf' ) ;
479479 }
480480 log ( `[error] ${
@@ -667,6 +667,7 @@ const get_prop_list = (obj, prop) => {
667667 const value = obj [ prop ] ;
668668 if (
669669 typeof value !== 'object' ||
670+ ! value ||
670671 value . length == null ||
671672 value . some ( item => typeof item !== 'string' )
672673 ) {
@@ -683,6 +684,7 @@ const get_prop_map = (obj, prop) => {
683684 let value = obj [ prop ] ;
684685 if (
685686 typeof value !== 'object' ||
687+ ! value ||
686688 (
687689 value = Object . entries ( value )
688690 ) . some ( ( [ _ , item ] ) => typeof item !== 'string' )
@@ -1097,15 +1099,19 @@ const request_handle = async (request, response, https) => {
10971099 body_raw ,
10981100 content_type . split ( 'boundary=' ) [ 1 ] . split ( ';' ) [ 0 ]
10991101 )
1100- . map ( ( { name, ...value } ) => [
1101- name ,
1102- value . type ? value : value . data . toString ( )
1103- ] )
1102+ . map ( value => {
1103+ const { name} = value ;
1104+ delete value . name ;
1105+ return [
1106+ name ,
1107+ value . type ? value : value . data . toString ( )
1108+ ] ;
1109+ } )
11041110 ) ;
11051111 }
11061112 }
11071113 if ( body ) {
1108- Object . assign ( file_function_input , body ) ;
1114+ Object . assign ( file_function_input , /** @type { !Object } */ ( body ) ) ;
11091115 }
11101116 }
11111117 catch ( err ) {
@@ -1397,13 +1403,13 @@ await file_keep_new(PATH_CONFIG + 'init.js', async data => {
13971403 json [ 'path_aliases' ] = parse_old_map ( old_path_aliases ) ;
13981404 }
13991405 if ( old_port_http ) {
1400- const number = parseInt ( old_port_http ) ;
1406+ const number = Number ( old_port_http ) ;
14011407 if ( ! isNaN ( number ) ) {
14021408 json [ 'port_http' ] = number ;
14031409 }
14041410 }
14051411 if ( old_port_https ) {
1406- const number = parseInt ( old_port_https ) ;
1412+ const number = Number ( old_port_https ) ;
14071413 if ( ! isNaN ( number ) ) {
14081414 json [ 'port_https' ] = number ;
14091415 }
0 commit comments