- 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
67 lines
2.1 KiB
JavaScript
67 lines
2.1 KiB
JavaScript
'use strict';
|
|
|
|
var $TypeError = require('es-errors/type');
|
|
var isObject = require('es-object-atoms/isObject');
|
|
|
|
var Call = require('./Call');
|
|
var CreateDataProperty = require('./CreateDataProperty');
|
|
var EnumerableOwnPropertyNames = require('./EnumerableOwnPropertyNames');
|
|
var Get = require('./Get');
|
|
var IsArray = require('./IsArray');
|
|
var LengthOfArrayLike = require('./LengthOfArrayLike');
|
|
var ToString = require('./ToString');
|
|
|
|
var forEach = require('../helpers/forEach');
|
|
|
|
// https://262.ecma-international.org/11.0/#sec-internalizejsonproperty
|
|
|
|
module.exports = function InternalizeJSONProperty(holder, name, reviver) {
|
|
if (!isObject(holder)) {
|
|
throw new $TypeError('Assertion failed: `holder` is not an Object');
|
|
}
|
|
if (typeof name !== 'string') {
|
|
throw new $TypeError('Assertion failed: `name` is not a String');
|
|
}
|
|
if (typeof reviver !== 'function') {
|
|
throw new $TypeError('Assertion failed: `reviver` is not a Function');
|
|
}
|
|
|
|
var val = Get(holder, name); // step 1
|
|
|
|
if (isObject(val)) { // step 2
|
|
var isArray = IsArray(val); // step 2.a
|
|
if (isArray) { // step 2.b
|
|
var I = 0; // step 2.b.i
|
|
|
|
var len = LengthOfArrayLike(val, 'length'); // step 2.b.ii
|
|
|
|
while (I < len) { // step 2.b.iii
|
|
var newElement = InternalizeJSONProperty(val, ToString(I), reviver); // step 2.b.iv.1
|
|
|
|
if (typeof newElement === 'undefined') { // step 2.b.iii.2
|
|
delete val[ToString(I)]; // step 2.b.iii.2.a
|
|
} else { // step 2.b.iii.3
|
|
CreateDataProperty(val, ToString(I), newElement); // step 2.b.iii.3.a
|
|
}
|
|
|
|
I += 1; // step 2.b.iii.4
|
|
}
|
|
} else { // step 2.c
|
|
var keys = EnumerableOwnPropertyNames(val, 'key'); // step 2.c.i
|
|
|
|
forEach(keys, function (P) { // step 2.c.ii
|
|
// eslint-disable-next-line no-shadow
|
|
var newElement = InternalizeJSONProperty(val, P, reviver); // step 2.c.ii.1
|
|
|
|
if (typeof newElement === 'undefined') { // step 2.c.ii.2
|
|
delete val[P]; // step 2.c.ii.2.a
|
|
} else { // step 2.c.ii.3
|
|
CreateDataProperty(val, P, newElement); // step 2.c.ii.3.a
|
|
}
|
|
});
|
|
}
|
|
}
|
|
|
|
return Call(reviver, holder, [name, val]); // step 3
|
|
};
|