map.js 283 B

12345678910
  1. import { identity } from '../utils/helper';
  2. /**
  3. * Map transform by function.
  4. */
  5. export const Map = (options) => {
  6. const { callback = identity } = options;
  7. return (data) => (Array.isArray(data) ? data.map(callback) : data);
  8. };
  9. Map.props = {};
  10. //# sourceMappingURL=map.js.map