MCPcopy Index your code
hub / github.com/di-sukharev/opencommit / timeRegexSource

Function timeRegexSource

out/cli.cjs:29838–29846  ·  view source on GitHub ↗
(args)

Source from the content-addressed store, hash-verified

29836 var dateRegexSource = `((\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-((0[13578]|1[02])-(0[1-9]|[12]\\d|3[01])|(0[469]|11)-(0[1-9]|[12]\\d|30)|(02)-(0[1-9]|1\\d|2[0-8])))`;
29837 var dateRegex = new RegExp(`^${dateRegexSource}$`);
29838 function timeRegexSource(args) {
29839 let regex = `([01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d`;
29840 if (args.precision) {
29841 regex = `${regex}\\.\\d{${args.precision}}`;
29842 } else if (args.precision == null) {
29843 regex = `${regex}(\\.\\d+)?`;
29844 }
29845 return regex;
29846 }
29847 function timeRegex(args) {
29848 return new RegExp(`^${timeRegexSource(args)}$`);
29849 }

Callers 2

timeRegexFunction · 0.85
datetimeRegexFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…