@teambit/toolbox.string.strip-trailing-char 0.0.0-aca6cb15817085d482be4331e5b985af90e091bb

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.
@@ -0,0 +1 @@
1
+ export { stripTrailingChar } from './strip-trailing-char';
package/dist/index.js ADDED
@@ -0,0 +1,6 @@
1
+ "use strict";
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; } });
6
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../index.ts"],"names":[],"mappings":";;;AAAA,6DAA0D;AAAjD,wHAAA,iBAAiB,OAAA"}
@@ -0,0 +1,6 @@
1
+ /**
2
+ * strip a trailing from a string.
3
+ * @param str string to apply on.
4
+ * @param char char to strip.
5
+ */
6
+ export declare function stripTrailingChar(str: string, char: string): string;
@@ -0,0 +1,18 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.stripTrailingChar = stripTrailingChar;
4
+ /**
5
+ * strip a trailing from a string.
6
+ * @param str string to apply on.
7
+ * @param char char to strip.
8
+ */
9
+ function stripTrailingChar(str, char) {
10
+ if (!str || !char) {
11
+ return str;
12
+ }
13
+ if (str[str.length - 1] === char) {
14
+ return str.slice(0, -1);
15
+ }
16
+ return str;
17
+ }
18
+ //# sourceMappingURL=strip-trailing-char.js.map
@@ -0,0 +1 @@
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/index.ts ADDED
@@ -0,0 +1 @@
1
+ export { stripTrailingChar } from './strip-trailing-char';
package/package.json ADDED
@@ -0,0 +1,39 @@
1
+ {
2
+ "name": "@teambit/toolbox.string.strip-trailing-char",
3
+ "version": "0.0.0-aca6cb15817085d482be4331e5b985af90e091bb",
4
+ "homepage": "https://bit.cloud/teambit/toolbox/string/strip-trailing-char",
5
+ "main": "dist/index.js",
6
+ "componentId": {
7
+ "scope": "teambit.toolbox",
8
+ "name": "string/strip-trailing-char",
9
+ "version": "aca6cb15817085d482be4331e5b985af90e091bb"
10
+ },
11
+ "dependencies": {},
12
+ "devDependencies": {
13
+ "@types/mocha": "9.1.0",
14
+ "chai": "4.3.0",
15
+ "@teambit/node.envs.node-typescript-mocha": "0.0.4"
16
+ },
17
+ "peerDependencies": {},
18
+ "license": "Apache-2.0",
19
+ "optionalDependencies": {},
20
+ "peerDependenciesMeta": {},
21
+ "private": false,
22
+ "engines": {
23
+ "node": ">=12.22.0"
24
+ },
25
+ "repository": {
26
+ "type": "git",
27
+ "url": "https://github.com/teambit/bit"
28
+ },
29
+ "keywords": [
30
+ "bit",
31
+ "components",
32
+ "collaboration",
33
+ "web",
34
+ "react",
35
+ "react-components",
36
+ "angular",
37
+ "angular-components"
38
+ ]
39
+ }
@@ -0,0 +1,14 @@
1
+ /**
2
+ * strip a trailing from a string.
3
+ * @param str string to apply on.
4
+ * @param char char to strip.
5
+ */
6
+ export function stripTrailingChar(str: string, char: string): string {
7
+ if (!str || !char) {
8
+ return str;
9
+ }
10
+ if (str[str.length - 1] === char) {
11
+ return str.slice(0, -1);
12
+ }
13
+ return str;
14
+ }
@@ -0,0 +1,41 @@
1
+ declare module '*.png' {
2
+ const value: any;
3
+ export = value;
4
+ }
5
+ declare module '*.svg' {
6
+ import type { FunctionComponent, SVGProps } from 'react';
7
+
8
+ export const ReactComponent: FunctionComponent<
9
+ SVGProps<SVGSVGElement> & { title?: string }
10
+ >;
11
+ const src: string;
12
+ export default src;
13
+ }
14
+ declare module '*.jpg' {
15
+ const value: any;
16
+ export = value;
17
+ }
18
+ declare module '*.jpeg' {
19
+ const value: any;
20
+ export = value;
21
+ }
22
+ declare module '*.gif' {
23
+ const value: any;
24
+ export = value;
25
+ }
26
+ declare module '*.bmp' {
27
+ const value: any;
28
+ export = value;
29
+ }
30
+ declare module '*.otf' {
31
+ const value: any;
32
+ export = value;
33
+ }
34
+ declare module '*.woff' {
35
+ const value: any;
36
+ export = value;
37
+ }
38
+ declare module '*.woff2' {
39
+ const value: any;
40
+ export = value;
41
+ }
@@ -0,0 +1,42 @@
1
+ declare module '*.module.css' {
2
+ const classes: { readonly [key: string]: string };
3
+ export default classes;
4
+ }
5
+ declare module '*.module.scss' {
6
+ const classes: { readonly [key: string]: string };
7
+ export default classes;
8
+ }
9
+ declare module '*.module.sass' {
10
+ const classes: { readonly [key: string]: string };
11
+ export default classes;
12
+ }
13
+
14
+ declare module '*.module.less' {
15
+ const classes: { readonly [key: string]: string };
16
+ export default classes;
17
+ }
18
+
19
+ declare module '*.less' {
20
+ const classes: { readonly [key: string]: string };
21
+ export default classes;
22
+ }
23
+
24
+ declare module '*.css' {
25
+ const classes: { readonly [key: string]: string };
26
+ export default classes;
27
+ }
28
+
29
+ declare module '*.sass' {
30
+ const classes: { readonly [key: string]: string };
31
+ export default classes;
32
+ }
33
+
34
+ declare module '*.scss' {
35
+ const classes: { readonly [key: string]: string };
36
+ export default classes;
37
+ }
38
+
39
+ declare module '*.mdx' {
40
+ const component: any;
41
+ export default component;
42
+ }