- 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
81 lines
2.0 KiB
JavaScript
81 lines
2.0 KiB
JavaScript
'use strict';
|
|
|
|
var GetIntrinsic = require('get-intrinsic');
|
|
|
|
var $Number = GetIntrinsic('%Number%');
|
|
var $TypeError = require('es-errors/type');
|
|
|
|
var $isNaN = require('math-intrinsics/isNaN');
|
|
|
|
var IsStringPrefix = require('./IsStringPrefix');
|
|
var StringToBigInt = require('./StringToBigInt');
|
|
var ToNumeric = require('./ToNumeric');
|
|
var ToPrimitive = require('./ToPrimitive');
|
|
|
|
var BigIntLessThan = require('./BigInt/lessThan');
|
|
var NumberLessThan = require('./Number/lessThan');
|
|
|
|
var isSameType = require('../helpers/isSameType');
|
|
|
|
// https://262.ecma-international.org/11.0/#sec-abstract-relational-comparison
|
|
|
|
// eslint-disable-next-line max-statements, max-lines-per-function
|
|
module.exports = function AbstractRelationalComparison(x, y, LeftFirst) {
|
|
if (typeof LeftFirst !== 'boolean') {
|
|
throw new $TypeError('Assertion failed: LeftFirst argument must be a Boolean');
|
|
}
|
|
var px;
|
|
var py;
|
|
if (LeftFirst) {
|
|
px = ToPrimitive(x, $Number);
|
|
py = ToPrimitive(y, $Number);
|
|
} else {
|
|
py = ToPrimitive(y, $Number);
|
|
px = ToPrimitive(x, $Number);
|
|
}
|
|
if (typeof px === 'string' && typeof py === 'string') {
|
|
if (IsStringPrefix(py, px)) {
|
|
return false;
|
|
}
|
|
if (IsStringPrefix(px, py)) {
|
|
return true;
|
|
}
|
|
return px < py; // both strings, neither a prefix of the other. shortcut for steps 3 c-f
|
|
}
|
|
|
|
var nx;
|
|
var ny;
|
|
if (typeof px === 'bigint' && typeof py === 'string') {
|
|
ny = StringToBigInt(py);
|
|
if ($isNaN(ny)) {
|
|
return void undefined;
|
|
}
|
|
return BigIntLessThan(px, ny);
|
|
}
|
|
if (typeof px === 'string' && typeof py === 'bigint') {
|
|
nx = StringToBigInt(px);
|
|
if ($isNaN(nx)) {
|
|
return void undefined;
|
|
}
|
|
return BigIntLessThan(nx, py);
|
|
}
|
|
|
|
nx = ToNumeric(px);
|
|
ny = ToNumeric(py);
|
|
if (isSameType(nx, ny)) {
|
|
return typeof nx === 'number' ? NumberLessThan(nx, ny) : BigIntLessThan(nx, ny);
|
|
}
|
|
|
|
if ($isNaN(nx) || $isNaN(ny)) {
|
|
return void undefined;
|
|
}
|
|
if (nx === -Infinity || ny === Infinity) {
|
|
return true;
|
|
}
|
|
if (nx === Infinity || ny === -Infinity) {
|
|
return false;
|
|
}
|
|
|
|
return nx < ny; // by now, these are both nonzero, finite, and not equal
|
|
};
|