Skip to content

Commit

Permalink
prepare deprecation_message which is multiline in the yaml file
Browse files Browse the repository at this point in the history
Squashed commit of the following:

commit 90421a7
Merge: 7e63fa4 7f81f9e
Author: Slava Leleka <[email protected]>
Date:   Fri Aug 18 11:59:38 2023 +0300

    Merge branch 'master' into fix/deprecation-message-no-break

commit 7e63fa4
Merge: 13fb8d2 a130373
Author: Slava Leleka <[email protected]>
Date:   Thu Aug 17 20:11:28 2023 +0300

    merge master into the branch

commit 13fb8d2
Author: Slava Leleka <[email protected]>
Date:   Thu Aug 17 20:03:08 2023 +0300

    prepare deprecation_message which is multiline in the yaml file
  • Loading branch information
slavaleleka committed Aug 18, 2023
1 parent 7f81f9e commit d06d24b
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions packages/agtree/src/validator/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import {
} from '../compatibility-tables';
import { type Modifier } from '../parser/common';
import { AdblockSyntax } from '../utils/adblockers';
import { UNDERSCORE } from '../utils/constants';
import { NEWLINE, SPACE, UNDERSCORE } from '../utils/constants';
import { INVALID_ERROR_PREFIX } from './constants';

const BLOCKER_PREFIX = {
Expand Down Expand Up @@ -154,9 +154,11 @@ const validateForSpecificSyntax = (
if (!specificBlockerData[SpecificKey.DeprecationMessage]) {
throw new Error('Deprecation notice is required for deprecated modifier');
}
// prepare the message which is multiline in the yaml file
const warn = specificBlockerData[SpecificKey.DeprecationMessage].replace(NEWLINE, SPACE);
return {
ok: true,
warn: specificBlockerData[SpecificKey.DeprecationMessage],
warn,
};
}

Expand Down

0 comments on commit d06d24b

Please sign in to comment.