Files
Laca-City/frontend/node_modules/es-iterator-helpers/test/Iterator.zipKeyed.js
PhongPham c65cc97a33 🎯 MapView v2.0 - Global Deployment Ready
 MAJOR FEATURES:
• Auto-zoom intelligence với smart bounds fitting
• Enhanced 3D GPS markers với pulsing effects
• Professional route display với 6-layer rendering
• Status-based parking icons với availability indicators
• Production-ready build optimizations

🗺️ AUTO-ZOOM FEATURES:
• Smart bounds fitting cho GPS + selected parking
• Adaptive padding (50px) cho visual balance
• Max zoom control (level 16) để tránh quá gần
• Dynamic centering khi không có selection

🎨 ENHANCED VISUALS:
• 3D GPS marker với multi-layer pulse effects
• Advanced parking icons với status colors
• Selection highlighting với animation
• Dimming system cho non-selected items

🛣️ ROUTE SYSTEM:
• OpenRouteService API integration
• Multi-layer route rendering (glow, shadow, main, animated)
• Real-time distance & duration calculation
• Visual route info trong popup

📱 PRODUCTION READY:
• SSR safe với dynamic imports
• Build errors resolved
• Global deployment via Vercel
• Optimized performance

🌍 DEPLOYMENT:
• Vercel: https://whatever-ctk2auuxr-phong12hexdockworks-projects.vercel.app
• Bundle size: 22.8 kB optimized
• Global CDN distribution
• HTTPS enabled

💾 VERSION CONTROL:
• MapView-v2.0.tsx backup created
• MAPVIEW_VERSIONS.md documentation
• Full version history tracking
2025-07-20 19:52:16 +07:00

152 lines
4.5 KiB
JavaScript

'use strict';
var defineProperties = require('define-properties');
var test = require('tape');
var callBind = require('call-bind');
var functionsHaveNames = require('functions-have-names')();
var forEach = require('for-each');
var debug = require('object-inspect');
var v = require('es-value-fixtures');
var hasSymbols = require('has-symbols/shams')();
var mockProperty = require('mock-property');
var index = require('../Iterator.zipKeyed');
var impl = require('../Iterator.zipKeyed/implementation');
var from = require('../Iterator.from/polyfill')();
var testIterator = require('./helpers/testIterator');
var isEnumerable = Object.prototype.propertyIsEnumerable;
module.exports = {
tests: function (zipKeyed, name, t) {
t['throws'](
function () { return new zipKeyed(); }, // eslint-disable-line new-cap
TypeError,
'`' + name + '` itself is not a constructor'
);
t['throws'](
function () { return new zipKeyed({}); }, // eslint-disable-line new-cap
TypeError,
'`' + name + '` itself is not a constructor, with an argument'
);
forEach(v.primitives, function (primitive) {
t['throws'](
function () { zipKeyed(primitive); },
TypeError,
debug(primitive) + ' is not an Object'
);
if (primitive != null) {
t['throws'](
function () { zipKeyed({ a: primitive }); },
TypeError,
'key "a" on iterables object is ' + debug(primitive) + ' which is not an iterable Object'
);
}
});
forEach(v.objects, function (nonIterator) {
t.doesNotThrow(function () { zipKeyed({ a: nonIterator }); }, 'does not throw until `.next()`');
t['throws'](
function () { zipKeyed({ a: nonIterator }).next(); },
TypeError,
'key "a" on iterables object is ' + debug(nonIterator) + ' which is not an iterable Object'
);
});
t.test('actual iteration', { skip: !hasSymbols }, function (st) {
forEach(v.nonFunctions, function (nonFunction) {
if (nonFunction != null) {
var badIterable = {};
badIterable[Symbol.iterator] = nonFunction;
st['throws'](
function () { zipKeyed({ a: [], b: badIterable, c: [] }).next(); },
TypeError,
'key "b" on iterables object is ' + debug(badIterable) + ' is not a function'
);
}
});
forEach(v.strings, function (string) {
st['throws'](
function () { zipKeyed({ a: string }); },
TypeError,
'key "a" on iterables object is an iterable primitive, but non-objects are not considered iterable'
);
});
st.test('real iterators', { skip: !hasSymbols }, function (s2t) {
var iter = [['a', 1], ['b', 2]][Symbol.iterator]();
var iterator = zipKeyed({ a: iter, b: ['a', 3], c: ['b', 4] });
testIterator(
iterator,
[
{ __proto__: null, a: ['a', 1], b: 'a', c: 'b' },
{ __proto__: null, a: ['b', 2], b: 3, c: 4 }
],
s2t,
'array iterator + array yields combined results'
);
s2t.end();
});
st.test('observability in a replaced String iterator', function (s2t) {
var originalStringIterator = String.prototype[Symbol.iterator];
var observedType;
s2t.teardown(mockProperty(String.prototype, Symbol.iterator, {
get: function () {
'use strict'; // eslint-disable-line strict, lines-around-directive
observedType = typeof this;
return originalStringIterator;
}
}));
zipKeyed([from('')]);
s2t.equal(observedType, 'string', 'string primitive -> primitive receiver in Symbol.iterator getter');
zipKeyed([from(Object(''))]);
s2t.equal(observedType, 'object', 'boxed string -> boxed string in Symbol.iterator getter');
s2t.end();
});
st.end();
});
},
index: function () {
test('Iterator.zipKeyed: index', function (t) {
module.exports.tests(index, 'Iterator.zipKeyed', t);
t.end();
});
},
implementation: function () {
test('Iterator.zipKeyed: implementation', function (t) {
module.exports.tests(impl, 'Iterator.zipKeyed', t);
t.end();
});
},
shimmed: function () {
test('Iterator.zipKeyed: shimmed', function (t) {
t.test('Function name', { skip: !functionsHaveNames }, function (st) {
st.equal(Iterator.zipKeyed.name, 'zipKeyed', 'Iterator.zipKeyed has name "zipKeyed"');
st.end();
});
t.test('enumerability', { skip: !defineProperties.supportsDescriptors }, function (et) {
et.equal(false, isEnumerable.call(Iterator, 'zipKeyed'), 'Iterator.zipKeyed is not enumerable');
et.end();
});
module.exports.tests(callBind(Iterator.zipKeyed, Iterator), 'Iterator.zipKeyed', t);
t.end();
});
}
};