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

@ephox/polaris

Package Overview
Dependencies
Maintainers
1
Versions
74
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@ephox/polaris - npm Package Compare versions

Comparing version 3.0.43 to 3.0.46

2

lib/main/ts/ephox/polaris/pattern/Chars.js

@@ -9,3 +9,3 @@ import { Unicode, Fun } from '@ephox/katamari';

// \u2018 and \u2019 are the smart quote characters
var charsStr = '\\w' + '\'' + '\\-' + '\\u0100-\\u017F\\u00C0-\\u00FF' + Unicode.zeroWidth() + '\\u2018\\u2019';
var charsStr = '\\w' + '\'' + '\\-' + '\\u0100-\\u017F\\u00C0-\\u00FF' + Unicode.zeroWidth + '\\u2018\\u2019';
var wordbreakStr = '[^' + charsStr + ']';

@@ -12,0 +12,0 @@ var wordcharStr = '[' + charsStr + ']';

export declare type CharacterMap = number[];
declare const classify: (characters: string[]) => number[];
declare const classify: (characters: string[]) => CharacterMap;
export { classify };
//# sourceMappingURL=StringMapper.d.ts.map

@@ -1,3 +0,4 @@

declare const isWordBoundary: (map: number[], index: number) => boolean;
import { CharacterMap } from './StringMapper';
declare const isWordBoundary: (map: CharacterMap, index: number) => boolean;
export { isWordBoundary };
//# sourceMappingURL=WordBoundary.d.ts.map

@@ -5,2 +5,3 @@ import { __assign } from "tslib";

import { isWordBoundary } from './WordBoundary';
import { Unicode } from '@ephox/katamari';
var EMPTY_STRING = UnicodeData.EMPTY_STRING;

@@ -69,3 +70,3 @@ var WHITESPACE = UnicodeData.WHITESPACE;

