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

@bbob/core

Package Overview
Dependencies
Maintainers
1
Versions
53
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@bbob/core - npm Package Compare versions

Comparing version 1.0.5 to 1.1.0

lib/utils.js

20

CHANGELOG.md

@@ -6,2 +6,22 @@ # Change Log

<a name="1.1.0"></a>
# [1.1.0](https://github.com/JiLiZART/bbob/compare/@bbob/core@1.0.6...@bbob/core@1.1.0) (2018-08-09)
### Features
* **core:** add helper function to plugin api ([e189a39](https://github.com/JiLiZART/bbob/commit/e189a39))
* **core:** implement plugin api ([ee047e8](https://github.com/JiLiZART/bbob/commit/ee047e8))
<a name="1.0.6"></a>
## [1.0.6](https://github.com/JiLiZART/bbob/compare/@bbob/core@1.0.5...@bbob/core@1.0.6) (2018-07-13)
**Note:** Version bump only for package @bbob/core
<a name="1.0.5"></a>

@@ -8,0 +28,0 @@ ## [1.0.5](https://github.com/JiLiZART/bbob/compare/@bbob/core@1.0.4...@bbob/core@1.0.5) (2018-07-11)

62

lib/index.js

@@ -1,21 +0,49 @@

class BBob {
constructor(plugins) {
this.plugins = plugins;
}
const parser = require('@bbob/parser');
const render = require('@bbob/html');
// parse() {
//
// }
//
// stringify() {
//
// }
//
// process(input) {
//
// }
const { iterate, match } = require('./utils');
function walk(cb) {
return iterate(this, cb);
}
module.exports = function bbob(...plugins) {
return new BBob(plugins);
module.exports = function bbob(plugs) {
const plugins = typeof plugs === 'function' ? [plugs] : plugs || [];
let options = {
skipParse: false,
};
return {
process(input, opts) {
options = opts || {};
const parseFn = options.parser || parser;
const renderFn = options.render || render;
let tree = options.skipParse
? input || []
: parseFn(input, options);
tree.walk = walk;
tree.match = match;
plugins.forEach((plugin) => {
tree = plugin(tree, {
parse: parseFn,
render: renderFn,
iterate,
match,
}) || tree;
});
return {
get html() {
return renderFn(tree, tree.options);
},
tree,
messages: tree.messages,
};
},
};
};
{
"name": "@bbob/core",
"version": "1.0.5",
"version": "1.1.0",
"description": "BBob is a tool to transform BBCode markup useing presets",

@@ -10,6 +10,8 @@ "main": "lib/index.js",

"dependencies": {
"@bbob/html": "^1.0.6",
"@bbob/parser": "^1.0.10",
"@bbob/preset-html5": "^1.0.5"
"@bbob/html": "^1.1.0",
"@bbob/parser": "^1.2.0"
},
"peerDependencies": {
"@bbob/preset-html5": "^1.x"
},
"repository": {

@@ -16,0 +18,0 @@ "type": "git",

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

# bbob
# @bbob/core

@@ -10,3 +10,5 @@ ## Usage

const processor = bbob([presetHTML5]).process(code, {sync: true}).html
const html = bbob([presetHTML5()]).process(code).html;
console.log(html); // <span style="font-style: italic;">Text</span>
```
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