- App.tsx: full navigation (Auth stack + Main tabs with 5 screens) - Auth: LoginScreen, RegisterScreen, ForgotPasswordScreen - HomeScreen: dashboard with IoT metrics, weather widget, alerts, quick actions, sensors - MapScreen: interactive map with layer toggles (6 layers) - MarketplaceScreen: categories (6), products (5), search - ChatScreen: AI chat with quick prompts (4), bot responses - ProfileScreen: user info, stats, menu (9 items), logout - AlertsScreen: alert list with severity, acknowledge - SensorsScreen: sensor list with type filters (6 types), search - ZonesScreen: zone cards with stats - SettingsScreen: language picker (FR/EN/ES/DE), privacy, about - Stores: iotStore (sensors, zones, alerts), notificationStore, uiStore + i18n - Hooks: useSensors, useAlerts, useNotifications, useLocation - Components: Card, Button, LoadingSpinner, ErrorBoundary, Header - Services: iotService, notificationService (with axios API client) - Utils: formatters (temp, AQI, noise, dates), validators (email, password, IBAN) - Theme: colors.ts with full design system (Blue Ocean palette) - Ditto: fixed MongoDB connection, new JWT secrets, official gateway image
47 lines
790 B
JavaScript
47 lines
790 B
JavaScript
'use strict';
|
|
|
|
var test = require('tape');
|
|
var traverse = require('../');
|
|
|
|
test('interface map', function (t) {
|
|
var obj = { a: [5, 6, 7], b: { c: [8] } };
|
|
|
|
t.same(
|
|
traverse.paths(obj)
|
|
.sort()
|
|
.map(function (path) { return path.join('/'); })
|
|
.slice(1)
|
|
.join(' ')
|
|
,
|
|
'a a/0 a/1 a/2 b b/c b/c/0'
|
|
);
|
|
|
|
t.same(
|
|
traverse.nodes(obj),
|
|
[
|
|
{ a: [5, 6, 7], b: { c: [8] } },
|
|
[5, 6, 7], 5, 6, 7,
|
|
{ c: [8] }, [8], 8,
|
|
]
|
|
);
|
|
|
|
t.same(
|
|
traverse.map(obj, function (node) {
|
|
if (typeof node === 'number') {
|
|
return node + 1000;
|
|
}
|
|
if (Array.isArray(node)) {
|
|
return node.join(' ');
|
|
}
|
|
return void undefined;
|
|
}),
|
|
{ a: '5 6 7', b: { c: '8' } }
|
|
);
|
|
|
|
var nodes = 0;
|
|
traverse.forEach(obj, function () { nodes += 1; });
|
|
t.equal(nodes, 8);
|
|
|
|
t.end();
|
|
});
|