var ch = extract(chars[i]);
if (ch !== '\ufeff') {
if (ch !== Unicode.zeroWidth) {
filteredChars.push(chars[i]);

@@ -72,0 +73,0 @@ extractedChars.push(ch);

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

import { assert, UnitTest } from '@ephox/bedrock';
import { assert, UnitTest } from '@ephox/bedrock-client';
import * as Boundaries from 'ephox/polaris/array/Boundaries';

@@ -3,0 +3,0 @@ UnitTest.test('BoundariesTest', function () {

@@ -1,13 +0,12 @@

import { assert, UnitTest } from '@ephox/bedrock';
import { Assert, UnitTest } from '@ephox/bedrock-client';
import * as Arrays from 'ephox/polaris/api/Arrays';
UnitTest.test('api.Arrays.sliceby', function () {
import * as fc from 'fast-check';
import { Testable } from '@ephox/dispute';
var tArray = Testable.tArray, tNumber = Testable.tNumber;
var is = function (a) { return function (b) { return a === b; }; };
UnitTest.test('sliceby: unit tests', function () {
var check = function (expected, input, pred) {
var actual = Arrays.sliceby(input, pred);
assert.eq(expected, actual);
Assert.eq('sliceby', expected, actual, tArray(tNumber));
};
var is = function (value) {
return function (x) {
return x === value;
};
};
check([], [], is(0));

@@ -18,2 +17,8 @@ check([], [1], is(1));

});
UnitTest.test('sliceby: property tests', function () {
fc.assert(fc.property(fc.array(fc.nat()), fc.array(fc.nat()), function (a1, a2) {
var input = a1.concat([-1]).concat(a2);
Assert.eq('sliceby', a1, Arrays.sliceby(input, is(-1)), tArray(tNumber));
}));
});
//# sourceMappingURL=ArraySliceTest.js.map

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

import { assert, UnitTest } from '@ephox/bedrock';
import { assert, UnitTest } from '@ephox/bedrock-client';
import { Fun } from '@ephox/katamari';

@@ -3,0 +3,0 @@ import * as Arrays from 'ephox/polaris/api/Arrays';

@@ -1,5 +0,6 @@

import { assert, UnitTest } from '@ephox/bedrock';
import { UnitTest } from '@ephox/bedrock-client';
import { Option } from '@ephox/katamari';
import * as PositionArray from 'ephox/polaris/api/PositionArray';
import * as Parrays from 'ephox/polaris/test/Parrays';
import { KAssert } from '@ephox/katamari-assertions';
UnitTest.test('api.PositionArray.find', function () {

@@ -12,7 +13,3 @@ var check = function (expected, input, value) {

var actual = PositionArray.find(parray, pred);
expected.fold(function () {
assert.eq(true, actual.isNone());
}, function (v) {
assert.eq(v, actual.getOrDie('getting nothing, expected: ' + v).item());
});
KAssert.eqOption('eq', expected, actual.map(function (x) { return x.item(); }));
};

@@ -19,0 +16,0 @@ check(Option.none(), [], null);

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

import { assert, UnitTest } from '@ephox/bedrock';
import { assert, UnitTest } from '@ephox/bedrock-client';
import { Arr, Fun, Option } from '@ephox/katamari';

@@ -3,0 +3,0 @@ import * as PositionArray from 'ephox/polaris/api/PositionArray';

@@ -1,5 +0,6 @@

import { assert, UnitTest } from '@ephox/bedrock';
import { UnitTest } from '@ephox/bedrock-client';
import { Option } from '@ephox/katamari';
import * as PositionArray from 'ephox/polaris/api/PositionArray';
import * as Parrays from 'ephox/polaris/test/Parrays';
import { KAssert } from '@ephox/katamari-assertions';
UnitTest.test('api.PositionArray.get', function () {

@@ -9,7 +10,3 @@ var check = function (expected, input, offset) {

var actual = PositionArray.get(parray, offset);
expected.fold(function () {
assert.eq(true, actual.isNone());
}, function (v) {
assert.eq(v, actual.getOrDie('getting nothing, expected: ' + v).item());
});
KAssert.eqOption('eq', expected, actual.map(function (x) { return x.item(); }));
};

@@ -16,0 +13,0 @@ check(Option.none(), [], 0);

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

import { assert, UnitTest } from '@ephox/bedrock';
import { assert, UnitTest } from '@ephox/bedrock-client';
import * as PositionArray from 'ephox/polaris/api/PositionArray';

@@ -3,0 +3,0 @@ import * as Strings from 'ephox/polaris/api/Strings';

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

import { assert, UnitTest } from '@ephox/bedrock';
import { assert, UnitTest } from '@ephox/bedrock-client';
import * as PositionArray from 'ephox/polaris/api/PositionArray';

@@ -3,0 +3,0 @@ import * as Parrays from 'ephox/polaris/test/Parrays';

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

import { assert, UnitTest } from '@ephox/bedrock';
import { assert, UnitTest } from '@ephox/bedrock-client';
import * as PositionArray from 'ephox/polaris/api/PositionArray';

@@ -3,0 +3,0 @@ import * as Parrays from 'ephox/polaris/test/Parrays';

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

import { assert, UnitTest } from '@ephox/bedrock';
import { assert, UnitTest } from '@ephox/bedrock-client';
import { Arr, Obj } from '@ephox/katamari';

@@ -3,0 +3,0 @@ import * as Regexes from 'ephox/polaris/api/Regexes';

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

import { assert, UnitTest } from '@ephox/bedrock';
import { assert, UnitTest } from '@ephox/bedrock-client';
import * as Sanitise from 'ephox/polaris/string/Sanitise';

@@ -3,0 +3,0 @@ UnitTest.test('api.Sanitise.css', function () {

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

import { assert, UnitTest } from '@ephox/bedrock';
import { assert, UnitTest } from '@ephox/bedrock-client';
import { Arr, Struct, Unicode } from '@ephox/katamari';

@@ -29,3 +29,3 @@ import * as Pattern from 'ephox/polaris/api/Pattern';

checkAll([[1, 7]], ' cattle', Pattern.unsafeword('cattle'));
checkAll([], Unicode.zeroWidth() + 'dog ', Pattern.safeword('dog'));
checkAll([], Unicode.zeroWidth + 'dog ', Pattern.safeword('dog'));
checkAll([[3, 7], [10, 14]], 'no it\'s i it\'s done.', Pattern.unsafetoken('it\'s'));

@@ -42,3 +42,3 @@ checkAll([[0, 12]], 'catastrophe\'', Pattern.unsafetoken('catastrophe\''));

checkAll([[1, 4], [5, 8], [9, 12]], ' sre sre sre ', Pattern.unsafeword('sre'));
checkAll([['this '.length, 'this e'.length + Unicode.zeroWidth().length + 'nds'.length]], 'this e' + Unicode.zeroWidth() + 'nds here', Pattern.unsafeword('e' + Unicode.zeroWidth() + 'nds'));
checkAll([['this '.length, 'this e'.length + Unicode.zeroWidth.length + 'nds'.length]], 'this e' + Unicode.zeroWidth + 'nds here', Pattern.unsafeword('e' + Unicode.zeroWidth + 'nds'));
var prefix = Safe.sanitise('[');

@@ -45,0 +45,0 @@ var suffix = Safe.sanitise(']');

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

import { assert, UnitTest } from '@ephox/bedrock';
import { assert, UnitTest } from '@ephox/bedrock-client';
import * as Strings from 'ephox/polaris/api/Strings';

@@ -3,0 +3,0 @@ UnitTest.test('api.Strings.splits', function () {

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

import { UnitTest, assert } from '@ephox/bedrock';
import { UnitTest, assert } from '@ephox/bedrock-client';
import { Arr } from '@ephox/katamari';

@@ -3,0 +3,0 @@ import { getWords } from 'ephox/polaris/words/Words';

import { Arr } from '@ephox/katamari';
import * as Chars from 'ephox/polaris/pattern/Chars';
import { UnitTest, assert } from '@ephox/bedrock';
import { UnitTest, assert } from '@ephox/bedrock-client';
UnitTest.test('CharsTest', function () {

@@ -5,0 +5,0 @@ var supported = ['fr', 'en_au', 'pt', 'it', 'nl', 'en_uk', 'pt_pt', 'de', 'nb', 'en_br', 'sv', 'da', 'en', 'es', 'en_gb', 'fi', 'en_us'];

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

import { assert, UnitTest } from '@ephox/bedrock';
import { assert, UnitTest } from '@ephox/bedrock-client';
import * as StringMapper from 'ephox/polaris/words/StringMapper';

@@ -3,0 +3,0 @@ import * as UnicodeData from 'ephox/polaris/words/UnicodeData';

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

import { assert, UnitTest } from '@ephox/bedrock';
import { assert, UnitTest } from '@ephox/bedrock-client';
import * as StringMapper from 'ephox/polaris/words/StringMapper';

@@ -3,0 +3,0 @@ import * as WordBoundary from 'ephox/polaris/words/WordBoundary';

{
"name": "@ephox/polaris",
"description": "This project does data manipulation on arrays and strings.",
"version": "3.0.43",
"version": "3.0.46",
"repository": {

@@ -22,5 +22,8 @@ "type": "git",

"@ephox/dom-globals": "^1.1.2",
"@ephox/katamari": "^4.0.5",
"@ephox/katamari": "^5.0.1",
"tslib": "^1.9.3"
},
"devDependencies": {
"@ephox/katamari-assertions": "^1.0.3"
},
"scripts": {

@@ -36,3 +39,3 @@ "prepublishOnly": "tsc -b",

"types": "./lib/main/ts/ephox/polaris/api/Main.d.ts",
"gitHead": "1d030b7b604a9a4d8c0037dd4774735b479e5ece"
"gitHead": "b04ad5648f3c8966f97de00ee5c0dedff199b4a1"
}

@@ -11,3 +11,3 @@ import { Unicode, Fun } from '@ephox/katamari';

// \u2018 and \u2019 are the smart quote characters
const charsStr = '\\w' + '\'' + '\\-' + '\\u0100-\\u017F\\u00C0-\\u00FF' + Unicode.zeroWidth() + '\\u2018\\u2019';
const charsStr = '\\w' + '\'' + '\\-' + '\\u0100-\\u017F\\u00C0-\\u00FF' + Unicode.zeroWidth + '\\u2018\\u2019';
const wordbreakStr = '[^' + charsStr + ']';

@@ -24,2 +24,2 @@ const wordcharStr = '[' + charsStr + ']';

wordchar
};
};
import { CharacterMap, classify } from './StringMapper';
import * as UnicodeData from './UnicodeData';
import { isWordBoundary } from './WordBoundary';
import { Unicode } from '@ephox/katamari';

@@ -93,3 +94,3 @@ const EMPTY_STRING = UnicodeData.EMPTY_STRING;

const ch = extract(chars[i]);
if (ch !== '\ufeff') {
if (ch !== Unicode.zeroWidth) {
filteredChars.push(chars[i]);

@@ -106,2 +107,2 @@ extractedChars.push(ch);

getWords
};
};

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

import { assert, UnitTest } from '@ephox/bedrock';
import { assert, UnitTest } from '@ephox/bedrock-client';
import * as Boundaries from 'ephox/polaris/array/Boundaries';

@@ -3,0 +3,0 @@

@@ -1,20 +0,36 @@

import { assert, UnitTest } from '@ephox/bedrock';
import { Assert, UnitTest } from '@ephox/bedrock-client';
import * as Arrays from 'ephox/polaris/api/Arrays';
import * as fc from 'fast-check';
import { Testable } from '@ephox/dispute';
UnitTest.test('api.Arrays.sliceby', function () {
const { tArray, tNumber } = Testable;
const is = <T> (a: T) => (b: T) => a === b;
UnitTest.test('sliceby: unit tests', function () {
const check = function (expected: number[], input: number[], pred: (x: number, i: number) => boolean) {
const actual = Arrays.sliceby(input, pred);
assert.eq(expected, actual);
Assert.eq('sliceby', expected, actual, tArray(tNumber));
};
const is = function (value: number) {
return function (x: number) {
return x === value;
};
};
check([], [], is(0));
check([], [1], is(1));
check([1], [1, 2], is(2));
check([1, 2, 3], [1, 2, 3, 4], is(4));
});
check([ ], [ ], is(0));
check([ ], [ 1 ], is(1));
check([ 1 ], [ 1, 2 ], is(2));
check([ 1, 2, 3 ], [1, 2, 3, 4 ], is(4));
UnitTest.test('sliceby: property tests', function () {
fc.assert(fc.property(
fc.array(fc.nat()),
fc.array(fc.nat()),
(a1, a2) => {
const input = a1.concat([-1]).concat(a2);
Assert.eq('sliceby',
a1,
Arrays.sliceby(input, is(-1)),
tArray(tNumber)
);
}));
});

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

import { assert, UnitTest } from '@ephox/bedrock';
import { assert, UnitTest } from '@ephox/bedrock-client';
import { Fun } from '@ephox/katamari';

@@ -3,0 +3,0 @@ import * as Arrays from 'ephox/polaris/api/Arrays';

@@ -1,5 +0,6 @@

import { assert, UnitTest } from '@ephox/bedrock';
import { UnitTest } from '@ephox/bedrock-client';
import { Option } from '@ephox/katamari';
import * as PositionArray from 'ephox/polaris/api/PositionArray';
import * as Parrays from 'ephox/polaris/test/Parrays';
import { KAssert } from '@ephox/katamari-assertions';

@@ -14,7 +15,3 @@ UnitTest.test('api.PositionArray.find', function () {

const actual = PositionArray.find(parray, pred);
expected.fold(function () {
assert.eq(true, actual.isNone());
}, function (v) {
assert.eq(v, actual.getOrDie('getting nothing, expected: ' + v).item());
});
KAssert.eqOption('eq', expected, actual.map((x) => x.item()));
};

@@ -21,0 +18,0 @@

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

import { assert, UnitTest } from '@ephox/bedrock';
import { assert, UnitTest } from '@ephox/bedrock-client';
import { Arr, Fun, Option } from '@ephox/katamari';

@@ -3,0 +3,0 @@ import * as PositionArray from 'ephox/polaris/api/PositionArray';

@@ -1,5 +0,6 @@

import { assert, UnitTest } from '@ephox/bedrock';
import { UnitTest } from '@ephox/bedrock-client';
import { Option } from '@ephox/katamari';
import * as PositionArray from 'ephox/polaris/api/PositionArray';
import * as Parrays from 'ephox/polaris/test/Parrays';
import { KAssert } from '@ephox/katamari-assertions';

@@ -10,7 +11,3 @@ UnitTest.test('api.PositionArray.get', function () {

const actual = PositionArray.get(parray, offset);
expected.fold(function () {
assert.eq(true, actual.isNone());
}, function (v) {
assert.eq(v, actual.getOrDie('getting nothing, expected: ' + v).item());
});
KAssert.eqOption('eq', expected, actual.map((x) => x.item()));
};

@@ -17,0 +14,0 @@

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

import { assert, UnitTest } from '@ephox/bedrock';
import { assert, UnitTest } from '@ephox/bedrock-client';
import * as PositionArray from 'ephox/polaris/api/PositionArray';

@@ -3,0 +3,0 @@ import * as Strings from 'ephox/polaris/api/Strings';

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

import { assert, UnitTest } from '@ephox/bedrock';
import { assert, UnitTest } from '@ephox/bedrock-client';
import * as PositionArray from 'ephox/polaris/api/PositionArray';

@@ -3,0 +3,0 @@ import * as Parrays from 'ephox/polaris/test/Parrays';

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

import { assert, UnitTest } from '@ephox/bedrock';
import { assert, UnitTest } from '@ephox/bedrock-client';
import * as PositionArray from 'ephox/polaris/api/PositionArray';

@@ -3,0 +3,0 @@ import * as Parrays from 'ephox/polaris/test/Parrays';

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

import { assert, UnitTest } from '@ephox/bedrock';
import { assert, UnitTest } from '@ephox/bedrock-client';
import { Arr, Obj } from '@ephox/katamari';

@@ -3,0 +3,0 @@ import * as Regexes from 'ephox/polaris/api/Regexes';

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

import { assert, UnitTest } from '@ephox/bedrock';
import { assert, UnitTest } from '@ephox/bedrock-client';
import * as Sanitise from 'ephox/polaris/string/Sanitise';

@@ -3,0 +3,0 @@

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

import { assert, UnitTest } from '@ephox/bedrock';
import { assert, UnitTest } from '@ephox/bedrock-client';
import { Arr, Struct, Unicode } from '@ephox/katamari';

@@ -33,3 +33,3 @@ import * as Pattern from 'ephox/polaris/api/Pattern';

checkAll([[1, 7]], ' cattle', Pattern.unsafeword('cattle'));
checkAll([], Unicode.zeroWidth() + 'dog ', Pattern.safeword('dog'));
checkAll([], Unicode.zeroWidth + 'dog ', Pattern.safeword('dog'));

@@ -49,3 +49,3 @@ checkAll([[3, 7], [10, 14]], 'no it\'s i it\'s done.', Pattern.unsafetoken('it\'s'));

checkAll([['this '.length, 'this e'.length + Unicode.zeroWidth().length + 'nds'.length]], 'this e' + Unicode.zeroWidth() + 'nds here', Pattern.unsafeword('e' + Unicode.zeroWidth() + 'nds'));
checkAll([['this '.length, 'this e'.length + Unicode.zeroWidth.length + 'nds'.length]], 'this e' + Unicode.zeroWidth + 'nds here', Pattern.unsafeword('e' + Unicode.zeroWidth + 'nds'));

@@ -52,0 +52,0 @@ const prefix = Safe.sanitise('[');

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

import { assert, UnitTest } from '@ephox/bedrock';
import { assert, UnitTest } from '@ephox/bedrock-client';
import * as Strings from 'ephox/polaris/api/Strings';

@@ -3,0 +3,0 @@

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

import { UnitTest, assert } from '@ephox/bedrock';
import { UnitTest, assert } from '@ephox/bedrock-client';
import { Arr } from '@ephox/katamari';

@@ -3,0 +3,0 @@ import { getWords, WordOptions } from 'ephox/polaris/words/Words';

import { Arr } from '@ephox/katamari';
import * as Chars from 'ephox/polaris/pattern/Chars';
import { UnitTest, assert } from '@ephox/bedrock';
import { UnitTest, assert } from '@ephox/bedrock-client';

@@ -5,0 +5,0 @@ UnitTest.test('CharsTest', function () {

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

import { assert, UnitTest } from '@ephox/bedrock';
import { assert, UnitTest } from '@ephox/bedrock-client';
import * as StringMapper from 'ephox/polaris/words/StringMapper';

@@ -3,0 +3,0 @@ import * as UnicodeData from 'ephox/polaris/words/UnicodeData';

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

import { assert, UnitTest } from '@ephox/bedrock';
import { assert, UnitTest } from '@ephox/bedrock-client';
import * as StringMapper from 'ephox/polaris/words/StringMapper';

@@ -3,0 +3,0 @@ import * as WordBoundary from 'ephox/polaris/words/WordBoundary';

@@ -18,7 +18,8 @@ {

"src/main/ts",
"src/test/ts",
"src/test/ts"
],
"references": [
{ "path": "../katamari" },
{ "path": "../katamari-assertions" }
]
}

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

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