From 9c312156653436364d26ed75186e82cbee69a4a4 Mon Sep 17 00:00:00 2001 From: ieba Date: Mon, 20 Feb 2017 14:49:57 +0200 Subject: [PATCH] fix(regExp): fix re to make it work with numbers in CellFilter as arguments Closes #12 --- package.json | 32 +++++++++++++++--------------- src/UiGridAutoFitColumnsService.ts | 4 ++-- 2 files changed, 18 insertions(+), 18 deletions(-) diff --git a/package.json b/package.json index 13d6128..3d1dde2 100644 --- a/package.json +++ b/package.json @@ -6,22 +6,22 @@ "description": "The plugin ensures that the column width will be wide enough for showing the longest data of that column (or column name).", "dependencies": {}, "devDependencies": { - "angular": "^1.5.6", - "angular-ui-grid": "^3.1.1", - "awesome-typescript-loader": "^0.17.0", - "commitizen": "^2.8.1", - "cross-env": "^1.0.8", - "cz-conventional-changelog": "^1.1.6", - "ghooks": "^1.2.1", - "jquery": "^2.2.4", - "lodash": "^3.10.1", - "ng-annotate-webpack-plugin": "^0.1.2", - "rimraf": "^2.5.2", - "semantic-release": "^4.3.5", - "typescript": "^1.8.10", - "typings": "^1.0.4", - "validate-commit-msg": "^2.6.1", - "webpack": "^1.13.1" + "angular": "~1.5.6", + "angular-ui-grid": "~3.1.1", + "awesome-typescript-loader": "~0.17.0", + "commitizen": "~2.8.1", + "cross-env": "~1.0.8", + "cz-conventional-changelog": "~1.1.6", + "ghooks": "~1.2.1", + "jquery": "~2.2.4", + "lodash": "~3.10.1", + "ng-annotate-webpack-plugin": "~0.1.2", + "rimraf": "~2.5.2", + "semantic-release": "~4.3.5", + "typescript": "~1.8.10", + "typings": "~1.0.4", + "validate-commit-msg": "~2.6.1", + "webpack": "~1.13.1" }, "scripts": { "prebuild": "typings install & rimraf dist build", diff --git a/src/UiGridAutoFitColumnsService.ts b/src/UiGridAutoFitColumnsService.ts index 8913060..939b8cf 100644 --- a/src/UiGridAutoFitColumnsService.ts +++ b/src/UiGridAutoFitColumnsService.ts @@ -56,8 +56,8 @@ export class UiGridAutoFitColumnsService { if (filter) { value = filter(value); } else { - // https://regex101.com/r/rC5eR5/3 - const re = /([^:]*):["']([^:]*)["']:?([\s\S]+)?/; + // https://regex101.com/r/rC5eR5/2 + const re = /([^:]*):([^:]*):?([\s\S]+)?/; let matches; if ((matches = re.exec(cellFilter)) !== null) { value = this.$filter(matches[1])(value, matches[2], matches[3]);