@teambit/toolbox.string.strip-trailing-char 0.0.499 → 0.0.501

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/dist/index.js CHANGED
@@ -1,20 +1,6 @@
1
1
  "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- Object.defineProperty(exports, "stripTrailingChar", {
7
- enumerable: true,
8
- get: function () {
9
- return _stripTrailingChar().stripTrailingChar;
10
- }
11
- });
12
- function _stripTrailingChar() {
13
- const data = require("./strip-trailing-char");
14
- _stripTrailingChar = function () {
15
- return data;
16
- };
17
- return data;
18
- }
19
-
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.stripTrailingChar = void 0;
4
+ var strip_trailing_char_1 = require("./strip-trailing-char");
5
+ Object.defineProperty(exports, "stripTrailingChar", { enumerable: true, get: function () { return strip_trailing_char_1.stripTrailingChar; } });
20
6
  //# sourceMappingURL=index.js.map
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"names":["_stripTrailingChar","data","require"],"sources":["index.ts"],"sourcesContent":["export { stripTrailingChar } from './strip-trailing-char';\n"],"mappings":";;;;;;;;;;;AAAA,SAAAA,mBAAA;EAAA,MAAAC,IAAA,GAAAC,OAAA;EAAAF,kBAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA","ignoreList":[]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../index.ts"],"names":[],"mappings":";;;AAAA,6DAA0D;AAAjD,wHAAA,iBAAiB,OAAA"}
@@ -1,8 +1,5 @@
1
1
  "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
2
+ Object.defineProperty(exports, "__esModule", { value: true });
6
3
  exports.stripTrailingChar = stripTrailingChar;
7
4
  /**
8
5
  * strip a trailing from a string.
@@ -10,13 +7,12 @@ exports.stripTrailingChar = stripTrailingChar;
10
7
  * @param char char to strip.
11
8
  */
12
9
  function stripTrailingChar(str, char) {
13
- if (!str || !char) {
10
+ if (!str || !char) {
11
+ return str;
12
+ }
13
+ if (str[str.length - 1] === char) {
14
+ return str.slice(0, -1);
15
+ }
14
16
  return str;
15
- }
16
- if (str[str.length - 1] === char) {
17
- return str.slice(0, -1);
18
- }
19
- return str;
20
17
  }
21
-
22
18
  //# sourceMappingURL=strip-trailing-char.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["stripTrailingChar","str","char","length","slice"],"sources":["strip-trailing-char.ts"],"sourcesContent":["/**\n * strip a trailing from a string.\n * @param str string to apply on.\n * @param char char to strip.\n */\nexport function stripTrailingChar(str: string, char: string): string {\n if (!str || !char) {\n return str;\n }\n if (str[str.length - 1] === char) {\n return str.slice(0, -1);\n }\n return str;\n}\n"],"mappings":";;;;;;AAAA;AACA;AACA;AACA;AACA;AACO,SAASA,iBAAiBA,CAACC,GAAW,EAAEC,IAAY,EAAU;EACnE,IAAI,CAACD,GAAG,IAAI,CAACC,IAAI,EAAE;IACjB,OAAOD,GAAG;EACZ;EACA,IAAIA,GAAG,CAACA,GAAG,CAACE,MAAM,GAAG,CAAC,CAAC,KAAKD,IAAI,EAAE;IAChC,OAAOD,GAAG,CAACG,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;EACzB;EACA,OAAOH,GAAG;AACZ","ignoreList":[]}
1
+ {"version":3,"file":"strip-trailing-char.js","sourceRoot":"","sources":["../strip-trailing-char.ts"],"names":[],"mappings":";;AAKA,8CAQC;AAbD;;;;GAIG;AACH,SAAgB,iBAAiB,CAAC,GAAW,EAAE,IAAY;IACzD,IAAI,CAAC,GAAG,IAAI,CAAC,IAAI,EAAE,CAAC;QAClB,OAAO,GAAG,CAAC;IACb,CAAC;IACD,IAAI,GAAG,CAAC,GAAG,CAAC,MAAM,GAAG,CAAC,CAAC,KAAK,IAAI,EAAE,CAAC;QACjC,OAAO,GAAG,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC;IAC1B,CAAC;IACD,OAAO,GAAG,CAAC;AACb,CAAC"}
package/package.json CHANGED
@@ -1,18 +1,18 @@
1
1
  {
2
2
  "name": "@teambit/toolbox.string.strip-trailing-char",
3
- "version": "0.0.499",
3
+ "version": "0.0.501",
4
4
  "homepage": "https://bit.cloud/teambit/toolbox/string/strip-trailing-char",
5
5
  "main": "dist/index.js",
6
6
  "componentId": {
7
7
  "scope": "teambit.toolbox",
8
8
  "name": "string/strip-trailing-char",
9
- "version": "0.0.499"
9
+ "version": "0.0.501"
10
10
  },
11
11
  "dependencies": {},
12
12
  "devDependencies": {
13
13
  "@types/mocha": "9.1.0",
14
14
  "chai": "4.3.0",
15
- "@teambit/node.envs.node-babel-mocha": "0.1.4"
15
+ "@teambit/node.envs.node-typescript-mocha": "0.0.4"
16
16
  },
17
17
  "peerDependencies": {},
18
18
  "license": "Apache-2.0",