@metascraper/helpers 5.33.5 → 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.
Files changed (2) hide show
  1. package/index.js +5 -7
  2. package/package.json +2 -2
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 truncatedStr = str.slice(0, truncateLength)
239
- if (truncatedStr.length < str.length) {
240
- truncatedStr = truncatedStr.trim() + '…'
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",
5
+ "version": "5.33.7",
6
6
  "main": "index.js",
7
7
  "author": {
8
8
  "email": "hello@microlink.io",
@@ -62,5 +62,5 @@
62
62
  "publishConfig": {
63
63
  "access": "public"
64
64
  },
65
- "gitHead": "6cd369d2522c238f72b411e67b7399ebf8808b1c"
65
+ "gitHead": "fbf546c9620b84799941aa8a16ce310e13451032"
66
66
  }