- 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
45 lines
1.5 KiB
JavaScript
45 lines
1.5 KiB
JavaScript
'use strict';
|
|
|
|
var $TypeError = require('es-errors/type');
|
|
|
|
var IsValidIntegerIndex = require('./IsValidIntegerIndex');
|
|
var SetValueInBuffer = require('./SetValueInBuffer');
|
|
var ToBigInt = require('./ToBigInt');
|
|
var ToNumber = require('./ToNumber');
|
|
|
|
var typedArrayBuffer = require('typed-array-buffer');
|
|
var typedArrayByteOffset = require('typed-array-byte-offset');
|
|
var whichTypedArray = require('which-typed-array');
|
|
|
|
var tableTAO = require('./tables/typed-array-objects');
|
|
|
|
// https://262.ecma-international.org/12.0/#sec-integerindexedelementset
|
|
|
|
module.exports = function IntegerIndexedElementSet(O, index, value) {
|
|
if (typeof index !== 'number') {
|
|
throw new $TypeError('Assertion failed: `index` must be a Number');
|
|
}
|
|
|
|
var arrayTypeName = whichTypedArray(O); // step 4.b
|
|
if (!arrayTypeName) {
|
|
throw new $TypeError('Assertion failed: `O` must be a TypedArray'); // step 1
|
|
}
|
|
|
|
var contentType = arrayTypeName === 'BigInt64Array' || arrayTypeName === 'BigUint64Array' ? 'BigInt' : 'Number';
|
|
var numValue = contentType === 'BigInt' ? ToBigInt(value) : ToNumber(value); // steps 2 - 3
|
|
|
|
if (IsValidIntegerIndex(O, index)) { // step 4
|
|
var offset = typedArrayByteOffset(O); // step 4.a
|
|
|
|
var elementType = tableTAO.name['$' + arrayTypeName]; // step 4.e
|
|
|
|
var elementSize = tableTAO.size['$' + elementType]; // step 4.c
|
|
|
|
var indexedPosition = (index * elementSize) + offset; // step 4.d
|
|
|
|
SetValueInBuffer(typedArrayBuffer(O), indexedPosition, elementType, numValue, true, 'Unordered'); // step 4.e
|
|
}
|
|
|
|
// 5. Return NormalCompletion(undefined)
|
|
};
|