UNPKG

newline-iterator

Version:
3 lines (2 loc) 745 B
!function(e,n){"object"==typeof exports&&"undefined"!=typeof module?module.exports=n():"function"==typeof define&&define.amd?define(n):(e="undefined"!=typeof globalThis?globalThis:e||self).newlineIterator=n()}(this,function(){"use strict";var e=/\r?\n|\r/g,n="undefined"==typeof window?global:window,t=void 0===n.Symbol?{iterator:void 0}:n.Symbol;return function(n){var o,r,i,l=n.split(e).reverse();return o={next:function(){if(0===l.length)return{value:null,done:!0};var e=l.pop();return 0===l.length&&0===e.length?{value:null,done:!0}:{value:e,done:!1}}},r=t.iterator,i=function(){return this},r in o?Object.defineProperty(o,r,{value:i,enumerable:!0,configurable:!0,writable:!0}):o[r]=i,o}}); //# sourceMappingURL=newline-iterator.min.cjs.map