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

@ngneat/bind-query-params

Package Overview
Dependencies
Maintainers
3
Versions
27
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@ngneat/bind-query-params - npm Package Compare versions

Comparing version 3.0.0 to 3.0.1

2

bundles/ngneat-bind-query-params.umd.js

@@ -324,3 +324,3 @@ (function (global, factory) {

case 'array':
return !value.length;
return !value || !value.length;
case 'object':

@@ -327,0 +327,0 @@ return !value || !Object.keys(value).length;

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

!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("@angular/core"),require("@angular/router"),require("rxjs"),require("rxjs/operators"),require("lodash.set")):"function"==typeof define&&define.amd?define("@ngneat/bind-query-params",["exports","@angular/core","@angular/router","rxjs","rxjs/operators","lodash.set"],t):t(((e="undefined"!=typeof globalThis?globalThis:e||self).ngneat=e.ngneat||{},e.ngneat["bind-query-params"]={}),e.ng.core,e.ng.router,e.rxjs,e.rxjs.operators,e.set)}(this,(function(e,t,r,n,o,i){"use strict";function a(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var u=a(i),s=new t.InjectionToken("BIND_QUERY_PARAMS_OPTIONS",{providedIn:"root",factory:function(){return{windowRef:window}}});Object.create;function c(e){var t="function"==typeof Symbol&&Symbol.iterator,r=t&&e[t],n=0;if(r)return r.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function f(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,o,i=r.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(n=i.next()).done;)a.push(n.value)}catch(e){o={error:e}}finally{try{n&&!n.done&&(r=i.return)&&r.call(i)}finally{if(o)throw o.error}}return a}Object.create;function p(e){var t=y(e),r={};return t.forEach((function(e){var t,n=e.def,o=e.value;t=n.removeEmptyValue&&function(e,t){switch(e.type){case"array":return!t.length;case"object":return!t||!Object.keys(t).length;case"string":return!t||""===t;default:return!1}}(n,o)?null:n.serialize(o),r[n.queryKey]=t})),r}function y(e){return Array.isArray(e)?e:[e]}var l=function(){function e(e){this.config=e}return Object.defineProperty(e.prototype,"queryKey",{get:function(){return this.config.queryKey},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"path",{get:function(){return this.config.path||this.queryKey},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"type",{get:function(){return this.config.type||"string"},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"strategy",{get:function(){return this.config.strategy||"twoWay"},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"parser",{get:function(){return this.config.parser},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"serializer",{get:function(){return this.config.serializer},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"syncInitialValue",{get:function(){return this.config.syncInitialValue||!1},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"removeEmptyValue",{get:function(){return void 0===this.config.removeEmptyValue||this.config.removeEmptyValue},enumerable:!1,configurable:!0}),e.prototype.serialize=function(e){if(this.serializer)return this.serializer(e);if(null==e||""===e)return null;var t=e.toString();return"[object Object]"===t?JSON.stringify(e):t},e.prototype.parse=function(e){return this.parser?this.parser(e):function(e,t){switch(t){case"string":return e;case"boolean":return"false"!==e&&!!e;case"array":return null==e?void 0:e.split(",");case"number":return+e;case"object":return JSON.parse(e);default:return e}}(e,this.type)},e}(),h=function(){function e(e,t,r,o){this.router=e,this.activeRoute=t,this.options=o,this.$destroy=new n.Subject,this.defsSynced={},this.defs=y(r).map((function(e){return new l(e)}))}return e.prototype.connect=function(e){return this.group=e,this.onInit(),this},e.prototype.onInit=function(){var e=this;this.updateControl(this.defs,{emitEvent:!0},d);var t=this.defs.map((function(t){var r=e.group.get(t.path);return r.valueChanges.pipe(d(t)?o.startWith(r.value):n.identity,o.map((function(e){return{def:t,value:e}})))})),r=[];n.merge.apply(void 0,function(){for(var e=[],t=0;t<arguments.length;t++)e=e.concat(f(arguments[t]));return e}(t)).pipe(o.map((function(e){return r.push(e)})),o.auditTime(0),o.takeUntil(this.$destroy)).subscribe((function(){e.updateQueryParams(p(r)),r=[]}));var i=this.defs.filter((function(e){return"twoWay"===e.strategy}));i.length&&this.activeRoute.queryParams.pipe(o.pairwise(),o.takeUntil(this.$destroy)).subscribe((function(t){var r=f(t,2),n=r[0],o=r[1],a=i.filter((function(e){var t=e.queryKey;return n[t]!==o[t]}));a.length&&e.updateControl(a,{emitEvent:!0})}))},e.prototype.destroy=function(){this.$destroy.next()},e.prototype.getDef=function(e){return this.defs.find((function(t){return t.queryKey===e}))},e.prototype.parse=function(e){var t,r,n={};try{for(var o=c(Object.entries(e)),i=o.next();!i.done;i=o.next()){var a=f(i.value,2),u=a[0],s=a[1],p=this.getDef(u);p&&(n[u]=p.parse(s))}}catch(e){t={error:e}}finally{try{i&&!i.done&&(r=o.return)&&r.call(o)}finally{if(t)throw t.error}}return n},e.prototype.syncAllDefs=function(e){void 0===e&&(e={emitEvent:!0});var t=this.defs.map((function(e){return e.queryKey}));this.syncDefs(t,e)},e.prototype.syncDefs=function(e,t){var r=this;void 0===t&&(t={emitEvent:!0});var n=[];y(e).forEach((function(e){if(!r.defsSynced[e]){r.defsSynced[e]=!0;var t=r.getDef(e);t&&n.push(t)}})),n.length&&this.updateControl(n,t)},e.prototype.paramExists=function(e){return new URLSearchParams(this.options.windowRef.location.search).has(e)},e.prototype.someParamExists=function(){var e=this;return this.defs.some((function(t){return new URLSearchParams(e.options.windowRef.location.search).has(t.queryKey)}))},e.prototype.updateQueryParams=function(e){this.router.navigate([],{queryParams:e,queryParamsHandling:"merge",replaceUrl:!0})},e.prototype.updateControl=function(e,t,r){var n,o;void 0===r&&(r=function(e){return!0});var i=new URLSearchParams(this.options.windowRef.location.search),a={};try{for(var s=c(e),f=s.next();!f.done;f=s.next()){var p=f.value;if(r(p)){var y=p.queryKey,l=i.get(y);if(!l)continue;u.default(a,p.path.split("."),p.parse(l))}}}catch(e){n={error:e}}finally{try{f&&!f.done&&(o=s.return)&&o.call(s)}finally{if(n)throw n.error}}Object.keys(a).length&&this.group.patchValue(a,t)},e}();function d(e){return"twoWay"===e.strategy||e.syncInitialValue}var g=function(){function e(e,t,r){this.router=e,this.activeRoute=t,this.options=r}return e.prototype.create=function(e){return new h(this.router,this.activeRoute,e,this.options)},e}();g.ɵprov=t.ɵɵdefineInjectable({factory:function(){return new g(t.ɵɵinject(r.Router),t.ɵɵinject(r.ActivatedRoute),t.ɵɵinject(s))},token:g,providedIn:"root"}),g.decorators=[{type:t.Injectable,args:[{providedIn:"root"}]}],g.ctorParameters=function(){return[{type:r.Router},{type:r.ActivatedRoute},{type:void 0,decorators:[{type:t.Inject,args:[s]}]}]},e.BIND_QUERY_PARAMS_OPTIONS=s,e.BindQueryParamsFactory=g,Object.defineProperty(e,"__esModule",{value:!0})}));
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("@angular/core"),require("@angular/router"),require("rxjs"),require("rxjs/operators"),require("lodash.set")):"function"==typeof define&&define.amd?define("@ngneat/bind-query-params",["exports","@angular/core","@angular/router","rxjs","rxjs/operators","lodash.set"],t):t(((e="undefined"!=typeof globalThis?globalThis:e||self).ngneat=e.ngneat||{},e.ngneat["bind-query-params"]={}),e.ng.core,e.ng.router,e.rxjs,e.rxjs.operators,e.set)}(this,(function(e,t,r,n,o,i){"use strict";function a(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var u=a(i),s=new t.InjectionToken("BIND_QUERY_PARAMS_OPTIONS",{providedIn:"root",factory:function(){return{windowRef:window}}});Object.create;function c(e){var t="function"==typeof Symbol&&Symbol.iterator,r=t&&e[t],n=0;if(r)return r.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function f(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,o,i=r.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(n=i.next()).done;)a.push(n.value)}catch(e){o={error:e}}finally{try{n&&!n.done&&(r=i.return)&&r.call(i)}finally{if(o)throw o.error}}return a}Object.create;function p(e){var t=y(e),r={};return t.forEach((function(e){var t,n=e.def,o=e.value;t=n.removeEmptyValue&&function(e,t){switch(e.type){case"array":return!t||!t.length;case"object":return!t||!Object.keys(t).length;case"string":return!t||""===t;default:return!1}}(n,o)?null:n.serialize(o),r[n.queryKey]=t})),r}function y(e){return Array.isArray(e)?e:[e]}var l=function(){function e(e){this.config=e}return Object.defineProperty(e.prototype,"queryKey",{get:function(){return this.config.queryKey},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"path",{get:function(){return this.config.path||this.queryKey},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"type",{get:function(){return this.config.type||"string"},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"strategy",{get:function(){return this.config.strategy||"twoWay"},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"parser",{get:function(){return this.config.parser},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"serializer",{get:function(){return this.config.serializer},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"syncInitialValue",{get:function(){return this.config.syncInitialValue||!1},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"removeEmptyValue",{get:function(){return void 0===this.config.removeEmptyValue||this.config.removeEmptyValue},enumerable:!1,configurable:!0}),e.prototype.serialize=function(e){if(this.serializer)return this.serializer(e);if(null==e||""===e)return null;var t=e.toString();return"[object Object]"===t?JSON.stringify(e):t},e.prototype.parse=function(e){return this.parser?this.parser(e):function(e,t){switch(t){case"string":return e;case"boolean":return"false"!==e&&!!e;case"array":return null==e?void 0:e.split(",");case"number":return+e;case"object":return JSON.parse(e);default:return e}}(e,this.type)},e}(),h=function(){function e(e,t,r,o){this.router=e,this.activeRoute=t,this.options=o,this.$destroy=new n.Subject,this.defsSynced={},this.defs=y(r).map((function(e){return new l(e)}))}return e.prototype.connect=function(e){return this.group=e,this.onInit(),this},e.prototype.onInit=function(){var e=this;this.updateControl(this.defs,{emitEvent:!0},d);var t=this.defs.map((function(t){var r=e.group.get(t.path);return r.valueChanges.pipe(d(t)?o.startWith(r.value):n.identity,o.map((function(e){return{def:t,value:e}})))})),r=[];n.merge.apply(void 0,function(){for(var e=[],t=0;t<arguments.length;t++)e=e.concat(f(arguments[t]));return e}(t)).pipe(o.map((function(e){return r.push(e)})),o.auditTime(0),o.takeUntil(this.$destroy)).subscribe((function(){e.updateQueryParams(p(r)),r=[]}));var i=this.defs.filter((function(e){return"twoWay"===e.strategy}));i.length&&this.activeRoute.queryParams.pipe(o.pairwise(),o.takeUntil(this.$destroy)).subscribe((function(t){var r=f(t,2),n=r[0],o=r[1],a=i.filter((function(e){var t=e.queryKey;return n[t]!==o[t]}));a.length&&e.updateControl(a,{emitEvent:!0})}))},e.prototype.destroy=function(){this.$destroy.next()},e.prototype.getDef=function(e){return this.defs.find((function(t){return t.queryKey===e}))},e.prototype.parse=function(e){var t,r,n={};try{for(var o=c(Object.entries(e)),i=o.next();!i.done;i=o.next()){var a=f(i.value,2),u=a[0],s=a[1],p=this.getDef(u);p&&(n[u]=p.parse(s))}}catch(e){t={error:e}}finally{try{i&&!i.done&&(r=o.return)&&r.call(o)}finally{if(t)throw t.error}}return n},e.prototype.syncAllDefs=function(e){void 0===e&&(e={emitEvent:!0});var t=this.defs.map((function(e){return e.queryKey}));this.syncDefs(t,e)},e.prototype.syncDefs=function(e,t){var r=this;void 0===t&&(t={emitEvent:!0});var n=[];y(e).forEach((function(e){if(!r.defsSynced[e]){r.defsSynced[e]=!0;var t=r.getDef(e);t&&n.push(t)}})),n.length&&this.updateControl(n,t)},e.prototype.paramExists=function(e){return new URLSearchParams(this.options.windowRef.location.search).has(e)},e.prototype.someParamExists=function(){var e=this;return this.defs.some((function(t){return new URLSearchParams(e.options.windowRef.location.search).has(t.queryKey)}))},e.prototype.updateQueryParams=function(e){this.router.navigate([],{queryParams:e,queryParamsHandling:"merge",replaceUrl:!0})},e.prototype.updateControl=function(e,t,r){var n,o;void 0===r&&(r=function(e){return!0});var i=new URLSearchParams(this.options.windowRef.location.search),a={};try{for(var s=c(e),f=s.next();!f.done;f=s.next()){var p=f.value;if(r(p)){var y=p.queryKey,l=i.get(y);if(!l)continue;u.default(a,p.path.split("."),p.parse(l))}}}catch(e){n={error:e}}finally{try{f&&!f.done&&(o=s.return)&&o.call(s)}finally{if(n)throw n.error}}Object.keys(a).length&&this.group.patchValue(a,t)},e}();function d(e){return"twoWay"===e.strategy||e.syncInitialValue}var g=function(){function e(e,t,r){this.router=e,this.activeRoute=t,this.options=r}return e.prototype.create=function(e){return new h(this.router,this.activeRoute,e,this.options)},e}();g.ɵprov=t.ɵɵdefineInjectable({factory:function(){return new g(t.ɵɵinject(r.Router),t.ɵɵinject(r.ActivatedRoute),t.ɵɵinject(s))},token:g,providedIn:"root"}),g.decorators=[{type:t.Injectable,args:[{providedIn:"root"}]}],g.ctorParameters=function(){return[{type:r.Router},{type:r.ActivatedRoute},{type:void 0,decorators:[{type:t.Inject,args:[s]}]}]},e.BIND_QUERY_PARAMS_OPTIONS=s,e.BindQueryParamsFactory=g,Object.defineProperty(e,"__esModule",{value:!0})}));
//# sourceMappingURL=ngneat-bind-query-params.umd.min.js.map
function isEmptyValue(def, value) {
switch (def.type) {
case 'array':
return !value.length;
return !value || !value.length;
case 'object':

@@ -60,2 +60,2 @@ return !value || !Object.keys(value).length;

}
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidXRpbHMuanMiLCJzb3VyY2VSb290IjoiLi4vLi4vLi4vLi4vcHJvamVjdHMvbmduZWF0L2JpbmQtcXVlcnktcGFyYW1zL3NyYy8iLCJzb3VyY2VzIjpbImxpYi91dGlscy50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VmLCB2YWx1ZSkgPyBudWxsIDogZGVmLnNlcmlhbGl6ZSh2YWx1ZSk7XG4gICAgfSBlbHNlIHtcbiAgICAgIGRlZlZhbHVlID0gZGVmLnNlcmlhbGl6ZSh2YWx1ZSk7XG4gICAgfVxuXG4gICAgcmVzdWx0W2RlZi5xdWVyeUtleV0gPSBkZWZWYWx1ZTtcbiAgfSk7XG5cbiAgcmV0dXJuIHJlc3VsdDtcbn1cblxuZXhwb3J0IGZ1bmN0aW9uIGNvZXJjZUFycmF5PFQ+KHZhbHVlOiBUIHwgVFtdKTogVFtdIHtcbiAgcmV0dXJuIEFycmF5LmlzQXJyYXkodmFsdWUpID8gdmFsdWUgOiBbdmFsdWVdO1xufVxuXG5leHBvcnQgZnVuY3Rpb24gZGVmc1RvUGFyYW1zKGRlZnM6IFF1ZXJ5UGFyYW1EZWZbXSwgZ3JvdXA6IEFic3RyYWN0Q29udHJvbCkge1xuICByZXR1cm4gZGVmcy5tYXAoKGRlZikgPT4ge1xuICAgIHJldHVybiB7XG4gICAgICBxdWVyeUtleTogZGVmLnF1ZXJ5S2V5LFxuICAgICAgdmFsdWU6IGdyb3VwLmdldChkZWYucGF0aCkhLnZhbHVlLFxuICAgIH07XG4gIH0pO1xufVxuIl19

@@ -19,3 +19,3 @@ import { InjectionToken, ɵɵdefineInjectable, ɵɵinject, Injectable, Inject } from '@angular/core';

case 'array':
return !value.length;
return !value || !value.length;
case 'object':

@@ -22,0 +22,0 @@ return !value || !Object.keys(value).length;

{
"name": "@ngneat/bind-query-params",
"version": "3.0.0",
"version": "3.0.1",
"description": "Sync URL Query Params with Angular Form Controls",

@@ -5,0 +5,0 @@ "dependencies": {

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