ngx-cookie-service 2.0.2 → 2.4.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
@@ -2,6 +2,12 @@
2
2
 
3
3
  An (AOT ready) Angular (4.2+) service for cookies. Originally based on the [ng2-cookies](https://www.npmjs.com/package/ng2-cookies) library.
4
4
 
5
+ # :cookie: Announcement: New maintainer
6
+
7
+ Many people were interested in taking over the maintenance of the `ngx-cookie-service` package, and we would like to shoot all of you a big thank you.
8
+
9
+ The experienced team behind [Studytube](https://www.studytube.nl/) will take care of our cookie service from now on. Thank you, and also thanks to everyone else for your patience.
10
+
5
11
  # Installation
6
12
 
7
13
  ```bash
@@ -57,6 +63,12 @@ export class AppComponent implements OnInit {
57
63
 
58
64
  That's it!
59
65
 
66
+ # What to do now?
67
+
68
+ * Run `npm run test` to run the tests for the cookie service (located in the `demo-app` folder)
69
+ * 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)
70
+ * 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
71
+
60
72
  # Methods
61
73
 
62
74
  ## check( name: string ): boolean;
@@ -83,13 +95,13 @@ const allCookies: {} = cookieService.getAll();
83
95
 
84
96
  Returns a map of key-value pairs for cookies that can be accessed.
85
97
 
86
- ## set( name: string, value: string, expires?: number | Date, path?: string, domain?: string, secure?: boolean ): void;
98
+ ## set( name: string, value: string, expires?: number | Date, path?: string, domain?: string, secure?: boolean, sameSite?: 'Lax' | 'Strict' | 'None' ): void;
87
99
 
88
100
  ```typescript
89
101
  cookieService.set( 'test', 'Hello World' );
90
102
  ```
91
103
 
92
- Sets a cookie with the specified `name` and `value`. It is good practice to specify a path. If you are unsure about the path value, use `'/'`. If no path or domain is explicitly defined, the current location is assumed.
104
+ Sets a cookie with the specified `name` and `value`. It is good practice to specify a path. If you are unsure about the path value, use `'/'`. If no path or domain is explicitly defined, the current location is assumed. `sameSite` defaults to `None`.
93
105
 
94
106
  **Important:** For security reasons, it is not possible to define cookies for other domains. Browsers do not allow this. Read [this](https://stackoverflow.com/a/1063760) and [this](https://stackoverflow.com/a/17777005/1007003) StackOverflow answer for a more in-depth explanation.
95
107
 
@@ -111,15 +123,72 @@ cookieService.deleteAll();
111
123
 
112
124
  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
125
 
114
- # FAQ & Troubleshooting
126
+ # FAQ
127
+
128
+ ## General tips
129
+
130
+ Checking out the following resources usually solves most of the problems people seem to have with this cookie service:
131
+
132
+ * [article about cookies in general @MDN](https://developer.mozilla.org/en-US/docs/Web/HTTP/Cookies) (recommended read!)
133
+ * [common localhost problems @StackOverflow](https://stackoverflow.com/questions/1134290/cookies-on-localhost-with-explicit-domain)
134
+ * [problems with secure cookies @StackOverflow](https://stackoverflow.com/questions/8064318/how-to-read-a-secure-cookie-using-javascript)
135
+ * [how do browser cookie domains work? @StackOverflow](https://stackoverflow.com/questions/1062963/how-do-browser-cookie-domains-work)
136
+ * [get cookies from different paths](https://github.com/7leads/ngx-cookie-service/issues/7#issuecomment-351321518)
137
+
138
+ The following general steps are usually very helpful when debugging problems with this cookie service or cookies in general:
139
+
140
+ * 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
141
+ * check out the actual value(s) of `document.cookie`
142
+ * does it work if you use `document.cookie` manually (i.e. in a console of your choice)?
143
+ * set explicit paths for your cookies
144
+ * [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)
145
+
146
+ # I am always getting a "token missing" or "no provider" error.
147
+
148
+ 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:
149
+
150
+ ```
151
+ rm -rf node_modules
152
+ yarn # or `npm install`
153
+ ```
154
+
155
+ ## I have a problem with framework X or library Y. What can I do?
156
+
157
+ 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.
158
+
159
+ ## Do you support Angular Universal?
160
+
161
+ 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.
162
+
163
+ # Opening issues
115
164
 
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.
165
+ 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?
166
+
167
+ # Contributing
168
+
169
+ We are happy to accept pull requests or test cases for things that do not work. Feel free to submit one of those.
170
+
171
+ 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).
172
+
173
+ * [Open a new pull request](https://github.com/7leads/ngx-cookie-service/compare)
117
174
 
118
175
  # Author
119
176
 
120
177
  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
178
 
122
- Check out the [GitHub page](https://github.com/7leads/ngx-cookie-service) for more.
179
+ # Contributors
180
+
181
+ Thanks to all contributors:
182
+
183
+ * [paroe](https://github.com/paroe)
184
+ * [CunningFatalist](https://github.com/CunningFatalist)
185
+ * [kthy](https://github.com/kthy)
186
+ * [JaredClemence](https://github.com/JaredClemence)
187
+ * [flakolefluk](https://github.com/flakolefluk)
188
+ * [mattbanks](https://github.com/mattbanks)
189
+ * [DBaker85](https://github.com/DBaker85)
190
+ * [mattlewis92](https://github.com/mattlewis92)
191
+ * [IceBreakerG](https://github.com/IceBreakerG)
123
192
 
124
193
  # License
125
194
 
@@ -0,0 +1,158 @@
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`, `None`, or `Strict`. Defaults to `None`
75
+ * @return {?}
76
+ */
77
+ CookieService.prototype.set = function (name, value, expires, path, domain, secure, sameSite) {
78
+ if (sameSite === void 0) { sameSite = 'None'; }
79
+ if (!this.documentIsAccessible) {
80
+ return;
81
+ }
82
+ var /** @type {?} */ cookieString = encodeURIComponent(name) + '=' + encodeURIComponent(value) + ';';
83
+ if (expires) {
84
+ if (typeof expires === 'number') {
85
+ var /** @type {?} */ dateExpires = new Date(new Date().getTime() + expires * 1000 * 60 * 60 * 24);
86
+ cookieString += 'expires=' + dateExpires.toUTCString() + ';';
87
+ }
88
+ else {
89
+ cookieString += 'expires=' + expires.toUTCString() + ';';
90
+ }
91
+ }
92
+ if (path) {
93
+ cookieString += 'path=' + path + ';';
94
+ }
95
+ if (domain) {
96
+ cookieString += 'domain=' + domain + ';';
97
+ }
98
+ if (secure) {
99
+ cookieString += 'secure;';
100
+ }
101
+ cookieString += 'sameSite=' + sameSite + ';';
102
+ this.document.cookie = cookieString;
103
+ };
104
+ /**
105
+ * @param {?} name Cookie name
106
+ * @param {?=} path Cookie path
107
+ * @param {?=} domain Cookie domain
108
+ * @return {?}
109
+ */
110
+ CookieService.prototype.delete = function (name, path, domain) {
111
+ if (!this.documentIsAccessible) {
112
+ return;
113
+ }
114
+ this.set(name, '', new Date('Thu, 01 Jan 1970 00:00:01 GMT'), path, domain, undefined, 'Lax');
115
+ };
116
+ /**
117
+ * @param {?=} path Cookie path
118
+ * @param {?=} domain Cookie domain
119
+ * @return {?}
120
+ */
121
+ CookieService.prototype.deleteAll = function (path, domain) {
122
+ if (!this.documentIsAccessible) {
123
+ return;
124
+ }
125
+ var /** @type {?} */ cookies = this.getAll();
126
+ for (var /** @type {?} */ cookieName in cookies) {
127
+ if (cookies.hasOwnProperty(cookieName)) {
128
+ this.delete(cookieName, path, domain);
129
+ }
130
+ }
131
+ };
132
+ /**
133
+ * @param {?} name Cookie name
134
+ * @return {?}
135
+ */
136
+ CookieService.prototype.getCookieRegExp = function (name) {
137
+ var /** @type {?} */ escapedName = name.replace(/([\[\]\{\}\(\)\|\=\;\+\?\,\.\*\^\$])/ig, '\\$1');
138
+ return new RegExp('(?:^' + escapedName + '|;\\s*' + escapedName + ')=(.*?)(?:;|$)', 'g');
139
+ };
140
+ return CookieService;
141
+ }());
142
+ CookieService.decorators = [
143
+ { type: core.Injectable },
144
+ ];
145
+ /**
146
+ * @nocollapse
147
+ */
148
+ CookieService.ctorParameters = function () { return [
149
+ { type: undefined, decorators: [{ type: core.Inject, args: [common.DOCUMENT,] },] },
150
+ { type: core.InjectionToken, decorators: [{ type: core.Inject, args: [core.PLATFORM_ID,] },] },
151
+ ]; };
152
+
153
+ exports.CookieService = CookieService;
154
+
155
+ Object.defineProperty(exports, '__esModule', { value: true });
156
+
157
+ })));
158
+ //# 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`, `None`, or `Strict`. Defaults to `None`\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' | 'None' | 'Strict' = 'None'\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 cookieString += 'sameSite=' + sameSite + ';';\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, undefined, 'Lax' );\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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A,CAAa,EAAE;gBAL1C,IAAI,CAMC,MAAC,CAAO,UAAA,EAAY,IAAA,EAAM,MAAA,CAAO,CAAE;aALzC;SACF;KACF,CAAH;;;;;IAYG,aAAH,CAAA,SAAA,CAAA,eAAG,GAAA,UAAA,IAAA,EAAH;QANI,qBAOM,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,CAAH;;CAhKA,EAAA,CAAA,CAAA;AAwKO,aAAP,CAAA,UAAO,GAAoC;IAN3C,EAOE,IAAA,EAAMD,eAAA,EAAW;CANlB,CAOC;;;;AAED,aAAD,CAAA,cAAC,GAAA,YAAD,EAAC,OAAA;IAJD,EAAC,IAAI,EAAE,SAAS,EAAE,UAAU,EAAE,CAAC,EAAE,IAAI,EAAEH,WAAM,EAAE,IAAI,EAAE,CAACE,eAAQ,EAAG,EAAE,EAAG,EAAC;IACvE,EAAC,IAAI,EAAEH,mBAAc,EAAE,UAAU,EAAE,CAAC,EAAE,IAAI,EAAEC,WAAM,EAAE,IAAI,EAAE,CAACC,gBAAW,EAAG,EAAE,EAAG,EAAC;CAC9E,CAAD,EAAC,CAAC;;;;;;;;;;;;"}
@@ -0,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=function(){function e(e,t){this.document=e,this.platformId=t,this.documentIsAccessible=o.isPlatformBrowser(this.platformId)}return e.prototype.check=function(e){return!!this.documentIsAccessible&&(e=encodeURIComponent(e),this.getCookieRegExp(e).test(this.document.cookie))},e.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""},e.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},e.prototype.set=function(e,t,o,n,i,c,r){if(void 0===r&&(r="None"),this.documentIsAccessible){var s=encodeURIComponent(e)+"="+encodeURIComponent(t)+";";if(o)if("number"==typeof o)s+="expires="+new Date((new Date).getTime()+1e3*o*60*60*24).toUTCString()+";";else s+="expires="+o.toUTCString()+";";n&&(s+="path="+n+";"),i&&(s+="domain="+i+";"),c&&(s+="secure;"),s+="sameSite="+r+";",this.document.cookie=s}},e.prototype["delete"]=function(e,t,o){this.documentIsAccessible&&this.set(e,"",new Date("Thu, 01 Jan 1970 00:00:01 GMT"),t,o,undefined,"Lax")},e.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)}},e.prototype.getCookieRegExp=function(e){var t=e.replace(/([\[\]\{\}\(\)\|\=\;\+\?\,\.\*\^\$])/gi,"\\$1");return new RegExp("(?:^"+t+"|;\\s*"+t+")=(.*?)(?:;|$)","g")},e}();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`, `None`, or `Strict`. Defaults to `None`\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' | 'None' | 'Strict' = 'None'\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 cookieString += 'sameSite=' + sameSite + ';';\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, undefined, 'Lax' );\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","document","platformId","this","documentIsAccessible","isPlatformBrowser","prototype","check","name","encodeURIComponent","getCookieRegExp","test","cookie","get","result","exec","decodeURIComponent","getAll","cookies","split","i","length","currentCookie","replace","set","value","expires","path","domain","secure","sameSite","cookieString","Date","getTime","toUTCString","delete","undefined","deleteAll","cookieName","hasOwnProperty","escapedName","RegExp","decorators","type","Injectable","ctorParameters","Inject","args","DOCUMENT","InjectionToken","PLATFORM_ID"],"mappings":"wTAKA,IAAAA,EAAA,WAQA,SAAAA,EAGaC,EAEAC,GAFAC,KAAbF,SAAaA,EAEAE,KAAbD,WAAaA,EADTC,KAAKC,qBAAuBC,EAAAA,kBAAmBF,KAAKD,mBAMxDF,EAAAM,UAAAC,MAAA,SAIGC,GAHC,QAIKL,KAAMC,uBAAXI,EAIOC,mBAAoBD,GAEJL,KAAKO,gBAAiBF,GACdG,KAAMR,KAAKF,SAASW,UAIvDZ,EAAAM,UAAAO,IAAA,SAKGL,GAJC,GAKKL,KAAKC,sBAAwBD,KAAKI,MAAOC,GAAS,CAJrDA,EAKOC,mBAAoBD,GAH3B,IAMMM,EADiBX,KAAKO,gBAAiBF,GACNO,KAAMZ,KAAKF,SAASW,QAH3D,OAKOI,mBAAoBF,EAAQ,IAHnC,MAKO,IACbd,EAAAM,UAAAW,OAAA,WACI,IAMKd,KAAMC,qBALT,MAMO,GAHT,IAMMc,EAAc,GACdjB,EAAgBE,KAAKF,SAJ3B,GAMKA,EAASW,QAA8B,KAApBX,EAASW,OAH/B,IAFA,IAMMO,EAAuBlB,EAASW,OAAOO,MAAM,KAEzCC,EAAI,EAAGA,EAAID,EAAME,OAAQD,GAAK,EAAI,CAL1C,IAMME,EAA+BH,EAAOC,GAAID,MAAM,KAJtDG,EAMe,GAAMA,EAAe,GAAIC,QAAS,KAAM,IALvDL,EAMSF,mBAAoBM,EAAe,KAAUN,mBAAoB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AMM,EAAAA,eAAgBP,WAAY,CAAC,CAAEC,KAAMG,EAAAA,OAAQC,KAAM,CAACG,EAAAA"}
@@ -19,14 +19,15 @@ export declare class CookieService {
19
19
  */
20
20
  getAll(): {};
21
21
  /**
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
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`, `None`, or `Strict`. Defaults to `None`
28
29
  */
