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

@blocksuite/store

Package Overview
Dependencies
Maintainers
5
Versions
1312
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@blocksuite/store - npm Package Compare versions

Comparing version 0.3.0-20221218162424-d362663 to 0.3.0-20221219152633-59209d4

dist/blocks/src/divider-block/divider-model.d.ts

2

package.json
{
"name": "@blocksuite/store",
"version": "0.3.0-20221218162424-d362663",
"version": "0.3.0-20221219152633-59209d4",
"description": "BlockSuite data store built for general purpose state management.",

@@ -5,0 +5,0 @@ "main": "dist/index.js",

@@ -1,2 +0,6 @@

import { Document as DocumentIndexer, DocumentSearchOptions } from 'flexsearch';
import {
Document as DocumentIndexer,
DocumentSearchOptions,
Index,
} from 'flexsearch';
import { Doc, Map as YMap, Text as YText } from 'yjs';

@@ -13,7 +17,26 @@ import type { YBlock } from './page';

if (tokenizer) {
// extract the latin encoder inside flexsearch
// eslint-disable-next-line @typescript-eslint/no-explicit-any
const latinIndexer: any = new Index({ charset: 'latin:advanced' });
const latinEncoder = latinIndexer.encode.bind(latinIndexer);
// check latin characters
const latinChecker = /^[\p{Script=Latin}\p{Mark}\d]+$/u;
const segmenter = new tokenizer([locale], { granularity: 'word' });
return (text: string) =>
Array.from(segmenter.segment(text))
.filter(s => s.isWordLike)
return (text: string) => {
const latinChars: string[] = [];
const cjkChars = Array.from(segmenter.segment(text))
.filter(s => {
if (s.isWordLike) {
if (!latinChecker.test(s.segment)) {
return true;
}
latinChars.push(s.segment);
}
return false;
})
.map(s => s.segment);
return [...cjkChars, ...latinEncoder(latinChars.join(' '))];
};
}

@@ -20,0 +43,0 @@ return (text: string) => {

{
"extends": "../../tsconfig.json",
"compilerOptions": {
"rootDir": "./src/",
"baseUrl": ".",
"outDir": "./dist/",

@@ -6,0 +6,0 @@ "noEmit": false

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