Comparing version 1.0.0 to 1.0.1
15
index.js
@@ -83,9 +83,9 @@ const Escaped = { '<': '<', '>': '>', '&': '&' }; | ||
} | ||
// TODO: padStart, padEnd, normalize, replace, replaceAll, split, trim, trimStart, trimEnd | ||
// TODO: padStart, padEnd, replace, replaceAll, split, trim, trimStart, trimEnd | ||
} | ||
for (let method of ['charAt', 'charCodeAt', 'codePointAt', 'endsWith', 'includes', 'indexOf', | ||
for (const method of ['charAt', 'charCodeAt', 'codePointAt', 'endsWith', 'includes', 'indexOf', | ||
'isWellFormed', 'lastIndexOf', 'localeCompare', 'match', 'matchAll', 'normalize', | ||
'search', 'split', 'startsWith', 'toLocaleLowerCase', 'toLocaleUpperCase', 'toLowerCase', | ||
'toString', 'toUpperCase', 'toWellFormed', 'trim', 'trimEnd', 'trimStart']) { | ||
'search', 'startsWith', 'toWellFormed']) { | ||
// Lift some methods from String class | ||
@@ -96,2 +96,9 @@ FormattedString.prototype[method] = function() { | ||
} | ||
for (const method of ['toLocaleLowerCase', 'toLocaleUpperCase', 'toLowerCase', 'toUpperCase']) { | ||
FormattedString.prototype[method] = function() { | ||
const result = new FormattedString(this.text[method].apply(this.text, arguments)); | ||
result.entities = this.entities.map(entity => Object.assign({}, entity)); | ||
return result; | ||
} | ||
} | ||
@@ -98,0 +105,0 @@ function fmt(strs, ...exprs) { |
{ | ||
"name": "tg-format", | ||
"version": "1.0.0", | ||
"version": "1.0.1", | ||
"description": "A tiny Node.JS helper for sending formatted text messages using Telegram Bot API", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -16,3 +16,3 @@ # tg-format | ||
```js | ||
const { html } = require('tgformat'); | ||
const { html } = require('tg-format'); | ||
@@ -42,3 +42,3 @@ // Предполагается, что функция sendMessage вызывает соответствующий метод Telegram Bot API | ||
```js | ||
const { fmt } = require('tgformat'); | ||
const { fmt } = require('tg-format'); | ||
@@ -45,0 +45,0 @@ // Предполагается, что функция sendMessage вызывает соответствующий метод Telegram Bot API |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
14753
137