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

@matchlighter/common_library

Package Overview
Dependencies
Maintainers
1
Versions
76
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@matchlighter/common_library - npm Package Compare versions

Comparing version 1.2.2 to 1.2.3

lib/components/shadowed_scroll/index.js

6

lib/sync_observable.d.ts
declare const syncedObservableSymbol: unique symbol;
declare type FilterFunc = (path: string, object: any) => boolean;
declare type FilterSelector = string | string[] | FilterFunc;
export interface SyncedObservableOptions {

@@ -8,3 +10,3 @@ /**

*/
refs?: string[];
refs?: FilterSelector;
/**

@@ -15,3 +17,3 @@ * Accepts a list of JSONPath patterns.

*/
exclude?: string[];
exclude?: FilterSelector;
}

@@ -18,0 +20,0 @@ declare class SyncedObservable<T> {

@@ -66,4 +66,4 @@ import { observable } from 'mobx';

deepSyncInternal(target, obj, {
refPaths: buildPathSets(obj, options.refs),
excludePaths: buildPathSets(obj, options.exclude),
refPaths: normalizeFilter(options.refs, obj),
excludePaths: normalizeFilter(options.exclude, obj),
currentPath: ['$'],

@@ -77,5 +77,5 @@ });

const currentPathSpec = JSONPath.stringify(currentPath);
if (options.excludePaths.has(currentPathSpec))
if (options.excludePaths(currentPathSpec, v))
continue;
if (options.refPaths.has(currentPathSpec) || typeof v != 'object') {
if (options.refPaths(currentPathSpec, v) || typeof v != 'object') {
target[k] = v;

@@ -109,2 +109,10 @@ }

}
function normalizeFilter(spec, obj) {
if (typeof spec == 'function')
return spec;
if (typeof spec == 'string')
spec = [spec];
const pathset = buildPathSets(obj, spec);
return (path, obj) => pathset.has(path);
}
function buildPathSets(obj, paths) {

@@ -111,0 +119,0 @@ const pathSet = new Set();

{
"name": "@matchlighter/common_library",
"version": "1.2.2",
"version": "1.2.3",
"description": "Shared Functions, Helpers, Patterns & Utilities for Apps and Libraries",

@@ -26,3 +26,3 @@ "author": "Matchlighter",

"test": "jest",
"build": "tsc",
"build": "node ./scripts/clean_build.js && tsc",
"prepublishOnly": "npm run-script build"

@@ -47,2 +47,3 @@ },

"@types/react": "^16.9.2",
"fs-extra": "^8.1.0",
"jest": "^24.9.0",

@@ -49,0 +50,0 @@ "jsonpath": "^1.0.2",

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