This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /** | |
| WARNING: AFTER READING THIS SECTION REMOVE THIS COMMENT SECTION FROM commit-template-checker.js file | |
| after adding this script to your project, your commit message should contain on of this format, if not, you can not commit. | |
| const correctCommitMsgFormat = [ | |
| "👌 IMPROVE: {Your message}", | |
| "🚀 RELEASE: {Your message}", | |
| "🗑 REMOVE: {Your message}", | |
| "🐛 FIX: {Your message}", |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import { GridifyConditionEnum, GridifyLogicalEnum, GridifyOrderEnum, FilterType, OperatorType, FiltersType } from "./types.ts"; | |
| function trimEnds(query: string): string { | |
| let result = query; | |
| // There should not be any starting or ending operator | |
| if (result.startsWith(GridifyLogicalEnum.And)) result = result.slice(GridifyLogicalEnum.And.length); | |
| if (result.startsWith(GridifyLogicalEnum.Or)) result = result.slice(GridifyLogicalEnum.Or.length); | |
| if (result.endsWith(GridifyLogicalEnum.And)) result = result.slice(0, -GridifyLogicalEnum.And.length); | |
| if (result.endsWith(GridifyLogicalEnum.Or)) result = result.slice(0, -GridifyLogicalEnum.Or.length); | |
| return result; |