Skip to content

Commit

Permalink
fix: relax service name requirements to allow starting with numbers (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
amchiclet authored May 4, 2022
1 parent 810c3e5 commit fe0f1cc
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ import {Profiler} from './profiler';

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

function hasService(
config: Config
Expand Down
2 changes: 1 addition & 1 deletion test/test-init-config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -257,7 +257,7 @@ describe('createProfiler', () => {
} catch (e) {
assert.strictEqual(
e.message,
'Service serviceName does not match regular expression "/^[a-z]([-a-z0-9_.]{0,253}[a-z0-9])?$/"'
'Service serviceName does not match regular expression "/^[a-z0-9]([-a-z0-9_.]{0,253}[a-z0-9])?$/"'
);
}
});
Expand Down

0 comments on commit fe0f1cc

Please sign in to comment.