Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@sum.cumo/nuxt-custom-route-folder

Package Overview
Dependencies
Maintainers
2
Versions
19
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@sum.cumo/nuxt-custom-route-folder - npm Package Compare versions

Comparing version 2.1.0 to 2.1.1

test/createCustomRoutesFromFolder.spec.js

11

changelog.md
# 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 @@

13

lib/createCustomRoutesFromFolder.js

@@ -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) {

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc