HEX
Server: Apache/2.4.41 (Ubuntu)
System: Linux ip-172-31-42-149 5.15.0-1084-aws #91~20.04.1-Ubuntu SMP Fri May 2 07:00:04 UTC 2025 aarch64
User: ubuntu (1000)
PHP: 7.4.33
Disabled: pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_get_handler,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,pcntl_async_signals,pcntl_unshare,
Upload Files
File: /var/www/vhost/disk-apps/pwa.sports-crowd.com/node_modules/@trapezedev/project/dist/properties.js
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.PropertiesFile = void 0;
const utils_fs_1 = require("@ionic/utils-fs");
const lodash_1 = require("lodash");
const logger_1 = require("./logger");
const fs_1 = require("./util/fs");
const properties_1 = require("./util/properties");
const vfs_1 = require("./vfs");
class PropertiesFile extends vfs_1.VFSStorable {
    constructor(path, vfs) {
        super();
        this.path = path;
        this.vfs = vfs;
        this.commitFn = async (file) => {
            await (0, fs_1.assertParentDirs)(file.getFilename());
            return (0, properties_1.writeProperties)(file.getFilename(), file.getData());
        };
    }
    getProperties() {
        return this.doc;
    }
    async updateProperties(properties) {
        if (!this.doc) {
            return;
        }
        logger_1.Logger.v('properties', 'update', `${this.path} - ${properties}`);
        const merged = (0, lodash_1.mergeWith)(this.doc, properties, (objValue, srcValue) => {
            // Override the default merge behavior for arrays of objects that have the
            // same sub-key. Otherwise lodash merge doesn't work how we need it to
            if (Array.isArray(objValue)) {
                //if (replace) {
                return srcValue;
                //}
                /*
                const firstObjValue = objValue[0];
                const firstSrcValue = srcValue[0];
        
                // https://github.com/ionic-team/capacitor-configure/issues/32
                // When merging an array of dicts, like when modifying
                // CFBundleURLTypes, we don't want to union the two arrays because that
                // would result in duplicated array of dicts. Instead, we want to merge as-is.
                // This check makes sure we're not trying to union an array of dicts
                if (typeof firstObjValue !== 'object' && typeof firstSrcValue !== 'object') {
                  return union(objValue, srcValue);
                }
                */
            }
            else if (typeof objValue === 'object' && objValue !== null) {
                //if (replace) {
                return srcValue;
                //}
            }
        });
        Object.assign(this.doc, merged);
    }
    async load() {
        if (this.vfs.isOpen(this.path)) {
            return;
        }
        if (!await (0, utils_fs_1.pathExists)(this.path)) {
            throw new Error(`Unable to locate file at ${this.path}`);
        }
        this.doc = await (0, properties_1.parseProperties)(this.path);
        logger_1.Logger.v('properties', 'load', `at ${this.path}`, this.doc);
        this.vfs.open(this.path, this.doc, this.commitFn);
    }
}
exports.PropertiesFile = PropertiesFile;
//# sourceMappingURL=properties.js.map