Skip to content

Commit

Permalink
chore(release): 6.4.1
Browse files Browse the repository at this point in the history
  • Loading branch information
krisk committed Jul 26, 2020
1 parent 226d868 commit e5c9907
Show file tree
Hide file tree
Showing 13 changed files with 150 additions and 45 deletions.
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,13 @@

All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.

### [6.4.1](https://github.com/krisk/Fuse/compare/v6.4.0...v6.4.1) (2020-07-26)


### Bug Fixes

* handle booleans in the data ([226d868](https://github.com/krisk/Fuse/commit/226d868a1102402e1e773db305ddd3928ae92f79)), closes [#469](https://github.com/krisk/Fuse/issues/469)

## [6.4.0](https://github.com/krisk/Fuse/compare/v6.3.1...v6.4.0) (2020-06-28)


Expand Down
28 changes: 21 additions & 7 deletions dist/fuse.basic.common.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* Fuse.js v6.4.0 - Lightweight fuzzy-search (http://fusejs.io)
* Fuse.js v6.4.1 - Lightweight fuzzy-search (http://fusejs.io)
*
* Copyright (c) 2020 Kiro Risk (http://kiro.me)
* All Rights Reserved. Apache Software License 2.0
Expand Down Expand Up @@ -130,9 +130,8 @@ function _nonIterableSpread() {
}

function isArray(value) {
return !Array.isArray ? Object.prototype.toString.call(value) === '[object Array]' : Array.isArray(value);
} // Adapted from:
// https://github.com/lodash/lodash/blob/f4ca396a796435422bd4fd41fadbd225edddf175/.internal/baseToString.js
return !Array.isArray ? getTag(value) === '[object Array]' : Array.isArray(value);
} // Adapted from: https://github.com/lodash/lodash/blob/master/.internal/baseToString.js

var INFINITY = 1 / 0;
function baseToString(value) {
Expand All @@ -152,15 +151,28 @@ function isString(value) {
}
function isNumber(value) {
return typeof value === 'number';
} // Adapted from: https://github.com/lodash/lodash/blob/master/isBoolean.js

function isBoolean(value) {
return value === true || value === false || isObjectLike(value) && getTag(value) == '[object Boolean]';
}
function isObject(value) {
return _typeof(value) === 'object';
} // Checks if `value` is object-like.

function isObjectLike(value) {
return isObject(value) && value !== null;
}
function isDefined(value) {
return value !== undefined && value !== null;
}
function isBlank(value) {
return !value.trim().length;
} // Gets the `toStringTag` of `value`.
// Adapted from: https://github.com/lodash/lodash/blob/master/.internal/getTag.js

function getTag(value) {
return value == null ? value === undefined ? '[object Undefined]' : '[object Null]' : Object.prototype.toString.call(value);
}

var EXTENDED_SEARCH_UNAVAILABLE = 'Extended search is not available';
Expand Down Expand Up @@ -282,9 +294,11 @@ function get(obj, path) {

if (!isDefined(value)) {
return;
}
} // If we're at the last value in the path, and if it's a string/number/bool,
// add it to the list


if (index === path.length - 1 && (isString(value) || isNumber(value))) {
if (index === path.length - 1 && (isString(value) || isNumber(value) || isBoolean(value))) {
list.push(toString(value));
} else if (isArray(value)) {
arr = true; // Search each item in the array.
Expand Down Expand Up @@ -1427,7 +1441,7 @@ function format(results, docs) {
});
}

Fuse.version = '6.4.0';
Fuse.version = '6.4.1';
Fuse.createIndex = createIndex;
Fuse.parseIndex = parseIndex;
Fuse.config = Config;
Expand Down
40 changes: 34 additions & 6 deletions dist/fuse.basic.esm.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* Fuse.js v6.4.0 - Lightweight fuzzy-search (http://fusejs.io)
* Fuse.js v6.4.1 - Lightweight fuzzy-search (http://fusejs.io)
*
* Copyright (c) 2020 Kiro Risk (http://kiro.me)
* All Rights Reserved. Apache Software License 2.0
Expand All @@ -9,12 +9,11 @@

function isArray(value) {
return !Array.isArray
? Object.prototype.toString.call(value) === '[object Array]'
? getTag(value) === '[object Array]'
: Array.isArray(value)
}

// Adapted from:
// https://github.com/lodash/lodash/blob/f4ca396a796435422bd4fd41fadbd225edddf175/.internal/baseToString.js
// Adapted from: https://github.com/lodash/lodash/blob/master/.internal/baseToString.js
const INFINITY = 1 / 0;
function baseToString(value) {
// Exit early for strings to avoid a performance hit in some environments.
Expand All @@ -37,10 +36,24 @@ function isNumber(value) {
return typeof value === 'number'
}

// Adapted from: https://github.com/lodash/lodash/blob/master/isBoolean.js
function isBoolean(value) {
return (
value === true ||
value === false ||
(isObjectLike(value) && getTag(value) == '[object Boolean]')
)
}

function isObject(value) {
return typeof value === 'object'
}

// Checks if `value` is object-like.
function isObjectLike(value) {
return isObject(value) && value !== null
}

function isDefined(value) {
return value !== undefined && value !== null
}
Expand All @@ -49,6 +62,16 @@ function isBlank(value) {
return !value.trim().length
}

// Gets the `toStringTag` of `value`.
// Adapted from: https://github.com/lodash/lodash/blob/master/.internal/getTag.js
function getTag(value) {
return value == null
? value === undefined
? '[object Undefined]'
: '[object Null]'
: Object.prototype.toString.call(value)
}

const EXTENDED_SEARCH_UNAVAILABLE = 'Extended search is not available';

const LOGICAL_SEARCH_UNAVAILABLE = 'Logical search is not available';
Expand Down Expand Up @@ -160,7 +183,12 @@ function get(obj, path) {
return
}

if (index === path.length - 1 && (isString(value) || isNumber(value))) {
// If we're at the last value in the path, and if it's a string/number/bool,
// add it to the list
if (
index === path.length - 1 &&
(isString(value) || isNumber(value) || isBoolean(value))
) {
list.push(toString(value));
} else if (isArray(value)) {
arr = true;
Expand Down Expand Up @@ -1195,7 +1223,7 @@ function format(
})
}

Fuse.version = '6.4.0';
Fuse.version = '6.4.1';
Fuse.createIndex = createIndex;
Fuse.parseIndex = parseIndex;
Fuse.config = Config;
Expand Down
4 changes: 2 additions & 2 deletions dist/fuse.basic.esm.min.js

Large diffs are not rendered by default.

28 changes: 21 additions & 7 deletions dist/fuse.basic.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* Fuse.js v6.4.0 - Lightweight fuzzy-search (http://fusejs.io)
* Fuse.js v6.4.1 - Lightweight fuzzy-search (http://fusejs.io)
*
* Copyright (c) 2020 Kiro Risk (http://kiro.me)
* All Rights Reserved. Apache Software License 2.0
Expand Down Expand Up @@ -134,9 +134,8 @@
}

function isArray(value) {
return !Array.isArray ? Object.prototype.toString.call(value) === '[object Array]' : Array.isArray(value);
} // Adapted from:
// https://github.com/lodash/lodash/blob/f4ca396a796435422bd4fd41fadbd225edddf175/.internal/baseToString.js
return !Array.isArray ? getTag(value) === '[object Array]' : Array.isArray(value);
} // Adapted from: https://github.com/lodash/lodash/blob/master/.internal/baseToString.js

var INFINITY = 1 / 0;
function baseToString(value) {
Expand All @@ -156,15 +155,28 @@
}
function isNumber(value) {
return typeof value === 'number';
} // Adapted from: https://github.com/lodash/lodash/blob/master/isBoolean.js

function isBoolean(value) {
return value === true || value === false || isObjectLike(value) && getTag(value) == '[object Boolean]';
}
function isObject(value) {
return _typeof(value) === 'object';
} // Checks if `value` is object-like.

function isObjectLike(value) {
return isObject(value) && value !== null;
}
function isDefined(value) {
return value !== undefined && value !== null;
}
function isBlank(value) {
return !value.trim().length;
} // Gets the `toStringTag` of `value`.
// Adapted from: https://github.com/lodash/lodash/blob/master/.internal/getTag.js

function getTag(value) {
return value == null ? value === undefined ? '[object Undefined]' : '[object Null]' : Object.prototype.toString.call(value);
}

var EXTENDED_SEARCH_UNAVAILABLE = 'Extended search is not available';
Expand Down Expand Up @@ -286,9 +298,11 @@

if (!isDefined(value)) {
return;
}
} // If we're at the last value in the path, and if it's a string/number/bool,
// add it to the list


if (index === path.length - 1 && (isString(value) || isNumber(value))) {
if (index === path.length - 1 && (isString(value) || isNumber(value) || isBoolean(value))) {
list.push(toString(value));
} else if (isArray(value)) {
arr = true; // Search each item in the array.
Expand Down Expand Up @@ -1431,7 +1445,7 @@
});
}

Fuse.version = '6.4.0';
Fuse.version = '6.4.1';
Fuse.createIndex = createIndex;
Fuse.parseIndex = parseIndex;
Fuse.config = Config;
Expand Down
Loading

0 comments on commit e5c9907

Please sign in to comment.