lien 3.4.3 → 4.0.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.
@@ -0,0 +1,4 @@
1
+ github: ionicabizau
2
+ patreon: ionicabizau
3
+ open_collective: ionicabizau
4
+ custom: https://www.buymeacoffee.com/h96wwchmy
package/CONTRIBUTING.md CHANGED
@@ -1,8 +1,8 @@
1
1
  # :eight_spoked_asterisk: :stars: :sparkles: :dizzy: :star2: :star2: :sparkles: :dizzy: :star2: :star2: Contributing :star: :star2: :dizzy: :sparkles: :star: :star2: :dizzy: :sparkles: :stars: :eight_spoked_asterisk:
2
2
 
3
3
  So, you want to contribute to this project! That's awesome. However, before
4
- doing so, please read the following simple steps how to contribute. This will
5
- make the life easier and will avoid wasting time on things which are not
4
+ doing so, please read the following simple steps explaining how to contribute. This will
5
+ make life easier and help avoid wasting time on things that are not
6
6
  requested. :sparkles:
7
7
 
8
8
  ## Discuss the changes before doing them
@@ -15,9 +15,9 @@ requested. :sparkles:
15
15
  system, Node.JS version etc.), screenshots (so we can see what you are
16
16
  seeing).
17
17
 
18
- - It is recommended to wait for feedback before continuing to next steps.
18
+ - It is recommended to wait for feedback before continuing the next steps.
19
19
  However, if the issue is clear (e.g. a typo) and the fix is simple, you can
20
- continue and fix it.
20
+ continue to fix it.
21
21
 
22
22
  ## Fixing issues
23
23
  - Fork the project in your account and create a branch with your fix:
package/DOCUMENTATION.md CHANGED
@@ -110,7 +110,7 @@ Sets, gets or deletes the cookie.
110
110
  - **String** `value`: If provided and it not `null`, the cookie will be set. If it's null, the cookie will be deleted. If `value` is not provided, the cookie value will be returned.
111
111
 
112
112
  #### Return
113
- - **String** `null`, if the cookie was deleted. `undefined` if the cookie doesn't exist. The cookie value if this exists.
113
+ - **String|null|undefined** `null`, if the cookie was deleted. `undefined` if the cookie doesn't exist. The cookie value if this exists.
114
114
 
115
115
  ### `file(path, customRoot)`
116
116
  Serves a file to the response.
@@ -218,7 +218,7 @@ Gets the transformer for a url.
218
218
  - **String** `method`: The method.
219
219
 
220
220
  #### Return
221
- - **Transformer** The transformer (if it exists) or `null`.
221
+ - **Transformer|null** The transformer (if it exists) or `null`.
222
222
 
223
223
  ### `getHooksStrict(type, url, method)`
224
224
  Similar to `getHooks`, but doesn't concat hooks based on the regex
@@ -231,7 +231,7 @@ matching but only if they are the same regex.
231
231
  - **String** `method`: The method.
232
232
 
233
233
  #### Return
234
- - **Transformer** The transformer (if it exists) or `null`.
234
+ - **Transformer|null** The transformer (if it exists) or `null`.
235
235
 
236
236
  ### `insertHook(type, url, method, trans)`
237
237
  Inserts a new hook.
package/LICENSE CHANGED
@@ -1,6 +1,6 @@
1
1
  The MIT License (MIT)
2
2
 
