moltres-utils
Version:
Utils for Moltres apps
48 lines (40 loc) • 1.3 kB
JavaScript
require("core-js/modules/es6.object.define-property");
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.baseTail = exports.default = void 0;
var _curry = _interopRequireDefault(require("../common/curry"));
var _defn = _interopRequireDefault(require("../common/defn"));
var _slice = _interopRequireDefault(require("./slice"));
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
var baseTail = (0, _slice.default)(1, Infinity);
/**
* Returns all but the first element of the given list or string (or object
* with a `tail` method).
*
* Dispatches to the `slice` method of the first argument, if present.
*
* @function
* @since v0.0.5
* @category data
* @sig [a] -> [a]
* @param {*} collection The collection to get the tail of
* @returns {*} The tail of the given collection
* @example
*
* tail([1, 2, 3]); //=> [2, 3]
* tail([1, 2]); //=> [2]
* tail([1]); //=> []
* tail([]); //=> []
*
* tail('abc'); //=> 'bc'
* tail('ab'); //=> 'b'
* tail('a'); //=> ''
* tail(''); //=> ''
*/
exports.baseTail = baseTail;
var tail = (0, _curry.default)((0, _defn.default)('tail', baseTail));
var _default = tail;
exports.default = _default;
//# sourceMappingURL=tail.js.map
;