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

light-observable

Package Overview
Dependencies
Maintainers
1
Versions
32
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

light-observable - npm Package Compare versions

Comparing version 1.5.0 to 1.6.0

2

.size-limit.js

@@ -5,3 +5,3 @@ module.exports = [

path: './es/Observable.js',
limit: '822B'
limit: '1078B'
},

@@ -8,0 +8,0 @@ {

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

import $$observable from 'symbol-observable';
import { enqueue } from './helpers/enqueue';
import { getSymbol } from './helpers/symbols';
import { ObservableSubscription } from './ObservableSubscription';

@@ -39,4 +39,4 @@ const fromArray = (arrayLike) => {

}
if (ish[getSymbol('observable')]) {
const observable = ish[getSymbol('observable')]();
if (ish[$$observable]) {
const observable = ish[$$observable]();
if (Object(observable) !== observable) {

@@ -50,4 +50,4 @@ throw new TypeError(error);

}
if (ish[getSymbol('iterator')]) {
return new C(fromArray(ish[getSymbol('iterator')]()));
if (Symbol.iterator && ish[Symbol.iterator]) {
return new C(fromArray(ish[Symbol.iterator]()));
}

@@ -75,3 +75,3 @@ // For old browsers that doesn't support @@iterator

}
[getSymbol('observable')]() {
[$$observable]() {
return this;

@@ -78,0 +78,0 @@ }

@@ -5,2 +5,38 @@ 'use strict';

function symbolObservablePonyfill(root) {
var result;
var Symbol = root.Symbol;
if (typeof Symbol === 'function') {
if (Symbol.observable) {
result = Symbol.observable;
} else {
result = Symbol('observable');
Symbol.observable = result;
}
} else {
result = '@@observable';
}
return result;
}
/* global window */
var root;
if (typeof self !== 'undefined') {
root = self;
} else if (typeof window !== 'undefined') {
root = window;
} else if (typeof global !== 'undefined') {
root = global;
} else if (typeof module !== 'undefined') {
root = module;
} else {
root = Function('return this')();
}
var result = symbolObservablePonyfill(root);
function enqueue(fn) {

@@ -11,6 +47,2 @@ // tslint:disable-next-line no-floating-promises

const getSymbol = (name) => {
return (typeof Symbol === 'function' && Symbol[name]) || '@@' + name;
};
function cleanupSubscription(subscription) {

@@ -189,4 +221,4 @@ const disposer = subscription._disposer;

}
if (ish[getSymbol('observable')]) {
const observable = ish[getSymbol('observable')]();
if (ish[result]) {
const observable = ish[result]();
if (Object(observable) !== observable) {

@@ -200,4 +232,4 @@ throw new TypeError(error);

}
if (ish[getSymbol('iterator')]) {
return new C(fromArray(ish[getSymbol('iterator')]()));
if (Symbol.iterator && ish[Symbol.iterator]) {
return new C(fromArray(ish[Symbol.iterator]()));
}

@@ -225,3 +257,3 @@ // For old browsers that doesn't support @@iterator

}
[getSymbol('observable')]() {
[result]() {
return this;

@@ -228,0 +260,0 @@ }

{
"name": "light-observable",
"version": "1.5.0",
"version": "1.6.0",
"description": "Light observable ponyfill",

@@ -16,3 +16,3 @@ "main": "lib/index.js",

"test:lint": "tslint -t verbose './src/**/*.ts' './src/**/*.tsx' -p ./tsconfig.json -c ./tslint.json",
"test:jest": "jest --runInBand --coverage --coverageReporters=text-lcov | coveralls",
"test:jest": "jest",
"precommit": "lint-staged",

@@ -84,2 +84,3 @@ "prepush": "npm run test",

"lint-staged": "^7.2.0",
"most": "^1.7.3",
"observable-operators": "^1.7.3",

@@ -106,3 +107,6 @@ "prettier": "^1.13.6",

}
},
"dependencies": {
"symbol-observable": "^1.2.0"
}
}

@@ -10,3 +10,3 @@ # Light Observable

* **Standard**: fully compatible with the [Observable Proposal](https://github.com/tc39/proposal-observable).
* **Tiny**: Observable itself is only [822 bytes in gzip](.size-limit.js).
* **Tiny**: Observable itself is only [1078 bytes in gzip](.size-limit.js) (including [symbol-observable](https://github.com/benlesh/symbol-observable) package).
* **Type-safe**: written in typescript.

@@ -70,2 +70,7 @@ * **Reliable**: 100% code coverage.

## Notice on interoperability
RxJS doesn't use 'symbol-observable' polyfill. This may cause some weird issues with interop depending on the import order. It is recommended to install and import `symbol-observable` polyfill before RxJS.
See an [issue](https://github.com/benlesh/symbol-observable/issues/38) for details.
## License

@@ -72,0 +77,0 @@ ```

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