@metascraper/helpers 5.33.4 → 5.33.7
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/index.js +5 -7
- package/package.json +3 -3
package/index.js
CHANGED
|
@@ -233,14 +233,12 @@ const description = (value, opts) =>
|
|
|
233
233
|
|
|
234
234
|
const getDescription = (
|
|
235
235
|
str,
|
|
236
|
-
{ truncateLength = TRUNCATE_MAX_LENGTH, ...opts } = {}
|
|
236
|
+
{ truncateLength = TRUNCATE_MAX_LENGTH, ellipsis = '…', ...opts } = {}
|
|
237
237
|
) => {
|
|
238
|
-
let
|
|
239
|
-
if (
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
const description = removeLocation(truncatedStr)
|
|
243
|
-
return titleize(description, opts)
|
|
238
|
+
let truncated = str.slice(0, truncateLength)
|
|
239
|
+
if (truncated.length < str.length) truncated = truncated.trim() + ellipsis
|
|
240
|
+
const description = removeLocation(truncated)
|
|
241
|
+
return titleize(description, opts).replace(/\s?\.\.\.?$/, ellipsis)
|
|
244
242
|
}
|
|
245
243
|
|
|
246
244
|
const publisher = value =>
|
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"name": "@metascraper/helpers",
|
|
3
3
|
"description": "Collection of helper functions used by metascraper",
|
|
4
4
|
"homepage": "https://nicedoc.io/microlinkhq/metascraper/packages/metascraper-helpers",
|
|
5
|
-
"version": "5.33.
|
|
5
|
+
"version": "5.33.7",
|
|
6
6
|
"main": "index.js",
|
|
7
7
|
"author": {
|
|
8
8
|
"email": "hello@microlink.io",
|
|
@@ -33,7 +33,7 @@
|
|
|
33
33
|
"is-uri": "~1.2.4",
|
|
34
34
|
"iso-639-3": "~2.2.0",
|
|
35
35
|
"isostring": "0.0.1",
|
|
36
|
-
"jsdom": "~21.
|
|
36
|
+
"jsdom": "~21.1.0",
|
|
37
37
|
"lodash": "~4.17.21",
|
|
38
38
|
"memoize-one": "~6.0.0",
|
|
39
39
|
"microsoft-capitalize": "~1.0.5",
|
|
@@ -62,5 +62,5 @@
|
|
|
62
62
|
"publishConfig": {
|
|
63
63
|
"access": "public"
|
|
64
64
|
},
|
|
65
|
-
"gitHead": "
|
|
65
|
+
"gitHead": "fbf546c9620b84799941aa8a16ce310e13451032"
|
|
66
66
|
}
|