Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow filters with nested paths where one of the objects is not defined #60

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion dist/amd/au-table.js
Original file line number Diff line number Diff line change
Expand Up @@ -279,6 +279,7 @@ define(['exports', 'aurelia-framework'], function (exports, _aureliaFramework) {
AureliaTableCustomAttribute.prototype.doSort = function doSort(toSort) {
var _this2 = this;

console.log('doSort', toSort);
toSort.sort(function (a, b) {
if (typeof _this2.customSort === 'function') {
return _this2.customSort(a, b, _this2.sortOrder);
Expand Down Expand Up @@ -315,7 +316,7 @@ define(['exports', 'aurelia-framework'], function (exports, _aureliaFramework) {
var a = keyPath.split('.');
for (var i = 0, n = a.length; i < n; ++i) {
var k = a[i];
if (k in object) {
if (object && k in object) {
object = object[k];
} else {
return;
Expand Down
3 changes: 2 additions & 1 deletion dist/commonjs/au-table.js
Original file line number Diff line number Diff line change
Expand Up @@ -276,6 +276,7 @@ var AureliaTableCustomAttribute = exports.AureliaTableCustomAttribute = (_dec =
AureliaTableCustomAttribute.prototype.doSort = function doSort(toSort) {
var _this2 = this;

console.log('doSort', toSort);
toSort.sort(function (a, b) {
if (typeof _this2.customSort === 'function') {
return _this2.customSort(a, b, _this2.sortOrder);
Expand Down Expand Up @@ -312,7 +313,7 @@ var AureliaTableCustomAttribute = exports.AureliaTableCustomAttribute = (_dec =
var a = keyPath.split('.');
for (var i = 0, n = a.length; i < n; ++i) {
var k = a[i];
if (k in object) {
if (object && k in object) {
object = object[k];
} else {
return;
Expand Down
3 changes: 2 additions & 1 deletion dist/es2015/au-table.js
Original file line number Diff line number Diff line change
Expand Up @@ -191,6 +191,7 @@ export let AureliaTableCustomAttribute = (_dec = inject(BindingEngine), _dec2 =
}

doSort(toSort) {
console.log('doSort', toSort);
toSort.sort((a, b) => {
if (typeof this.customSort === 'function') {
return this.customSort(a, b, this.sortOrder);
Expand Down Expand Up @@ -227,7 +228,7 @@ export let AureliaTableCustomAttribute = (_dec = inject(BindingEngine), _dec2 =
let a = keyPath.split('.');
for (let i = 0, n = a.length; i < n; ++i) {
let k = a[i];
if (k in object) {
if (object && k in object) {
object = object[k];
} else {
return;
Expand Down
3 changes: 2 additions & 1 deletion dist/system/au-table.js
Original file line number Diff line number Diff line change
Expand Up @@ -284,6 +284,7 @@ System.register(['aurelia-framework'], function (_export, _context) {
AureliaTableCustomAttribute.prototype.doSort = function doSort(toSort) {
var _this2 = this;

console.log('doSort', toSort);
toSort.sort(function (a, b) {
if (typeof _this2.customSort === 'function') {
return _this2.customSort(a, b, _this2.sortOrder);
Expand Down Expand Up @@ -320,7 +321,7 @@ System.register(['aurelia-framework'], function (_export, _context) {
var a = keyPath.split('.');
for (var i = 0, n = a.length; i < n; ++i) {
var k = a[i];
if (k in object) {
if (object && k in object) {
object = object[k];
} else {
return;
Expand Down
3 changes: 2 additions & 1 deletion src/au-table.js
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,7 @@ export class AureliaTableCustomAttribute {
}

doSort(toSort) {
console.log('doSort',toSort);
toSort.sort((a, b) => {
if (typeof this.customSort === 'function') {
return this.customSort(a, b, this.sortOrder);
Expand Down Expand Up @@ -198,7 +199,7 @@ export class AureliaTableCustomAttribute {
let a = keyPath.split('.');
for (let i = 0, n = a.length; i < n; ++i) {
let k = a[i];
if (k in object) {
if (object && k in object) {
object = object[k];
} else {
return;
Expand Down
90 changes: 19 additions & 71 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,7 @@ JSONStream@^1.0.4:
jsonparse "^1.2.0"
through ">=2.2.7 <3"

abbrev@1:
version "1.1.1"
resolved "https://registry.yarnpkg.com/abbrev/-/abbrev-1.1.1.tgz#f8f2c887ad10bf67f634f005b6987fed3179aac8"

[email protected]:
abbrev@1, [email protected]:
version "1.0.9"
resolved "https://registry.yarnpkg.com/abbrev/-/abbrev-1.0.9.tgz#91b4792588a7738c25f35dd6f63752a2f8776135"

Expand Down Expand Up @@ -113,12 +109,6 @@ ansi-styles@^2.2.1:
version "2.2.1"
resolved "https://registry.yarnpkg.com/ansi-styles/-/ansi-styles-2.2.1.tgz#b432dd3358b634cf75e1e4664368240533c1ddbe"

ansi-styles@^3.2.0:
version "3.2.0"
resolved "https://registry.yarnpkg.com/ansi-styles/-/ansi-styles-3.2.0.tgz#c159b8d5be0f9e5a6f346dab94f16ce022161b88"
dependencies:
color-convert "^1.9.0"

ansi-styles@~1.0.0:
version "1.0.0"
resolved "https://registry.yarnpkg.com/ansi-styles/-/ansi-styles-1.0.0.tgz#cb102df1c56f5123eab8b67cd7b98027a0279178"
Expand Down Expand Up @@ -1172,13 +1162,15 @@ center-align@^0.1.1:
align-text "^0.1.3"
lazy-cache "^1.0.3"

chalk@*:
version "2.3.1"
resolved "https://registry.yarnpkg.com/chalk/-/chalk-2.3.1.tgz#523fe2678aec7b04e8041909292fe8b17059b796"
chalk@*, chalk@^1.0.0, chalk@^1.1.1, chalk@^1.1.3:
version "1.1.3"
resolved "https://registry.yarnpkg.com/chalk/-/chalk-1.1.3.tgz#a8115c55e4a702fe4d150abd3872822a7e09fc98"
dependencies:
ansi-styles "^3.2.0"
escape-string-regexp "^1.0.5"
supports-color "^5.2.0"
ansi-styles "^2.2.1"
escape-string-regexp "^1.0.2"
has-ansi "^2.0.0"
strip-ansi "^3.0.0"
supports-color "^2.0.0"

chalk@^0.5.0:
version "0.5.1"
Expand All @@ -1190,16 +1182,6 @@ chalk@^0.5.0:
strip-ansi "^0.3.0"
supports-color "^0.2.0"

chalk@^1.0.0, chalk@^1.1.1, chalk@^1.1.3:
version "1.1.3"
resolved "https://registry.yarnpkg.com/chalk/-/chalk-1.1.3.tgz#a8115c55e4a702fe4d150abd3872822a7e09fc98"
dependencies:
ansi-styles "^2.2.1"
escape-string-regexp "^1.0.2"
has-ansi "^2.0.0"
strip-ansi "^3.0.0"
supports-color "^2.0.0"

chalk@~0.4.0:
version "0.4.0"
resolved "https://registry.yarnpkg.com/chalk/-/chalk-0.4.0.tgz#5199a3ddcd0c1efe23bc08c1b027b06176e0c64f"
Expand Down Expand Up @@ -1289,16 +1271,6 @@ collection-visit@^1.0.0:
map-visit "^1.0.0"
object-visit "^1.0.0"

color-convert@^1.9.0:
version "1.9.1"
resolved "https://registry.yarnpkg.com/color-convert/-/color-convert-1.9.1.tgz#c1261107aeb2f294ebffec9ed9ecad529a6097ed"
dependencies:
color-name "^1.1.1"

color-name@^1.1.1:
version "1.1.3"
resolved "https://registry.yarnpkg.com/color-name/-/color-name-1.1.3.tgz#a7d0558bd89c42f795dd42328f740831ca53bc25"

color-support@^1.1.3:
version "1.1.3"
resolved "https://registry.yarnpkg.com/color-support/-/color-support-1.1.3.tgz#93834379a1cc9a0c61f82f52f0d04322251bd5a2"
Expand Down Expand Up @@ -1606,9 +1578,9 @@ dateformat@^2.0.0:
version "2.2.0"
resolved "https://registry.yarnpkg.com/dateformat/-/dateformat-2.2.0.tgz#4065e2013cf9fb916ddfd82efb506ad4c6769062"

debug@*, debug@^3.1.0:
version "3.1.0"
resolved "https://registry.yarnpkg.com/debug/-/debug-3.1.0.tgz#5bb5a0672628b64149566ba16819e61518c67261"
debug@*, debug@2.6.9, debug@^2.1.1, debug@^2.2.0, debug@^2.3.3, debug@^2.6.8:
version "2.6.9"
resolved "https://registry.yarnpkg.com/debug/-/debug-2.6.9.tgz#5d128515df134ff327e90a4c93f4e077a536341f"
dependencies:
ms "2.0.0"

Expand All @@ -1624,9 +1596,9 @@ [email protected]:
dependencies:
ms "0.7.2"

debug@2.6.9, debug@^2.1.1, debug@^2.2.0, debug@^2.3.3, debug@^2.6.8:
version "2.6.9"
resolved "https://registry.yarnpkg.com/debug/-/debug-2.6.9.tgz#5d128515df134ff327e90a4c93f4e077a536341f"
debug@^3.1.0:
version "3.1.0"
resolved "https://registry.yarnpkg.com/debug/-/debug-3.1.0.tgz#5bb5a0672628b64149566ba16819e61518c67261"
dependencies:
ms "2.0.0"

Expand Down Expand Up @@ -2133,14 +2105,10 @@ extglob@^2.0.4:
snapdragon "^0.8.1"
to-regex "^3.0.1"

[email protected]:
[email protected], extsprintf@^1.2.0:
version "1.3.0"
resolved "https://registry.yarnpkg.com/extsprintf/-/extsprintf-1.3.0.tgz#96918440e3041a7a414f8c52e3c574eb3c3e1e05"

extsprintf@^1.2.0:
version "1.4.0"
resolved "https://registry.yarnpkg.com/extsprintf/-/extsprintf-1.4.0.tgz#e2689f8f356fad62cca65a3a91c5df5f9551692f"

fancy-log@^1.1.0:
version "1.3.2"
resolved "https://registry.yarnpkg.com/fancy-log/-/fancy-log-1.3.2.tgz#f41125e3d84f2e7d89a43d06d958c8f78be16be1"
Expand Down Expand Up @@ -2746,10 +2714,6 @@ has-flag@^1.0.0:
version "1.0.0"
resolved "https://registry.yarnpkg.com/has-flag/-/has-flag-1.0.0.tgz#9d9e793165ce017a00f00418c43f942a7b1d11fa"

has-flag@^3.0.0:
version "3.0.0"
resolved "https://registry.yarnpkg.com/has-flag/-/has-flag-3.0.0.tgz#b5d454dc2199ae225699f3467e5a07f3b955bafd"

has-gulplog@^0.1.0:
version "0.1.0"
resolved "https://registry.yarnpkg.com/has-gulplog/-/has-gulplog-0.1.0.tgz#6414c82913697da51590397dafb12f22967811ce"
Expand Down Expand Up @@ -3962,7 +3926,7 @@ minimist-options@^3.0.1:
arrify "^1.0.1"
is-plain-obj "^1.1.0"

[email protected]:
[email protected], minimist@~0.0.1:
version "0.0.8"
resolved "https://registry.yarnpkg.com/minimist/-/minimist-0.0.8.tgz#857fcabfc3397d2625b8228262e86aa7a011b05d"

Expand All @@ -3974,10 +3938,6 @@ minimist@^1.1.0, minimist@^1.1.3, minimist@^1.2.0:
version "1.2.0"
resolved "https://registry.yarnpkg.com/minimist/-/minimist-1.2.0.tgz#a35008b20f41383eec1fb914f4cd5df79a264284"

minimist@~0.0.1:
version "0.0.10"
resolved "https://registry.yarnpkg.com/minimist/-/minimist-0.0.10.tgz#de3f98543dbf96082be48ad1a0c7cda836301dcf"

mixin-deep@^1.2.0:
version "1.3.1"
resolved "https://registry.yarnpkg.com/mixin-deep/-/mixin-deep-1.3.1.tgz#a49e7268dce1a0d9698e45326c5626df3543d0fe"
Expand Down Expand Up @@ -4282,7 +4242,7 @@ os-locale@^1.4.0:
dependencies:
lcid "^1.0.0"

os-tmpdir@^1.0.0, os-tmpdir@^1.0.1, os-tmpdir@~1.0.1, os-tmpdir@~1.0.2:
os-tmpdir@^1.0.0, os-tmpdir@^1.0.1, os-tmpdir@~1.0.1:
version "1.0.2"
resolved "https://registry.yarnpkg.com/os-tmpdir/-/os-tmpdir-1.0.2.tgz#bbe67406c79aa85c5cfec766fe5734555dfa1274"

Expand Down Expand Up @@ -5269,12 +5229,6 @@ supports-color@^3.1.0, supports-color@^3.1.2:
dependencies:
has-flag "^1.0.0"

supports-color@^5.2.0:
version "5.2.0"
resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-5.2.0.tgz#b0d5333b1184dd3666cbe5aa0b45c5ac7ac17a4a"
dependencies:
has-flag "^3.0.0"

table@^3.7.8:
version "3.8.3"
resolved "https://registry.yarnpkg.com/table/-/table-3.8.3.tgz#2bbc542f0fda9861a755d3947fefd8b3f513855f"
Expand Down Expand Up @@ -5357,18 +5311,12 @@ time-stamp@^1.0.0:
version "1.1.0"
resolved "https://registry.yarnpkg.com/time-stamp/-/time-stamp-1.1.0.tgz#764a5a11af50561921b133f3b44e618687e0f5c3"

[email protected]:
[email protected], [email protected]:
version "0.0.31"
resolved "https://registry.yarnpkg.com/tmp/-/tmp-0.0.31.tgz#8f38ab9438e17315e5dbd8b3657e8bfb277ae4a7"
dependencies:
os-tmpdir "~1.0.1"

[email protected]:
version "0.0.33"
resolved "https://registry.yarnpkg.com/tmp/-/tmp-0.0.33.tgz#6d34335889768d21b2bcda0aa277ced3b1bfadf9"
dependencies:
os-tmpdir "~1.0.2"

[email protected]:
version "0.1.4"
resolved "https://registry.yarnpkg.com/to-array/-/to-array-0.1.4.tgz#17e6c11f73dd4f3d74cda7a4ff3238e9ad9bf890"
Expand Down