@teambit/toolbox.string.ellipsis 0.0.190 → 0.0.192
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/ellipsis.js +2 -6
- package/dist/ellipsis.js.map +1 -1
- package/dist/ellipsis.spec.js +5 -18
- package/dist/ellipsis.spec.js.map +1 -1
- package/dist/index.js +4 -18
- package/dist/index.js.map +1 -1
- package/package.json +3 -3
package/dist/ellipsis.js
CHANGED
|
@@ -1,15 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
3
|
exports.ellipsis = ellipsis;
|
|
7
4
|
/**
|
|
8
5
|
* ellipsis the text.
|
|
9
6
|
* @param str string to cut
|
|
10
7
|
*/
|
|
11
8
|
function ellipsis(str, maxCharacters) {
|
|
12
|
-
|
|
9
|
+
return str.length > maxCharacters ? `${str.substring(0, maxCharacters)}...` : str;
|
|
13
10
|
}
|
|
14
|
-
|
|
15
11
|
//# sourceMappingURL=ellipsis.js.map
|
package/dist/ellipsis.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"file":"ellipsis.js","sourceRoot":"","sources":["../ellipsis.ts"],"names":[],"mappings":";;AAIA,4BAEC;AAND;;;GAGG;AACH,SAAgB,QAAQ,CAAC,GAAW,EAAE,aAAqB;IACzD,OAAO,GAAG,CAAC,MAAM,GAAG,aAAa,CAAC,CAAC,CAAC,GAAG,GAAG,CAAC,SAAS,CAAC,CAAC,EAAE,aAAa,CAAC,KAAK,CAAC,CAAC,CAAC,GAAG,CAAC;AACpF,CAAC"}
|
package/dist/ellipsis.spec.js
CHANGED
|
@@ -1,24 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
_ellipsis = function () {
|
|
6
|
-
return data;
|
|
7
|
-
};
|
|
8
|
-
return data;
|
|
9
|
-
}
|
|
10
|
-
function _chai() {
|
|
11
|
-
const data = require("chai");
|
|
12
|
-
_chai = function () {
|
|
13
|
-
return data;
|
|
14
|
-
};
|
|
15
|
-
return data;
|
|
16
|
-
}
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const ellipsis_1 = require("./ellipsis");
|
|
4
|
+
const chai_1 = require("chai");
|
|
17
5
|
it('should not ellipsis', () => {
|
|
18
|
-
|
|
6
|
+
(0, chai_1.expect)((0, ellipsis_1.ellipsis)('abc', 3)).to.equal('abc');
|
|
19
7
|
});
|
|
20
8
|
it('should ellipsis', () => {
|
|
21
|
-
|
|
9
|
+
(0, chai_1.expect)((0, ellipsis_1.ellipsis)('abcde', 3)).to.equal('abc...');
|
|
22
10
|
});
|
|
23
|
-
|
|
24
11
|
//# sourceMappingURL=ellipsis.spec.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"file":"ellipsis.spec.js","sourceRoot":"","sources":["../ellipsis.spec.ts"],"names":[],"mappings":";;AAAA,yCAAsC;AACtC,+BAA8B;AAE9B,EAAE,CAAC,qBAAqB,EAAE,GAAG,EAAE;IAC7B,IAAA,aAAM,EAAC,IAAA,mBAAQ,EAAC,KAAK,EAAE,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;AAC7C,CAAC,CAAC,CAAC;AAEH,EAAE,CAAC,iBAAiB,EAAE,GAAG,EAAE;IACzB,IAAA,aAAM,EAAC,IAAA,mBAAQ,EAAC,OAAO,EAAE,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC;AAClD,CAAC,CAAC,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -1,20 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
});
|
|
6
|
-
Object.defineProperty(exports, "ellipsis", {
|
|
7
|
-
enumerable: true,
|
|
8
|
-
get: function () {
|
|
9
|
-
return _ellipsis().ellipsis;
|
|
10
|
-
}
|
|
11
|
-
});
|
|
12
|
-
function _ellipsis() {
|
|
13
|
-
const data = require("./ellipsis");
|
|
14
|
-
_ellipsis = function () {
|
|
15
|
-
return data;
|
|
16
|
-
};
|
|
17
|
-
return data;
|
|
18
|
-
}
|
|
19
|
-
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ellipsis = void 0;
|
|
4
|
+
var ellipsis_1 = require("./ellipsis");
|
|
5
|
+
Object.defineProperty(exports, "ellipsis", { enumerable: true, get: function () { return ellipsis_1.ellipsis; } });
|
|
20
6
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../index.ts"],"names":[],"mappings":";;;AAAA,uCAAsC;AAA7B,oGAAA,QAAQ,OAAA"}
|
package/package.json
CHANGED
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@teambit/toolbox.string.ellipsis",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.192",
|
|
4
4
|
"homepage": "https://bit.cloud/teambit/toolbox/string/ellipsis",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"componentId": {
|
|
7
7
|
"scope": "teambit.toolbox",
|
|
8
8
|
"name": "string/ellipsis",
|
|
9
|
-
"version": "0.0.
|
|
9
|
+
"version": "0.0.192"
|
|
10
10
|
},
|
|
11
11
|
"dependencies": {},
|
|
12
12
|
"devDependencies": {
|
|
13
13
|
"@types/chai": "4.2.15",
|
|
14
14
|
"chai": "4.3.0",
|
|
15
15
|
"@types/mocha": "9.1.0",
|
|
16
|
-
"@teambit/node.envs.node-
|
|
16
|
+
"@teambit/node.envs.node-typescript-mocha": "0.0.4"
|
|
17
17
|
},
|
|
18
18
|
"peerDependencies": {},
|
|
19
19
|
"license": "Apache-2.0",
|