@sum.cumo/nuxt-custom-route-folder
Advanced tools
Comparing version 2.1.0 to 2.1.1
# Changelog @sum.cumo/nuxt-custom-route-folder | ||
## Version 2.1.1 | ||
### 🐞 Bug Fixes | ||
→ **ensure fs events called after ready are not buffered forever** | ||
### 🔨 Refactorings | ||
→ **resolve initial promise on complete** | ||
## Version 2.1.0 | ||
@@ -4,0 +15,0 @@ |
@@ -203,5 +203,7 @@ 'use strict'; | ||
var ready$ = watch$.pipe(readyFilter, (0, _operators.delay)(1)); | ||
var rdy = false; | ||
var ready$$ = _rxjs.Observable.create(function (obs) { | ||
var sub = ready$.subscribe({ | ||
next: function next() { | ||
rdy = true; | ||
obs.complete(); | ||
@@ -212,5 +214,6 @@ sub.unsubscribe(); | ||
}); | ||
var throttle = (0, _rxjs.interval)(100); | ||
var fs$ = watch$.pipe((0, _operators.bufferWhen)(function () { | ||
return ready$$; | ||
return !rdy ? ready$$ : throttle; | ||
}), (0, _operators.take)(Infinity), (0, _operators.concatMap)(function (messages) { | ||
@@ -238,5 +241,5 @@ return Promise.all(messages.map(processFileMsg)); | ||
return new Promise(function (resolve, reject) { | ||
var promise = new Promise(function (resolve, reject) { | ||
var sub = fs$.pipe(readyFilter, (0, _operators.delay)(2)).subscribe({ | ||
next: function next() { | ||
complete: function complete() { | ||
resolve(); | ||
@@ -249,2 +252,6 @@ sub.unsubscribe(); | ||
}); | ||
promise.ready$ = ready$; | ||
return promise; | ||
} | ||
@@ -251,0 +258,0 @@ |
@@ -6,2 +6,3 @@ 'use strict'; | ||
}); | ||
exports.cache = undefined; | ||
exports.default = observe; | ||
@@ -23,3 +24,3 @@ | ||
var cache = {}; | ||
var cache = exports.cache = {}; | ||
@@ -26,0 +27,0 @@ function observe(srcDir, watch) { |
{ | ||
"name": "@sum.cumo/nuxt-custom-route-folder", | ||
"version": "2.1.0", | ||
"version": "2.1.1", | ||
"main": "index.js", | ||
@@ -5,0 +5,0 @@ "scripts": { |
import path from 'path' | ||
import kebabCase from 'lodash.kebabcase' | ||
import { Observable } from 'rxjs' | ||
import { Observable, interval } from 'rxjs' | ||
import minimatch from 'minimatch' | ||
@@ -84,5 +84,7 @@ import { | ||
const ready$ = watch$.pipe(readyFilter, delay(1)) | ||
let rdy = false | ||
const ready$$ = Observable.create((obs) => { | ||
const sub = ready$.subscribe({ | ||
next() { | ||
rdy = true | ||
obs.complete() | ||
@@ -93,5 +95,6 @@ sub.unsubscribe() | ||
}) | ||
const throttle = interval(100) | ||
const fs$ = watch$.pipe( | ||
bufferWhen(() => ready$$), | ||
bufferWhen(() => (!rdy ? ready$$ : throttle)), | ||
take(Infinity), | ||
@@ -113,5 +116,5 @@ concatMap((messages) => Promise.all(messages.map(processFileMsg))), | ||
return new Promise((resolve, reject) => { | ||
const promise = new Promise((resolve, reject) => { | ||
const sub = fs$.pipe(readyFilter, delay(2)).subscribe({ | ||
next() { | ||
complete() { | ||
resolve() | ||
@@ -123,2 +126,6 @@ sub.unsubscribe() | ||
}) | ||
promise.ready$ = ready$ | ||
return promise | ||
} | ||
@@ -125,0 +132,0 @@ |
@@ -5,3 +5,3 @@ import * as path from 'path' | ||
const cache = {} | ||
export const cache = {} | ||
@@ -8,0 +8,0 @@ export default function observe(srcDir, watch) { |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Filesystem access
Supply chain riskAccesses the file system, and could potentially read sensitive data.
Found 1 instance in 1 package
685
1
28407
15