codsen-utils 1.1.1 → 1.2.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.2.0](https://github.com/codsen/codsen/compare/codsen-utils@1.1.1...codsen-utils@1.2.0) (2022-12-27)
7
+
8
+ ### Features
9
+
10
+ - add `isCurrencyChar()` ([3de83c3](https://github.com/codsen/codsen/commit/3de83c3edf31c503bf394887b64915d3d74ed185))
11
+ - add `isCurrencySymbol()` ([9de553c](https://github.com/codsen/codsen/commit/9de553c30c2dbbc570409b876dde8161ac2ae693))
12
+
6
13
  ## [1.1.1](https://github.com/codsen/codsen/compare/codsen-utils@1.1.0...codsen-utils@1.1.1) (2022-12-27)
7
14
 
8
15
  ### Bug Fixes
@@ -1,10 +1,10 @@
1
1
  /**
2
2
  * @name codsen-utils
3
3
  * @fileoverview Various utility functions
4
- * @version 1.1.1
4
+ * @version 1.2.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 r="1.1.1";var m=r,p="\u2018",c="\u2019",u="\u201C",l="\u201D",f="\u2013",b="\u2014",x="\xA0",g="\u2026",h="\u200A",y="\u2009",w="\u2032",k="\u2033",j="\\",C="\uFFFD",A="`",S="\xD7",D=[".",",",";","!","?"];function L(t){return typeof t=="string"&&t.charCodeAt(0)>=48&&t.charCodeAt(0)<=57}function s(t){return typeof t=="string"&&t.length===1&&t.toUpperCase()!==t.toLowerCase()}function O(t){return!!(t&&typeof t=="string"&&(t.charCodeAt(0)>64&&t.charCodeAt(0)<91||t.charCodeAt(0)>96&&t.charCodeAt(0)<123))}function T(t){return typeof t=="string"&&(t==='"'||t==="'"||t===p||t===c||t===u||t===l)}function P(t){return typeof t!="string"||!s(t)?!1:t===t.toLowerCase()&&t!==t.toUpperCase()}function Q(t){return typeof t!="string"||!s(t)?!1:t===t.toUpperCase()&&t!==t.toLowerCase()}function M(t){return typeof t!="string"||!t?!1:!t[0].trim()}var R=t=>typeof t=="string"&&t.length&&t.endsWith("/")?t.slice(0,-1).trim():t;function U(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 E(t="",e=0,o=0,n=""){return e<0&&(e+=t.length,e<0&&(e=0)),t.slice(0,e)+(n||"")+t.slice(e+o)}function F(t,e){if(typeof t!="string"||typeof e!="string")return[];let o=[],n=-1;for(;(n=t.indexOf(e,n+1))>=0;)o.push(n);return o}var N=["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"],I=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{j as backslash,A as backtick,k as doublePrime,g as ellipsis,F as findAllIdx,h as hairspace,I as inlineTags,O as isLatinLetter,s as isLetter,P as isLowercaseLetter,L as isNumberChar,U as isPlainObject,T as isQuote,Q as isUppercaseLetter,M as isWhitespaceChar,u as leftDoubleQuote,p as leftSingleQuote,S as multiplicationSign,D as punctuationChars,b as rawMDash,f as rawNDash,x as rawNbsp,C as rawReplacementMark,R as removeTrailingSlash,l as rightDoubleQuote,c as rightSingleQuote,w as singlePrime,E as stringSplice,y as thinSpace,m as version,N as voidTags};
10
+ var o="1.2.0";var f=o,p="\u2018",c="\u2019",u="\u201C",l="\u201D",b="\u2013",x="\u2014",g="\xA0",h="\u2026",y="\u200A",w="\u2009",k="\u2032",C="\u2033",j="\\",S="\uFFFD",L="`",T="\xD7",$=[".",",",";","!","?"];function A(t){return typeof t=="string"&&t.charCodeAt(0)>=48&&t.charCodeAt(0)<=57}function a(t){return typeof t=="string"&&"\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 D(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 typeof t=="string"&&!!t.trim()&&(a(t)||e.has(t))}function s(t){return typeof t=="string"&&t.length===1&&t.toUpperCase()!==t.toLowerCase()}function R(t){return!!(t&&typeof t=="string"&&(t.charCodeAt(0)>64&&t.charCodeAt(0)<91||t.charCodeAt(0)>96&&t.charCodeAt(0)<123))}function M(t){return typeof t=="string"&&(t==='"'||t==="'"||t===p||t===c||t===u||t===l)}function O(t){return typeof t!="string"||!s(t)?!1:t===t.toLowerCase()&&t!==t.toUpperCase()}function P(t){return typeof t!="string"||!s(t)?!1:t===t.toUpperCase()&&t!==t.toLowerCase()}function Q(t){return typeof t!="string"||!t?!1:!t[0].trim()}var F=t=>typeof t=="string"&&t.length&&t.endsWith("/")?t.slice(0,-1).trim():t;function U(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,n=""){return e<0&&(e+=t.length,e<0&&(e=0)),t.slice(0,e)+(n||"")+t.slice(e+r)}function N(t,e){if(typeof t!="string"||typeof e!="string")return[];let r=[],n=-1;for(;(n=t.indexOf(e,n+1))>=0;)r.push(n);return r}var E=["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"],I=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{j as backslash,L as backtick,C as doublePrime,h as ellipsis,N as findAllIdx,y as hairspace,I as inlineTags,a as isCurrencyChar,D as isCurrencySymbol,R as isLatinLetter,s as isLetter,O as isLowercaseLetter,A as isNumberChar,U as isPlainObject,M as isQuote,P as isUppercaseLetter,Q as isWhitespaceChar,u as leftDoubleQuote,p as leftSingleQuote,T as multiplicationSign,$ as punctuationChars,x as rawMDash,b as rawNDash,g as rawNbsp,S as rawReplacementMark,F as removeTrailingSlash,l as rightDoubleQuote,c as rightSingleQuote,k as singlePrime,B as stringSplice,w as thinSpace,f as version,E as voidTags};
@@ -1,10 +1,10 @@
1
1
  /**
2
2
  * @name codsen-utils
3
3
  * @fileoverview Various utility functions
4
- * @version 1.1.1
4
+ * @version 1.2.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 s=Object.defineProperty;var d=Object.getOwnPropertyDescriptor;var m=Object.getOwnPropertyNames;var f=Object.prototype.hasOwnProperty;var b=(t,e)=>{for(var n in e)s(t,n,{get:e[n],enumerable:!0})},x=(t,e,n,o)=>{if(e&&typeof e=="object"||typeof e=="function")for(let r of m(e))!f.call(t,r)&&r!==n&&s(t,r,{get:()=>e[r],enumerable:!(o=d(e,r))||o.enumerable});return t};var g=t=>x(s({},"__esModule",{value:!0}),t);var H={};b(H,{backslash:()=>O,backtick:()=>P,doublePrime:()=>L,ellipsis:()=>C,findAllIdx:()=>z,hairspace:()=>A,inlineTags:()=>G,isLatinLetter:()=>U,isLetter:()=>i,isLowercaseLetter:()=>F,isNumberChar:()=>R,isPlainObject:()=>W,isQuote:()=>E,isUppercaseLetter:()=>N,isWhitespaceChar:()=>I,leftDoubleQuote:()=>l,leftSingleQuote:()=>c,multiplicationSign:()=>Q,punctuationChars:()=>M,rawMDash:()=>k,rawNDash:()=>w,rawNbsp:()=>j,rawReplacementMark:()=>T,removeTrailingSlash:()=>V,rightDoubleQuote:()=>a,rightSingleQuote:()=>u,singlePrime:()=>D,stringSplice:()=>q,thinSpace:()=>S,version:()=>y,voidTags:()=>B});var p="1.1.1";var y=p,c="\u2018",u="\u2019",l="\u201C",a="\u201D",w="\u2013",k="\u2014",j="\xA0",C="\u2026",A="\u200A",S="\u2009",D="\u2032",L="\u2033",O="\\",T="\uFFFD",P="`",Q="\xD7",M=[".",",",";","!","?"];function R(t){return typeof t=="string"&&t.charCodeAt(0)>=48&&t.charCodeAt(0)<=57}function i(t){return typeof t=="string"&&t.length===1&&t.toUpperCase()!==t.toLowerCase()}function U(t){return!!(t&&typeof t=="string"&&(t.charCodeAt(0)>64&&t.charCodeAt(0)<91||t.charCodeAt(0)>96&&t.charCodeAt(0)<123))}function E(t){return typeof t=="string"&&(t==='"'||t==="'"||t===c||t===u||t===l||t===a)}function F(t){return typeof t!="string"||!i(t)?!1:t===t.toLowerCase()&&t!==t.toUpperCase()}function N(t){return typeof t!="string"||!i(t)?!1:t===t.toUpperCase()&&t!==t.toLowerCase()}function I(t){return typeof t!="string"||!t?!1:!t[0].trim()}var V=t=>typeof t=="string"&&t.length&&t.endsWith("/")?t.slice(0,-1).trim():t;function W(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 q(t="",e=0,n=0,o=""){return e<0&&(e+=t.length,e<0&&(e=0)),t.slice(0,e)+(o||"")+t.slice(e+n)}function z(t,e){if(typeof t!="string"||typeof e!="string")return[];let n=[],o=-1;for(;(o=t.indexOf(e,o+1))>=0;)n.push(o);return n}var B=["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"],G=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 g(H);})();
10
+ "use strict";var codsenUtils=(()=>{var s=Object.defineProperty;var m=Object.getOwnPropertyDescriptor;var f=Object.getOwnPropertyNames;var b=Object.prototype.hasOwnProperty;var x=(t,e)=>{for(var n in e)s(t,n,{get:e[n],enumerable:!0})},g=(t,e,n,r)=>{if(e&&typeof e=="object"||typeof e=="function")for(let o of f(e))!b.call(t,o)&&o!==n&&s(t,o,{get:()=>e[o],enumerable:!(r=m(e,o))||r.enumerable});return t};var h=t=>g(s({},"__esModule",{value:!0}),t);var G={};x(G,{backslash:()=>D,backtick:()=>M,doublePrime:()=>A,ellipsis:()=>S,findAllIdx:()=>Z,hairspace:()=>L,inlineTags:()=>z,isCurrencyChar:()=>d,isCurrencySymbol:()=>F,isLatinLetter:()=>U,isLetter:()=>i,isLowercaseLetter:()=>N,isNumberChar:()=>Q,isPlainObject:()=>V,isQuote:()=>B,isUppercaseLetter:()=>E,isWhitespaceChar:()=>I,leftDoubleQuote:()=>l,leftSingleQuote:()=>c,multiplicationSign:()=>O,punctuationChars:()=>P,rawMDash:()=>C,rawNDash:()=>k,rawNbsp:()=>j,rawReplacementMark:()=>R,removeTrailingSlash:()=>K,rightDoubleQuote:()=>a,rightSingleQuote:()=>u,singlePrime:()=>$,stringSplice:()=>W,thinSpace:()=>T,version:()=>w,voidTags:()=>q});var p="1.2.0";var w=p,c="\u2018",u="\u2019",l="\u201C",a="\u201D",k="\u2013",C="\u2014",j="\xA0",S="\u2026",L="\u200A",T="\u2009",$="\u2032",A="\u2033",D="\\",R="\uFFFD",M="`",O="\xD7",P=[".",",",";","!","?"];function Q(t){return typeof t=="string"&&t.charCodeAt(0)>=48&&t.charCodeAt(0)<=57}function d(t){return typeof t=="string"&&"\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 F(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 typeof t=="string"&&!!t.trim()&&(d(t)||e.has(t))}function i(t){return typeof t=="string"&&t.length===1&&t.toUpperCase()!==t.toLowerCase()}function U(t){return!!(t&&typeof t=="string"&&(t.charCodeAt(0)>64&&t.charCodeAt(0)<91||t.charCodeAt(0)>96&&t.charCodeAt(0)<123))}function B(t){return typeof t=="string"&&(t==='"'||t==="'"||t===c||t===u||t===l||t===a)}function N(t){return typeof t!="string"||!i(t)?!1:t===t.toLowerCase()&&t!==t.toUpperCase()}function E(t){return typeof t!="string"||!i(t)?!1:t===t.toUpperCase()&&t!==t.toLowerCase()}function I(t){return typeof t!="string"||!t?!1:!t[0].trim()}var K=t=>typeof t=="string"&&t.length&&t.endsWith("/")?t.slice(0,-1).trim():t;function V(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,n=0,r=""){return e<0&&(e+=t.length,e<0&&(e=0)),t.slice(0,e)+(r||"")+t.slice(e+n)}function Z(t,e){if(typeof t!="string"||typeof e!="string")return[];let n=[],r=-1;for(;(r=t.indexOf(e,r+1))>=0;)n.push(r);return n}var q=["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"],z=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 h(G);})();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "codsen-utils",
3
- "version": "1.1.1",
3
+ "version": "1.2.0",
4
4
  "description": "Various utility functions",
5
5
  "keywords": [
6
6
  "codsen",
package/types/index.d.ts CHANGED
@@ -17,6 +17,8 @@ declare const backtick = "`";
17
17
  declare const multiplicationSign = "\u00D7";
18
18
  declare const punctuationChars: string[];
19
19
  declare function isNumberChar(value: unknown): boolean;
20
+ declare function isCurrencyChar(value: unknown): boolean;
21
+ declare function isCurrencySymbol(value: unknown): boolean;
20
22
  declare function isLetter(value: unknown): boolean;
21
23
  declare function isLatinLetter(value: unknown): boolean;
22
24
  declare function isQuote(value: unknown): boolean;
@@ -66,6 +68,8 @@ export {
66
68
  findAllIdx,
67
69
  hairspace,
68
70
  inlineTags,
71
+ isCurrencyChar,
72
+ isCurrencySymbol,
69
73
  isLatinLetter,
70
74
  isLetter,
71
75
  isLowercaseLetter,