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

@flecks/core

Package Overview
Dependencies
Maintainers
1
Versions
33
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@flecks/core - npm Package Compare versions

Comparing version 4.0.2 to 4.0.3

build/add-paths-to-yml.js

2

build/flecks.hooks.js

@@ -118,3 +118,3 @@ export const hooks = {

}
}
},

@@ -121,0 +121,0 @@ /**

// eslint-disable-next-line max-classes-per-file
const {dump: dumpYml, load: loadYml} = require('js-yaml');
const JsonParse = require('jsonparse');

@@ -7,19 +8,24 @@ const {Transform} = require('stream');

constructor() {
constructor(decorator) {
super();
this.parser = new JsonParse();
const self = this;
this.done = undefined;
this.parser = new JsonParse();
this.parser.onValue = function onValue(O) {
if (0 === this.stack.length) {
self.push(JSON.stringify(O));
self.done();
self.transformed = JSON.stringify(decorator(O));
}
};
this.transformed = undefined;
}
// eslint-disable-next-line no-underscore-dangle
_flush(done) {
this.push(this.transformed);
done();
}
// eslint-disable-next-line no-underscore-dangle
_transform(chunk, encoding, done) {
this.done = done;
this.parser.write(chunk);
done();
}

@@ -29,31 +35,38 @@

exports.JsonStream.PrettyPrint = class extends Transform {
exports.JsonStream.PrettyPrint = class extends exports.JsonStream {
constructor(indent = 2) {
constructor(decorator, indent = 2) {
super(decorator);
const self = this;
this.parser.onValue = function onValue(O) {
if (0 === this.stack.length) {
self.transformed = JSON.stringify(O, null, indent);
}
};
}
};
exports.YamlStream = class YamlStream extends Transform {
constructor(decorator, options = {dump: {}, load: {}}) {
super();
this.indent = indent;
this.buffers = [];
this.decorator = decorator;
this.options = options;
}
// eslint-disable-next-line no-underscore-dangle
async _transform(chunk, encoding, done) {
this.push(JSON.stringify(JSON.parse(chunk), null, this.indent));
_flush(done) {
const yml = loadYml(Buffer.concat(this.buffers).toString(), this.options.load);
this.push(dumpYml(this.decorator(yml), this.options.dump));
done();
}
};
// eslint-disable-next-line no-underscore-dangle
_transform(chunk, encoding, done) {
this.buffers.push(chunk);
done();
}
exports.transform = (fn, opts = {}) => {
class EasyTransform extends Transform {
constructor() {
super(opts);
}
// eslint-disable-next-line no-underscore-dangle, class-methods-use-this
_transform(chunk, encoding, done) {
fn(chunk, encoding, done, this);
}
}
return new EasyTransform();
};
{
"name": "@flecks/core",
"version": "4.0.2",
"version": "4.0.3",
"author": "cha0s",

@@ -34,4 +34,6 @@ "license": "MIT",

"glob": "^10.3.10",
"js-yaml": "4.1.0",
"jsonparse": "^1.3.1",
"lodash.get": "^4.4.2",
"minimatch": "^5.0.1",
"set-value": "^4.1.0",

@@ -38,0 +40,0 @@ "source-map-support": "0.5.19",

@@ -1,2 +0,2 @@

!function(e,r){"object"==typeof exports&&"object"==typeof module?module.exports=r(require("debug"),require("glob"),require("jsonparse")):"function"==typeof define&&define.amd?define("@flecks/core",["debug","glob","jsonparse"],r):"object"==typeof exports?exports["@flecks/core"]=r(require("debug"),require("glob"),require("jsonparse")):e["@flecks/core"]=r(e.debug,e.glob,e.jsonparse)}(global,((__WEBPACK_EXTERNAL_MODULE__856__,__WEBPACK_EXTERNAL_MODULE__488__,__WEBPACK_EXTERNAL_MODULE__728__)=>(()=>{var __webpack_modules__={24:(e,r,n)=>{function s(){return s=Object.assign?Object.assign.bind():function(e){for(var r=1;r<arguments.length;r++){var n=arguments[r];for(var s in n)Object.prototype.hasOwnProperty.call(n,s)&&(e[s]=n[s])}return e},s.apply(this,arguments)}e.exports=s(s(s({glob:n(488).glob},n(968)),n(484)),n(524))},484:(e,r,n)=>{var{processCode:s,spawnWith:t}=n(524),{npm_config_user_agent:a="npm"}=process.env;r.inferPackageManager=()=>a.split("/")[0],r.build=async e=>{var n,{cwd:a,packageManager:o=r.inferPackageManager()}=e;switch(o){case"bun":n=["bun","run","build"];break;case"npm":n=["npm","run","build"];break;case"pnpm":n=["pnpm","run","build"];break;case"yarn":n=["yarn","run","build"]}return n&&s(t(n,{cwd:a}))},r.add=async e=>{var n,{dev:a,packageManager:o=r.inferPackageManager(),packages:i}=e;switch(o){case"bun":n=["bun","add",...a?["--dev"]:[],...i];break;case"npm":n=["npm","install",...a?["--save-dev"]:[],...i];break;case"pnpm":n=["pnpm","add",...a?["--save-dev"]:[],...i];break;case"yarn":n=["yarn","add",...a?["--dev"]:[],...i]}return n&&s(t(n))},r.install=async e=>{var n,{cwd:a,packageManager:o=r.inferPackageManager()}=e;switch(o){case"bun":n=["bun","install"];break;case"npm":n=["npm","install"];break;case"pnpm":n=["pnpm","install"];break;case"yarn":n=["yarn","install"]}return n&&s(t(n,{cwd:a}))},r.lockFile=function(e){switch(void 0===e&&(e=r.inferPackageManager()),e){case"bun":return"bun.lockb";case"npm":return"package-lock.json";case"pnpm":return"pnpm-lock.yaml";case"yarn":return"yarn.lock";default:return""}}},524:(__unused_webpack_module,exports,__webpack_require__)=>{var _excluded=["useFork"];function _extends(){return _extends=Object.assign?Object.assign.bind():function(e){for(var r=1;r<arguments.length;r++){var n=arguments[r];for(var s in n)Object.prototype.hasOwnProperty.call(n,s)&&(e[s]=n[s])}return e},_extends.apply(this,arguments)}function _objectWithoutPropertiesLoose(e,r){if(null==e)return{};var n,s,t={},a=Object.keys(e);for(s=0;s<a.length;s++)n=a[s],r.indexOf(n)>=0||(t[n]=e[n]);return t}var{fork,spawn}=__webpack_require__(368),{access,constants:{X_OK},realpath}=__webpack_require__(392),{dirname,join,sep}=__webpack_require__(72),D=__webpack_require__(816),debug=D("@flecks/core/server"),debugSilly=debug.extend("silly"),{FLECKS_CORE_ROOT=process.cwd()}=process.env;exports.binaryPath=async function(binary,root){void 0===root&&(root=FLECKS_CORE_ROOT);for(var resolved=dirname(await realpath(eval("require").resolve(join(root,"package.json")))),parts=resolved.split(sep);parts.length>0;){var path=parts.concat(join("node_modules",".bin",binary)).join(sep);try{return await access(path,X_OK),path}catch(e){parts.pop()}}throw new Error("Binary '".concat(binary,"' not found! (root: ").concat(root,")"))},exports.processCode=e=>new Promise(((r,n)=>{e.on("error",n),e.on("exit",(s=>{e.off("error",n),r(s)}))}));var children=[];exports.spawnWith=function(e,r){void 0===r&&(r={});var{useFork:n}=r,s=_objectWithoutPropertiesLoose(r,_excluded);debug("%sing: '%s'",n?"fork":"spawn",e.join(" ")),debugSilly("with options: %O",s);var t=(n?fork:spawn)(e[0],e.slice(1),_extends(_extends({stdio:"inherit"},s),{},{env:_extends(_extends({},process.env),s.env)}));return children.push(t),t.on("exit",(()=>{children.splice(children.indexOf(t),1)})),t};var killed=!1;function handleTerminationEvent(e){process.on(e,(()=>{killed||(killed=!0,children.forEach((e=>{e.kill()})),"exit"!==e&&process.exit(1))}))}handleTerminationEvent("exit"),handleTerminationEvent("SIGINT"),handleTerminationEvent("SIGTERM")},816:(e,r,n)=>{const s=n(856),{VSCODE_INSPECTOR_OPTIONS:t}=process.env;e.exports=e=>{{if(t){const{formatArgs:e}=s;s.formatArgs=function(r){const{useColors:n}=this;r[0].match(/%[oO]/)&&(this.useColors=!1),e.call(this,r),this.useColors=n},s.formatters.o=void 0,s.formatters.O=void 0}const e="web"===process.env.FLECKS_CORE_BUILD_TARGET?"debug":"error";s.log=console[e].bind(console)}return s(e)}},968:(e,r,n)=>{const s=n(728),{Transform:t}=n(378);r.JsonStream=class extends t{constructor(){super();const e=this;this.done=void 0,this.parser=new s,this.parser.onValue=function(r){0===this.stack.length&&(e.push(JSON.stringify(r)),e.done())}}_transform(e,r,n){this.done=n,this.parser.write(e)}},r.JsonStream.PrettyPrint=class extends t{constructor(e=2){super(),this.indent=e}async _transform(e,r,n){this.push(JSON.stringify(JSON.parse(e),null,this.indent)),n()}},r.transform=(e,r={})=>new class extends t{constructor(){super(r)}_transform(r,n,s){e(r,n,s,this)}}},368:e=>{"use strict";e.exports=require("child_process")},392:e=>{"use strict";e.exports=require("fs/promises")},72:e=>{"use strict";e.exports=require("path")},378:e=>{"use strict";e.exports=require("stream")},856:e=>{"use strict";e.exports=__WEBPACK_EXTERNAL_MODULE__856__},488:e=>{"use strict";e.exports=__WEBPACK_EXTERNAL_MODULE__488__},728:e=>{"use strict";e.exports=__WEBPACK_EXTERNAL_MODULE__728__}},__webpack_module_cache__={};function __webpack_require__(e){var r=__webpack_module_cache__[e];if(void 0!==r)return r.exports;var n=__webpack_module_cache__[e]={exports:{}};return __webpack_modules__[e](n,n.exports,__webpack_require__),n.exports}var __webpack_exports__=__webpack_require__(24);return __webpack_exports__})()));
!function(e,r){"object"==typeof exports&&"object"==typeof module?module.exports=r(require("debug"),require("glob"),require("js-yaml"),require("jsonparse")):"function"==typeof define&&define.amd?define("@flecks/core",["debug","glob","js-yaml","jsonparse"],r):"object"==typeof exports?exports["@flecks/core"]=r(require("debug"),require("glob"),require("js-yaml"),require("jsonparse")):e["@flecks/core"]=r(e.debug,e.glob,e["js-yaml"],e.jsonparse)}(global,((__WEBPACK_EXTERNAL_MODULE__856__,__WEBPACK_EXTERNAL_MODULE__488__,__WEBPACK_EXTERNAL_MODULE__380__,__WEBPACK_EXTERNAL_MODULE__728__)=>(()=>{var __webpack_modules__={24:(e,r,s)=>{function t(){return t=Object.assign?Object.assign.bind():function(e){for(var r=1;r<arguments.length;r++){var s=arguments[r];for(var t in s)Object.prototype.hasOwnProperty.call(s,t)&&(e[t]=s[t])}return e},t.apply(this,arguments)}var{dump:n,load:a}=s(380);e.exports=t(t(t({dumpYml:n,glob:s(488).glob,loadYml:a},s(968)),s(484)),s(524))},484:(e,r,s)=>{var{processCode:t,spawnWith:n}=s(524),{npm_config_user_agent:a="npm"}=process.env;r.inferPackageManager=()=>a.split("/")[0],r.build=async e=>{var s,{cwd:a,packageManager:o=r.inferPackageManager()}=e;switch(o){case"bun":s=["bun","run","build"];break;case"npm":s=["npm","run","build"];break;case"pnpm":s=["pnpm","run","build"];break;case"yarn":s=["yarn","run","build"]}return s&&t(n(s,{cwd:a}))},r.add=async e=>{var s,{dev:a,packageManager:o=r.inferPackageManager(),packages:i}=e;switch(o){case"bun":s=["bun","add",...a?["--dev"]:[],...i];break;case"npm":s=["npm","install",...a?["--save-dev"]:[],...i];break;case"pnpm":s=["pnpm","add",...a?["--save-dev"]:[],...i];break;case"yarn":s=["yarn","add",...a?["--dev"]:[],...i]}return s&&t(n(s))},r.install=async e=>{var s,{cwd:a,packageManager:o=r.inferPackageManager()}=e;switch(o){case"bun":s=["bun","install"];break;case"npm":s=["npm","install"];break;case"pnpm":s=["pnpm","install"];break;case"yarn":s=["yarn","install"]}return s&&t(n(s,{cwd:a}))},r.lockFile=function(e){switch(void 0===e&&(e=r.inferPackageManager()),e){case"bun":return"bun.lockb";case"npm":return"package-lock.json";case"pnpm":return"pnpm-lock.yaml";case"yarn":return"yarn.lock";default:return""}}},524:(__unused_webpack_module,exports,__webpack_require__)=>{var _excluded=["useFork"];function _extends(){return _extends=Object.assign?Object.assign.bind():function(e){for(var r=1;r<arguments.length;r++){var s=arguments[r];for(var t in s)Object.prototype.hasOwnProperty.call(s,t)&&(e[t]=s[t])}return e},_extends.apply(this,arguments)}function _objectWithoutPropertiesLoose(e,r){if(null==e)return{};var s,t,n={},a=Object.keys(e);for(t=0;t<a.length;t++)s=a[t],r.indexOf(s)>=0||(n[s]=e[s]);return n}var{fork,spawn}=__webpack_require__(368),{access,constants:{X_OK},realpath}=__webpack_require__(392),{dirname,join,sep}=__webpack_require__(72),D=__webpack_require__(816),debug=D("@flecks/core/server"),debugSilly=debug.extend("silly"),{FLECKS_CORE_ROOT=process.cwd()}=process.env;exports.binaryPath=async function(binary,root){void 0===root&&(root=FLECKS_CORE_ROOT);for(var resolved=dirname(await realpath(eval("require").resolve(join(root,"package.json")))),parts=resolved.split(sep);parts.length>0;){var path=parts.concat(join("node_modules",".bin",binary)).join(sep);try{return await access(path,X_OK),path}catch(e){parts.pop()}}throw new Error("Binary '".concat(binary,"' not found! (root: ").concat(root,")"))},exports.processCode=e=>new Promise(((r,s)=>{e.on("error",s),e.on("exit",(t=>{e.off("error",s),r(t)}))}));var children=[];exports.spawnWith=function(e,r){void 0===r&&(r={});var{useFork:s}=r,t=_objectWithoutPropertiesLoose(r,_excluded);debug("%sing: '%s'",s?"fork":"spawn",e.join(" ")),debugSilly("with options: %O",t);var n=(s?fork:spawn)(e[0],e.slice(1),_extends(_extends({stdio:"inherit"},t),{},{env:_extends(_extends({},process.env),t.env)}));return children.push(n),n.on("exit",(()=>{children.splice(children.indexOf(n),1)})),n};var killed=!1;function handleTerminationEvent(e){process.on(e,(()=>{killed||(killed=!0,children.forEach((e=>{e.kill()})),"exit"!==e&&process.exit(1))}))}handleTerminationEvent("exit"),handleTerminationEvent("SIGINT"),handleTerminationEvent("SIGTERM")},816:(e,r,s)=>{const t=s(856),{VSCODE_INSPECTOR_OPTIONS:n}=process.env;e.exports=e=>{{if(n){const{formatArgs:e}=t;t.formatArgs=function(r){const{useColors:s}=this;r[0].match(/%[oO]/)&&(this.useColors=!1),e.call(this,r),this.useColors=s},t.formatters.o=void 0,t.formatters.O=void 0}const e="web"===process.env.FLECKS_CORE_BUILD_TARGET?"debug":"error";t.log=console[e].bind(console)}return t(e)}},968:(e,r,s)=>{const{dump:t,load:n}=s(380),a=s(728),{Transform:o}=s(378);r.JsonStream=class extends o{constructor(e){super(),this.parser=new a;const r=this;this.parser.onValue=function(s){0===this.stack.length&&(r.transformed=JSON.stringify(e(s)))},this.transformed=void 0}_flush(e){this.push(this.transformed),e()}_transform(e,r,s){this.parser.write(e),s()}},r.JsonStream.PrettyPrint=class extends r.JsonStream{constructor(e,r=2){super(e);const s=this;this.parser.onValue=function(e){0===this.stack.length&&(s.transformed=JSON.stringify(e,null,r))}}},r.YamlStream=class extends o{constructor(e,r={dump:{},load:{}}){super(),this.buffers=[],this.decorator=e,this.options=r}_flush(e){const r=n(Buffer.concat(this.buffers).toString(),this.options.load);this.push(t(this.decorator(r),this.options.dump)),e()}_transform(e,r,s){this.buffers.push(e),s()}}},368:e=>{"use strict";e.exports=require("child_process")},392:e=>{"use strict";e.exports=require("fs/promises")},72:e=>{"use strict";e.exports=require("path")},378:e=>{"use strict";e.exports=require("stream")},856:e=>{"use strict";e.exports=__WEBPACK_EXTERNAL_MODULE__856__},488:e=>{"use strict";e.exports=__WEBPACK_EXTERNAL_MODULE__488__},380:e=>{"use strict";e.exports=__WEBPACK_EXTERNAL_MODULE__380__},728:e=>{"use strict";e.exports=__WEBPACK_EXTERNAL_MODULE__728__}},__webpack_module_cache__={};function __webpack_require__(e){var r=__webpack_module_cache__[e];if(void 0!==r)return r.exports;var s=__webpack_module_cache__[e]={exports:{}};return __webpack_modules__[e](s,s.exports,__webpack_require__),s.exports}var __webpack_exports__=__webpack_require__(24);return __webpack_exports__})()));
//# sourceMappingURL=server.js.map
/* eslint-disable global-require */
const {dump: dumpYml, load: loadYml} = require('js-yaml');
module.exports = {
dumpYml,
glob: require('glob').glob,
loadYml,
...require('../../build/stream'),

@@ -6,0 +10,0 @@ ...require('./package-manager'),

Sorry, the diff of this file is not supported yet

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