js-cookie 2.1.2 → 2.2.1

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/Gruntfile.js DELETED
@@ -1,243 +0,0 @@
1
- /*jshint node:true */
2
- 'use strict';
3
-
4
- module.exports = function (grunt) {
5
-
6
- function encodingMiddleware(request, response, next) {
7
- var url = require('url').parse(request.url, true, true);
8
- var query = url.query;
9
- var pathname = url.pathname;
10
-
11
- if (pathname !== '/encoding') {
12
- next();
13
- return;
14
- }
15
-
16
- var cookieName = query.name;
17
- var cookieValue = query.value;
18
-
19
- response.setHeader('content-type', 'application/json');
20
- response.end(JSON.stringify({
21
- name: cookieName,
22
- value: cookieValue
23
- }));
24
- }
25
-
26
- grunt.initConfig({
27
- pkg: grunt.file.readJSON('package.json'),
28
- qunit: {
29
- all: {
30
- options: {
31
- urls: [
32
- 'http://127.0.0.1:9998/',
33
- 'http://127.0.0.1:9998/amd.html',
34
- 'http://127.0.0.1:9998/encoding.html?integration_baseurl=http://127.0.0.1:9998/'
35
- ]
36
- }
37
- },
38
- },
39
- nodeunit: {
40
- all: 'test/node.js'
41
- },
42
- jshint: {
43
- options: {
44
- jshintrc: true
45
- },
46
- grunt: 'Gruntfile.js',
47
- source: 'src/**/*.js',
48
- tests: ['test/**/*.js', '!test/polyfill.js']
49
- },
50
- jscs: {
51
- options: {
52
- requireCommaBeforeLineBreak: true,
53
- requireLineFeedAtFileEnd: true,
54
- requireSemicolons: true,
55
- requireSpaceBeforeKeywords: ['else', 'while', 'catch'],
56
- requireSpaceAfterKeywords: true,
57
- requireSpaceAfterLineComment: true,
58
- requireSpaceBeforeBlockStatements: true,
59
- requireSpaceBeforeObjectValues: true,
60
- validateIndentation: '\t',
61
- validateLineBreaks: 'LF',
62
- validateQuoteMarks: true,
63
- disallowSpacesInsideArrayBrackets: 'all',
64
- disallowSpacesInsideParentheses: true,
65
- disallowTrailingWhitespace: true
66
- },
67
- grunt: 'Gruntfile.js',
68
- source: 'src/**/*.js',
69
- tests: ['test/**/*.js', '!test/polyfill.js']
70
- },
71
- uglify: {
72
- options: {
73
- banner: '/*! <%= pkg.name %> v<%= pkg.version %> | <%= pkg.license %> */\n'
74
- },
75
- build: {
76
- files: {
77
- 'build/js.cookie-<%= pkg.version %>.min.js': 'src/js.cookie.js'
78
- }
79
- }
80
- },
81
- watch: {
82
- options: {
83
- livereload: true
84
- },
85
- files: '{src,test}/**/*.js',
86
- tasks: 'default'
87
- },
88
- compare_size: {
89
- files: [
90
- 'build/js.cookie-<%= pkg.version %>.min.js',
91
- 'src/js.cookie.js'
92
- ],
93
- options: {
94
- compress: {
95
- gz: function (fileContents) {
96
- return require('gzip-js').zip(fileContents, {}).length;
97
- }
98
- }
99
- }
100
- },
101
- connect: {
102
- 'build-qunit': {
103
- options: {
104
- port: 9998,
105
- base: ['.', 'test'],
106
- middleware: function (connect, options, middlewares) {
107
- middlewares.unshift(encodingMiddleware);
108
- return middlewares;
109
- }
110
- }
111
- },
112
- 'build-sauce': {
113
- options: {
114
- port: 9999,
115
- base: ['.', 'test']
116
- }
117
- },
118
- tests: {
119
- options: {
120
- port: 10000,
121
- base: ['.', 'test'],
122
- open: 'http://127.0.0.1:10000',
123
- keepalive: true,
124
- livereload: true,
125
- middleware: function (connect, options, middlewares) {
126
- middlewares.unshift(encodingMiddleware);
127
- return middlewares;
128
- }
129
- }
130
- }
131
- },
132
- 'saucelabs-qunit': {
133
- all: {
134
- options: {
135
- urls: ['http://127.0.0.1:9999'],
136
- testname: 'Sauce Test for js-cookie',
137
- build: process.env.TRAVIS_JOB_ID,
138
- pollInterval: 10000,
139
- statusCheckAttempts: 90,
140
- throttled: 3,
141
- browsers: (function () {
142
- var browsers = {
143
- 'iOS': [{
144
- browserName: 'iphone',
145
- platform: 'OS X 10.10',
146
- version: '8.2',
147
- deviceName: 'iPhone Simulator'
148
- }, {
149
- browserName: 'iphone',
150
- platform: 'OS X 10.10',
151
- version: '8.2',
152
- deviceName: 'iPad Simulator'
153
- }],
154
- 'android': [{
155
- browserName: 'android',
156
- platform: 'Linux',
157
- version: '5.1',
158
- deviceName: 'Android Emulator'
159
- }],
160
- 'mac': [{
161
- browserName: 'safari',
162
- platform: 'OS X 10.10',
163
- version: '8.0'
164
- }, {
165
- browserName: 'firefox',
166
- platform: 'OS X 10.10',
167
- version: '36.0'
168
- }, {
169
- browserName: 'chrome',
170
- platform: 'OS X 10.10',
171
- versiono: '41.0'
172
- }],
173
- 'windows7': [{
174
- browserName: 'internet explorer',
175
- platform: 'Windows 7',
176
- version: '11.0'
177
- }, {
178
- browserName: 'internet explorer',
179
- platform: 'Windows 7',
180
- version: '10.0'
181
- }, {
182
- browserName: 'internet explorer',
183
- platform: 'Windows 7',
184
- version: '9.0'
185
- }, {
186
- browserName: 'opera',
187
- platform: 'Windows 7',
188
- version: '12.12'
189
- }],
190
- 'windowsXP': [{
191
- browserName: 'internet explorer',
192
- platform: 'Windows XP',
193
- version: '8.0'
194
- }, {
195
- browserName: 'internet explorer',
196
- platform: 'Windows XP',
197
- version: '7.0'
198
- }, {
199
- browserName: 'internet explorer',
200
- platform: 'Windows XP',
201
- version: '6.0'
202
- }],
203
- 'linux': [{
204
- browserName: 'opera',
205
- platform: 'Linux',
206
- version: '12.15'
207
- }, {
208
- browserName: 'firefox',
209
- platform: 'Linux',
210
- version: '37.0'
211
- }, {
212
- browserName: 'chrome',
213
- platform: 'Linux',
214
- version: '41.0'
215
- }]
216
- };
217
-
218
- var matrix = [];
219
- for (var os in browsers) {
220
- matrix = matrix.concat(browsers[os]);
221
- }
222
- return matrix;
223
- }())
224
- }
225
- }
226
- }
227
- });
228
-
229
- // Loading dependencies
230
- for (var key in grunt.file.readJSON('package.json').devDependencies) {
231
- if (key !== 'grunt' && key.indexOf('grunt') === 0) {
232
- grunt.loadNpmTasks(key);
233
- }
234
- }
235
-
236
- grunt.registerTask('saucelabs', ['connect:build-sauce', 'saucelabs-qunit']);
237
- grunt.registerTask('test', ['jshint', 'jscs', 'connect:build-qunit', 'qunit', 'nodeunit']);
238
-
239
- grunt.registerTask('dev', ['test', 'uglify', 'compare_size']);
240
- grunt.registerTask('ci', ['test', 'saucelabs']);
241
-
242
- grunt.registerTask('default', 'dev');
243
- };
package/MIT-LICENSE.txt DELETED
@@ -1,20 +0,0 @@
1
- Copyright 2014 Klaus Hartl
2
-
3
- Permission is hereby granted, free of charge, to any person obtaining
4
- a copy of this software and associated documentation files (the
5
- "Software"), to deal in the Software without restriction, including
6
- without limitation the rights to use, copy, modify, merge, publish,
7
- distribute, sublicense, and/or sell copies of the Software, and to
8
- permit persons to whom the Software is furnished to do so, subject to
9
- the following conditions:
10
-
11
- The above copyright notice and this permission notice shall be
12
- included in all copies or substantial portions of the Software.
13
-
14
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
15
- EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
16
- MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
17
- NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
18
- LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
19
- OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
20
- WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
package/bower.json DELETED
@@ -1,18 +0,0 @@
1
- {
2
- "name": "js-cookie",
3
- "license": "MIT",
4
- "main": [
5
- "src/js.cookie.js"
6
- ],
7
- "ignore": [
8
- "travis.sh",
9
- "test",
10
- "Gruntfile.js",
11
- "package.json",
12
- ".gitignore",
13
- ".jshintignore",
14
- ".jshintrc",
15
- ".tm_properties",
16
- ".travis.yml"
17
- ]
18
- }
package/src/.jshintrc DELETED
@@ -1,13 +0,0 @@
1
- {
2
- "browser": true,
3
- "camelcase": true,
4
- "quotmark": "single",
5
- "globals": {
6
- "define": true,
7
- "module": true,
8
- "require": true,
9
- "escape": true
10
- },
11
-
12
- "extends": "../.jshintrc"
13
- }
package/test/.jshintrc DELETED
@@ -1,16 +0,0 @@
1
- {
2
- "browser": true,
3
- "qunit": true,
4
-
5
- "-W053": true,
6
-
7
- "extends": "../.jshintrc",
8
- "globals": {
9
- "require": true,
10
- "unescape": true,
11
- "lifecycle": true,
12
- "using": true,
13
- "addEvent": true,
14
- "loadFileSync": true
15
- }
16
- }
@@ -1,9 +0,0 @@
1
- /*jshint unused:false */
2
-
3
- var require = {
4
- paths: {
5
- 'qunit': [
6
- '../node_modules/qunitjs/qunit/qunit'
7
- ]
8
- }
9
- };
package/test/amd.html DELETED
@@ -1,15 +0,0 @@
1
- <!DOCTYPE html>
2
- <html>
3
- <head>
4
- <meta charset="utf-8">
5
- <title>JavaScript Cookie Test Suite - AMD</title>
6
- <link href="../node_modules/qunitjs/qunit/qunit.css" rel="stylesheet">
7
- <script src="amd-config.js"></script>
8
- <script src="../node_modules/requirejs/require.js"></script>
9
- <script src="amd.js"></script>
10
- </head>
11
- <body>
12
- <div id="qunit"></div>
13
- <div id="qunit-fixture"></div>
14
- </body>
15
- </html>
package/test/amd.js DELETED
@@ -1,14 +0,0 @@
1
- require(['qunit'], function (QUnit) {
2
- QUnit.module('amd');
3
-
4
- QUnit.start();
5
- QUnit.test('module loading', function (assert) {
6
- QUnit.expect(1);
7
- var done = assert.async();
8
- require(['/src/js.cookie.js'], function (Cookies) {
9
- assert.ok(!!Cookies.get, 'should load the api');
10
- done();
11
- });
12
- });
13
-
14
- });
@@ -1,18 +0,0 @@
1
- <!DOCTYPE html>
2
- <html>
3
- <head>
4
- <meta charset="utf-8">
5
- <title>JavaScript Cookie Test Suite - Encoding</title>
6
- <link href="../node_modules/qunitjs/qunit/qunit.css" rel="stylesheet">
7
- <script src="../node_modules/qunitjs/qunit/qunit.js"></script>
8
- <script src="../src/js.cookie.js"></script>
9
- <script src="utils.js"></script>
10
- <script src="encoding.js"></script>
11
- </head>
12
- <body>
13
- <div id="qunit"></div>
14
- <div id="qunit-fixture">
15
- <iframe id="request_target"></iframe>
16
- </div>
17
- </body>
18
- </html>