Skip to content

Releases: motss/normalize-diacritics

v2.2.0

07 Apr 04:46
Compare
Choose a tag to compare

Minor code refactoring to check if the JavaScript runtime in which the code executes comes with ICU data installed. If yes, it will use the native method String.prototype.normalize to normalize strings. Without required ICU data, String.prototype.normalize has no effect on the normalization.

In this release, a simple feature detection is added to do that for you and fallbacks when necessary. This is particularly useful for modern JavaScript/ TypeScript runtime such as deno which is built without ICU data.

v2.0.0

17 Mar 03:44
Compare
Choose a tag to compare

Improved file structure for both the web and Node.js

Notable changes

Leverage file extension that favors each different module system and environment.

  1. Use .mjs for ES Modules on Node.js
import { normalize } from 'normalize-diacritics'; /** Use `index.mjs` */
  1. Use .js for CommonJS on Node.js
const { normalize } = require('normalize-diacritics'); /** Use `index.js` */
  1. Default .js for ES Modules on the web
<script type="module">
  import { normalize } from 'https://unpkg.com/normalize-diacritics@latest/dist/normalize-diacritics.js';
</script>
  1. Use .iife.js for IIFE on the web
<script src="https://unpkg.com/normalize-diacritics@latest/dist/normalize-diacritics.iife.js"></script>
<script>
  const { normalize } = window.NormalizeDiacritics;
</script>

v1.0.1-deno

07 Apr 04:45
Compare
Choose a tag to compare
v1.0.1-deno Pre-release
Pre-release
🔖 v1.0.1-deno

🎉 v1.0.0 stable release

16 Jan 14:38
Compare
Choose a tag to compare

Notable changes:-

  1. Now ship with multiple bundles:

    a. esm - Targeting native ES modules such as TypeScript.
    b. cjs - Targeting Node.js with CommonJS.
    c. iife - Targeting older browsers by compiling to IIFE and ES5.

  2. Fixed a bug where single-character string is not being normalized.

  3. Alternatively, you can rely on third-party services to grab the bundle: unpkg and jsdelivr.

Deno support

It's cool to see this project gaining traction by the community. Because of that, I've decided to add more support for this particular project. It's officially supported as a deno package and is available at awesome-deno where it lists all the deno packages by the community.

Try it now as of today!

import { normalize } from 'https://denopkg.com/motss/[email protected]/index.ts';

(async () => {
  const str = 'söme stüff with áccènts';

  await normalize(str); // 'some stuff with accents'
})();

Now in TypeScript with new features

28 Nov 08:00
Compare
Choose a tag to compare
  • 💥 A major rewrite of the entire package in TypeScript

  • ✨ : Revised the available methods the package offers, now it comes with async method by default and you can choose to use a sync-version of the method:

    • normalize(input) - Normalizing strings that contains accents/ diacritics via async/ await under the hood.
    • normalizeSync(input) - The synchronous version of the normalization method.

🔥 🔥 🔥Have fun!