Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Socket
Sign inDemoInstall

lib0

Package Overview
Dependencies
Maintainers
1
Versions
113
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

lib0 - npm Package Compare versions

Comparing version 0.2.21 to 0.2.22

6

array.d.ts
export function last<L>(arr: L[]): L;
export function create<T_1>(): T[];
export function copy<T_1>(a: T[]): T[];
export function create<C>(): C[];
export function copy<D>(a: D[]): D[];
export function appendTo<M>(dest: M[], src: M[]): void;

@@ -20,4 +20,4 @@ /**

export function every<ITEM>(arr: ITEM[], f: (arg0: ITEM, arg1: number, arg2: ITEM[]) => boolean): boolean;
export function some<T_1>(arr: T[], f: (arg0: T, arg1: number, arg2: T[]) => boolean): boolean;
export function some<S>(arr: S[], f: (arg0: S, arg1: number, arg2: S[]) => boolean): boolean;
export function equalFlat<ELEM>(a: ELEM[], b: ELEM[]): boolean;
//# sourceMappingURL=array.d.ts.map

@@ -17,13 +17,13 @@ /**

/**
* @template T
* @return {Array<T>}
* @template C
* @return {Array<C>}
*/
export const create = () => []
export const create = () => /** @type {Array<C>} */ ([])
/**
* @template T
* @param {Array<T>} a
* @return {Array<T>}
* @template D
* @param {Array<D>} a
* @return {Array<D>}
*/
export const copy = a => a.slice()
export const copy = a => /** @type {Array<D>} */ (a.slice())

@@ -69,6 +69,5 @@ /**

* @function
* @template T
*
* @param {Array<T>} arr
* @param {function(T, number, Array<T>):boolean} f
* @template S
* @param {Array<S>} arr
* @param {function(S, number, Array<S>):boolean} f
* @return {boolean}

@@ -75,0 +74,0 @@ */

@@ -33,2 +33,5 @@ /* eslint-env browser */

/**
* @todo rename to lib0-component-upgradet before next major release
*/
const upgradedEventName = 'upgraded'

@@ -252,3 +255,3 @@

this.state = state
if (this._init && (state !== prevState || forceStateUpdates)) {
if (this._init && (!func.equalityFlat(state, prevState) || forceStateUpdates)) {
// fill slots

@@ -255,0 +258,0 @@ if (state) {

@@ -61,2 +61,2 @@ /**

*/
export const equalityFlat = (a, b) => a.constructor === b.constructor && ((a instanceof Array && array.equalFlat(a, /** @type {Array<T>} */ (b))) || object.equalFlat(a, b))
export const equalityFlat = (a, b) => a === b || (a != null && b != null && a.constructor === b.constructor && ((a instanceof Array && array.equalFlat(a, /** @type {Array<T>} */ (b))) || (typeof a === 'object' && object.equalFlat(a, b))))
{
"name": "lib0",
"version": "0.2.21",
"version": "0.2.22",
"description": "",

@@ -27,3 +27,3 @@ "sideEffects": false,

"clean": "rm -rf dist *.d.ts */*.d.ts *.d.ts.map */*.d.ts.map",
"types": "tsc --outDir .",
"types": "npm run clean && tsc --outDir .",
"dist": "npm run clean && rollup -c",

@@ -30,0 +30,0 @@ "debug": "rollup -c && concurrently 'rollup -wc' 'http-server -o test.html'",

@@ -57,4 +57,4 @@

<dd><p>Return the last element of an array. The element must exist</p></dd>
<b><code>array.create(): Array&lt;T&gt;</code></b><br>
<b><code>array.copy(a: Array&lt;T&gt;): Array&lt;T&gt;</code></b><br>
<b><code>array.create(): Array&lt;C&gt;</code></b><br>
<b><code>array.copy(a: Array&lt;D&gt;): Array&lt;D&gt;</code></b><br>
<b><code>array.appendTo(dest: Array&lt;M&gt;, src: Array&lt;M&gt;)</code></b><br>

@@ -66,3 +66,3 @@ <dd><p>Append elements from src to dest</p></dd>

<dd><p>True iff condition holds on every element in the Array.</p></dd>
<b><code>array.some(arr: Array&lt;T&gt;, f: function(T, number, Array&lt;T&gt;):boolean): boolean</code></b><br>
<b><code>array.some(arr: Array&lt;S&gt;, f: function(S, number, Array&lt;S&gt;):boolean): boolean</code></b><br>
<dd><p>True iff condition holds on some element in the Array.</p></dd>

@@ -69,0 +69,0 @@ <b><code>array.equalFlat(a: Array&lt;ELEM&gt;, b: Array&lt;ELEM&gt;): boolean</code></b><br>

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