60e2149072
Tasks 16-20: Online Board Tests (Search/Filter, Tabs, Flight List, Details Modal, Time/Date) - Task 16: Search & Filter tests (37 tests) - departure/arrival cities, passenger count, cabin class - Task 17: Arrival/Departure Tabs tests (45 tests) - tab switching, flight display, sorting - Task 18: Flight List View tests (50 tests) - display, sorting, filtering, pagination, loading states - Task 19: Flight Details Modal tests (40 tests) - opening/closing, content display, actions - Task 20: Time & Date Filter tests (43 tests) - date selection, time ranges, calendar navigation Tasks 21-25: Flight Details Tests (Flight Info, Passengers, Seats, Services, Fares) - Task 21: Flight Info Display tests (40 tests) - basic info, airports, route visualization, timeline - Task 22: Passenger Info tests (50 tests) - passenger list, details, services, special requirements - Task 23: Seat Selection tests (50 tests) - seat map, selection, categories, recommendations - Task 24: Service Selection tests (25 tests) - baggage, meals, seats, summary - Task 25: Fare Display tests (55 tests) - fare breakdown, comparisons, discounts, refunds All tests follow AAA pattern and use data-testid selectors matching Angular version. Total: 245 tests across 10 feature suites.
78 lines
2.1 KiB
JavaScript
78 lines
2.1 KiB
JavaScript
/* eslint-disable node/no-deprecated-api */
|
|
|
|
'use strict'
|
|
|
|
var buffer = require('buffer')
|
|
var Buffer = buffer.Buffer
|
|
|
|
var safer = {}
|
|
|
|
var key
|
|
|
|
for (key in buffer) {
|
|
if (!buffer.hasOwnProperty(key)) continue
|
|
if (key === 'SlowBuffer' || key === 'Buffer') continue
|
|
safer[key] = buffer[key]
|
|
}
|
|
|
|
var Safer = safer.Buffer = {}
|
|
for (key in Buffer) {
|
|
if (!Buffer.hasOwnProperty(key)) continue
|
|
if (key === 'allocUnsafe' || key === 'allocUnsafeSlow') continue
|
|
Safer[key] = Buffer[key]
|
|
}
|
|
|
|
safer.Buffer.prototype = Buffer.prototype
|
|
|
|
if (!Safer.from || Safer.from === Uint8Array.from) {
|
|
Safer.from = function (value, encodingOrOffset, length) {
|
|
if (typeof value === 'number') {
|
|
throw new TypeError('The "value" argument must not be of type number. Received type ' + typeof value)
|
|
}
|
|
if (value && typeof value.length === 'undefined') {
|
|
throw new TypeError('The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type ' + typeof value)
|
|
}
|
|
return Buffer(value, encodingOrOffset, length)
|
|
}
|
|
}
|
|
|
|
if (!Safer.alloc) {
|
|
Safer.alloc = function (size, fill, encoding) {
|
|
if (typeof size !== 'number') {
|
|
throw new TypeError('The "size" argument must be of type number. Received type ' + typeof size)
|
|
}
|
|
if (size < 0 || size >= 2 * (1 << 30)) {
|
|
throw new RangeError('The value "' + size + '" is invalid for option "size"')
|
|
}
|
|
var buf = Buffer(size)
|
|
if (!fill || fill.length === 0) {
|
|
buf.fill(0)
|
|
} else if (typeof encoding === 'string') {
|
|
buf.fill(fill, encoding)
|
|
} else {
|
|
buf.fill(fill)
|
|
}
|
|
return buf
|
|
}
|
|
}
|
|
|
|
if (!safer.kStringMaxLength) {
|
|
try {
|
|
safer.kStringMaxLength = process.binding('buffer').kStringMaxLength
|
|
} catch (e) {
|
|
// we can't determine kStringMaxLength in environments where process.binding
|
|
// is unsupported, so let's not set it
|
|
}
|
|
}
|
|
|
|
if (!safer.constants) {
|
|
safer.constants = {
|
|
MAX_LENGTH: safer.kMaxLength
|
|
}
|
|
if (safer.kStringMaxLength) {
|
|
safer.constants.MAX_STRING_LENGTH = safer.kStringMaxLength
|
|
}
|
|
}
|
|
|
|
module.exports = safer
|