29
- 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' | 'None' | 'Strict'): void;
30
31
  /**
31
32
  * @param name Cookie name
32
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,43 +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, PLATFORM_ID, InjectionToken } from '@angular/core';
5
- import { DOCUMENT, isPlatformBrowser } 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,
13
- // Get the `PLATFORM_ID` so we can check if we're in a browser.
14
- platformId) {
7
+ /**
8
+ * @param {?} document
9
+ * @param {?} platformId
10
+ */
11
+ function CookieService(document, platformId) {
15
12
  this.document = document;
16
13
  this.platformId = platformId;
17
14
  this.documentIsAccessible = isPlatformBrowser(this.platformId);
18
15
  }
19
16
  /**
20
- * @param name Cookie name
21
- * @returns {boolean}
17
+ * @param {?} name Cookie name
18
+ * @return {?}
22
19
  */
23
20
  CookieService.prototype.check = function (name) {
24
21
  if (!this.documentIsAccessible) {
25
22
  return false;
26
23
  }
27
24
  name = encodeURIComponent(name);
28
- var regExp = this.getCookieRegExp(name);
29
- var exists = regExp.test(this.document.cookie);
25
+ var /** @type {?} */ regExp = this.getCookieRegExp(name);
26
+ var /** @type {?} */ exists = regExp.test(this.document.cookie);
30
27
  return exists;
31
28
  };
