- 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
51 lines
1.2 KiB
JavaScript
51 lines
1.2 KiB
JavaScript
'use strict';
|
|
|
|
var $TypeError = require('es-errors/type');
|
|
|
|
var Call = require('./Call');
|
|
var IsLessThan = require('./IsLessThan');
|
|
var ToNumber = require('./ToNumber');
|
|
var ToString = require('./ToString');
|
|
|
|
var isNaN = require('math-intrinsics/isNaN');
|
|
|
|
// https://262.ecma-international.org/14.0/#sec-comparearrayelements
|
|
|
|
module.exports = function CompareArrayElements(x, y, compareFn) {
|
|
if (typeof compareFn !== 'function' && typeof compareFn !== 'undefined') {
|
|
throw new $TypeError('Assertion failed: `compareFn` must be a function or undefined');
|
|
}
|
|
|
|
if (typeof x === 'undefined' && typeof y === 'undefined') {
|
|
return 0; // step 1
|
|
}
|
|
|
|
if (typeof x === 'undefined') {
|
|
return 1; // step 2
|
|
}
|
|
|
|
if (typeof y === 'undefined') {
|
|
return -1; // step 3
|
|
}
|
|
|
|
if (typeof compareFn !== 'undefined') { // step 4
|
|
var v = ToNumber(Call(compareFn, void undefined, [x, y])); // step 4.a
|
|
if (isNaN(v)) {
|
|
return 0; // step 4.b
|
|
}
|
|
return v; // step 4.c
|
|
}
|
|
|
|
var xString = ToString(x); // step 5
|
|
var yString = ToString(y); // step 6
|
|
var xSmaller = IsLessThan(xString, yString, true); // step 7
|
|
if (xSmaller) {
|
|
return -1; // step 8
|
|
}
|
|
var ySmaller = IsLessThan(yString, xString, true); // step 9
|
|
if (ySmaller) {
|
|
return 1; // step 10
|
|
}
|
|
return 0; // step 11
|
|
};
|