Skip to content

Commit

Permalink
fix: correctly get and set top level contentType property
Browse files Browse the repository at this point in the history
  • Loading branch information
SimenB committed Apr 16, 2024
1 parent 99b25a4 commit 6c82468
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
4 changes: 3 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,12 @@ project adheres to [Semantic Versioning](http://semver.org/).

### Changed

- Enable `bun.js` by catching `NotImplemented` error (Fixes [#570](https://github.com/siimon/prom-client/issues/570))
- Correctly read and set `contentType` top level export

### Added

- Enable `bun.js` by catching `NotImplemented` error (Fixes [#570](https://github.com/siimon/prom-client/issues/570))

[unreleased]: https://github.com/siimon/prom-client/compare/v15.1.0...HEAD

## [15.1.1] - 2024-03-26
Expand Down
9 changes: 8 additions & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,14 @@

exports.register = require('./lib/registry').globalRegistry;
exports.Registry = require('./lib/registry');
exports.contentType = require('./lib/registry').globalRegistry.contentType;
Object.defineProperty(exports, 'contentType', {
configurable: false,
enumerable: true,
get: () => exports.register.contentType,
set: value => {
exports.register.setContentType(value);
},
});
exports.prometheusContentType =
require('./lib/registry').PROMETHEUS_CONTENT_TYPE;
exports.openMetricsContentType =
Expand Down

0 comments on commit 6c82468

Please sign in to comment.