{"version":3,"file":"forbidden-methods.mjs","names":[],"sources":["../../../../../../../../@warlock.js/seal/src/validators/methods/forbidden-methods.ts"],"sourcesContent":["import {\r\n  forbiddenIfEmptyRule,\r\n  forbiddenIfInRule,\r\n  forbiddenIfNotEmptyRule,\r\n  forbiddenIfNotInRule,\r\n  forbiddenIfNotRule,\r\n  forbiddenIfRule,\r\n} from \"../../rules/conditional/forbidden-if-rules\";\r\nimport { forbiddenRule } from \"../../rules/core/forbidden\";\r\nimport { BaseValidator } from \"../base-validator\";\r\n\r\n/**\r\n * Marker re-exported by the validators barrel so the dts bundler keeps this\r\n * module (and its `declare module` augmentation) in the bundled `.d.ts`.\r\n */\r\nexport const forbiddenMethodsApplied = true;\r\n\r\ndeclare module \"../base-validator\" {\r\n  interface BaseValidator {\r\n    /**\r\n     * Value is forbidden to be present\r\n     */\r\n    forbidden(errorMessage?: string): this;\r\n\r\n    /**\r\n     * Value is forbidden if another field equals a specific value (global scope)\r\n     */\r\n    forbiddenIf(field: string, value: any, errorMessage?: string): this;\r\n\r\n    /**\r\n     * Value is forbidden if another field equals a specific value (sibling scope)\r\n     */\r\n    forbiddenIfSibling(field: string, value: any, errorMessage?: string): this;\r\n\r\n    /**\r\n     * Value is forbidden if another field does NOT equal a specific value (global scope)\r\n     */\r\n    forbiddenIfNot(field: string, value: any, errorMessage?: string): this;\r\n\r\n    /**\r\n     * Value is forbidden if another field does NOT equal a specific value (sibling scope)\r\n     */\r\n    forbiddenIfNotSibling(field: string, value: any, errorMessage?: string): this;\r\n\r\n    /**\r\n     * Value is forbidden if another field is empty (global scope)\r\n     */\r\n    forbiddenIfEmpty(field: string, errorMessage?: string): this;\r\n\r\n    /**\r\n     * Value is forbidden if another field is empty (sibling scope)\r\n     */\r\n    forbiddenIfEmptySibling(field: string, errorMessage?: string): this;\r\n\r\n    /**\r\n     * Value is forbidden if another field is not empty (global scope)\r\n     */\r\n    forbiddenIfNotEmpty(field: string, errorMessage?: string): this;\r\n\r\n    /**\r\n     * Value is forbidden if another field is not empty (sibling scope)\r\n     */\r\n    forbiddenIfNotEmptySibling(field: string, errorMessage?: string): this;\r\n\r\n    /**\r\n     * Value is forbidden if another field's value is in the given array (global scope)\r\n     */\r\n    forbiddenIfIn(field: string, values: any[], errorMessage?: string): this;\r\n\r\n    /**\r\n     * Value is forbidden if another field's value is in the given array (sibling scope)\r\n     */\r\n    forbiddenIfInSibling(field: string, values: any[], errorMessage?: string): this;\r\n\r\n    /**\r\n     * Value is forbidden if another field's value is NOT in the given array (global scope)\r\n     */\r\n    forbiddenIfNotIn(field: string, values: any[], errorMessage?: string): this;\r\n\r\n    /**\r\n     * Value is forbidden if another field's value is NOT in the given array (sibling scope)\r\n     */\r\n    forbiddenIfNotInSibling(field: string, values: any[], errorMessage?: string): this;\r\n  }\r\n}\r\n\r\n/**\r\n * Value is forbidden to be present\r\n */\r\nBaseValidator.prototype.forbidden = function (errorMessage?: string) {\r\n  return this.addRule(forbiddenRule, errorMessage);\r\n};\r\n\r\n/**\r\n * Value is forbidden if another field equals a specific value (global scope)\r\n */\r\nBaseValidator.prototype.forbiddenIf = function (field: string, value: any, errorMessage?: string) {\r\n  return this.addRule(forbiddenIfRule, errorMessage, {\r\n    field,\r\n    value,\r\n    scope: \"global\",\r\n  });\r\n};\r\n\r\n/**\r\n * Value is forbidden if another field equals a specific value (sibling scope)\r\n */\r\nBaseValidator.prototype.forbiddenIfSibling = function (\r\n  field: string,\r\n  value: any,\r\n  errorMessage?: string,\r\n) {\r\n  return this.addRule(forbiddenIfRule, errorMessage, {\r\n    field,\r\n    value,\r\n    scope: \"sibling\",\r\n  });\r\n};\r\n\r\n/**\r\n * Value is forbidden if another field does NOT equal a specific value (global scope)\r\n */\r\nBaseValidator.prototype.forbiddenIfNot = function (\r\n  field: string,\r\n  value: any,\r\n  errorMessage?: string,\r\n) {\r\n  return this.addRule(forbiddenIfNotRule, errorMessage, {\r\n    field,\r\n    value,\r\n    scope: \"global\",\r\n  });\r\n};\r\n\r\n/**\r\n * Value is forbidden if another field does NOT equal a specific value (sibling scope)\r\n */\r\nBaseValidator.prototype.forbiddenIfNotSibling = function (\r\n  field: string,\r\n  value: any,\r\n  errorMessage?: string,\r\n) {\r\n  return this.addRule(forbiddenIfNotRule, errorMessage, {\r\n    field,\r\n    value,\r\n    scope: \"sibling\",\r\n  });\r\n};\r\n\r\n/**\r\n * Value is forbidden if another field is empty (global scope)\r\n */\r\nBaseValidator.prototype.forbiddenIfEmpty = function (field: string, errorMessage?: string) {\r\n  return this.addRule(forbiddenIfEmptyRule, errorMessage, {\r\n    field,\r\n    scope: \"global\",\r\n  });\r\n};\r\n\r\n/**\r\n * Value is forbidden if another field is empty (sibling scope)\r\n */\r\nBaseValidator.prototype.forbiddenIfEmptySibling = function (field: string, errorMessage?: string) {\r\n  return this.addRule(forbiddenIfEmptyRule, errorMessage, {\r\n    field,\r\n    scope: \"sibling\",\r\n  });\r\n};\r\n\r\n/**\r\n * Value is forbidden if another field is not empty (global scope)\r\n */\r\nBaseValidator.prototype.forbiddenIfNotEmpty = function (field: string, errorMessage?: string) {\r\n  return this.addRule(forbiddenIfNotEmptyRule, errorMessage, {\r\n    field,\r\n    scope: \"global\",\r\n  });\r\n};\r\n\r\n/**\r\n * Value is forbidden if another field is not empty (sibling scope)\r\n */\r\nBaseValidator.prototype.forbiddenIfNotEmptySibling = function (\r\n  field: string,\r\n  errorMessage?: string,\r\n) {\r\n  return this.addRule(forbiddenIfNotEmptyRule, errorMessage, {\r\n    field,\r\n    scope: \"sibling\",\r\n  });\r\n};\r\n\r\n/**\r\n * Value is forbidden if another field's value is in the given array (global scope)\r\n */\r\nBaseValidator.prototype.forbiddenIfIn = function (\r\n  field: string,\r\n  values: any[],\r\n  errorMessage?: string,\r\n) {\r\n  return this.addRule(forbiddenIfInRule, errorMessage, {\r\n    field,\r\n    values,\r\n    scope: \"global\",\r\n  });\r\n};\r\n\r\n/**\r\n * Value is forbidden if another field's value is in the given array (sibling scope)\r\n */\r\nBaseValidator.prototype.forbiddenIfInSibling = function (\r\n  field: string,\r\n  values: any[],\r\n  errorMessage?: string,\r\n) {\r\n  return this.addRule(forbiddenIfInRule, errorMessage, {\r\n    field,\r\n    values,\r\n    scope: \"sibling\",\r\n  });\r\n};\r\n\r\n/**\r\n * Value is forbidden if another field's value is NOT in the given array (global scope)\r\n */\r\nBaseValidator.prototype.forbiddenIfNotIn = function (\r\n  field: string,\r\n  values: any[],\r\n  errorMessage?: string,\r\n) {\r\n  return this.addRule(forbiddenIfNotInRule, errorMessage, {\r\n    field,\r\n    values,\r\n    scope: \"global\",\r\n  });\r\n};\r\n\r\n/**\r\n * Value is forbidden if another field's value is NOT in the given array (sibling scope)\r\n */\r\nBaseValidator.prototype.forbiddenIfNotInSibling = function (\r\n  field: string,\r\n  values: any[],\r\n  errorMessage?: string,\r\n) {\r\n  return this.addRule(forbiddenIfNotInRule, errorMessage, {\r\n    field,\r\n    values,\r\n    scope: \"sibling\",\r\n  });\r\n};\r\n"],"mappings":";;;;;;;;;AAeA,MAAa,0BAA0B;;;;AA0EvC,cAAc,UAAU,YAAY,SAAU,cAAuB;CACnE,OAAO,KAAK,QAAQ,eAAe,YAAY;AACjD;;;;AAKA,cAAc,UAAU,cAAc,SAAU,OAAe,OAAY,cAAuB;CAChG,OAAO,KAAK,QAAQ,iBAAiB,cAAc;EACjD;EACA;EACA,OAAO;CACT,CAAC;AACH;;;;AAKA,cAAc,UAAU,qBAAqB,SAC3C,OACA,OACA,cACA;CACA,OAAO,KAAK,QAAQ,iBAAiB,cAAc;EACjD;EACA;EACA,OAAO;CACT,CAAC;AACH;;;;AAKA,cAAc,UAAU,iBAAiB,SACvC,OACA,OACA,cACA;CACA,OAAO,KAAK,QAAQ,oBAAoB,cAAc;EACpD;EACA;EACA,OAAO;CACT,CAAC;AACH;;;;AAKA,cAAc,UAAU,wBAAwB,SAC9C,OACA,OACA,cACA;CACA,OAAO,KAAK,QAAQ,oBAAoB,cAAc;EACpD;EACA;EACA,OAAO;CACT,C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