@nevware21/ts-utils
    Preparing search index...

    Function objGetOwnPropertyNames

    • The objGetOwnPropertyNames() method returns an array of all properties (including non-enumerable properties except for those which use Symbol) found directly in a given object.

      Parameters

      • obj: any

        The object whose enumerable and non-enumerable properties are to be returned

      Returns string[]

      An array of strings that correspond to the properties found directly in the given object

      0.12.0

      objGetOwnPropertyNames({ a: 1, b: 2 }); // ['a', 'b']

      // Array properties include indices and 'length'
      objGetOwnPropertyNames(['a', 'b']); // ['0', '1', 'length']

      // Non-enumerable properties are included
      const obj = Object.create({}, {
      hidden: { value: 'secret', enumerable: false },
      visible: { value: 'public', enumerable: true }
      });
      objGetOwnPropertyNames(obj); // ['hidden', 'visible']