]> Piment Noir Git Repositories - e-mobility-charging-stations-simulator.git/commit
refactor(meter-values): rename Prng.ts to PRNG.ts (issue #1936 c) (#1940)
authorJérôme Benoit <jerome.benoit@piment-noir.org>
Sat, 4 Jul 2026 19:54:07 +0000 (21:54 +0200)
committerGitHub <noreply@github.com>
Sat, 4 Jul 2026 19:54:07 +0000 (21:54 +0200)
commit11cc0a37c7c72640a1fb5c5bc561a71ef3b4241d
treee05ef30431a72626c7793333c0458d8090375173
parentc471bd9b298709de00b4ef457825054d9d7abfd2
refactor(meter-values): rename Prng.ts to PRNG.ts (issue #1936 c) (#1940)

* refactor(meter-values): rename Prng.ts to PRNG.ts (issue #1936 c)

PRNG is the canonical uppercase abbreviation (Pseudo-Random Number
Generator). Uppercase acronyms in file names align with the codebase's
TypeScript PascalCase-for-modules convention (e.g. `OCPPServiceUtils.ts`).
`Prng.ts` was the outlier.

Rename performed via two-step `git mv` to survive case-insensitive
filesystems (macOS APFS default). Updates:
- Path imports (4 sites): `CoherentSampleComputer.ts`, `CoherentSession.ts`,
  `CoherentMeterValues.test.ts`, `PRNG.test.ts`.
- JSDoc `{@link}` module references (3 sites): `CoherentSession.ts` (2),
  `index.ts` (1).
- JSDoc backtick module references (2 sites): `CoherentSession.ts` (1),
  `CoherentMeterValues.test.ts` (1).
- Test suite description string: `describe('Prng', ...)` to
  `describe('PRNG', ...)` in `PRNG.test.ts`.

camelCase identifiers containing "Prng" (`voltagePrng`, `profilePickPrng`,
`socPrng`, `createStreamPrng`) preserved per TypeScript camelCase-for-
variables/functions convention.

Cosmetic; zero runtime change. Test invariant `fail: 0, skipped: 6`
preserved (2895 pass / 2901 total). Build passes.

Closes issue #1936 item (c).

* style(meter-values): normalize prose em-dash to ASCII on PR-C-touched lines (issue #1936 c)

R1 Lane C flagged em-dash (U+2014) in `+` lines of PR-C delta:
- `src/charging-station/meter-values/CoherentSession.ts:71` (JSDoc backtick reference line
  updated by rename)
- `src/charging-station/meter-values/index.ts:23` (JSDoc `{@link}` reference line updated
  by rename)

Both lines were modified by the PR-C rename (`Prng.ts` -> `PRNG.ts` reference updates) and
therefore appear in the branch `+` diff. Session ASCII rule permits only the section sign
(U+00A7) plus pre-existing physics/math notation in JSDoc as non-ASCII exceptions; em-dash
as prose punctuation is not covered.

Fix: replace both `--` (U+2014) with ASCII `-`. Semantic content preserved.

Em-dashes on lines NOT modified by PR-C (CoherentSession.ts:15, index.ts:14/18/21,
PRNG.test.ts x3, CoherentMeterValues.test.ts x1) remain SUB-THRESHOLD per pre-existing
outside line-level delta convention.

Test invariant `fail: 0, skipped: 6` preserved. Build passes.
src/charging-station/meter-values/CoherentSampleComputer.ts
src/charging-station/meter-values/CoherentSession.ts
src/charging-station/meter-values/PRNG.ts [moved from src/charging-station/meter-values/Prng.ts with 100% similarity]
src/charging-station/meter-values/index.ts
tests/charging-station/meter-values/CoherentMeterValues.test.ts
tests/charging-station/meter-values/PRNG.test.ts [moved from tests/charging-station/meter-values/Prng.test.ts with 97% similarity]