您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符

18 行
517 B

4 年前
  1. var baseSlice = require('./_baseSlice');
  2. /**
  3. * Casts `array` to a slice if it's needed.
  4. *
  5. * @private
  6. * @param {Array} array The array to inspect.
  7. * @param {number} start The start position.
  8. * @param {number} [end=array.length] The end position.
  9. * @returns {Array} Returns the cast slice.
  10. */
  11. function castSlice(array, start, end) {
  12. var length = array.length;
  13. end = end === undefined ? length : end;
  14. return (!start && end >= length) ? array : baseSlice(array, start, end);
  15. }
  16. module.exports = castSlice;