32
29
  /**
33
- * @param name Cookie name
34
- * @returns {any}
30
+ * @param {?} name Cookie name
31
+ * @return {?}
35
32
  */
36
33
  CookieService.prototype.get = function (name) {
37
34
  if (this.documentIsAccessible && this.check(name)) {
38
35
  name = encodeURIComponent(name);
39
- var regExp = this.getCookieRegExp(name);
40
- var result = regExp.exec(this.document.cookie);
36
+ var /** @type {?} */ regExp = this.getCookieRegExp(name);
37
+ var /** @type {?} */ result = regExp.exec(this.document.cookie);
41
38
  return decodeURIComponent(result[1]);
42
39
  }
43
40
  else {
@@ -45,18 +42,18 @@ var CookieService = (function () {
45
42
  }
46
43
  };
47
44
  /**
48
- * @returns {}
45
+ * @return {?}
49
46
  */
50
47
  CookieService.prototype.getAll = function () {
51
48
  if (!this.documentIsAccessible) {
52
49
  return {};
53
50
  }
54
- var cookies = {};
55
- var document = this.document;
51
+ var /** @type {?} */ cookies = {};
52
+ var /** @type {?} */ document = this.document;
56
53
  if (document.cookie && document.cookie !== '') {
57
- var split = document.cookie.split(';');
58
- for (var i = 0; i < split.length; i += 1) {
59
- 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('=');
60
57
  currentCookie[0] = currentCookie[0].replace(/^ /, '');
61
58
  cookies[decodeURIComponent(currentCookie[0])] = decodeURIComponent(currentCookie[1]);
62
59
  }
@@ -64,21 +61,24 @@ var CookieService = (function () {
64
61
  return cookies;
65
62
  };
66
63
  /**
67
- * @param name Cookie name
68
- * @param value Cookie value
69
- * @param expires Number of days until the cookies expires or an actual `Date`
70
- * @param path Cookie path
71
- * @param domain Cookie domain
72
- * @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`, `None`, or `Strict`. Defaults to `None`
71
+ * @return {?}
73
72
  */
74
- CookieService.prototype.set = function (name, value, expires, path, domain, secure) {
73
+ CookieService.prototype.set = function (name, value, expires, path, domain, secure, sameSite) {
74
+ if (sameSite === void 0) { sameSite = 'None'; }
75
75
  if (!this.documentIsAccessible) {
76
76
  return;
77
77
  }
78
- var cookieString = encodeURIComponent(name) + '=' + encodeURIComponent(value) + ';';
78
+ var /** @type {?} */ cookieString = encodeURIComponent(name) + '=' + encodeURIComponent(value) + ';';
79
79
  if (expires) {
80
80
  if (typeof expires === 'number') {
81
- var dateExpires = new Date(new Date().getTime() + expires * 1000 * 60 * 60 * 24);
81
+ var /** @type {?} */ dateExpires = new Date(new Date().getTime() + expires * 1000 * 60 * 60 * 24);
82
82
  cookieString += 'expires=' + dateExpires.toUTCString() + ';';
83
83
  }
84
84
  else {
@@ -94,51 +94,59 @@ var CookieService = (function () {
94
94
  if (secure) {
95
95
  cookieString += 'secure;';
96
96
  }
97
+ cookieString += 'sameSite=' + sameSite + ';';
97
98
  this.document.cookie = cookieString;
98
99
  };
99
100
  /**
100
- * @param name Cookie name
101
- * @param path Cookie path
102
- * @param domain Cookie domain
101
+ * @param {?} name Cookie name
102
+ * @param {?=} path Cookie path
103
+ * @param {?=} domain Cookie domain
104
+ * @return {?}
103
105
  */
104
106
  CookieService.prototype.delete = function (name, path, domain) {
105
107
  if (!this.documentIsAccessible) {
106
108
  return;
107
109
  }
108
- this.set(name, '', new Date('Thu, 01 Jan 1970 00:00:01 GMT'), path, domain);
110
+ this.set(name, '', new Date('Thu, 01 Jan 1970 00:00:01 GMT'), path, domain, undefined, 'Lax');
109
111
  };
110
112
  /**
111
- * @param path Cookie path
112
- * @param domain Cookie domain
113
+ * @param {?=} path Cookie path
114
+ * @param {?=} domain Cookie domain
115
+ * @return {?}
113
116
  */
114
117
  CookieService.prototype.deleteAll = function (path, domain) {
115
118
  if (!this.documentIsAccessible) {
116
119
  return;
117
120
  }
118
- var cookies = this.getAll();
119
- for (var cookieName in cookies) {
121
+ var /** @type {?} */ cookies = this.getAll();
122
+ for (var /** @type {?} */ cookieName in cookies) {
120
123
  if (cookies.hasOwnProperty(cookieName)) {
121
124
  this.delete(cookieName, path, domain);
122
125
  }
123
126
  }
124
127
  };
125
128
  /**
126
- * @param name Cookie name
127
- * @returns {RegExp}
129
+ * @param {?} name Cookie name
130
+ * @return {?}
128
131
  */
129
132
  CookieService.prototype.getCookieRegExp = function (name) {
130
- var escapedName = name.replace(/([\[\]\{\}\(\)\|\=\;\+\?\,\.\*\^\$])/ig, '\\$1');
133
+ var /** @type {?} */ escapedName = name.replace(/([\[\]\{\}\(\)\|\=\;\+\?\,\.\*\^\$])/ig, '\\$1');
131
134
  return new RegExp('(?:^' + escapedName + '|;\\s*' + escapedName + ')=(.*?)(?:;|$)', 'g');
132
135
  };
133
136
  return CookieService;
134
137
  }());
135
- export { CookieService };
136
138
  CookieService.decorators = [
137
139
  { type: Injectable },
138
140
  ];
139
- /** @nocollapse */
141
+ /**
142
+ * @nocollapse
143
+ */
140
144
  CookieService.ctorParameters = function () { return [
141
145
  { type: undefined, decorators: [{ type: Inject, args: [DOCUMENT,] },] },
142
146
  { type: InjectionToken, decorators: [{ type: Inject, args: [PLATFORM_ID,] },] },
143
147
  ]; };
144
- //# sourceMappingURL=cookie.service.js.map
148
+ /**
149
+ * Generated bundle index. Do not edit.
150
+ */
151
+ export { CookieService };
152
+ //# 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`, `None`, or `Strict`. Defaults to `None`\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' | 'None' | 'Strict' = 'None'\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 cookieString += 'sameSite=' + sameSite + ';';\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, undefined, 'Lax' );\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,CA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FORM_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`, `None`, or `Strict`. Defaults to `None`
72
+ * @return {?}
73
+ */
74
+ set(name, value, expires, path, domain, secure, sameSite = 'None') {
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
+ cookieString += 'sameSite=' + sameSite + ';';
98
+ this.document.cookie = cookieString;
99
+ }
100
+ /**
101
+ * @param {?} name Cookie name
102
+ * @param {?=} path Cookie path
103
+ * @param {?=} domain Cookie domain
104
+ * @return {?}
105
+ */
106
+ delete(name, path, domain) {
107
+ if (!this.documentIsAccessible) {
108
+ return;
109
+ }
110
+ this.set(name, '', new Date('Thu, 01 Jan 1970 00:00:01 GMT'), path, domain, undefined, 'Lax');
111
+ }
112
+ /**
113
+ * @param {?=} path Cookie path
114
+ * @param {?=} domain Cookie domain
115
+ * @return {?}
116
+ */
117
+ deleteAll(path, domain) {
118
+ if (!this.documentIsAccessible) {
119
+ return;
120
+ }
121
+ const /** @type {?} */ cookies = this.getAll();
122
+ for (const /** @type {?} */ cookieName in cookies) {
123
+ if (cookies.hasOwnProperty(cookieName)) {
124
+ this.delete(cookieName, path, domain);
125
+ }
126
+ }
127
+ }
128
+ /**
129
+ * @param {?} name Cookie name
130
+ * @return {?}
131
+ */
132
+ getCookieRegExp(name) {
133
+ const /** @type {?} */ escapedName = name.replace(/([\[\]\{\}\(\)\|\=\;\+\?\,\.\*\^\$])/ig, '\\$1');
134
+ return new RegExp('(?:^' + escapedName + '|;\\s*' + escapedName + ')=(.*?)(?:;|$)', 'g');
135
+ }
136
+ }
137
+ CookieService.decorators = [
138
+ { type: Injectable },
139
+ ];
140
+ /**
141
+ * @nocollapse
142
+ */
143
+ CookieService.ctorParameters = () => [
144
+ { type: undefined, decorators: [{ type: Inject, args: [DOCUMENT,] },] },
145
+ { type: InjectionToken, decorators: [{ type: Inject, args: [PLATFORM_ID,] },] },
146
+ ];
147
+
148
+ /**
149
+ * Generated bundle index. Do not edit.
150
+ */
151
+
152
+ export { CookieService };
153
+ //# 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`, `None`, or `Strict`. Defaults to `None`\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' | 'None' | 'Strict' = 'None'\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 cookieString += 'sameSite=' + sameSite + ';';\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, undefined, 'Lax' );\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,uBAKM,MAAA,GAAiB,IAAA,CAAK,eAAC,CAAgB,IAAA,CAAK,CAAE;YAJpD,uBAKM,MAAA,GAA0B,MAAA,CAAO,IAAC,CAAK,IAAA,CAAK,QAAC,CAAQ,MAAC,CAAM,CAAE;YAHpE,OAKO,kBAAA,CAAoB,MAAA,CAAQ,CAAA,CAAE,CAAE,CAAE;SAJ1C;aAKM;YAJL,OAKO,EAAA,CAAG;SAJX;KACF;;;;IAIH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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;;AD/KF;;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,108 +1 @@
1
- {
2
- "name": "ngx-cookie-service",
3
- "description": "an (aot ready) angular (4.2+) cookie service",
4
- "version": "2.0.2",
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
- "name": "mattbanks"
48
- }
49
- ],
50
- "main": "index.js",
51
- "typings": "index.d.ts",
52
- "scripts": {
53
- "ng": "ng",
54
- "start": "npm run compile && ng serve",
55
- "build": "npm run compile && ng build",
56
- "test": "npm run compile && ng test",
57
- "lint": "npm run compile && ng lint",
58
- "e2e": "npm run compile && ng e2e",
59
- "compile": "node scripts/compile.js",
60
- "publish:dist": "npm run compile && cd dist-lib && npm publish"
61
- },
62
- "repository": {
63
- "type": "git",
64
- "url": "https://github.com/7leads/ngx-cookie-service.git"
65
- },
66
- "bugs": {
67
- "url": "https://github.com/7leads/ngx-cookie-service/issues",
68
- "email": "info@7leads.org"
69
- },
70
- "peerDependencies": {
71
- "@angular/core": ">=4.2.0",
72
- "@angular/platform-browser": ">=4.2.0",
73
- "@angular/platform-browser-dynamic": ">=4.2.0"
74
- },
75
- "devDependencies": {
76
- "@angular/cli": "1.0.0",
77
- "@angular/core": "^4.0.0",
78
- "@angular/platform-browser": "^4.0.0",
79
- "@angular/platform-browser-dynamic": "^4.0.0",
80
- "@angular/common": "^4.0.0",
81
- "@angular/compiler": "^4.0.0",
82
- "@angular/compiler-cli": "^4.0.0",
83
- "@angular/forms": "^4.0.0",
84
- "@angular/http": "^4.0.0",
85
- "@angular/platform-server": "^4.0.0",
86
- "@angular/router": "^4.0.0",
87
- "@types/jasmine": "2.5.38",
88
- "@types/node": "~6.0.60",
89
- "async": "^2.3.0",
90
- "codelyzer": "~2.0.0",
91
- "core-js": "^2.4.1",
92
- "jasmine-core": "~2.5.2",
93
- "jasmine-spec-reporter": "~3.2.0",
94
- "karma": "~1.4.1",
95
- "karma-chrome-launcher": "~2.0.0",
96
- "karma-cli": "~1.0.1",
97
- "karma-coverage-istanbul-reporter": "^0.2.0",
98
- "karma-jasmine": "~1.1.0",
99
- "karma-jasmine-html-reporter": "^0.2.2",
100
- "protractor": "~5.1.0",
101
- "rimraf": "^2.6.1",
102
- "rxjs": "^5.1.0",
103
- "ts-node": "~2.0.0",
104
- "tslint": "~4.5.0",
105
- "typescript": "~2.2.0",
106
- "zone.js": "^0.8.4"
107
- }
108
- }
1
+ {"name":"ngx-cookie-service","description":"an (aot ready) angular (4.2+) cookie service","version":"2.4.0","license":"MIT","author":"7leads GmbH <info@7leads.org>","keywords":["angular","angular2","angular4","angular5","angular-2","angular-4","angular-5","angular-6","angular-7","angular-8","aot","aot-compatible","aot-compilation","ngx","ng2","ng","service","angular-service","cookie-service","cookie","cookies"],"contributors":[{"name":"Stepan Suvorov","email":"stepan@studytube.nl"},{"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"},{"name":"IceBreakerG"}],"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/stevermeister/ngx-cookie-service.git"},"bugs":{"url":"https://github.com/stevermeister/ngx-cookie-service/issues","email":"stepan@studytube.nl"},"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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0 @@
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","module":"@angular/core","name":"InjectionToken","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"}]}}}},{"__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"}]}],[{"__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","module":"@angular/core","name":"InjectionToken","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"}]}}}}]
@@ -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":[]}]}],[{"__symbolic":"call","expression":{"__symbol":1,"members":[]},"arguments":[{"__symbol":3,"members":[]}]}]],"parameters":[null,{"__symbol":4,"members":[]}]}],"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":[]}}}},{"isAttribute":false,"isHost":false,"isSelf":false,"isSkipSelf":false,"isOptional":false,"token":{"identifier":{"reference":{"__symbol":3,"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"},{"__symbol":3,"name":"PLATFORM_ID","filePath":"/Users/stefan/Repositories/github/ngx-cookie-service/node_modules/@angular/core/core.d.ts"},{"__symbol":4,"name":"InjectionToken","filePath":"/Users/stefan/Repositories/github/ngx-cookie-service/node_modules/@angular/core/core.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"}]}