How to use the intersect function from hoek
Find comprehensive JavaScript hoek.intersect code examples handpicked from public code repositorys.
GitHub: bloglovin/hoek

154 155 156 157 158 159 160 161 162
```javascript var array1 = [1, 2, 3]; var array2 = [1, 4, 5]; var newArray = Hoek.intersect(array1, array2) // results in [1] ``` ### flatten(array, target)
GitHub: geek/hoek

223 224 225 226 227 228 229 230 231
```javascript var array1 = [1, 2, 3]; var array2 = [1, 4, 5]; var newArray = Hoek.intersect(array1, array2); // results in [1] ``` ### contain(ref, values, [options])
GitHub: hemerajs/hemera

57 58 59 60 61 62 63 64 65 66
if (scope.length < subset.length) { return false } const common = Hoek.intersect(scope, subset) return common.length === subset.length } const plugin = Hp(hemeraJwtAuth, {
GitHub: kidtronnix/oz

51 52 53 54 55 56 57 58
if (scope.length < subset.length) { return false; } var common = Hoek.intersect(scope, subset); return common.length === subset.length; };
74 75 76 77 78 79 80 81 82 83
return routingTable } return _.filter(routingTable, function (route) { var routeTags = route.settings ? route.settings.tags : null return Hoek.intersect(routeTags, requiredTags).length === requiredTags.length }) } utils.filterRoutesByTagSelection = function (routingTable, includedTags, excludedTags) {
+ 3 other calls in file
GitHub: rook2pawn/podium

182 183 184 185 186 187 188 189 190 191
if (handler.filter) { if (!criteria.tags) { continue; } const match = Hoek.intersect(criteria.tags, handler.filter.tags, !handler.filter.all); if (!match || (handler.filter.all && match.length !== handler.filter.tags.length)) { continue;
GitHub: Cron-J/hapi

208 209 210 211 212 213 214 215 216 217
this._logger.push(event); this.connection.emit(_internal ? 'request-internal' : 'request', this, event, tagsMap); if (this.server._settings.debug && this.server._settings.debug.request && Hoek.intersect(tagsMap, this.server._settings.debug.request, true)) { console.error('Debug:', event.tags.join(', '), (data ? '\n ' + (data.stack || (typeof data === 'object' ? Hoek.stringify(data) : data)) : '')); } };
hoek.assert is the most popular function in hoek (1712 examples)