@@ -31,6 +31,8 @@ import { fileURLToPath } from 'node:url';
3131
3232import { describe , expect , it } from 'vitest' ;
3333
34+ import { maskComments } from '../../../../scripts/js-comment-mask.mjs' ;
35+
3436import { ALL_CONVERSIONS } from '../conversions/registry' ;
3537import { MIGRATIONS_BY_MAJOR , RETIRED_KEYS_BY_MAJOR } from '../migrations/registry' ;
3638import {
@@ -144,7 +146,7 @@ describe('revokeSessionsOnPasswordReset retirement — ADR-0087 registration', (
144146// The key name is unique to this setting (better-auth's option of the same
145147// name aside — see the exclusions), so the matcher is the key in KEY POSITION
146148// (`revokeSessionsOnPasswordReset:` or its quoted JSON form), with comment
147- // contents masked in code; the tombstone declaration itself
149+ // contents masked in code (`scripts/js-comment-mask.mjs`) ; the tombstone declaration itself
148150// (`: retiredKey(`) is never an offence. Excluded, each for its reason:
149151// - this file, which writes the key to prove the refusal;
150152// - plugin-auth's `password-reset-ends-sessions.test.ts`, which writes it as
@@ -180,12 +182,6 @@ describe('tree-scoped absence: nothing inside the declared radius still writes e
180182
181183 const IN_KEY_POSITION = / ( ^ | [ \s { , ( ] ) [ " ' ] ? r e v o k e S e s s i o n s O n P a s s w o r d R e s e t [ " ' ] ? \s * : (? ! \s * r e t i r e d K e y \( ) / g;
182184
183- /** Code with `//` and block-comment CONTENTS blanked, offsets kept. */
184- const maskComments = ( src : string ) : string =>
185- src
186- . replace ( / \/ \* [ \s \S ] * ?\* \/ / g, ( m ) => m . replace ( / [ ^ \n ] / g, ' ' ) )
187- . replace ( / ( ^ | [ ^ : ' " ` \\ ] ) \/ \/ [ ^ \n ] * / g, ( m , lead : string ) => lead + ' ' . repeat ( m . length - lead . length ) ) ;
188-
189185 const walk = ( dir : string , out : string [ ] ) => {
190186 for ( const ent of fs . readdirSync ( dir , { withFileTypes : true } ) ) {
191187 if ( ent . isDirectory ( ) ) {
0 commit comments