string-trim-spaces-only 2.8.16 → 2.8.17

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,7 +1,7 @@
1
1
  /**
2
2
  * string-trim-spaces-only
3
3
  * Like String.trim() but you can choose granularly what to trim
4
- * Version: 2.8.16
4
+ * Version: 2.8.17
5
5
  * Author: Roy Revelt, Codsen Ltd
6
6
  * License: MIT
7
7
  * Homepage: https://gitlab.com/codsen/codsen/tree/master/packages/string-trim-spaces-only
@@ -86,7 +86,7 @@ function trimSpaces(s, originalOpts) {
86
86
  space: true,
87
87
  nbsp: false
88
88
  };
89
- var opts = _objectSpread2({}, defaults, {}, originalOpts);
89
+ var opts = _objectSpread2(_objectSpread2({}, defaults), originalOpts);
90
90
  function check(char) {
91
91
  return opts.classicTrim && !char.trim() || !opts.classicTrim && (opts.space && char === " " || opts.cr && char === "\r" || opts.lf && char === "\n" || opts.tab && char === "\t" || opts.nbsp && char === "\xA0");
92
92
  }
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * string-trim-spaces-only
3
3
  * Like String.trim() but you can choose granularly what to trim
4
- * Version: 2.8.16
4
+ * Version: 2.8.17
5
5
  * Author: Roy Revelt, Codsen Ltd
6
6
  * License: MIT
7
7
  * Homepage: https://gitlab.com/codsen/codsen/tree/master/packages/string-trim-spaces-only
@@ -94,7 +94,7 @@
94
94
  nbsp: false
95
95
  };
96
96
 
97
- var opts = _objectSpread2({}, defaults, {}, originalOpts);
97
+ var opts = _objectSpread2(_objectSpread2({}, defaults), originalOpts);
98
98
 
99
99
  function check(char) {
100
100
  return opts.classicTrim && !char.trim() || !opts.classicTrim && (opts.space && char === " " || opts.cr && char === "\r" || opts.lf && char === "\n" || opts.tab && char === "\t" || opts.nbsp && char === "\xA0");
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * string-trim-spaces-only
3
3
  * Like String.trim() but you can choose granularly what to trim
4
- * Version: 2.8.16
4
+ * Version: 2.8.17
5
5
  * Author: Roy Revelt, Codsen Ltd
6
6
  * License: MIT
7
7
  * Homepage: https://gitlab.com/codsen/codsen/tree/master/packages/string-trim-spaces-only
@@ -1,10 +1,10 @@
1
1
  /**
2
2
  * string-trim-spaces-only
3
3
  * Like String.trim() but you can choose granularly what to trim
4
- * Version: 2.8.16
4
+ * Version: 2.8.17
5
5
  * Author: Roy Revelt, Codsen Ltd
6
6
  * License: MIT
7
7
  * Homepage: https://gitlab.com/codsen/codsen/tree/master/packages/string-trim-spaces-only
8
8
  */
9
9
 
10
- !function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):(e=e||self).stringTrimSpacesOnly=t()}(this,(function(){"use strict";function e(t){return(e="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(t)}function t(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function r(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}return function(n,o){if("string"!=typeof n)throw new Error("string-trim-spaces-only: [THROW_ID_01] input must be string! It was given as ".concat(e(n),", equal to:\n").concat(JSON.stringify(n,null,4)));var i,c,s=function(e){for(var n=1;n<arguments.length;n++){var o=null!=arguments[n]?arguments[n]:{};n%2?r(Object(o),!0).forEach((function(r){t(e,r,o[r])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(o)):r(Object(o)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(o,t))}))}return e}({},{classicTrim:!1,cr:!1,lf:!1,tab:!1,space:!0,nbsp:!1},{},o);function f(e){return s.classicTrim&&!e.trim()||!s.classicTrim&&(s.space&&" "===e||s.cr&&"\r"===e||s.lf&&"\n"===e||s.tab&&"\t"===e||s.nbsp&&" "===e)}if(n.length){if(f(n[0]))for(var l=0,u=n.length;l<u;l++){if(!f(n[l])){i=l;break}if(l===n.length-1)return{res:"",ranges:[[0,n.length]]}}if(f(n[n.length-1]))for(var a=n.length;a--;)if(!f(n[a])){c=a+1;break}return i?c?{res:n.slice(i,c),ranges:[[0,i],[c,n.length]]}:{res:n.slice(i),ranges:[[0,i]]}:c?{res:n.slice(0,c),ranges:[[c,n.length]]}:{res:n,ranges:[]}}return{res:"",ranges:[]}}}));
10
+ !function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):(e=e||self).stringTrimSpacesOnly=t()}(this,(function(){"use strict";function e(t){return(e="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(t)}function t(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function r(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function n(e){for(var n=1;n<arguments.length;n++){var o=null!=arguments[n]?arguments[n]:{};n%2?r(Object(o),!0).forEach((function(r){t(e,r,o[r])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(o)):r(Object(o)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(o,t))}))}return e}return function(t,r){if("string"!=typeof t)throw new Error("string-trim-spaces-only: [THROW_ID_01] input must be string! It was given as ".concat(e(t),", equal to:\n").concat(JSON.stringify(t,null,4)));var o,i,c=n(n({},{classicTrim:!1,cr:!1,lf:!1,tab:!1,space:!0,nbsp:!1}),r);function s(e){return c.classicTrim&&!e.trim()||!c.classicTrim&&(c.space&&" "===e||c.cr&&"\r"===e||c.lf&&"\n"===e||c.tab&&"\t"===e||c.nbsp&&" "===e)}if(t.length){if(s(t[0]))for(var f=0,l=t.length;f<l;f++){if(!s(t[f])){o=f;break}if(f===t.length-1)return{res:"",ranges:[[0,t.length]]}}if(s(t[t.length-1]))for(var u=t.length;u--;)if(!s(t[u])){i=u+1;break}return o?i?{res:t.slice(o,i),ranges:[[0,o],[i,t.length]]}:{res:t.slice(o),ranges:[[0,o]]}:i?{res:t.slice(0,i),ranges:[[i,t.length]]}:{res:t,ranges:[]}}return{res:"",ranges:[]}}}));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "string-trim-spaces-only",
3
- "version": "2.8.16",
3
+ "version": "2.8.17",
4
4
  "description": "Like String.trim() but you can choose granularly what to trim",
5
5
  "license": "MIT",
6
6
  "repository": "https://gitlab.com/codsen/codsen/",
@@ -122,16 +122,16 @@
122
122
  "timeout": 0
123
123
  },
124
124
  "devDependencies": {
125
- "@babel/core": "^7.9.0",
126
- "@babel/preset-env": "^7.9.5",
125
+ "@babel/core": "^7.9.6",
126
+ "@babel/preset-env": "^7.9.6",
127
+ "@rollup/plugin-babel": "^5.0.0",
127
128
  "@rollup/plugin-commonjs": "^11.1.0",
128
129
  "@rollup/plugin-node-resolve": "^7.1.3",
129
130
  "@rollup/plugin-strip": "^1.3.2",
130
131
  "benchmark": "^2.1.4",
131
- "lect": "^0.12.8",
132
- "rollup": "^2.7.2",
132
+ "lect": "^0.13.0",
133
+ "rollup": "^2.8.0",
133
134
  "rollup-plugin-ascii": "^0.0.3",
134
- "rollup-plugin-babel": "^4.4.0",
135
135
  "rollup-plugin-banner": "^0.2.1",
136
136
  "rollup-plugin-cleanup": "^3.1.1",
137
137
  "rollup-plugin-terser": "^5.3.0",