Skip to content
This repository was archived by the owner on Feb 20, 2026. It is now read-only.

Commit fe0f1cc

Browse files
authored
fix: relax service name requirements to allow starting with numbers (#828)
1 parent 810c3e5 commit fe0f1cc

2 files changed

Lines changed: 2 additions & 2 deletions

File tree

src/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ import {Profiler} from './profiler';
2525

2626
// eslint-disable-next-line @typescript-eslint/no-var-requires
2727
const pjson = require('../../package.json');
28-
const serviceRegex = /^[a-z]([-a-z0-9_.]{0,253}[a-z0-9])?$/;
28+
const serviceRegex = /^[a-z0-9]([-a-z0-9_.]{0,253}[a-z0-9])?$/;
2929

3030
function hasService(
3131
config: Config

test/test-init-config.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -257,7 +257,7 @@ describe('createProfiler', () => {
257257
} catch (e) {
258258
assert.strictEqual(
259259
e.message,
260-
'Service serviceName does not match regular expression "/^[a-z]([-a-z0-9_.]{0,253}[a-z0-9])?$/"'
260+
'Service serviceName does not match regular expression "/^[a-z0-9]([-a-z0-9_.]{0,253}[a-z0-9])?$/"'
261261
);
262262
}
263263
});

0 commit comments

Comments
 (0)