... this.me Docs modules/properties.js

Source

modules/properties.js

//this.me/src/methods/properties.js
/**
 * @module Properties
 * @description Methods to manage properties for the `Me` class.
 */

/**
 * Add a property to the identity.
 * @function
 * @param {Array} properties - The properties array to update.
 * @param {Object} property - The property to add (e.g., { type: "ETH", address: "0x123..." }).
 * @throws {Error} If the property is invalid.
 */
export function addProperty(properties, property) {
    if (!property || typeof property !== 'object') {
      throw new Error('Invalid property');
    }
    properties.push(property);
  }
  
  /**
   * Retrieve all properties for the identity.
   * @function
   * @param {Array} properties - The properties array to retrieve from.
   * @returns {Array} The properties array.
   * @instance
   */
  export function getProperties(properties) {
    return properties;
  }

By neurons.me