Sha256: bb5ec6a397b4ffcaa119153fcb70457367368f6fa547a93b09ca997906bf8df2

Contents?: true

Size: 324 Bytes

Versions: 3

Compression:

Stored size: 324 Bytes

Contents

export default function getAllPropertyNames(Klass) {
  let proto = Klass.prototype;
  let properties = new Set();

  while (proto !== Object.prototype) {
    let names = Object.getOwnPropertyNames(proto);
    names.forEach(name => properties.add(name));
    proto = Object.getPrototypeOf(proto);
  }

  return properties;
}

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
discourse-ember-source-3.6.0.0 dist/es/internal-test-helpers/lib/get-all-property-names.js
discourse-ember-source-3.5.1.1 dist/es/internal-test-helpers/lib/get-all-property-names.js
discourse-ember-source-3.5.1.0 dist/dist/es/internal-test-helpers/lib/get-all-property-names.js