string-trim-spaces-only 5.0.13 → 5.0.22

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.
@@ -1,12 +1,12 @@
1
1
  /**
2
2
  * @name string-trim-spaces-only
3
3
  * @fileoverview Like String.trim() but you can choose granularly what to trim
4
- * @version 5.0.13
4
+ * @version 5.0.22
5
5
  * @author Roy Revelt, Codsen Ltd
6
6
  * @license MIT
7
7
  * {@link https://codsen.com/os/string-trim-spaces-only/}
8
8
  */
9
9
 
10
- var i="5.0.13";var g=i,p={classicTrim:!1,cr:!1,lf:!1,tab:!1,space:!0,nbsp:!1};function d(e,l){if(typeof e!="string")throw new Error(`string-trim-spaces-only: [THROW_ID_01] input must be string! It was given as ${typeof e}, equal to:
10
+ var i="5.0.22";var g=i,p={classicTrim:!1,cr:!1,lf:!1,tab:!1,space:!0,nbsp:!1};function d(e,l){if(typeof e!="string")throw new Error(`string-trim-spaces-only: [THROW_ID_01] input must be string! It was given as ${typeof e}, equal to:
11
11
  ${JSON.stringify(e,null,4)}`);let n={...p,...l};function o(t){return n.classicTrim&&!t.trim()||!n.classicTrim&&(n.space&&t===" "||n.cr&&t==="\r"||n.lf&&t===`
12
12
  `||n.tab&&t===" "||n.nbsp&&t==="\xA0")}let r,s;if(e.length){if(o(e[0]))for(let t=0,c=e.length;t<c;t++){if(!o(e[t])){r=t;break}if(t===e.length-1)return{res:"",ranges:[[0,e.length]]}}if(o(e[e.length-1])){for(let t=e.length;t--;)if(!o(e[t])){s=t+1;break}}return r?s?{res:e.slice(r,s),ranges:[[0,r],[s,e.length]]}:{res:e.slice(r),ranges:[[0,r]]}:s?{res:e.slice(0,s),ranges:[[s,e.length]]}:{res:e,ranges:[]}}return{res:"",ranges:[]}}export{p as defaults,d as trimSpaces,g as version};
@@ -1,12 +1,10 @@
1
1
  /**
2
2
  * @name string-trim-spaces-only
3
3
  * @fileoverview Like String.trim() but you can choose granularly what to trim
4
- * @version 5.0.13
4
+ * @version 5.0.22
5
5
  * @author Roy Revelt, Codsen Ltd
6
6
  * @license MIT
7
7
  * {@link https://codsen.com/os/string-trim-spaces-only/}
8
8
  */
9
9
 
10
- "use strict";var stringTrimSpacesOnly=(()=>{var l=Object.defineProperty;var b=Object.getOwnPropertyDescriptor;var f=Object.getOwnPropertyNames,a=Object.getOwnPropertySymbols;var u=Object.prototype.hasOwnProperty,$=Object.prototype.propertyIsEnumerable;var p=(e,n,t)=>n in e?l(e,n,{enumerable:!0,configurable:!0,writable:!0,value:t}):e[n]=t,c=(e,n)=>{for(var t in n||(n={}))u.call(n,t)&&p(e,t,n[t]);if(a)for(var t of a(n))$.call(n,t)&&p(e,t,n[t]);return e};var y=(e,n)=>{for(var t in n)l(e,t,{get:n[t],enumerable:!0})},h=(e,n,t,o)=>{if(n&&typeof n=="object"||typeof n=="function")for(let r of f(n))!u.call(e,r)&&r!==t&&l(e,r,{get:()=>n[r],enumerable:!(o=b(n,r))||o.enumerable});return e};var E=e=>h(l({},"__esModule",{value:!0}),e);var v={};y(v,{defaults:()=>g,trimSpaces:()=>D,version:()=>x});var m="5.0.13";var x=m,g={classicTrim:!1,cr:!1,lf:!1,tab:!1,space:!0,nbsp:!1};function D(e,n){if(typeof e!="string")throw new Error(`string-trim-spaces-only: [THROW_ID_01] input must be string! It was given as ${typeof e}, equal to:
11
- ${JSON.stringify(e,null,4)}`);let t=c(c({},g),n);function o(s){return t.classicTrim&&!s.trim()||!t.classicTrim&&(t.space&&s===" "||t.cr&&s==="\r"||t.lf&&s===`
12
- `||t.tab&&s===" "||t.nbsp&&s==="\xA0")}let r,i;if(e.length){if(o(e[0]))for(let s=0,d=e.length;s<d;s++){if(!o(e[s])){r=s;break}if(s===e.length-1)return{res:"",ranges:[[0,e.length]]}}if(o(e[e.length-1])){for(let s=e.length;s--;)if(!o(e[s])){i=s+1;break}}return r?i?{res:e.slice(r,i),ranges:[[0,r],[i,e.length]]}:{res:e.slice(r),ranges:[[0,r]]}:i?{res:e.slice(0,i),ranges:[[i,e.length]]}:{res:e,ranges:[]}}return{res:"",ranges:[]}}return E(v);})();
10
+ "use strict";var stringTrimSpacesOnly=(()=>{var l=Object.defineProperty;var b=Object.getOwnPropertyDescriptor;var f=Object.getOwnPropertyNames,a=Object.getOwnPropertySymbols;var u=Object.prototype.hasOwnProperty,$=Object.prototype.propertyIsEnumerable;var p=(e,n,t)=>n in e?l(e,n,{enumerable:!0,configurable:!0,writable:!0,value:t}):e[n]=t,c=(e,n)=>{for(var t in n||(n={}))u.call(n,t)&&p(e,t,n[t]);if(a)for(var t of a(n))$.call(n,t)&&p(e,t,n[t]);return e};var y=(e,n)=>{for(var t in n)l(e,t,{get:n[t],enumerable:!0})},h=(e,n,t,o)=>{if(n&&typeof n=="object"||typeof n=="function")for(let r of f(n))!u.call(e,r)&&r!==t&&l(e,r,{get:()=>n[r],enumerable:!(o=b(n,r))||o.enumerable});return e};var E=e=>h(l({},"__esModule",{value:!0}),e);var D={};y(D,{defaults:()=>g,trimSpaces:()=>x,version:()=>v});var m="5.0.22";var v=m,g={classicTrim:!1,cr:!1,lf:!1,tab:!1,space:!0,nbsp:!1};function x(e,n){if(typeof e!="string")throw new Error("string-trim-spaces-only: [THROW_ID_01] input must be string! It was given as ".concat(typeof e,", equal to:\n").concat(JSON.stringify(e,null,4)));let t=c(c({},g),n);function o(s){return t.classicTrim&&!s.trim()||!t.classicTrim&&(t.space&&s===" "||t.cr&&s==="\r"||t.lf&&s==="\n"||t.tab&&s===" "||t.nbsp&&s==="\xA0")}let r,i;if(e.length){if(o(e[0]))for(let s=0,d=e.length;s<d;s++){if(!o(e[s])){r=s;break}if(s===e.length-1)return{res:"",ranges:[[0,e.length]]}}if(o(e[e.length-1])){for(let s=e.length;s--;)if(!o(e[s])){i=s+1;break}}return r?i?{res:e.slice(r,i),ranges:[[0,r],[i,e.length]]}:{res:e.slice(r),ranges:[[0,r]]}:i?{res:e.slice(0,i),ranges:[[i,e.length]]}:{res:e,ranges:[]}}return{res:"",ranges:[]}}return E(D);})();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "string-trim-spaces-only",
3
- "version": "5.0.13",
3
+ "version": "5.0.22",
4
4
  "description": "Like String.trim() but you can choose granularly what to trim",
5
5
  "keywords": [
6
6
  "characters",
@@ -42,7 +42,7 @@
42
42
  "dts": "rollup -c && npm run prettier -- 'types/index.d.ts' --write --log-level 'silent'",
43
43
  "examples": "node '../../ops/scripts/run-examples.js'",
44
44
  "lect": "node '../../ops/lect/lect.js' && npm run prettier -- 'README.md' '.all-contributorsrc' 'rollup.config.js' --write",
45
- "letspublish": "npm publish || :",
45
+ "letspublish": "npm publish --provenance || :",
46
46
  "lint": "eslint . --fix",
47
47
  "perf": "node perf/check.js",
48
48
  "prep": "echo 'ready'",
@@ -68,5 +68,8 @@
68
68
  ""
69
69
  ]
70
70
  }
71
+ },
72
+ "publishConfig": {
73
+ "registry": "https://registry.npmjs.org/"
71
74
  }
72
75
  }