ngx-cookie-service 2.0.0 → 2.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2017 7leads GmbH
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md CHANGED
@@ -57,6 +57,12 @@ export class AppComponent implements OnInit {
57
57
 
58
58
  That's it!
59
59
 
60
+ # What to do now?
61
+
62
+ * Run `npm run test` to run the tests for the cookie service (located in the `demo-app` folder)
63
+ * Have a look at and play around with the `demo-app` to get to know the cookie service with `npm run start` (open `http://localhost:4200/` in your favourite browser)
64
+ * If you do not want to install this via [NPM](http://npmjs.com/), you can run `npm run compile` and use the `*.d.ts` and `*.js` files in the `dist-lib` folder
65
+
60
66
  # Methods
61
67
 
62
68
  ## check( name: string ): boolean;
@@ -83,7 +89,7 @@ const allCookies: {} = cookieService.getAll();
83
89
 
84
90
  Returns a map of key-value pairs for cookies that can be accessed.
85
91
 
86
- ## set( name: string, value: string, expires?: number | Date, path?: string, domain?: string, secure?: boolean ): void;
92
+ ## set( name: string, value: string, expires?: number | Date, path?: string, domain?: string, secure?: boolean, sameSite?: 'Lax' | 'Strict' ): void;
87
93
 
88
94
  ```typescript
89
95
  cookieService.set( 'test', 'Hello World' );
@@ -111,15 +117,71 @@ cookieService.deleteAll();
111
117
 
112
118
  Deletes all cookies that can currently be accessed. It is best practice to always define a path. If you are unsure about the path value, use `'/'`.
113
119
 
114
- # FAQ & Troubleshooting
120
+ # FAQ
121
+
122
+ ## General tips
123
+
124
+ Checking out the following resources usually solves most of the problems people seem to have with this cookie service:
125
+
126
+ * [article about cookies in general @MDN](https://developer.mozilla.org/en-US/docs/Web/HTTP/Cookies) (recommended read!)
127
+ * [common localhost problems @StackOverflow](https://stackoverflow.com/questions/1134290/cookies-on-localhost-with-explicit-domain)
128
+ * [problems with secure cookies @StackOverflow](https://stackoverflow.com/questions/8064318/how-to-read-a-secure-cookie-using-javascript)
129
+ * [how do browser cookie domains work? @StackOverflow](https://stackoverflow.com/questions/1062963/how-do-browser-cookie-domains-work)
130
+ * [get cookies from different paths](https://github.com/7leads/ngx-cookie-service/issues/7#issuecomment-351321518)
131
+
132
+ The following general steps are usually very helpful when debugging problems with this cookie service or cookies in general:
133
+
134
+ * check out if there are any [open](https://github.com/7leads/ngx-cookie-service/issues) or [closed](https://github.com/7leads/ngx-cookie-service/issues?q=is%3Aissue+is%3Aclosed) issues that answer your question
135
+ * check out the actual value(s) of `document.cookie`
136
+ * does it work if you use `document.cookie` manually (i.e. in a console of your choice)?
137
+ * set explicit paths for your cookies
138
+ * [explain to your local rubber duck why your code should work and why it (probably) does not](https://en.wikipedia.org/wiki/Rubber_duck_debugging)
139
+
140
+ # I am always getting a "token missing" or "no provider" error.
141
+
142
+ Package managers are a well known source of frustration. If you have "token missing" or "no provider" errors, a simple re-installation of your node modules might suffice:
143
+
144
+ ```
145
+ rm -rf node_modules
146
+ yarn # or `npm install`
147
+ ```
115
148
 
116
- Are you having any trouble with your integration or cookies in general? Check out our [FAQ](https://github.com/7leads/ngx-cookie-service#faq), maybe it will save you some headache.
149
+ ## I have a problem with framework X or library Y. What can I do?
150
+
151
+ Please be aware that we cannot help you with problems that are out of scope. For example, we cannot debug a Symfony or Springboot application for you. In that case, you are better off asking the nice folks over at [StackOverflow](https://stackoverflow.com/) for help.
152
+
153
+ ## Do you support Angular Universal?
154
+
155
+ There is an [issue](https://github.com/7leads/ngx-cookie-service/issues/1) for that. Check out [this comment](https://github.com/7leads/ngx-cookie-service/issues/1#issuecomment-361150174) for more information about future support.
156
+
157
+ # Opening issues
158
+
159
+ Please make sure to check out our FAQ before you open a new issue. Also, try to give us as much information as you can when you open an issue. Maybe you can even supply a test environment or test cases, if necessary?
160
+
161
+ # Contributing
162
+
163
+ We are happy to accept pull requests or test cases for things that do not work. Feel free to submit one of those.
164
+
165
+ However, we will only accept pull requests that pass all tests and include some new ones (as long as it makes sense to add them, of course).
166
+
167
+ * [Open a new pull request](https://github.com/7leads/ngx-cookie-service/compare)
117
168
 
118
169
  # Author
119
170
 
120
171
  This cookie service is brought to you by [7leads GmbH](http://www.7leads.org/). We built it for one of our apps, because the other cookie packages we found were either not designed "the Angular way" or caused trouble during AOT compilation.
121
172
 
122
- Check out the [GitHub page](https://github.com/7leads/ngx-cookie-service) for more.
173
+ # Contributors
174
+
175
+ Thanks to all contributors:
176
+
177
+ * [paroe](https://github.com/paroe)
178
+ * [CunningFatalist](https://github.com/CunningFatalist)
179
+ * [kthy](https://github.com/kthy)
180
+ * [JaredClemence](https://github.com/JaredClemence)
181
+ * [flakolefluk](https://github.com/flakolefluk)
182
+ * [mattbanks](https://github.com/mattbanks)
183
+ * [DBaker85](https://github.com/DBaker85)
184
+ * [mattlewis92](https://github.com/mattlewis92)
123
185
 
124
186
  # License
125
187
 
@@ -0,0 +1,159 @@
1
+ (function (global, factory) {
2
+ typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@angular/core'), require('@angular/common')) :
3
+ typeof define === 'function' && define.amd ? define(['exports', '@angular/core', '@angular/common'], factory) :
4
+ (factory((global['ngx-cookie-service'] = {}),global.ng.core,global.ng.common));
5
+ }(this, (function (exports,core,common) { 'use strict';
6
+
7
+ // This service is based on the `ng2-cookies` package which sadly is not a service and does
8
+ // not use `DOCUMENT` injection and therefore doesn't work well with AoT production builds.
9
+ // Package: https://github.com/BCJTI/ng2-cookies
10
+ var CookieService = (function () {
11
+ /**
12
+ * @param {?} document
13
+ * @param {?} platformId
14
+ */
15
+ function CookieService(document, platformId) {
16
+ this.document = document;
17
+ this.platformId = platformId;
18
+ this.documentIsAccessible = common.isPlatformBrowser(this.platformId);
19
+ }
20
+ /**
21
+ * @param {?} name Cookie name
22
+ * @return {?}
23
+ */
24
+ CookieService.prototype.check = function (name) {
25
+ if (!this.documentIsAccessible) {
26
+ return false;
27
+ }
28
+ name = encodeURIComponent(name);
29
+ var /** @type {?} */ regExp = this.getCookieRegExp(name);
30
+ var /** @type {?} */ exists = regExp.test(this.document.cookie);
31
+ return exists;
32
+ };
33
+ /**
34
+ * @param {?} name Cookie name
35
+ * @return {?}
36
+ */
37
+ CookieService.prototype.get = function (name) {
38
+ if (this.documentIsAccessible && this.check(name)) {
39
+ name = encodeURIComponent(name);
40
+ var /** @type {?} */ regExp = this.getCookieRegExp(name);
41
+ var /** @type {?} */ result = regExp.exec(this.document.cookie);
42
+ return decodeURIComponent(result[1]);
43
+ }
44
+ else {
45
+ return '';
46
+ }
47
+ };
48
+ /**
49
+ * @return {?}
50
+ */
51
+ CookieService.prototype.getAll = function () {
52
+ if (!this.documentIsAccessible) {
53
+ return {};
54
+ }
55
+ var /** @type {?} */ cookies = {};
56
+ var /** @type {?} */ document = this.document;
57
+ if (document.cookie && document.cookie !== '') {
58
+ var /** @type {?} */ split = document.cookie.split(';');
59
+ for (var /** @type {?} */ i = 0; i < split.length; i += 1) {
60
+ var /** @type {?} */ currentCookie = split[i].split('=');
61
+ currentCookie[0] = currentCookie[0].replace(/^ /, '');
62
+ cookies[decodeURIComponent(currentCookie[0])] = decodeURIComponent(currentCookie[1]);
63
+ }
64
+ }
65
+ return cookies;
66
+ };
67
+ /**
68
+ * @param {?} name Cookie name
69
+ * @param {?} value Cookie value
70
+ * @param {?=} expires Number of days until the cookies expires or an actual `Date`
71
+ * @param {?=} path Cookie path
72
+ * @param {?=} domain Cookie domain
73
+ * @param {?=} secure Secure flag
74
+ * @param {?=} sameSite OWASP samesite token `Lax` or `Strict`
75
+ * @return {?}
76
+ */
77
+ CookieService.prototype.set = function (name, value, expires, path, domain, secure, sameSite) {
78
+ if (!this.documentIsAccessible) {
79
+ return;
80
+ }
81
+ var /** @type {?} */ cookieString = encodeURIComponent(name) + '=' + encodeURIComponent(value) + ';';
82
+ if (expires) {
83
+ if (typeof expires === 'number') {
84
+ var /** @type {?} */ dateExpires = new Date(new Date().getTime() + expires * 1000 * 60 * 60 * 24);
85
+ cookieString += 'expires=' + dateExpires.toUTCString() + ';';
86
+ }
87
+ else {
88
+ cookieString += 'expires=' + expires.toUTCString() + ';';
89
+ }
90
+ }
91
+ if (path) {
92
+ cookieString += 'path=' + path + ';';
93
+ }
94
+ if (domain) {
95
+ cookieString += 'domain=' + domain + ';';
96
+ }
97
+ if (secure) {
98
+ cookieString += 'secure;';
99
+ }
100
+ if (sameSite) {
101
+ cookieString += 'sameSite=' + sameSite + ';';
102
+ }
103
+ this.document.cookie = cookieString;
104
+ };
105
+ /**
106
+ * @param {?} name Cookie name
107
+ * @param {?=} path Cookie path
108
+ * @param {?=} domain Cookie domain
109
+ * @return {?}
110
+ */
111
+ CookieService.prototype.delete = function (name, path, domain) {
112
+ if (!this.documentIsAccessible) {
113
+ return;
114
+ }
115
+ this.set(name, '', new Date('Thu, 01 Jan 1970 00:00:01 GMT'), path, domain);
116
+ };
117
+ /**
118
+ * @param {?=} path Cookie path
119
+ * @param {?=} domain Cookie domain
120
+ * @return {?}
121
+ */
122
+ CookieService.prototype.deleteAll = function (path, domain) {
123
+ if (!this.documentIsAccessible) {
124
+ return;
125
+ }
126
+ var /** @type {?} */ cookies = this.getAll();
127
+ for (var /** @type {?} */ cookieName in cookies) {
128
+ if (cookies.hasOwnProperty(cookieName)) {
129
+ this.delete(cookieName, path, domain);
130
+ }
131
+ }
132
+ };
133
+ /**
134
+ * @param {?} name Cookie name
135
+ * @return {?}
136
+ */
137
+ CookieService.prototype.getCookieRegExp = function (name) {
138
+ var /** @type {?} */ escapedName = name.replace(/([\[\]\{\}\(\)\|\=\;\+\?\,\.\*\^\$])/ig, '\\$1');
139
+ return new RegExp('(?:^' + escapedName + '|;\\s*' + escapedName + ')=(.*?)(?:;|$)', 'g');
140
+ };
141
+ return CookieService;
142
+ }());
143
+ CookieService.decorators = [
144
+ { type: core.Injectable },
145
+ ];
146
+ /**
147
+ * @nocollapse
148
+ */
149
+ CookieService.ctorParameters = function () { return [
150
+ { type: undefined, decorators: [{ type: core.Inject, args: [common.DOCUMENT,] },] },
151
+ { type: core.InjectionToken, decorators: [{ type: core.Inject, args: [core.PLATFORM_ID,] },] },
152
+ ]; };
153
+
154
+ exports.CookieService = CookieService;
155
+
156
+ Object.defineProperty(exports, '__esModule', { value: true });
157
+
158
+ })));
159
+ //# sourceMappingURL=ngx-cookie-service.umd.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ngx-cookie-service.umd.js","sources":["~/ngx-cookie-service/lib/cookie-service/cookie.service.ts"],"sourcesContent":["// This service is based on the `ng2-cookies` package which sadly is not a service and does\n// not use `DOCUMENT` injection and therefore doesn't work well with AoT production builds.\n// Package: https://github.com/BCJTI/ng2-cookies\n\n\nimport { Injectable, Inject, PLATFORM_ID, InjectionToken } from '@angular/core';\nimport { DOCUMENT, isPlatformBrowser } from '@angular/common';\nexport class CookieService {\nprivate readonly documentIsAccessible: boolean;\n/**\n * @param {?} document\n * @param {?} platformId\n */\nconstructor(\nprivate document: any,\nprivate platformId: InjectionToken<Object>,\n ) {\n this.documentIsAccessible = isPlatformBrowser( this.platformId );\n }\n/**\n * @param {?} name Cookie name\n * @return {?}\n */\ncheck( name: string ): boolean {\n if ( !this.documentIsAccessible ) {\n return false;\n }\n\n name = encodeURIComponent( name );\n\n const /** @type {?} */ regExp: RegExp = this.getCookieRegExp( name );\n const /** @type {?} */ exists: boolean = regExp.test( this.document.cookie );\n\n return exists;\n }\n/**\n * @param {?} name Cookie name\n * @return {?}\n */\nget( name: string ): string {\n if ( this.documentIsAccessible && this.check( name ) ) {\n name = encodeURIComponent( name );\n\n const /** @type {?} */ regExp: RegExp = this.getCookieRegExp( name );\n const /** @type {?} */ result: RegExpExecArray = regExp.exec( this.document.cookie );\n\n return decodeURIComponent( result[ 1 ] );\n } else {\n return '';\n }\n }\n/**\n * @return {?}\n */\ngetAll(): {} {\n if ( !this.documentIsAccessible ) {\n return {};\n }\n\n const /** @type {?} */ cookies: {} = {};\n const /** @type {?} */ document: any = this.document;\n\n if ( document.cookie && document.cookie !== '' ) {\n const /** @type {?} */ split: Array<string> = document.cookie.split(';');\n\n for ( let /** @type {?} */ i = 0; i < split.length; i += 1 ) {\n const /** @type {?} */ currentCookie: Array<string> = split[ i ].split('=');\n\n currentCookie[ 0 ] = currentCookie[ 0 ].replace( /^ /, '' );\n cookies[ decodeURIComponent( currentCookie[ 0 ] ) ] = decodeURIComponent( currentCookie[ 1 ] );\n }\n }\n\n return cookies;\n }\n/**\n * @param {?} name Cookie name\n * @param {?} value Cookie value\n * @param {?=} expires Number of days until the cookies expires or an actual `Date`\n * @param {?=} path Cookie path\n * @param {?=} domain Cookie domain\n * @param {?=} secure Secure flag\n * @param {?=} sameSite OWASP samesite token `Lax` or `Strict`\n * @return {?}\n */\nset(\n name: string,\n value: string,\n expires?: number | Date,\n path?: string,\n domain?: string,\n secure?: boolean,\n sameSite?: 'Lax' | 'Strict'\n ): void {\n if ( !this.documentIsAccessible ) {\n return;\n }\n\n let /** @type {?} */ cookieString: string = encodeURIComponent( name ) + '=' + encodeURIComponent( value ) + ';';\n\n if ( expires ) {\n if ( typeof expires === 'number' ) {\n const /** @type {?} */ dateExpires: Date = new Date( new Date().getTime() + expires * 1000 * 60 * 60 * 24 );\n\n cookieString += 'expires=' + dateExpires.toUTCString() + ';';\n } else {\n cookieString += 'expires=' + expires.toUTCString() + ';';\n }\n }\n\n if ( path ) {\n cookieString += 'path=' + path + ';';\n }\n\n if ( domain ) {\n cookieString += 'domain=' + domain + ';';\n }\n\n if ( secure ) {\n cookieString += 'secure;';\n }\n\n if ( sameSite ) {\n cookieString += 'sameSite=' + sameSite + ';';\n }\n\n this.document.cookie = cookieString;\n }\n/**\n * @param {?} name Cookie name\n * @param {?=} path Cookie path\n * @param {?=} domain Cookie domain\n * @return {?}\n */\ndelete( name: string, path?: string, domain?: string ): void {\n if ( !this.documentIsAccessible ) {\n return;\n }\n\n this.set( name, '', new Date('Thu, 01 Jan 1970 00:00:01 GMT'), path, domain );\n }\n/**\n * @param {?=} path Cookie path\n * @param {?=} domain Cookie domain\n * @return {?}\n */\ndeleteAll( path?: string, domain?: string ): void {\n if ( !this.documentIsAccessible ) {\n return;\n }\n\n const /** @type {?} */ cookies: any = this.getAll();\n\n for ( const /** @type {?} */ cookieName in cookies ) {\n if ( cookies.hasOwnProperty( cookieName ) ) {\n this.delete( cookieName, path, domain );\n }\n }\n }\n/**\n * @param {?} name Cookie name\n * @return {?}\n */\nprivate getCookieRegExp( name: string ): RegExp {\n const /** @type {?} */ escapedName: string = name.replace( /([\\[\\]\\{\\}\\(\\)\\|\\=\\;\\+\\?\\,\\.\\*\\^\\$])/ig, '\\\\$1' );\n\n return new RegExp( '(?:^' + escapedName + '|;\\\\s*' + escapedName + ')=(.*?)(?:;|$)', 'g' );\n }\nstatic decorators: DecoratorInvocation[] = [\n{ type: Injectable },\n];\n/**\n * @nocollapse\n */\nstatic ctorParameters: () => ({type: any, decorators?: DecoratorInvocation[]}|null)[] = () => [\n{type: undefined, decorators: [{ type: Inject, args: [DOCUMENT, ] }, ]},\n{type: InjectionToken, decorators: [{ type: Inject, args: [PLATFORM_ID, ] }, ]},\n];\n}\n\nfunction CookieService_tsickle_Closure_declarations() {\n/** @type {?} */\nCookieService.decorators;\n/**\n * @nocollapse\n * @type {?}\n */\nCookieService.ctorParameters;\n/** @type {?} */\nCookieService.prototype.documentIsAccessible;\n/** @type {?} */\nCookieService.prototype.document;\n/** @type {?} */\nCookieService.prototype.platformId;\n}\n\n\ninterface DecoratorInvocation {\n type: Function;\n args?: any[];\n}\n"],"names":["InjectionToken","Inject","PLATFORM_ID","DOCUMENT","Injectable","isPlatformBrowser"],"mappings":";;;;;;AAAA;;;AAKA,IAAA,aAAA,IAAA,YAAA;;;;;IAQA,SAAA,aAAA,CAGa,QAAU,EAEV,UAAkC,EAL/C;QAGa,IAAb,CAAA,QAAa,GAAA,QAAA,CAAU;QAEV,IAAb,CAAA,UAAa,GAAA,UAAA,CAAkC;QAD3C,IAAI,CAAC,oBAAoB,GAAGK,wBAAiB,CAAE,IAAI,CAAC,UAAU,CAAE,CAAC;KAClE;;;;;IAKH,aAAA,CAAA,SAAA,CAAA,KAIG,GAJH,UAIG,IAAA,EAJH;QACI,IAIK,CAAA,IAAE,CAAI,oBAAqB,EAAE;YAHhC,OAIO,KAAA,CAAM;SAHd;QAED,IAAI,GAIG,kBAAA,CAAoB,IAAA,CAAK,CAAE;QAFlC,qBAIM,MAAA,GAAiB,IAAA,CAAK,eAAC,CAAgB,IAAA,CAAK,CAAE;QAHpD,qBAIM,MAAA,GAAkB,MAAA,CAAO,IAAC,CAAK,IAAA,CAAK,QAAC,CAAQ,MAAC,CAAM,CAAE;QAF5D,OAIO,MAAA,CAAO;KAHf,CAAH;;;;;IAKA,aAAA,CAAA,SAAA,CAAA,GAKG,GALH,UAKG,IAAA,EALH;QACI,IAKK,IAAA,CAAK,oBAAC,IAAuB,IAAA,CAAK,KAAC,CAAM,IAAA,CAAO,EAAE;YAJr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0 +1,2 @@
1
+ !function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("@angular/core"),require("@angular/common")):"function"==typeof define&&define.amd?define(["exports","@angular/core","@angular/common"],t):t(e["ngx-cookie-service"]={},e.ng.core,e.ng.common)}(this,function(e,t,o){"use strict";var n=(i.prototype.check=function(e){return!!this.documentIsAccessible&&(e=encodeURIComponent(e),this.getCookieRegExp(e).test(this.document.cookie))},i.prototype.get=function(e){if(this.documentIsAccessible&&this.check(e)){e=encodeURIComponent(e);var t=this.getCookieRegExp(e).exec(this.document.cookie);return decodeURIComponent(t[1])}return""},i.prototype.getAll=function(){if(!this.documentIsAccessible)return{};var e={},t=this.document;if(t.cookie&&""!==t.cookie)for(var o=t.cookie.split(";"),n=0;n<o.length;n+=1){var i=o[n].split("=");i[0]=i[0].replace(/^ /,""),e[decodeURIComponent(i[0])]=decodeURIComponent(i[1])}return e},i.prototype.set=function(e,t,o,n,i,c,r){if(this.documentIsAccessible){var s=encodeURIComponent(e)+"="+encodeURIComponent(t)+";";o&&(s+="number"==typeof o?"expires="+new Date((new Date).getTime()+1e3*o*60*60*24).toUTCString()+";":"expires="+o.toUTCString()+";"),n&&(s+="path="+n+";"),i&&(s+="domain="+i+";"),c&&(s+="secure;"),r&&(s+="sameSite="+r+";"),this.document.cookie=s}},i.prototype["delete"]=function(e,t,o){this.documentIsAccessible&&this.set(e,"",new Date("Thu, 01 Jan 1970 00:00:01 GMT"),t,o)},i.prototype.deleteAll=function(e,t){if(this.documentIsAccessible){var o=this.getAll();for(var n in o)o.hasOwnProperty(n)&&this["delete"](n,e,t)}},i.prototype.getCookieRegExp=function(e){var t=e.replace(/([\[\]\{\}\(\)\|\=\;\+\?\,\.\*\^\$])/gi,"\\$1");return new RegExp("(?:^"+t+"|;\\s*"+t+")=(.*?)(?:;|$)","g")},i);function i(e,t){this.document=e,this.platformId=t,this.documentIsAccessible=o.isPlatformBrowser(this.platformId)}n.decorators=[{type:t.Injectable}],n.ctorParameters=function(){return[{type:undefined,decorators:[{type:t.Inject,args:[o.DOCUMENT]}]},{type:t.InjectionToken,decorators:[{type:t.Inject,args:[t.PLATFORM_ID]}]}]},e.CookieService=n,Object.defineProperty(e,"__esModule",{value:!0})});
2
+ //# sourceMappingURL=ngx-cookie-service.umd.min.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ngx-cookie-service.umd.min.js","sources":["~/ngx-cookie-service/lib/cookie-service/cookie.service.ts"],"sourcesContent":["// This service is based on the `ng2-cookies` package which sadly is not a service and does\n// not use `DOCUMENT` injection and therefore doesn't work well with AoT production builds.\n// Package: https://github.com/BCJTI/ng2-cookies\n\nimport { Injectable, Inject, PLATFORM_ID, InjectionToken } from '@angular/core';\nimport { DOCUMENT, isPlatformBrowser } from '@angular/common';\n\n@Injectable()\nexport class CookieService {\n private readonly documentIsAccessible: boolean;\n\n constructor(\n // The type `Document` may not be used here. Although a fix is on its way,\n // we will go with `any` for now to support Angular 2.4.x projects.\n // Issue: https://github.com/angular/angular/issues/12631\n // Fix: https://github.com/angular/angular/pull/14894\n @Inject( DOCUMENT ) private document: any,\n // Get the `PLATFORM_ID` so we can check if we're in a browser.\n @Inject( PLATFORM_ID ) private platformId: InjectionToken<Object>,\n ) {\n this.documentIsAccessible = isPlatformBrowser( this.platformId );\n }\n\n /**\n * @param name Cookie name\n * @returns {boolean}\n */\n check( name: string ): boolean {\n if ( !this.documentIsAccessible ) {\n return false;\n }\n\n name = encodeURIComponent( name );\n\n const regExp: RegExp = this.getCookieRegExp( name );\n const exists: boolean = regExp.test( this.document.cookie );\n\n return exists;\n }\n\n /**\n * @param name Cookie name\n * @returns {any}\n */\n get( name: string ): string {\n if ( this.documentIsAccessible && this.check( name ) ) {\n name = encodeURIComponent( name );\n\n const regExp: RegExp = this.getCookieRegExp( name );\n const result: RegExpExecArray = regExp.exec( this.document.cookie );\n\n return decodeURIComponent( result[ 1 ] );\n } else {\n return '';\n }\n }\n\n /**\n * @returns {}\n */\n getAll(): {} {\n if ( !this.documentIsAccessible ) {\n return {};\n }\n\n const cookies: {} = {};\n const document: any = this.document;\n\n if ( document.cookie && document.cookie !== '' ) {\n const split: Array<string> = document.cookie.split(';');\n\n for ( let i = 0; i < split.length; i += 1 ) {\n const currentCookie: Array<string> = split[ i ].split('=');\n\n currentCookie[ 0 ] = currentCookie[ 0 ].replace( /^ /, '' );\n cookies[ decodeURIComponent( currentCookie[ 0 ] ) ] = decodeURIComponent( currentCookie[ 1 ] );\n }\n }\n\n return cookies;\n }\n\n /**\n * @param name Cookie name\n * @param value Cookie value\n * @param expires Number of days until the cookies expires or an actual `Date`\n * @param path Cookie path\n * @param domain Cookie domain\n * @param secure Secure flag\n * @param sameSite OWASP samesite token `Lax` or `Strict`\n */\n set(\n name: string,\n value: string,\n expires?: number | Date,\n path?: string,\n domain?: string,\n secure?: boolean,\n sameSite?: 'Lax' | 'Strict'\n ): void {\n if ( !this.documentIsAccessible ) {\n return;\n }\n\n let cookieString: string = encodeURIComponent( name ) + '=' + encodeURIComponent( value ) + ';';\n\n if ( expires ) {\n if ( typeof expires === 'number' ) {\n const dateExpires: Date = new Date( new Date().getTime() + expires * 1000 * 60 * 60 * 24 );\n\n cookieString += 'expires=' + dateExpires.toUTCString() + ';';\n } else {\n cookieString += 'expires=' + expires.toUTCString() + ';';\n }\n }\n\n if ( path ) {\n cookieString += 'path=' + path + ';';\n }\n\n if ( domain ) {\n cookieString += 'domain=' + domain + ';';\n }\n\n if ( secure ) {\n cookieString += 'secure;';\n }\n\n if ( sameSite ) {\n cookieString += 'sameSite=' + sameSite + ';';\n }\n\n this.document.cookie = cookieString;\n }\n\n /**\n * @param name Cookie name\n * @param path Cookie path\n * @param domain Cookie domain\n */\n delete( name: string, path?: string, domain?: string ): void {\n if ( !this.documentIsAccessible ) {\n return;\n }\n\n this.set( name, '', new Date('Thu, 01 Jan 1970 00:00:01 GMT'), path, domain );\n }\n\n /**\n * @param path Cookie path\n * @param domain Cookie domain\n */\n deleteAll( path?: string, domain?: string ): void {\n if ( !this.documentIsAccessible ) {\n return;\n }\n\n const cookies: any = this.getAll();\n\n for ( const cookieName in cookies ) {\n if ( cookies.hasOwnProperty( cookieName ) ) {\n this.delete( cookieName, path, domain );\n }\n }\n }\n\n /**\n * @param name Cookie name\n * @returns {RegExp}\n */\n private getCookieRegExp( name: string ): RegExp {\n const escapedName: string = name.replace( /([\\[\\]\\{\\}\\(\\)\\|\\=\\;\\+\\?\\,\\.\\*\\^\\$])/ig, '\\\\$1' );\n\n return new RegExp( '(?:^' + escapedName + '|;\\\\s*' + escapedName + ')=(.*?)(?:;|$)', 'g' );\n }\n}\n"],"names":["CookieService","prototype","check","name","this","documentIsAccessible","encodeURIComponent","getCookieRegExp","test","document","cookie","get","result","exec","decodeURIComponent","getAll","cookies","split","i","length","currentCookie","replace","set","value","expires","path","domain","secure","sameSite","cookieString","Date","getTime","toUTCString","delete","deleteAll","cookieName","hasOwnProperty","escapedName","RegExp","platformId","isPlatformBrowser","decorators","type","Injectable","ctorParameters","undefined","Inject","args","DOCUMENT","InjectionToken","PLATFORM_ID"],"mappings":"wTAKA,IAAAA,GAkBAA,EAAAC,UAAAC,MAAA,SAIGC,GAHC,QAIKC,KAAMC,uBAAXF,EAIOG,mBAAoBH,GAEJC,KAAKG,gBAAiBJ,GACdK,KAAMJ,KAAKK,SAASC,UAIvDV,EAAAC,UAAAU,IAAA,SAKGR,GAJC,GAKKC,KAAKC,sBAAwBD,KAAKF,MAAOC,GAAS,CAJrDA,EAKOG,mBAAoBH,GAH3B,IAMMS,EADiBR,KAAKG,gBAAiBJ,GACNU,KAAMT,KAAKK,SAASC,QAH3D,OAKOI,mBAAoBF,EAAQ,IAHnC,MAKO,IACbZ,EAAAC,UAAAc,OAAA,WACI,IAMKX,KAAMC,qBALT,MAMO,GAHT,IAMMW,EAAc,GACdP,EAAgBL,KAAKK,SAJ3B,GAMKA,EAASC,QAA8B,KAApBD,EAASC,OAH/B,IAFA,IAMMO,EAAuBR,EAASC,OAAOO,MA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C,WAAaA,EADTnC,KAAKC,qBAAuBmC,EAAAA,kBAAmBpC,KAAKmC,YA8JjDvC,EAAPyC,WAA2C,CAN3C,CAOEC,KAAMC,EAAAA,aAGP3C,EAAD4C,eAAC,WAAA,MAAA,CAJD,CAACF,KAAMG,UAAWJ,WAAY,CAAC,CAAEC,KAAMI,EAAAA,OAAQC,KAAM,CAACC,EAAAA,aACtD,CAACN,KAAMO,EAAAA,eAAgBR,WAAY,CAAC,CAAEC,KAAMI,EAAAA,OAAQC,KAAM,CAACG,EAAAA"}
@@ -1,7 +1,9 @@
1
+ import { InjectionToken } from '@angular/core';
1
2
  export declare class CookieService {
2
3
  private document;
4
+ private platformId;
3
5
  private readonly documentIsAccessible;
4
- constructor(document: any);
6
+ constructor(document: any, platformId: InjectionToken<Object>);
5
7
  /**
6
8
  * @param name Cookie name
7
9
  * @returns {boolean}
@@ -17,14 +19,15 @@ export declare class CookieService {
17
19
  */
18
20
  getAll(): {};
19
21
  /**
20
- * @param name Cookie name
21
- * @param value Cookie value
22
- * @param expires Number of days until the cookies expires or an actual `Date`
23
- * @param path Cookie path
24
- * @param domain Cookie domain
25
- * @param secure Secure flag
22
+ * @param name Cookie name
23
+ * @param value Cookie value
24
+ * @param expires Number of days until the cookies expires or an actual `Date`
25
+ * @param path Cookie path
26
+ * @param domain Cookie domain
27
+ * @param secure Secure flag
28
+ * @param sameSite OWASP samesite token `Lax` or `Strict`
26
29
  */
27
- set(name: string, value: string, expires?: number | Date, path?: string, domain?: string, secure?: boolean): void;
30
+ set(name: string, value: string, expires?: number | Date, path?: string, domain?: string, secure?: boolean, sameSite?: 'Lax' | 'Strict'): void;
28
31
  /**
29
32
  * @param name Cookie name
30
33
  * @param path Cookie path
@@ -0,0 +1,4 @@
1
+ /* SystemJS module definition */
2
+ declare var module: {
3
+ id: string;
4
+ };
@@ -0,0 +1,4 @@
1
+ /**
2
+ * Generated bundle index. Do not edit.
3
+ */
4
+ export * from './index';
@@ -1,41 +1,40 @@
1
+ import { Inject, Injectable, InjectionToken, PLATFORM_ID } from '@angular/core';
2
+ import { DOCUMENT, isPlatformBrowser } from '@angular/common';
1
3
  // This service is based on the `ng2-cookies` package which sadly is not a service and does
2
4
  // not use `DOCUMENT` injection and therefore doesn't work well with AoT production builds.
3
5
  // Package: https://github.com/BCJTI/ng2-cookies
4
- import { Injectable, Inject } from '@angular/core';
5
- import { DOCUMENT } from '@angular/common';
6
6
  var CookieService = (function () {
7
- function CookieService(
8
- // The type `Document` may not be used here. Although a fix is on its way,
9
- // we will go with `any` for now to support Angular 2.4.x projects.
10
- // Issue: https://github.com/angular/angular/issues/12631
11
- // Fix: https://github.com/angular/angular/pull/14894
12
- document) {
7
+ /**
8
+ * @param {?} document
9
+ * @param {?} platformId
10
+ */
11
+ function CookieService(document, platformId) {
13
12
  this.document = document;
14
- // To avoid issues with server side prerendering, check if `document` is defined.
15
- this.documentIsAccessible = document !== undefined;
13
+ this.platformId = platformId;
14
+ this.documentIsAccessible = isPlatformBrowser(this.platformId);
16
15
  }
17
16
  /**
18
- * @param name Cookie name
19
- * @returns {boolean}
17
+ * @param {?} name Cookie name
18
+ * @return {?}
20
19
  */
21
20
  CookieService.prototype.check = function (name) {
22
21
  if (!this.documentIsAccessible) {
23
22
  return false;
24
23
  }
25
24
  name = encodeURIComponent(name);
26
- var regExp = this.getCookieRegExp(name);
27
- var exists = regExp.test(this.document.cookie);
25
+ var /** @type {?} */ regExp = this.getCookieRegExp(name);
26
+ var /** @type {?} */ exists = regExp.test(this.document.cookie);
28
27
  return exists;
29
28
  };
30
29
  /**
31
- * @param name Cookie name
32
- * @returns {any}
30
+ * @param {?} name Cookie name
31
+ * @return {?}
33
32
  */
34
33
  CookieService.prototype.get = function (name) {
35
34
  if (this.documentIsAccessible && this.check(name)) {
36
35
  name = encodeURIComponent(name);
37
- var regExp = this.getCookieRegExp(name);
38
- var result = regExp.exec(this.document.cookie);
36
+ var /** @type {?} */ regExp = this.getCookieRegExp(name);
37
+ var /** @type {?} */ result = regExp.exec(this.document.cookie);
39
38
  return decodeURIComponent(result[1]);
40
39
  }
41
40
  else {
@@ -43,18 +42,18 @@ var CookieService = (function () {
43
42
  }
44
43
  };
45
44
  /**
46
- * @returns {}
45
+ * @return {?}
47
46
  */
48
47
  CookieService.prototype.getAll = function () {
49
48
  if (!this.documentIsAccessible) {
50
49
  return {};
51
50
  }
52
- var cookies = {};
53
- var document = this.document;
51
+ var /** @type {?} */ cookies = {};
52
+ var /** @type {?} */ document = this.document;
54
53
  if (document.cookie && document.cookie !== '') {
55
- var split = document.cookie.split(';');
56
- for (var i = 0; i < split.length; i += 1) {
57
- var currentCookie = split[i].split('=');
54
+ var /** @type {?} */ split = document.cookie.split(';');
55
+ for (var /** @type {?} */ i = 0; i < split.length; i += 1) {
56
+ var /** @type {?} */ currentCookie = split[i].split('=');
58
57
  currentCookie[0] = currentCookie[0].replace(/^ /, '');
59
58
  cookies[decodeURIComponent(currentCookie[0])] = decodeURIComponent(currentCookie[1]);
60
59
  }
@@ -62,21 +61,23 @@ var CookieService = (function () {
62
61
  return cookies;
63
62
  };
64
63
  /**
65
- * @param name Cookie name
66
- * @param value Cookie value
67
- * @param expires Number of days until the cookies expires or an actual `Date`
68
- * @param path Cookie path
69
- * @param domain Cookie domain
70
- * @param secure Secure flag
64
+ * @param {?} name Cookie name
65
+ * @param {?} value Cookie value
66
+ * @param {?=} expires Number of days until the cookies expires or an actual `Date`
67
+ * @param {?=} path Cookie path
68
+ * @param {?=} domain Cookie domain
69
+ * @param {?=} secure Secure flag
70
+ * @param {?=} sameSite OWASP samesite token `Lax` or `Strict`
71
+ * @return {?}
71
72
  */
72
- CookieService.prototype.set = function (name, value, expires, path, domain, secure) {
73
+ CookieService.prototype.set = function (name, value, expires, path, domain, secure, sameSite) {
73
74
  if (!this.documentIsAccessible) {
74
75
  return;
75
76
  }
76
- var cookieString = encodeURIComponent(name) + '=' + encodeURIComponent(value) + ';';
77
+ var /** @type {?} */ cookieString = encodeURIComponent(name) + '=' + encodeURIComponent(value) + ';';
77
78
  if (expires) {
78
79
  if (typeof expires === 'number') {
79
- var dateExpires = new Date(new Date().getTime() + expires * 1000 * 60 * 60 * 24);
80
+ var /** @type {?} */ dateExpires = new Date(new Date().getTime() + expires * 1000 * 60 * 60 * 24);
80
81
  cookieString += 'expires=' + dateExpires.toUTCString() + ';';
81
82
  }
82
83
  else {
@@ -92,12 +93,16 @@ var CookieService = (function () {
92
93
  if (secure) {
93
94
  cookieString += 'secure;';
94
95
  }
96
+ if (sameSite) {
97
+ cookieString += 'sameSite=' + sameSite + ';';
98
+ }
95
99
  this.document.cookie = cookieString;
96
100
  };
97
101
  /**
98
- * @param name Cookie name
99
- * @param path Cookie path
100
- * @param domain Cookie domain
102
+ * @param {?} name Cookie name
103
+ * @param {?=} path Cookie path
104
+ * @param {?=} domain Cookie domain
105
+ * @return {?}
101
106
  */
102
107
  CookieService.prototype.delete = function (name, path, domain) {
103
108
  if (!this.documentIsAccessible) {
@@ -106,36 +111,43 @@ var CookieService = (function () {
106
111
  this.set(name, '', new Date('Thu, 01 Jan 1970 00:00:01 GMT'), path, domain);
107
112
  };
108
113
  /**
109
- * @param path Cookie path
110
- * @param domain Cookie domain
114
+ * @param {?=} path Cookie path
115
+ * @param {?=} domain Cookie domain
116
+ * @return {?}
111
117
  */
112
118
  CookieService.prototype.deleteAll = function (path, domain) {
113
119
  if (!this.documentIsAccessible) {
114
120
  return;
115
121
  }
116
- var cookies = this.getAll();
117
- for (var cookieName in cookies) {
122
+ var /** @type {?} */ cookies = this.getAll();
123
+ for (var /** @type {?} */ cookieName in cookies) {
118
124
  if (cookies.hasOwnProperty(cookieName)) {
119
125
  this.delete(cookieName, path, domain);
120
126
  }
121
127
  }
122
128
  };
123
129
  /**
124
- * @param name Cookie name
125
- * @returns {RegExp}
130
+ * @param {?} name Cookie name
131
+ * @return {?}
126
132
  */
127
133
  CookieService.prototype.getCookieRegExp = function (name) {
128
- var escapedName = name.replace(/([\[\]\{\}\(\)\|\=\;\+\?\,\.\*\^\$])/ig, '\\$1');
134
+ var /** @type {?} */ escapedName = name.replace(/([\[\]\{\}\(\)\|\=\;\+\?\,\.\*\^\$])/ig, '\\$1');
129
135
  return new RegExp('(?:^' + escapedName + '|;\\s*' + escapedName + ')=(.*?)(?:;|$)', 'g');
130
136
  };
131
137
  return CookieService;
132
138
  }());
133
- export { CookieService };
134
139
  CookieService.decorators = [
135
140
  { type: Injectable },
136
141
  ];
137
- /** @nocollapse */
142
+ /**
143
+ * @nocollapse
144
+ */
138
145
  CookieService.ctorParameters = function () { return [
139
146
  { type: undefined, decorators: [{ type: Inject, args: [DOCUMENT,] },] },
147
+ { type: InjectionToken, decorators: [{ type: Inject, args: [PLATFORM_ID,] },] },
140
148
  ]; };
141
- //# sourceMappingURL=cookie.service.js.map
149
+ /**
150
+ * Generated bundle index. Do not edit.
151
+ */
152
+ export { CookieService };
153
+ //# sourceMappingURL=ngx-cookie-service.es5.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ngx-cookie-service.es5.js","sources":["ts/lib/ngx-cookie-service.ts","ts/lib/cookie-service/cookie.service.ts"],"sourcesContent":["/**\n * Generated bundle index. Do not edit.\n */\n\nexport {CookieService} from './index';\n","// This service is based on the `ng2-cookies` package which sadly is not a service and does\n// not use `DOCUMENT` injection and therefore doesn't work well with AoT production builds.\n// Package: https://github.com/BCJTI/ng2-cookies\n\n\nimport { Injectable, Inject, PLATFORM_ID, InjectionToken } from '@angular/core';\nimport { DOCUMENT, isPlatformBrowser } from '@angular/common';\nexport class CookieService {\nprivate readonly documentIsAccessible: boolean;\n/**\n * @param {?} document\n * @param {?} platformId\n */\nconstructor(\nprivate document: any,\nprivate platformId: InjectionToken<Object>,\n ) {\n this.documentIsAccessible = isPlatformBrowser( this.platformId );\n }\n/**\n * @param {?} name Cookie name\n * @return {?}\n */\ncheck( name: string ): boolean {\n if ( !this.documentIsAccessible ) {\n return false;\n }\n\n name = encodeURIComponent( name );\n\n const /** @type {?} */ regExp: RegExp = this.getCookieRegExp( name );\n const /** @type {?} */ exists: boolean = regExp.test( this.document.cookie );\n\n return exists;\n }\n/**\n * @param {?} name Cookie name\n * @return {?}\n */\nget( name: string ): string {\n if ( this.documentIsAccessible && this.check( name ) ) {\n name = encodeURIComponent( name );\n\n const /** @type {?} */ regExp: RegExp = this.getCookieRegExp( name );\n const /** @type {?} */ result: RegExpExecArray = regExp.exec( this.document.cookie );\n\n return decodeURIComponent( result[ 1 ] );\n } else {\n return '';\n }\n }\n/**\n * @return {?}\n */\ngetAll(): {} {\n if ( !this.documentIsAccessible ) {\n return {};\n }\n\n const /** @type {?} */ cookies: {} = {};\n const /** @type {?} */ document: any = this.document;\n\n if ( document.cookie && document.cookie !== '' ) {\n const /** @type {?} */ split: Array<string> = document.cookie.split(';');\n\n for ( let /** @type {?} */ i = 0; i < split.length; i += 1 ) {\n const /** @type {?} */ currentCookie: Array<string> = split[ i ].split('=');\n\n currentCookie[ 0 ] = currentCookie[ 0 ].replace( /^ /, '' );\n cookies[ decodeURIComponent( currentCookie[ 0 ] ) ] = decodeURIComponent( currentCookie[ 1 ] );\n }\n }\n\n return cookies;\n }\n/**\n * @param {?} name Cookie name\n * @param {?} value Cookie value\n * @param {?=} expires Number of days until the cookies expires or an actual `Date`\n * @param {?=} path Cookie path\n * @param {?=} domain Cookie domain\n * @param {?=} secure Secure flag\n * @param {?=} sameSite OWASP samesite token `Lax` or `Strict`\n * @return {?}\n */\nset(\n name: string,\n value: string,\n expires?: number | Date,\n path?: string,\n domain?: string,\n secure?: boolean,\n sameSite?: 'Lax' | 'Strict'\n ): void {\n if ( !this.documentIsAccessible ) {\n return;\n }\n\n let /** @type {?} */ cookieString: string = encodeURIComponent( name ) + '=' + encodeURIComponent( value ) + ';';\n\n if ( expires ) {\n if ( typeof expires === 'number' ) {\n const /** @type {?} */ dateExpires: Date = new Date( new Date().getTime() + expires * 1000 * 60 * 60 * 24 );\n\n cookieString += 'expires=' + dateExpires.toUTCString() + ';';\n } else {\n cookieString += 'expires=' + expires.toUTCString() + ';';\n }\n }\n\n if ( path ) {\n cookieString += 'path=' + path + ';';\n }\n\n if ( domain ) {\n cookieString += 'domain=' + domain + ';';\n }\n\n if ( secure ) {\n cookieString += 'secure;';\n }\n\n if ( sameSite ) {\n cookieString += 'sameSite=' + sameSite + ';';\n }\n\n this.document.cookie = cookieString;\n }\n/**\n * @param {?} name Cookie name\n * @param {?=} path Cookie path\n * @param {?=} domain Cookie domain\n * @return {?}\n */\ndelete( name: string, path?: string, domain?: string ): void {\n if ( !this.documentIsAccessible ) {\n return;\n }\n\n this.set( name, '', new Date('Thu, 01 Jan 1970 00:00:01 GMT'), path, domain );\n }\n/**\n * @param {?=} path Cookie path\n * @param {?=} domain Cookie domain\n * @return {?}\n */\ndeleteAll( path?: string, domain?: string ): void {\n if ( !this.documentIsAccessible ) {\n return;\n }\n\n const /** @type {?} */ cookies: any = this.getAll();\n\n for ( const /** @type {?} */ cookieName in cookies ) {\n if ( cookies.hasOwnProperty( cookieName ) ) {\n this.delete( cookieName, path, domain );\n }\n }\n }\n/**\n * @param {?} name Cookie name\n * @return {?}\n */\nprivate getCookieRegExp( name: string ): RegExp {\n const /** @type {?} */ escapedName: string = name.replace( /([\\[\\]\\{\\}\\(\\)\\|\\=\\;\\+\\?\\,\\.\\*\\^\\$])/ig, '\\\\$1' );\n\n return new RegExp( '(?:^' + escapedName + '|;\\\\s*' + escapedName + ')=(.*?)(?:;|$)', 'g' );\n }\nstatic decorators: DecoratorInvocation[] = [\n{ type: Injectable },\n];\n/**\n * @nocollapse\n */\nstatic ctorParameters: () => ({type: any, decorators?: DecoratorInvocation[]}|null)[] = () => [\n{type: undefined, decorators: [{ type: Inject, args: [DOCUMENT, ] }, ]},\n{type: InjectionToken, decorators: [{ type: Inject, args: [PLATFORM_ID, ] }, ]},\n];\n}\n\nfunction CookieService_tsickle_Closure_declarations() {\n/** @type {?} */\nCookieService.decorators;\n/**\n * @nocollapse\n * @type {?}\n */\nCookieService.ctorParameters;\n/** @type {?} */\nCookieService.prototype.documentIsAccessible;\n/** @type {?} */\nCookieService.prototype.document;\n/** @type {?} */\nCookieService.prototype.platformId;\n}\n\n\ninterface DecoratorInvocation {\n type: Function;\n args?: any[];\n}\n"],"names":[],"mappings":";;ACAA,2FAAA;;;AAKA;;;;;IAQA,uBAGa,QAAU,EAEV,UAAkC;QAFlC,IAAb,CAAA,QAAa,GAAA,QAAA,CAAU;QAEV,IAAb,CAAA,UAAa,GAAA,UAAA,CAAkC;QAD3C,IAAI,CAAC,oBAAoB,GAAG,iBAAiB,CAAE,IAAI,CAAC,UAAU,CAAE,CAAC;IACrE,CAAG;;;;;IAKH,6BAIG,GAJH,UAIG,IAAA;QAHC,EAAJ,CAAA,CAIS,CAAA,IAAE,CAAI,oBAAqB,CAJpC,CAIsC,CAJtC;YACM,MAAN,CAIa,KAAA,CAAM;QAHnB,CAAK;QAED,IAAI,GAIG,kBAAA,CAAoB,IAAA,CAAK,CAAE;QAFlC,IAAJ,gBAAA,CAIU,MAAA,GAAiB,IAAA,CAAK,eAAC,CAAgB,IAAA,CAAK,CAAE;QAHpD,IAAJ,gBAAA,CAIU,MAAA,GAAkB,MAAA,CAAO,IAAC,CAAK,IAAA,CAAK,QAAC,CAAQ,MAAC,CAAM,CAAE;QAF5D,MAAJ,CAIW,MAAA,CAAO;IAHlB,CAAG;;;;;IAKH,2BAKG,GALH,UAKG,IAAA;QAJC,EAAJ,CAAA,CAKS,IAAA,CAAK,oBAAC,IAAuB,IAAA,CAAK,KAAC,CAAM,IAAA,CAAO,CALzD,CAK2D,CAL3D;YACM,IAAI,GAKG,kBAAA,CAAoB,IAAA,CAAK,CAAE;YAHlC,IAAN,gBAAA,CAKY,MAAA,GAAiB,IAAA,CAAK,eAAC,CAAgB,IAAA,CAAK,CAAE;YAJpD,IAAN,gBAAA,CAKY,MAAA,GAA0B,MAAA,CAAO,IAAC,CAAK,IAAA,CAAK,QAAC,CAAQ,MAAC,CAAM,CAAE;YAHpE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E,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,CAAC,QAAQ,EAAG,EAAE,EAAG,EAAC;IACvE,EAAC,IAAI,EAAE,cAAc,EAAE,UAAU,EAAE,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,CAAC,WAAW,EAAG,EAAE,EAAG,EAAC;CAC9E,EAEA,CAFA,CAAC;ADjLF;;GAEG;"}
@@ -0,0 +1,155 @@
1
+ import { Inject, Injectable, InjectionToken, PLATFORM_ID } from '@angular/core';
2
+ import { DOCUMENT, isPlatformBrowser } from '@angular/common';
3
+
4
+ // This service is based on the `ng2-cookies` package which sadly is not a service and does
5
+ // not use `DOCUMENT` injection and therefore doesn't work well with AoT production builds.
6
+ // Package: https://github.com/BCJTI/ng2-cookies
7
+ class CookieService {
8
+ /**
9
+ * @param {?} document
10
+ * @param {?} platformId
11
+ */
12
+ constructor(document, platformId) {
13
+ this.document = document;
14
+ this.platformId = platformId;
15
+ this.documentIsAccessible = isPlatformBrowser(this.platformId);
16
+ }
17
+ /**
18
+ * @param {?} name Cookie name
19
+ * @return {?}
20
+ */
21
+ check(name) {
22
+ if (!this.documentIsAccessible) {
23
+ return false;
24
+ }
25
+ name = encodeURIComponent(name);
26
+ const /** @type {?} */ regExp = this.getCookieRegExp(name);
27
+ const /** @type {?} */ exists = regExp.test(this.document.cookie);
28
+ return exists;
29
+ }
30
+ /**
31
+ * @param {?} name Cookie name
32
+ * @return {?}
33
+ */
34
+ get(name) {
35
+ if (this.documentIsAccessible && this.check(name)) {
36
+ name = encodeURIComponent(name);
37
+ const /** @type {?} */ regExp = this.getCookieRegExp(name);
38
+ const /** @type {?} */ result = regExp.exec(this.document.cookie);
39
+ return decodeURIComponent(result[1]);
40
+ }
41
+ else {
42
+ return '';
43
+ }
44
+ }
45
+ /**
46
+ * @return {?}
47
+ */
48
+ getAll() {
49
+ if (!this.documentIsAccessible) {
50
+ return {};
51
+ }
52
+ const /** @type {?} */ cookies = {};
53
+ const /** @type {?} */ document = this.document;
54
+ if (document.cookie && document.cookie !== '') {
55
+ const /** @type {?} */ split = document.cookie.split(';');
56
+ for (let /** @type {?} */ i = 0; i < split.length; i += 1) {
57
+ const /** @type {?} */ currentCookie = split[i].split('=');
58
+ currentCookie[0] = currentCookie[0].replace(/^ /, '');
59
+ cookies[decodeURIComponent(currentCookie[0])] = decodeURIComponent(currentCookie[1]);
60
+ }
61
+ }
62
+ return cookies;
63
+ }
64
+ /**
65
+ * @param {?} name Cookie name
66
+ * @param {?} value Cookie value
67
+ * @param {?=} expires Number of days until the cookies expires or an actual `Date`
68
+ * @param {?=} path Cookie path
69
+ * @param {?=} domain Cookie domain
70
+ * @param {?=} secure Secure flag
71
+ * @param {?=} sameSite OWASP samesite token `Lax` or `Strict`
72
+ * @return {?}
73
+ */
74
+ set(name, value, expires, path, domain, secure, sameSite) {
75
+ if (!this.documentIsAccessible) {
76
+ return;
77
+ }
78
+ let /** @type {?} */ cookieString = encodeURIComponent(name) + '=' + encodeURIComponent(value) + ';';
79
+ if (expires) {
80
+ if (typeof expires === 'number') {
81
+ const /** @type {?} */ dateExpires = new Date(new Date().getTime() + expires * 1000 * 60 * 60 * 24);
82
+ cookieString += 'expires=' + dateExpires.toUTCString() + ';';
83
+ }
84
+ else {
85
+ cookieString += 'expires=' + expires.toUTCString() + ';';
86
+ }
87
+ }
88
+ if (path) {
89
+ cookieString += 'path=' + path + ';';
90
+ }
91
+ if (domain) {
92
+ cookieString += 'domain=' + domain + ';';
93
+ }
94
+ if (secure) {
95
+ cookieString += 'secure;';
96
+ }
97
+ if (sameSite) {
98
+ cookieString += 'sameSite=' + sameSite + ';';
99
+ }
100
+ this.document.cookie = cookieString;
101
+ }
102
+ /**
103
+ * @param {?} name Cookie name
104
+ * @param {?=} path Cookie path
105
+ * @param {?=} domain Cookie domain
106
+ * @return {?}
107
+ */
108
+ delete(name, path, domain) {
109
+ if (!this.documentIsAccessible) {
110
+ return;
111
+ }
112
+ this.set(name, '', new Date('Thu, 01 Jan 1970 00:00:01 GMT'), path, domain);
113
+ }
114
+ /**
115
+ * @param {?=} path Cookie path
116
+ * @param {?=} domain Cookie domain
117
+ * @return {?}
118
+ */
119
+ deleteAll(path, domain) {
120
+ if (!this.documentIsAccessible) {
121
+ return;
122
+ }
123
+ const /** @type {?} */ cookies = this.getAll();
124
+ for (const /** @type {?} */ cookieName in cookies) {
125
+ if (cookies.hasOwnProperty(cookieName)) {
126
+ this.delete(cookieName, path, domain);
127
+ }
128
+ }
129
+ }
130
+ /**
131
+ * @param {?} name Cookie name
132
+ * @return {?}
133
+ */
134
+ getCookieRegExp(name) {
135
+ const /** @type {?} */ escapedName = name.replace(/([\[\]\{\}\(\)\|\=\;\+\?\,\.\*\^\$])/ig, '\\$1');
136
+ return new RegExp('(?:^' + escapedName + '|;\\s*' + escapedName + ')=(.*?)(?:;|$)', 'g');
137
+ }
138
+ }
139
+ CookieService.decorators = [
140
+ { type: Injectable },
141
+ ];
142
+ /**
143
+ * @nocollapse
144
+ */
145
+ CookieService.ctorParameters = () => [
146
+ { type: undefined, decorators: [{ type: Inject, args: [DOCUMENT,] },] },
147
+ { type: InjectionToken, decorators: [{ type: Inject, args: [PLATFORM_ID,] },] },
148
+ ];
149
+
150
+ /**
151
+ * Generated bundle index. Do not edit.
152
+ */
153
+
154
+ export { CookieService };
155
+ //# sourceMappingURL=ngx-cookie-service.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ngx-cookie-service.js","sources":["ts/lib/ngx-cookie-service.ts","ts/lib/cookie-service/cookie.service.ts"],"sourcesContent":["/**\n * Generated bundle index. Do not edit.\n */\n\nexport {CookieService} from './index';\n","// This service is based on the `ng2-cookies` package which sadly is not a service and does\n// not use `DOCUMENT` injection and therefore doesn't work well with AoT production builds.\n// Package: https://github.com/BCJTI/ng2-cookies\n\n\nimport { Injectable, Inject, PLATFORM_ID, InjectionToken } from '@angular/core';\nimport { DOCUMENT, isPlatformBrowser } from '@angular/common';\nexport class CookieService {\nprivate readonly documentIsAccessible: boolean;\n/**\n * @param {?} document\n * @param {?} platformId\n */\nconstructor(\nprivate document: any,\nprivate platformId: InjectionToken<Object>,\n ) {\n this.documentIsAccessible = isPlatformBrowser( this.platformId );\n }\n/**\n * @param {?} name Cookie name\n * @return {?}\n */\ncheck( name: string ): boolean {\n if ( !this.documentIsAccessible ) {\n return false;\n }\n\n name = encodeURIComponent( name );\n\n const /** @type {?} */ regExp: RegExp = this.getCookieRegExp( name );\n const /** @type {?} */ exists: boolean = regExp.test( this.document.cookie );\n\n return exists;\n }\n/**\n * @param {?} name Cookie name\n * @return {?}\n */\nget( name: string ): string {\n if ( this.documentIsAccessible && this.check( name ) ) {\n name = encodeURIComponent( name );\n\n const /** @type {?} */ regExp: RegExp = this.getCookieRegExp( name );\n const /** @type {?} */ result: RegExpExecArray = regExp.exec( this.document.cookie );\n\n return decodeURIComponent( result[ 1 ] );\n } else {\n return '';\n }\n }\n/**\n * @return {?}\n */\ngetAll(): {} {\n if ( !this.documentIsAccessible ) {\n return {};\n }\n\n const /** @type {?} */ cookies: {} = {};\n const /** @type {?} */ document: any = this.document;\n\n if ( document.cookie && document.cookie !== '' ) {\n const /** @type {?} */ split: Array<string> = document.cookie.split(';');\n\n for ( let /** @type {?} */ i = 0; i < split.length; i += 1 ) {\n const /** @type {?} */ currentCookie: Array<string> = split[ i ].split('=');\n\n currentCookie[ 0 ] = currentCookie[ 0 ].replace( /^ /, '' );\n cookies[ decodeURIComponent( currentCookie[ 0 ] ) ] = decodeURIComponent( currentCookie[ 1 ] );\n }\n }\n\n return cookies;\n }\n/**\n * @param {?} name Cookie name\n * @param {?} value Cookie value\n * @param {?=} expires Number of days until the cookies expires or an actual `Date`\n * @param {?=} path Cookie path\n * @param {?=} domain Cookie domain\n * @param {?=} secure Secure flag\n * @param {?=} sameSite OWASP samesite token `Lax` or `Strict`\n * @return {?}\n */\nset(\n name: string,\n value: string,\n expires?: number | Date,\n path?: string,\n domain?: string,\n secure?: boolean,\n sameSite?: 'Lax' | 'Strict'\n ): void {\n if ( !this.documentIsAccessible ) {\n return;\n }\n\n let /** @type {?} */ cookieString: string = encodeURIComponent( name ) + '=' + encodeURIComponent( value ) + ';';\n\n if ( expires ) {\n if ( typeof expires === 'number' ) {\n const /** @type {?} */ dateExpires: Date = new Date( new Date().getTime() + expires * 1000 * 60 * 60 * 24 );\n\n cookieString += 'expires=' + dateExpires.toUTCString() + ';';\n } else {\n cookieString += 'expires=' + expires.toUTCString() + ';';\n }\n }\n\n if ( path ) {\n cookieString += 'path=' + path + ';';\n }\n\n if ( domain ) {\n cookieString += 'domain=' + domain + ';';\n }\n\n if ( secure ) {\n cookieString += 'secure;';\n }\n\n if ( sameSite ) {\n cookieString += 'sameSite=' + sameSite + ';';\n }\n\n this.document.cookie = cookieString;\n }\n/**\n * @param {?} name Cookie name\n * @param {?=} path Cookie path\n * @param {?=} domain Cookie domain\n * @return {?}\n */\ndelete( name: string, path?: string, domain?: string ): void {\n if ( !this.documentIsAccessible ) {\n return;\n }\n\n this.set( name, '', new Date('Thu, 01 Jan 1970 00:00:01 GMT'), path, domain );\n }\n/**\n * @param {?=} path Cookie path\n * @param {?=} domain Cookie domain\n * @return {?}\n */\ndeleteAll( path?: string, domain?: string ): void {\n if ( !this.documentIsAccessible ) {\n return;\n }\n\n const /** @type {?} */ cookies: any = this.getAll();\n\n for ( const /** @type {?} */ cookieName in cookies ) {\n if ( cookies.hasOwnProperty( cookieName ) ) {\n this.delete( cookieName, path, domain );\n }\n }\n }\n/**\n * @param {?} name Cookie name\n * @return {?}\n */\nprivate getCookieRegExp( name: string ): RegExp {\n const /** @type {?} */ escapedName: string = name.replace( /([\\[\\]\\{\\}\\(\\)\\|\\=\\;\\+\\?\\,\\.\\*\\^\\$])/ig, '\\\\$1' );\n\n return new RegExp( '(?:^' + escapedName + '|;\\\\s*' + escapedName + ')=(.*?)(?:;|$)', 'g' );\n }\nstatic decorators: DecoratorInvocation[] = [\n{ type: Injectable },\n];\n/**\n * @nocollapse\n */\nstatic ctorParameters: () => ({type: any, decorators?: DecoratorInvocation[]}|null)[] = () => [\n{type: undefined, decorators: [{ type: Inject, args: [DOCUMENT, ] }, ]},\n{type: InjectionToken, decorators: [{ type: Inject, args: [PLATFORM_ID, ] }, ]},\n];\n}\n\nfunction CookieService_tsickle_Closure_declarations() {\n/** @type {?} */\nCookieService.decorators;\n/**\n * @nocollapse\n * @type {?}\n */\nCookieService.ctorParameters;\n/** @type {?} */\nCookieService.prototype.documentIsAccessible;\n/** @type {?} */\nCookieService.prototype.document;\n/** @type {?} */\nCookieService.prototype.platformId;\n}\n\n\ninterface DecoratorInvocation {\n type: Function;\n args?: any[];\n}\n"],"names":[],"mappings":";;;ACAA;;;AAKA,AAEA,MAAA,aAAA,CAAA;;;;;IAMA,WAAA,CAGa,QAAU,EAEV,UAAkC,EAL/C;QAGa,IAAb,CAAA,QAAa,GAAA,QAAA,CAAU;QAEV,IAAb,CAAA,UAAa,GAAA,UAAA,CAAkC;QAD3C,IAAI,CAAC,oBAAoB,GAAG,iBAAiB,CAAE,IAAI,CAAC,UAAU,CAAE,CAAC;KAClE;;;;;IAKH,KAIG,CAAA,IAAA,EAJH;QACI,IAIK,CAAA,IAAE,CAAI,oBAAqB,EAAE;YAHhC,OAIO,KAAA,CAAM;SAHd;QAED,IAAI,GAIG,kBAAA,CAAoB,IAAA,CAAK,CAAE;QAFlC,uBAIM,MAAA,GAAiB,IAAA,CAAK,eAAC,CAAgB,IAAA,CAAK,CAAE;QAHpD,uBAIM,MAAA,GAAkB,MAAA,CAAO,IAAC,CAAK,IAAA,CAAK,QAAC,CAAQ,MAAC,CAAM,CAAE;QAF5D,OAIO,MAAA,CAAO;KAHf;;;;;IAKH,GAKG,CAAA,IAAA,EALH;QACI,IAKK,IAAA,CAAK,oBAAC,IAAuB,IAAA,CAAK,KAAC,CAAM,IAAA,CAAO,EAAE;YAJrD,IAAI,GAKG,kBAAA,CAAoB,IAAA,CAAK,CAAE;YAHlC,uB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AqB,EAAE;YALhC,OAAO;SACR;QAED,uBAMM,OAAA,GAAe,IAAA,CAAK,MAAC,EAAM,CAAE;QAJnC,KAMM,uBAAM,UAAA,IAAc,OAAQ,EAAE;YALlC,IAMK,OAAA,CAAQ,cAAC,CAAe,UAAA,CAAa,EAAE;gBAL1C,IAAI,CAMC,MAAC,CAAO,UAAA,EAAY,IAAA,EAAM,MAAA,CAAO,CAAE;aALzC;SACF;KACF;;;;;IAYA,eAAA,CAAA,IAAA,EAAH;QANI,uBAOM,WAAA,GAAsB,IAAA,CAAK,OAAC,CAAQ,wCAAA,EAA0C,MAAA,CAAO,CAAE;QAL7F,OAOO,IAAI,MAAA,CAAQ,MAAA,GAAS,WAAA,GAAc,QAAA,GAAW,WAAA,GAAc,gBAAA,EAAkB,GAAA,CAAI,CAAE;KAN5F;;AAQI,aAAP,CAAA,UAAO,GAAoC;IAN3C,EAOE,IAAA,EAAM,UAAA,EAAW;CANlB,CAOC;;;;AAED,aAAD,CAAA,cAAC,GAAA,MAAA;IAJD,EAAC,IAAI,EAAE,SAAS,EAAE,UAAU,EAAE,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,CAAC,QAAQ,EAAG,EAAE,EAAG,EAAC;IACvE,EAAC,IAAI,EAAE,cAAc,EAAE,UAAU,EAAE,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,CAAC,WAAW,EAAG,EAAE,EAAG,EAAC;CAC9E,CAAC;;ADjLF;;GAEG;;;;"}
@@ -0,0 +1 @@
1
+ {"__symbolic":"module","version":3,"metadata":{"CookieService":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Injectable"}}],"members":{"__ctor__":[{"__symbolic":"constructor","parameterDecorators":[[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Inject"},"arguments":[{"__symbolic":"reference","module":"@angular/common","name":"DOCUMENT"}]}],[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Inject"},"arguments":[{"__symbolic":"reference","module":"@angular/core","name":"PLATFORM_ID"}]}]],"parameters":[{"__symbolic":"reference","name":"any"},{"__symbolic":"reference","name":"InjectionToken","module":"@angular/core","arguments":[{"__symbolic":"reference","name":"Object"}]}]}],"check":[{"__symbolic":"method"}],"get":[{"__symbolic":"method"}],"getAll":[{"__symbolic":"method"}],"set":[{"__symbolic":"method"}],"delete":[{"__symbolic":"method"}],"deleteAll":[{"__symbolic":"method"}],"getCookieRegExp":[{"__symbolic":"method"}]}}},"origins":{"CookieService":"./cookie-service/cookie.service"},"importAs":"ngx-cookie-service"}
package/package.json CHANGED
@@ -1,105 +1 @@
1
- {
2
- "name": "ngx-cookie-service",
3
- "description": "an (aot ready) angular (4.2+) cookie service",
4
- "version": "2.0.0",
5
- "license": "MIT",
6
- "author": "7leads GmbH <info@7leads.org>",
7
- "keywords": [
8
- "angular",
9
- "angular2",
10
- "angular4",
11
- "angular5",
12
- "angular-2",
13
- "angular-4",
14
- "angular-5",
15
- "aot",
16
- "aot-compatible",
17
- "aot-compilation",
18
- "ngx",
19
- "ng2",
20
- "ng",
21
- "service",
22
- "angular-service",
23
- "cookie-service",
24
- "cookie",
25
- "cookies"
26
- ],
27
- "contributors": [
28
- {
29
- "name": "Christopher Parotat",
30
- "email": "c.parotat@7leads.org"
31
- },
32
- {
33
- "name": "Stefan Bauer",
34
- "email": "bauer.stefan@live.de"
35
- },
36
- {
37
- "name": "Kristian Thy",
38
- "email": "thy@42.dk"
39
- },
40
- {
41
- "name": "Jared Clemence"
42
- },
43
- {
44
- "name": "flakolefluk"
45
- }
46
- ],
47
- "main": "index.js",
48
- "typings": "index.d.ts",
49
- "scripts": {
50
- "ng": "ng",
51
- "start": "npm run compile && ng serve",
52
- "build": "npm run compile && ng build",
53
- "test": "npm run compile && ng test",
54
- "lint": "npm run compile && ng lint",
55
- "e2e": "npm run compile && ng e2e",
56
- "compile": "node scripts/compile.js",
57
- "publish:dist": "npm run compile && cd dist-lib && npm publish"
58
- },
59
- "repository": {
60
- "type": "git",
61
- "url": "https://github.com/7leads/ngx-cookie-service.git"
62
- },
63
- "bugs": {
64
- "url": "https://github.com/7leads/ngx-cookie-service/issues",
65
- "email": "info@7leads.org"
66
- },
67
- "peerDependencies": {
68
- "@angular/core": ">=4.2.0",
69
- "@angular/platform-browser": ">=4.2.0",
70
- "@angular/platform-browser-dynamic": ">=4.2.0"
71
- },
72
- "devDependencies": {
73
- "@angular/cli": "1.0.0",
74
- "@angular/core": "^4.0.0",
75
- "@angular/platform-browser": "^4.0.0",
76
- "@angular/platform-browser-dynamic": "^4.0.0",
77
- "@angular/common": "^4.0.0",
78
- "@angular/compiler": "^4.0.0",
79
- "@angular/compiler-cli": "^4.0.0",
80
- "@angular/forms": "^4.0.0",
81
- "@angular/http": "^4.0.0",
82
- "@angular/platform-server": "^4.0.0",
83
- "@angular/router": "^4.0.0",
84
- "@types/jasmine": "2.5.38",
85
- "@types/node": "~6.0.60",
86
- "async": "^2.3.0",
87
- "codelyzer": "~2.0.0",
88
- "core-js": "^2.4.1",
89
- "jasmine-core": "~2.5.2",
90
- "jasmine-spec-reporter": "~3.2.0",
91
- "karma": "~1.4.1",
92
- "karma-chrome-launcher": "~2.0.0",
93
- "karma-cli": "~1.0.1",
94
- "karma-coverage-istanbul-reporter": "^0.2.0",
95
- "karma-jasmine": "~1.1.0",
96
- "karma-jasmine-html-reporter": "^0.2.2",
97
- "protractor": "~5.1.0",
98
- "rimraf": "^2.6.1",
99
- "rxjs": "^5.1.0",
100
- "ts-node": "~2.0.0",
101
- "tslint": "~4.5.0",
102
- "typescript": "~2.2.0",
103
- "zone.js": "^0.8.4"
104
- }
105
- }
1
+ {"name":"ngx-cookie-service","description":"an (aot ready) angular (4.2+) cookie service","version":"2.2.0","license":"MIT","author":"7leads GmbH <info@7leads.org>","keywords":["angular","angular2","angular4","angular5","angular-2","angular-4","angular-5","angular-6","angular-7","aot","aot-compatible","aot-compilation","ngx","ng2","ng","service","angular-service","cookie-service","cookie","cookies"],"contributors":[{"name":"Christopher Parotat","email":"c.parotat@7leads.org"},{"name":"Stefan Bauer","email":"bauer.stefan@live.de"},{"name":"Kristian Thy","email":"thy@42.dk"},{"name":"Jared Clemence"},{"name":"flakolefluk"},{"name":"mattbanks"},{"name":"DBaker85"},{"name":"Matt Lewis","email":"npm@mattlewis.me"}],"scripts":{"ng":"ng","start":"npm run compile && ng serve","build":"npm run compile && ng build","test":"npm run compile && ng test","lint":"npm run compile && ng lint","e2e":"npm run compile && ng e2e","compile":"ng-packagr -p ng-package.json","publish:dist":"npm run compile && npm publish dist-lib"},"repository":{"type":"git","url":"https://github.com/7leads/ngx-cookie-service.git"},"bugs":{"url":"https://github.com/7leads/ngx-cookie-service/issues","email":"info@7leads.org"},"peerDependencies":{"@angular/core":">=4.2.0","@angular/platform-browser":">=4.2.0","@angular/platform-browser-dynamic":">=4.2.0"},"devDependencies":{"@angular/cli":"1.0.0","@angular/common":"^4.0.0","@angular/compiler":"^4.0.0","@angular/compiler-cli":"^4.0.0","@angular/core":"^4.0.0","@angular/forms":"^4.0.0","@angular/http":"^4.0.0","@angular/platform-browser":"^4.0.0","@angular/platform-browser-dynamic":"^4.0.0","@angular/platform-server":"^4.0.0","@angular/router":"^4.0.0","@types/jasmine":"2.5.38","@types/node":"~6.0.60","async":"^2.3.0","codelyzer":"~2.0.0","core-js":"^2.4.1","jasmine-core":"~2.5.2","jasmine-spec-reporter":"~3.2.0","karma":"~1.4.1","karma-chrome-launcher":"~2.0.0","karma-cli":"~1.0.1","karma-coverage-istanbul-reporter":"^0.2.0","karma-jasmine":"~1.1.0","karma-jasmine-html-reporter":"^0.2.2","ng-packagr":"^1.7.0","protractor":"~5.1.0","rimraf":"^2.6.1","rxjs":"^5.1.0","ts-node":"~2.0.0","tslint":"~4.5.0","typescript":"~2.2.0","zone.js":"^0.8.4"},"main":"bundles/ngx-cookie-service.umd.js","module":"ngx-cookie-service.es5.js","es2015":"ngx-cookie-service.js","typings":"ngx-cookie-service.d.ts","metadata":"ngx-cookie-service.metadata.json"}
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../lib/cookie-service/cookie.service.ts"],"names":[],"mappings":"AAAA,2FAAC;AACD,2FAA2F;AAC3F,gDAAgD;AAEhD,OAAO,EAAE,UAAA,EAAY,MAAA,EAAO,MAAO,eAAA,CAAgB;AACnD,OAAO,EAAE,QAAA,EAAS,MAAO,iBAAA,CAAkB;AAG3C;IAGE;QACE,0EAA0E;QAC1E,mEAAmE;QACnE,yDAAyD;QACzD,qDAAqD;QAC5C,QAAa;QAAb,aAAQ,GAAR,QAAQ,CAAK;QAEtB,iFAAiF;QACjF,IAAI,CAAC,oBAAoB,GAAG,QAAQ,KAAK,SAAS,CAAC;IACrD,CAAC;IAED;;;OAGG;IACH,6BAAK,GAAL,UAAO,IAAY;QACjB,EAAE,CAAC,CAAE,CAAC,IAAI,CAAC,oBAAqB,CAAC,CAAC,CAAC;YACjC,MAAM,CAAC,KAAK,CAAC;QACf,CAAC;QAED,IAAI,GAAG,kBAAkB,CAAE,IAAI,CAAE,CAAC;QAElC,IAAM,MAAM,GAAW,IAAI,CAAC,eAAe,CAAE,IAAI,CAAE,CAAC;QACpD,IAAM,MAAM,GAAY,MAAM,CAAC,IAAI,CAAE,IAAI,CAAC,QAAQ,CAAC,MAAM,CAAE,CAAC;QAE5D,MAAM,CAAC,MAAM,CAAC;IAChB,CAAC;IAED;;;OAGG;IACH,2BAAG,GAAH,UAAK,IAAY;QACf,EAAE,CAAC,CAAE,IAAI,CAAC,oBAAoB,IAAI,IAAI,CAAC,KAAK,CAAE,IAAI,CAAG,CAAC,CAAC,CAAC;YACtD,IAAI,GAAG,kBAAkB,CAAE,IAAI,CAAE,CAAC;YAElC,IAAM,MAAM,GAAW,IAAI,CAAC,eAAe,CAAE,IAAI,CAAE,CAAC;YACpD,IAAM,MAAM,GAAoB,MAAM,CAAC,IAAI,CAAE,IAAI,CAAC,QAAQ,CAAC,MA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"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Injectable"}}],"members":{"__ctor__":[{"__symbolic":"constructor","parameterDecorators":[[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Inject"},"arguments":[{"__symbolic":"reference","module":"@angular/common","name":"DOCUMENT"}]}]],"parameters":[{"__symbolic":"reference","name":"any"}]}],"check":[{"__symbolic":"method"}],"get":[{"__symbolic":"method"}],"getAll":[{"__symbolic":"method"}],"set":[{"__symbolic":"method"}],"delete":[{"__symbolic":"method"}],"deleteAll":[{"__symbolic":"method"}],"getCookieRegExp":[{"__symbolic":"method"}]}}}},{"__symbolic":"module","version":1,"metadata":{"CookieService":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Injectable"}}],"members":{"__ctor__":[{"__symbolic":"constructor","parameterDecorators":[[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Inject"},"arguments":[{"__symbolic":"reference","module":"@angular/common","name":"DOCUMENT"}]}]],"parameters":[{"__symbolic":"reference","name":"any"}]}],"check":[{"__symbolic":"method"}],"get":[{"__symbolic":"method"}],"getAll":[{"__symbolic":"method"}],"set":[{"__symbolic":"method"}],"delete":[{"__symbolic":"method"}],"deleteAll":[{"__symbolic":"method"}],"getCookieRegExp":[{"__symbolic":"method"}]}}}}]
@@ -1 +0,0 @@
1
- {"summaries":[{"symbol":{"__symbol":0,"members":[]},"metadata":{"__symbolic":"class","members":{"__ctor__":[{"__symbolic":"constructor","parameterDecorators":[[{"__symbolic":"call","expression":{"__symbol":1,"members":[]},"arguments":[{"__symbol":2,"members":[]}]}]],"parameters":[null]}],"check":[{"__symbolic":"method"}],"get":[{"__symbolic":"method"}],"getAll":[{"__symbolic":"method"}],"set":[{"__symbolic":"method"}],"delete":[{"__symbolic":"method"}],"deleteAll":[{"__symbolic":"method"}],"getCookieRegExp":[{"__symbolic":"method"}]}},"type":{"summaryKind":3,"type":{"reference":{"__symbol":0,"members":[]},"diDeps":[{"isAttribute":false,"isHost":false,"isSelf":false,"isSkipSelf":false,"isOptional":false,"token":{"identifier":{"reference":{"__symbol":2,"members":[]}}}}],"lifecycleHooks":[]}}}],"symbols":[{"__symbol":0,"name":"CookieService","filePath":"/Users/stefan/Repositories/github/ngx-cookie-service/lib/cookie-service/cookie.service.d.ts"},{"__symbol":1,"name":"Inject","filePath":"/Users/stefan/Repositories/github/ngx-cookie-service/node_modules/@angular/core/core.d.ts"},{"__symbol":2,"name":"DOCUMENT","filePath":"/Users/stefan/Repositories/github/ngx-cookie-service/node_modules/@angular/common/common.d.ts"}]}
package/index.js DELETED
@@ -1,2 +0,0 @@
1
- export * from './cookie-service/cookie.service';
2
- //# sourceMappingURL=index.js.map
package/index.js.map DELETED
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../lib/index.ts"],"names":[],"mappings":"AAAA,cAAc,iCAAiC,CAAC","file":"index.js","sourceRoot":""}
@@ -1 +0,0 @@
1
- [{"__symbolic":"module","version":3,"metadata":{},"exports":[{"from":"./cookie-service/cookie.service"}]},{"__symbolic":"module","version":1,"metadata":{},"exports":[{"from":"./cookie-service/cookie.service"}]}]
@@ -1 +0,0 @@
1
- {"summaries":[{"symbol":{"__symbol":0,"members":[]},"metadata":{"__symbol":1,"members":[]}}],"symbols":[{"__symbol":0,"name":"CookieService","filePath":"/Users/stefan/Repositories/github/ngx-cookie-service/lib/index.d.ts"},{"__symbol":1,"name":"CookieService","filePath":"/Users/stefan/Repositories/github/ngx-cookie-service/lib/cookie-service/cookie.service.d.ts"}]}