Files
dewedev/node_modules/underscore/amd/toArray.js
dwindown 7f2dd5260f Initial commit: Developer Tools MVP with visual editor
- Complete React app with 7 developer tools
- JSON Tool with visual structured editor
- Serialize Tool with visual structured editor
- URL, Base64, CSV/JSON, Beautifier, Diff tools
- Responsive navigation with dropdown menu
- Dark/light mode toggle
- Mobile-responsive design with sticky header
- All tools working with copy/paste functionality
2025-08-02 09:31:26 +07:00

19 lines
656 B
JavaScript

define(['./_setup', './identity', './isArray', './_isArrayLike', './values', './isString', './map'], function (_setup, identity, isArray, _isArrayLike, values, isString, map) {
// Safely create a real, live array from anything iterable.
var reStrSymbol = /[^\ud800-\udfff]|[\ud800-\udbff][\udc00-\udfff]|[\ud800-\udfff]/g;
function toArray(obj) {
if (!obj) return [];
if (isArray(obj)) return _setup.slice.call(obj);
if (isString(obj)) {
// Keep surrogate pair characters together.
return obj.match(reStrSymbol);
}
if (_isArrayLike(obj)) return map(obj, identity);
return values(obj);
}
return toArray;
});