3
- Copyright (c) 2014-23 Ionică Bizău <bizauionica@gmail.com> (https://ionicabizau.net/)
3
+ Copyright (c) 2014-24 Ionică Bizău <bizauionica@gmail.com> (https://ionicabizau.net/)
4
4
 
5
5
  Permission is hereby granted, free of charge, to any person obtaining a copy
6
6
  of this software and associated documentation files (the "Software"), to deal
package/README.md CHANGED
@@ -244,7 +244,7 @@ Sets, gets or deletes the cookie.
244
244
  - **String** `value`: If provided and it not `null`, the cookie will be set. If it's null, the cookie will be deleted. If `value` is not provided, the cookie value will be returned.
245
245
 
246
246
  #### Return
247
- - **String** `null`, if the cookie was deleted. `undefined` if the cookie doesn't exist. The cookie value if this exists.
247
+ - **String|null|undefined** `null`, if the cookie was deleted. `undefined` if the cookie doesn't exist. The cookie value if this exists.
248
248
 
249
249
  ### `file(path, customRoot)`
250
250
  Serves a file to the response.
@@ -352,7 +352,7 @@ Gets the transformer for a url.
352
352
  - **String** `method`: The method.
353
353
 
354
354
  #### Return
355
- - **Transformer** The transformer (if it exists) or `null`.
355
+ - **Transformer|null** The transformer (if it exists) or `null`.
356
356
 
357
357
  ### `getHooksStrict(type, url, method)`
358
358
  Similar to `getHooks`, but doesn't concat hooks based on the regex
@@ -365,7 +365,7 @@ matching but only if they are the same regex.
365
365
  - **String** `method`: The method.
366
366
 
367
367
  #### Return
368
- - **Transformer** The transformer (if it exists) or `null`.
368
+ - **Transformer|null** The transformer (if it exists) or `null`.
369
369
 
370
370
  ### `insertHook(type, url, method, trans)`
371
371
  Inserts a new hook.
@@ -483,24 +483,25 @@ Thanks! :heart:
483
483
  ## :dizzy: Where is this library used?
484
484
  If you are using this library in one of your projects, add it in this list. :sparkles:
485
485
 
486
+ - `@dottjt/mediareade`
487
+ - `@everything-registry/sub-chunk-2069`
486
488
  - `bloggify`
487
- - `gh-contributions`
488
489
  - `bloggify-cli`
489
- - `web-term`
490
+ - `bloggify-prebuilt`
490
491
  - `bloggify-server-prebuilt`
491
- - `@dottjt/mediareade`
492
- - `youtube-album-uploader`
493
- - `youtube-album-uploader-multiple`
494
492
  - `bnotify`
495
- - `test-youtube-api`
496
- - `bloggify-prebuilt`
493
+ - `chewb-youtube-uploader`
494
+ - `fb-token-updater`
495
+ - `gh-contributions`
497
496
  - `learning-node-file-upload`
497
+ - `learning-nodejs-file-upload`
498
498
  - `lien-github-comments-example`
499
- - `fb-token-updater`
500
499
  - `nodejs-youtube-uploader`
501
- - `chewb-youtube-uploader`
500
+ - `test-youtube-api`
501
+ - `web-term`
502
502
  - `wrabbit`
503
- - `learning-nodejs-file-upload`
503
+ - `youtube-album-uploader`
504
+ - `youtube-album-uploader-multiple`
504
505
 
505
506
 
506
507
 
package/lib/index.js CHANGED
@@ -587,6 +587,9 @@ var Lien = function (_EventEmitter) {
587
587
  if (typeof options.session.store === "string") {
588
588
  try {
589
589
  _this3.SessionStoreModule = require(options.session.store);
590
+ if (_this3.SessionStoreModule.__esModule && _this3.SessionStoreModule.default) {
591
+ _this3.SessionStoreModule = _this3.SessionStoreModule.default;
592
+ }
590
593
  } catch (e) {
591
594
  if (e.code === "MODULE_NOT_FOUND") {
592
595
  _this3.emit("error", new Error("The " + options.session.store + " should be installed in your app to use it as session store."));
@@ -909,6 +912,9 @@ var Lien = function (_EventEmitter) {
909
912
  }, {
910
913
  key: "getHooksStrict",
911
914
  value: function getHooksStrict(type, url, method) {
915
+ if (url === "*") {
916
+ url = "(.*)";
917
+ }
912
918
  var reUrl = pathToRegexp(url),
913
919
  typ = this.transformers[type] = this.transformers[type] || {},
914
920
  all = setOrGet(typ, method, []),
@@ -947,6 +953,11 @@ var Lien = function (_EventEmitter) {
947
953
  }, {
948
954
  key: "insertHook",
949
955
  value: function insertHook(type, url, method, trans) {
956
+
957
+ if (url === "*") {
958
+ url = "(.*)";
959
+ }
960
+
950
961
  var all = setOrGet(this.transformers[type], method, []);
951
962
 
952
963
  all.push({
package/package.json CHANGED
@@ -3,7 +3,7 @@
3
3
  "test": "node test/index.js"
4
4
  },
5
5
  "name": "lien",
6
- "version": "3.4.3",
6
+ "version": "4.0.0",
7
7
  "description": "An easy to use web framework for Node.js.",
8
8
  "main": "lib/index.js",
9
9
  "keywords": [
@@ -21,7 +21,7 @@
21
21
  },
22
22
  "devDependencies": {
23
23
  "ajs": "^1.2.1",
24
- "connect-mongo": "^4.6.0",
24
+ "connect-mongo": "^5.1.0",
25
25
  "tester": "^1.3.4",
26
26
  "tinyreq": "^3.1.2"
27
27
  },