codsen-utils 1.3.1 → 1.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -3,6 +3,13 @@
3
3
  All notable changes to this project will be documented in this file.
4
4
  See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
5
 
6
+ # [1.4.0](https://github.com/codsen/codsen/compare/codsen-utils@1.3.1...codsen-utils@1.4.0) (2023-04-16)
7
+
8
+ ### Features
9
+
10
+ - add `detectEol()` ([04d2f3d](https://github.com/codsen/codsen/commit/04d2f3d36963e1b1729887098126cba5719d97c0))
11
+ - add `resolveEolSetting()` and type `EolSetting` ([ceae282](https://github.com/codsen/codsen/commit/ceae282e1f9240638e0aefc57eab48dde9de6ba1))
12
+
6
13
  # [1.3.0](https://github.com/codsen/codsen/compare/codsen-utils@1.2.0...codsen-utils@1.3.0) (2023-03-12)
7
14
 
8
15
  ### Features
@@ -1,10 +1,19 @@
1
1
  /**
2
2
  * @name codsen-utils
3
3
  * @fileoverview Various utility functions
4
- * @version 1.3.1
4
+ * @version 1.4.0
5
5
  * @author Roy Revelt, Codsen Ltd
6
6
  * @license MIT
7
7
  * {@link https://codsen.com/os/codsen-utils/}
8
8
  */
9
9
 
10
- var s="1.3.1";var x=s,c="\u2018",u="\u2019",l="\u201C",a="\u201D",h="\u2013",g="\u2014",y="\xA0",w="\u2026",k="\u200A",C="\u2009",j="\u2032",S="\u2033",T="\\",A="\uFFFD",L="`",O="\xD7",$=[".",",",";","!","?"];function D(t){return n(t)&&t.charCodeAt(0)>=48&&t.charCodeAt(0)<=57}function m(t){return n(t)&&"\u060B$\u20BC\u17DB\xA5\u20A1\u20B1\xA3\u20AC\xA2\u20B9\uFDFC\u20AA\u20A9\u20AD\u20A8\u20AE\u20A6\u20BD\u20AB\u0E3F\u20A9\u20BA\u20B4".includes(t)}function R(t){let e=new Set(["$U","$b","B/.","BZ$","Br","Bs","C$","CHF","Ft","Gs","J$","KM","K\u010D","L","MT","NT$","P","Q","R","R$","RD$","RM","Rp","S","S/.","TT$","Z$","kn","kr","lei","z\u0142","\u0192","\u0414\u0438\u043D.","\u0434\u0435\u043D","\u043B\u0432","\u062F.\u0625","Lek"]);return n(t)&&!!t.trim()&&(m(t)||e.has(t))}function i(t){return n(t)&&t.length===1&&t.toUpperCase()!==t.toLowerCase()}function N(t){return!!(t&&n(t)&&(t.charCodeAt(0)>64&&t.charCodeAt(0)<91||t.charCodeAt(0)>96&&t.charCodeAt(0)<123))}function P(t){return n(t)&&(t==='"'||t==="'"||t===c||t===u||t===l||t===a)}function M(t){return!n(t)||!i(t)?!1:t===t.toLowerCase()&&t!==t.toUpperCase()}function U(t){return!n(t)||!i(t)?!1:t===t.toUpperCase()&&t!==t.toLowerCase()}function F(t){return!n(t)||!t?!1:!t[0].trim()}var Q=t=>n(t)&&t.length&&t.endsWith("/")?t.slice(0,-1).trim():t;function d(t){if(t==null||typeof t!="object")return!1;let e=Object.getPrototypeOf(t);return e!==null&&e!==Object.prototype&&Object.getPrototypeOf(e)!==null?!1:!(Symbol.iterator in t)&&!(Symbol.toStringTag in t)}function B(t="",e=0,r=0,o=""){return e<0&&(e+=t.length,e<0&&(e=0)),t.slice(0,e)+(o||"")+t.slice(e+r)}function n(t){return typeof t=="string"}function I(t){return Number.isFinite(t)}function E(t){return Number.isSafeInteger(t)&&t>=0}function q(t){return typeof t=="boolean"}function K(t){return t===null}function V(t,e){if(!n(t)||!n(e))return[];let r=[],o=-1;for(;(o=t.indexOf(e,o+1))>=0;)r.push(o);return r}function W(t=[],e=[]){return!t||!Array.isArray(t)||!t.length?[]:!e||!Array.isArray(e)||!e.length?t:t.filter(r=>!e.includes(r))}function Z(t){return t!=null}function z(t){return[...new Set(t)]}function G(t,e){return d(t)&&n(e)&&Object.prototype.hasOwnProperty.call(t,e)}var H=["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"],J=new Set(["a","abbr","acronym","audio","b","bdi","bdo","big","br","button","canvas","cite","code","data","datalist","del","dfn","em","embed","i","iframe","img","input","ins","kbd","label","map","mark","meter","noscript","object","output","picture","progress","q","ruby","s","samp","script","select","slot","small","span","strong","sub","sup","svg","template","textarea","time","u","tt","var","video","wbr"]);export{T as backslash,L as backtick,S as doublePrime,w as ellipsis,Z as existy,V as findAllIdx,k as hairspace,G as hasOwnProp,J as inlineTags,q as isBool,m as isCurrencyChar,R as isCurrencySymbol,E as isInt,N as isLatinLetter,i as isLetter,M as isLowercaseLetter,K as isNull,I as isNum,D as isNumberChar,d as isPlainObject,P as isQuote,n as isStr,U as isUppercaseLetter,F as isWhitespaceChar,l as leftDoubleQuote,c as leftSingleQuote,O as multiplicationSign,W as pullAll,$ as punctuationChars,g as rawMDash,h as rawNDash,y as rawNbsp,A as rawReplacementMark,Q as removeTrailingSlash,a as rightDoubleQuote,u as rightSingleQuote,j as singlePrime,B as stringSplice,C as thinSpace,z as uniq,x as version,H as voidTags};
10
+ var s="1.4.0";var h=s,c="\u2018",p="\u2019",l="\u201C",a="\u201D",g="\u2013",w="\u2014",y="\xA0",k="\u2026",C="\u200A",S="\u2009",j="\u2032",T="\u2033",A="\\",E="\uFFFD",O="`",L="\xD7",$=[".",",",";","!","?"];function D(t){return e(t)&&t.charCodeAt(0)>=48&&t.charCodeAt(0)<=57}function f(t){return e(t)&&"\u060B$\u20BC\u17DB\xA5\u20A1\u20B1\xA3\u20AC\xA2\u20B9\uFDFC\u20AA\u20A9\u20AD\u20A8\u20AE\u20A6\u20BD\u20AB\u0E3F\u20A9\u20BA\u20B4".includes(t)}function N(t){let n=new Set(["$U","$b","B/.","BZ$","Br","Bs","C$","CHF","Ft","Gs","J$","KM","K\u010D","L","MT","NT$","P","Q","R","R$","RD$","RM","Rp","S","S/.","TT$","Z$","kn","kr","lei","z\u0142","\u0192","\u0414\u0438\u043D.","\u0434\u0435\u043D","\u043B\u0432","\u062F.\u0625","Lek"]);return e(t)&&!!t.trim()&&(f(t)||n.has(t))}function i(t){return e(t)&&t.length===1&&t.toUpperCase()!==t.toLowerCase()}function R(t){return!!(t&&e(t)&&(t.charCodeAt(0)>64&&t.charCodeAt(0)<91||t.charCodeAt(0)>96&&t.charCodeAt(0)<123))}function P(t){return e(t)&&(t==='"'||t==="'"||t===c||t===p||t===l||t===a)}function M(t){return!e(t)||!i(t)?!1:t===t.toLowerCase()&&t!==t.toUpperCase()}function U(t){return!e(t)||!i(t)?!1:t===t.toUpperCase()&&t!==t.toLowerCase()}function F(t){return!e(t)||!t?!1:!t[0].trim()}var Q=t=>e(t)&&t.length&&t.endsWith("/")?t.slice(0,-1).trim():t;function d(t){if(t==null||typeof t!="object")return!1;let n=Object.getPrototypeOf(t);return n!==null&&n!==Object.prototype&&Object.getPrototypeOf(n)!==null?!1:!(Symbol.iterator in t)&&!(Symbol.toStringTag in t)}function B(t="",n=0,r=0,o=""){return n<0&&(n+=t.length,n<0&&(n=0)),t.slice(0,n)+(o||"")+t.slice(n+r)}function e(t){return typeof t=="string"}function I(t){return Number.isFinite(t)}function q(t){return Number.isSafeInteger(t)&&t>=0}function J(t){return typeof t=="boolean"}function K(t){return t===null}function V(t,n){if(!e(t)||!e(n))return[];let r=[],o=-1;for(;(o=t.indexOf(n,o+1))>=0;)r.push(o);return r}function W(t=[],n=[]){return!t||!Array.isArray(t)||!t.length?[]:!n||!Array.isArray(n)||!n.length?t:t.filter(r=>!n.includes(r))}function Z(t){return t!=null}function z(t){return[...new Set(t)]}function m(t){if(!(typeof t!="string"||!t)){if(t.includes(`\r
11
+ `))return`\r
12
+ `;if(t.includes(`
13
+ `))return`
14
+ `;if(t.includes("\r"))return"\r"}}function G(t,n,r=`
15
+ `){if(![`\r
16
+ `,"\r",`
17
+ `].includes(r))throw new Error(`codsen-utils/resolveEolSetting(): the input argument defaultEolChar should be one of EOL values: "\\n", "\\r", or "\\r\\n", but it was given as ${JSON.stringify(r,null,0)}`);return n==="crlf"?`\r
18
+ `:n==="cr"?"\r":n==="lf"?`
19
+ `:m(t)||r}function H(t,n){return d(t)&&e(n)&&Object.prototype.hasOwnProperty.call(t,n)}var X=["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"],Y=new Set(["a","abbr","acronym","audio","b","bdi","bdo","big","br","button","canvas","cite","code","data","datalist","del","dfn","em","embed","i","iframe","img","input","ins","kbd","label","map","mark","meter","noscript","object","output","picture","progress","q","ruby","s","samp","script","select","slot","small","span","strong","sub","sup","svg","template","textarea","time","u","tt","var","video","wbr"]);export{A as backslash,O as backtick,m as detectEol,T as doublePrime,k as ellipsis,Z as existy,V as findAllIdx,C as hairspace,H as hasOwnProp,Y as inlineTags,J as isBool,f as isCurrencyChar,N as isCurrencySymbol,q as isInt,R as isLatinLetter,i as isLetter,M as isLowercaseLetter,K as isNull,I as isNum,D as isNumberChar,d as isPlainObject,P as isQuote,e as isStr,U as isUppercaseLetter,F as isWhitespaceChar,l as leftDoubleQuote,c as leftSingleQuote,L as multiplicationSign,W as pullAll,$ as punctuationChars,w as rawMDash,g as rawNDash,y as rawNbsp,E as rawReplacementMark,Q as removeTrailingSlash,G as resolveEolSetting,a as rightDoubleQuote,p as rightSingleQuote,j as singlePrime,B as stringSplice,S as thinSpace,z as uniq,h as version,X as voidTags};
@@ -1,10 +1,19 @@
1
1
  /**
2
2
  * @name codsen-utils
3
3
  * @fileoverview Various utility functions
4
- * @version 1.3.1
4
+ * @version 1.4.0
5
5
  * @author Roy Revelt, Codsen Ltd
6
6
  * @license MIT
7
7
  * {@link https://codsen.com/os/codsen-utils/}
8
8
  */
9
9
 
10
- "use strict";var codsenUtils=(()=>{var i=Object.defineProperty;var f=Object.getOwnPropertyDescriptor;var x=Object.getOwnPropertyNames;var h=Object.prototype.hasOwnProperty;var g=(t,e)=>{for(var r in e)i(t,r,{get:e[r],enumerable:!0})},y=(t,e,r,o)=>{if(e&&typeof e=="object"||typeof e=="function")for(let s of x(e))!h.call(t,s)&&s!==r&&i(t,s,{get:()=>e[s],enumerable:!(o=f(e,s))||o.enumerable});return t};var w=t=>y(i({},"__esModule",{value:!0}),t);var nt={};g(nt,{backslash:()=>R,backtick:()=>P,doublePrime:()=>D,ellipsis:()=>A,existy:()=>Y,findAllIdx:()=>J,hairspace:()=>L,hasOwnProp:()=>v,inlineTags:()=>et,isBool:()=>G,isCurrencyChar:()=>d,isCurrencySymbol:()=>Q,isInt:()=>z,isLatinLetter:()=>B,isLetter:()=>p,isLowercaseLetter:()=>E,isNull:()=>H,isNum:()=>Z,isNumberChar:()=>F,isPlainObject:()=>b,isQuote:()=>I,isStr:()=>n,isUppercaseLetter:()=>q,isWhitespaceChar:()=>K,leftDoubleQuote:()=>a,leftSingleQuote:()=>u,multiplicationSign:()=>M,pullAll:()=>X,punctuationChars:()=>U,rawMDash:()=>S,rawNDash:()=>j,rawNbsp:()=>T,rawReplacementMark:()=>N,removeTrailingSlash:()=>V,rightDoubleQuote:()=>m,rightSingleQuote:()=>l,singlePrime:()=>$,stringSplice:()=>W,thinSpace:()=>O,uniq:()=>_,version:()=>C,voidTags:()=>tt});var c="1.3.1";var C=c,u="\u2018",l="\u2019",a="\u201C",m="\u201D",j="\u2013",S="\u2014",T="\xA0",A="\u2026",L="\u200A",O="\u2009",$="\u2032",D="\u2033",R="\\",N="\uFFFD",P="`",M="\xD7",U=[".",",",";","!","?"];function F(t){return n(t)&&t.charCodeAt(0)>=48&&t.charCodeAt(0)<=57}function d(t){return n(t)&&"\u060B$\u20BC\u17DB\xA5\u20A1\u20B1\xA3\u20AC\xA2\u20B9\uFDFC\u20AA\u20A9\u20AD\u20A8\u20AE\u20A6\u20BD\u20AB\u0E3F\u20A9\u20BA\u20B4".includes(t)}function Q(t){let e=new Set(["$U","$b","B/.","BZ$","Br","Bs","C$","CHF","Ft","Gs","J$","KM","K\u010D","L","MT","NT$","P","Q","R","R$","RD$","RM","Rp","S","S/.","TT$","Z$","kn","kr","lei","z\u0142","\u0192","\u0414\u0438\u043D.","\u0434\u0435\u043D","\u043B\u0432","\u062F.\u0625","Lek"]);return n(t)&&!!t.trim()&&(d(t)||e.has(t))}function p(t){return n(t)&&t.length===1&&t.toUpperCase()!==t.toLowerCase()}function B(t){return!!(t&&n(t)&&(t.charCodeAt(0)>64&&t.charCodeAt(0)<91||t.charCodeAt(0)>96&&t.charCodeAt(0)<123))}function I(t){return n(t)&&(t==='"'||t==="'"||t===u||t===l||t===a||t===m)}function E(t){return!n(t)||!p(t)?!1:t===t.toLowerCase()&&t!==t.toUpperCase()}function q(t){return!n(t)||!p(t)?!1:t===t.toUpperCase()&&t!==t.toLowerCase()}function K(t){return!n(t)||!t?!1:!t[0].trim()}var V=t=>n(t)&&t.length&&t.endsWith("/")?t.slice(0,-1).trim():t;function b(t){if(t==null||typeof t!="object")return!1;let e=Object.getPrototypeOf(t);return e!==null&&e!==Object.prototype&&Object.getPrototypeOf(e)!==null?!1:!(Symbol.iterator in t)&&!(Symbol.toStringTag in t)}function W(t="",e=0,r=0,o=""){return e<0&&(e+=t.length,e<0&&(e=0)),t.slice(0,e)+(o||"")+t.slice(e+r)}function n(t){return typeof t=="string"}function Z(t){return Number.isFinite(t)}function z(t){return Number.isSafeInteger(t)&&t>=0}function G(t){return typeof t=="boolean"}function H(t){return t===null}function J(t,e){if(!n(t)||!n(e))return[];let r=[],o=-1;for(;(o=t.indexOf(e,o+1))>=0;)r.push(o);return r}function X(t=[],e=[]){return!t||!Array.isArray(t)||!t.length?[]:!e||!Array.isArray(e)||!e.length?t:t.filter(r=>!e.includes(r))}function Y(t){return t!=null}function _(t){return[...new Set(t)]}function v(t,e){return b(t)&&n(e)&&Object.prototype.hasOwnProperty.call(t,e)}var tt=["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"],et=new Set(["a","abbr","acronym","audio","b","bdi","bdo","big","br","button","canvas","cite","code","data","datalist","del","dfn","em","embed","i","iframe","img","input","ins","kbd","label","map","mark","meter","noscript","object","output","picture","progress","q","ruby","s","samp","script","select","slot","small","span","strong","sub","sup","svg","template","textarea","time","u","tt","var","video","wbr"]);return w(nt);})();
10
+ "use strict";var codsenUtils=(()=>{var i=Object.defineProperty;var x=Object.getOwnPropertyDescriptor;var h=Object.getOwnPropertyNames;var g=Object.prototype.hasOwnProperty;var w=(t,n)=>{for(var e in n)i(t,e,{get:n[e],enumerable:!0})},y=(t,n,e,o)=>{if(n&&typeof n=="object"||typeof n=="function")for(let s of h(n))!g.call(t,s)&&s!==e&&i(t,s,{get:()=>n[s],enumerable:!(o=x(n,s))||o.enumerable});return t};var k=t=>y(i({},"__esModule",{value:!0}),t);var ot={};w(ot,{backslash:()=>N,backtick:()=>P,detectEol:()=>b,doublePrime:()=>D,ellipsis:()=>E,existy:()=>_,findAllIdx:()=>X,hairspace:()=>O,hasOwnProp:()=>nt,inlineTags:()=>rt,isBool:()=>G,isCurrencyChar:()=>d,isCurrencySymbol:()=>Q,isInt:()=>z,isLatinLetter:()=>B,isLetter:()=>u,isLowercaseLetter:()=>q,isNull:()=>H,isNum:()=>Z,isNumberChar:()=>F,isPlainObject:()=>m,isQuote:()=>I,isStr:()=>r,isUppercaseLetter:()=>J,isWhitespaceChar:()=>K,leftDoubleQuote:()=>a,leftSingleQuote:()=>p,multiplicationSign:()=>M,pullAll:()=>Y,punctuationChars:()=>U,rawMDash:()=>T,rawNDash:()=>j,rawNbsp:()=>A,rawReplacementMark:()=>R,removeTrailingSlash:()=>V,resolveEolSetting:()=>tt,rightDoubleQuote:()=>f,rightSingleQuote:()=>l,singlePrime:()=>$,stringSplice:()=>W,thinSpace:()=>L,uniq:()=>v,version:()=>S,voidTags:()=>et});var c="1.4.0";var S=c,p="\u2018",l="\u2019",a="\u201C",f="\u201D",j="\u2013",T="\u2014",A="\xA0",E="\u2026",O="\u200A",L="\u2009",$="\u2032",D="\u2033",N="\\",R="\uFFFD",P="`",M="\xD7",U=[".",",",";","!","?"];function F(t){return r(t)&&t.charCodeAt(0)>=48&&t.charCodeAt(0)<=57}function d(t){return r(t)&&"\u060B$\u20BC\u17DB\xA5\u20A1\u20B1\xA3\u20AC\xA2\u20B9\uFDFC\u20AA\u20A9\u20AD\u20A8\u20AE\u20A6\u20BD\u20AB\u0E3F\u20A9\u20BA\u20B4".includes(t)}function Q(t){let n=new Set(["$U","$b","B/.","BZ$","Br","Bs","C$","CHF","Ft","Gs","J$","KM","K\u010D","L","MT","NT$","P","Q","R","R$","RD$","RM","Rp","S","S/.","TT$","Z$","kn","kr","lei","z\u0142","\u0192","\u0414\u0438\u043D.","\u0434\u0435\u043D","\u043B\u0432","\u062F.\u0625","Lek"]);return r(t)&&!!t.trim()&&(d(t)||n.has(t))}function u(t){return r(t)&&t.length===1&&t.toUpperCase()!==t.toLowerCase()}function B(t){return!!(t&&r(t)&&(t.charCodeAt(0)>64&&t.charCodeAt(0)<91||t.charCodeAt(0)>96&&t.charCodeAt(0)<123))}function I(t){return r(t)&&(t==='"'||t==="'"||t===p||t===l||t===a||t===f)}function q(t){return!r(t)||!u(t)?!1:t===t.toLowerCase()&&t!==t.toUpperCase()}function J(t){return!r(t)||!u(t)?!1:t===t.toUpperCase()&&t!==t.toLowerCase()}function K(t){return!r(t)||!t?!1:!t[0].trim()}var V=t=>r(t)&&t.length&&t.endsWith("/")?t.slice(0,-1).trim():t;function m(t){if(t==null||typeof t!="object")return!1;let n=Object.getPrototypeOf(t);return n!==null&&n!==Object.prototype&&Object.getPrototypeOf(n)!==null?!1:!(Symbol.iterator in t)&&!(Symbol.toStringTag in t)}function W(t="",n=0,e=0,o=""){return n<0&&(n+=t.length,n<0&&(n=0)),t.slice(0,n)+(o||"")+t.slice(n+e)}function r(t){return typeof t=="string"}function Z(t){return Number.isFinite(t)}function z(t){return Number.isSafeInteger(t)&&t>=0}function G(t){return typeof t=="boolean"}function H(t){return t===null}function X(t,n){if(!r(t)||!r(n))return[];let e=[],o=-1;for(;(o=t.indexOf(n,o+1))>=0;)e.push(o);return e}function Y(t=[],n=[]){return!t||!Array.isArray(t)||!t.length?[]:!n||!Array.isArray(n)||!n.length?t:t.filter(e=>!n.includes(e))}function _(t){return t!=null}function v(t){return[...new Set(t)]}function b(t){if(!(typeof t!="string"||!t)){if(t.includes(`\r
11
+ `))return`\r
12
+ `;if(t.includes(`
13
+ `))return`
14
+ `;if(t.includes("\r"))return"\r"}}function tt(t,n,e=`
15
+ `){if(![`\r
16
+ `,"\r",`
17
+ `].includes(e))throw new Error(`codsen-utils/resolveEolSetting(): the input argument defaultEolChar should be one of EOL values: "\\n", "\\r", or "\\r\\n", but it was given as ${JSON.stringify(e,null,0)}`);return n==="crlf"?`\r
18
+ `:n==="cr"?"\r":n==="lf"?`
19
+ `:b(t)||e}function nt(t,n){return m(t)&&r(n)&&Object.prototype.hasOwnProperty.call(t,n)}var et=["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"],rt=new Set(["a","abbr","acronym","audio","b","bdi","bdo","big","br","button","canvas","cite","code","data","datalist","del","dfn","em","embed","i","iframe","img","input","ins","kbd","label","map","mark","meter","noscript","object","output","picture","progress","q","ruby","s","samp","script","select","slot","small","span","strong","sub","sup","svg","template","textarea","time","u","tt","var","video","wbr"]);return k(ot);})();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "codsen-utils",
3
- "version": "1.3.1",
3
+ "version": "1.4.0",
4
4
  "description": "Various utility functions",
5
5
  "keywords": [
6
6
  "codsen",
@@ -49,6 +49,7 @@
49
49
  "node": ">=14.18.0"
50
50
  },
51
51
  "c8": {
52
+ "branches": 100,
52
53
  "check-coverage": true,
53
54
  "exclude": [
54
55
  "**/test/**/*.*"
package/types/index.d.ts CHANGED
@@ -19,6 +19,8 @@ declare const punctuationChars: string[];
19
19
  interface Obj {
20
20
  [key: string]: any;
21
21
  }
22
+ type EolChar = "\n" | "\r" | "\r\n";
23
+ type EolSetting = "lf" | "crlf" | "cr";
22
24
  declare function isNumberChar(value: unknown): boolean;
23
25
  declare function isCurrencyChar(value: unknown): boolean;
24
26
  declare function isCurrencySymbol(value: unknown): boolean;
@@ -79,14 +81,23 @@ declare function existy(x: unknown): boolean;
79
81
  * @returns de-duped array
80
82
  */
81
83
  declare function uniq<T>(input: T[]): T[];
84
+ declare function detectEol(str: string | unknown): EolChar | undefined;
85
+ declare function resolveEolSetting(
86
+ str: string | unknown,
87
+ eolSetting: EolSetting | unknown,
88
+ defaultEolChar?: EolChar
89
+ ): EolChar;
82
90
  declare function hasOwnProp(obj: unknown, prop: string): boolean;
83
91
  declare const voidTags: string[];
84
92
  declare const inlineTags: Set<string>;
85
93
 
86
94
  export {
95
+ EolChar,
96
+ EolSetting,
87
97
  Obj,
88
98
  backslash,
89
99
  backtick,
100
+ detectEol,
90
101
  doublePrime,
91
102
  ellipsis,
92
103
  existy,
@@ -119,6 +130,7 @@ export {
119
130
  rawNbsp,
120
131
  rawReplacementMark,
121
132
  removeTrailingSlash,
133
+ resolveEolSetting,
122
134
  rightDoubleQuote,
123
135
  rightSingleQuote,
124
136
  singlePrime,