UNPKG

@halospv3/hce.shared-config

Version:

Automate commit message quality, changelogs, and CI/CD releases. Exports a semantic-release shareable configuration deserialized from this package's '.releaserc.yml'. Shared resources for .NET projects are also distributed with this package.

28 lines (27 loc) 1.08 kB
/** * Iterates through the descriptors object, checking for property descriptors whose `get` is a function. * Returns an {@link OwnGetterDescriptorMap} of the getters. * If you want only own, non-inherited getters, you must filter sanitize the * type the `descriptors` parameter yourself e.g. `Omit<Class, keyof * SuperClass>`. * @param descriptorMap An object like the return value of Object.getOwnPropertyDescriptors * @template Class Any ClassLike type * @template T Any `object`-like type. * @template [__proto__=null] If {@link Class} is not {@link ClassLike}, the `__proto__` of {@link T}. * @returns An {@link OwnGetterDescriptorMap}. * @since 3.0.0 */ function filterForGetters(descriptorMap) { let getterDescriptorMap = {}; for (const key in descriptorMap) { const element = descriptorMap[key]; if (typeof element.get === 'function') { getterDescriptorMap = Object.assign(getterDescriptorMap, { [key]: element }); } } return getterDescriptorMap; } export { filterForGetters }; //# sourceMappingURL=filterForGetters.mjs.map