New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

intl-segmenter-polyfill

Package Overview
Dependencies
Maintainers
1
Versions
18
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

intl-segmenter-polyfill - npm Package Compare versions

Comparing version 0.1.0 to 0.1.1

3

dist/index.js

@@ -57,3 +57,3 @@ "use strict";

switch (_a.label) {
case 0: return [4 /*yield*/, WebAssembly.instantiateStreaming(wasm, {
case 0: return [4 /*yield*/, WebAssembly.instantiate(wasm, {
env: {

@@ -97,2 +97,3 @@ push: function (start, end, segmentType) {

var localePtr = allocStr(locale)[0];
console.log(this.options);
exports.break_iterator(BREAK_TYPES[granularity], localePtr, inputPtr);

@@ -99,0 +100,0 @@ exports.free(localePtr);

{
"name": "intl-segmenter-polyfill",
"version": "0.1.0",
"version": "0.1.1",
"description": "This repo builds .wasm module using icu4c for breaking text into words, so that we can polyfill [Intl Segmenter Proposal](https://github.com/tc39/proposal-intl-segmenter) with full compatibility, even on browsers that do not expose v8BreakIterator api.",

@@ -8,3 +8,2 @@ "main": "dist/index.js",

"dist/",
"examples/",
"src/"

@@ -11,0 +10,0 @@ ],

@@ -5,2 +5,3 @@ const BREAK_TYPES = {

}
const getSegmentType = (type: number) => {

@@ -22,3 +23,6 @@ switch (type) {

const response = await WebAssembly.instantiateStreaming(wasm, {
// node env does not support instantiateStreaming
// const instantiate =
// WebAssembly.instantiateStreaming || WebAssembly.instantiate
const response = await WebAssembly.instantiate(wasm, {
env: {

@@ -43,3 +47,3 @@ push: (start: number, end: number, segmentType: number) => {

// eslint-disable-next-line @typescript-eslint/no-explicit-any
const exports = (response.instance.exports as unknown) as any
const exports = ((response as any).instance.exports as unknown) as any

@@ -64,3 +68,3 @@ const ptr = exports.malloc(view.length)

const granularity = this.options.granularity
const exports = (response.instance.exports as unknown) as any
const exports = ((response as any).instance.exports as unknown) as any

@@ -70,3 +74,3 @@ breaks = []

const [localePtr] = allocStr(locale)
console.log(this.options)
exports.break_iterator(BREAK_TYPES[granularity], localePtr, inputPtr)

@@ -73,0 +77,0 @@

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc