MCPcopy Index your code
hub / github.com/JavaScriptRegenerated/yieldparser / IPAddress

Function IPAddress

examples/deno.ts:13–23  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

11}
12
13function* IPAddress() {
14 const first = yield Digit;
15 yield '.';
16 const second = yield Digit;
17 yield '.';
18 const third = yield Digit;
19 yield '.';
20 const fourth = yield Digit;
21 yield mustEnd;
22 return [first, second, third, fourth];
23}
24
25console.log(parse('1.2.3.4', IPAddress()));
26console.log(parse('1.2.3.256', IPAddress()));

Callers 1

deno.tsFile · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected