@enkidevs/curriculum-helpers
Advanced tools
Comparing version 1.0.4 to 1.1.0
@@ -1,7 +0,2 @@ | ||
const contentTypes = { | ||
MARKDOWN: 'markdown', | ||
INSIGHT: 'insight', | ||
EXERCISE: 'exercise', | ||
QUESTION: 'question' | ||
} | ||
const contentTypes = require('./content-types') | ||
@@ -8,0 +3,0 @@ module.exports = { |
{ | ||
"name": "@enkidevs/curriculum-helpers", | ||
"version": "1.0.4", | ||
"version": "1.1.0", | ||
"description": "", | ||
"main": "index.js", | ||
"scripts": {}, | ||
"scripts": { | ||
"test": "jest --notify" | ||
}, | ||
"author": "Nemanja Stojanovic <nemanjacoder@gmail.com>", | ||
@@ -23,2 +25,9 @@ "repository": { | ||
"homepage": "https://github.com/enkidevs/curriculum-processors#readme", | ||
"dependencies": { | ||
"unist-util-assert": "^1.0.1", | ||
"unist-util-map": "^1.0.3" | ||
}, | ||
"devDependencies": { | ||
"jest": "^22.4.2" | ||
}, | ||
"jest": { | ||
@@ -25,0 +34,0 @@ "testRegex": "/.*__tests__/.*\\.test.js$" |
@@ -5,2 +5,54 @@ # Enki Curriculum Compiler String | ||
See [Enki curriculum processors](https://github.com/enkidevs/curriculum-processors) for more details. | ||
See [Enki curriculum processors](https://github.com/enkidevs/curriculum-processors) for more details. | ||
```js | ||
const { contentTypes, compactAst } = require("@enkidevs/curriculum-helpers") | ||
const { getParser } = require("@enkidevs/curriculum-parser") | ||
console.log( | ||
JSON.stringify( | ||
compactAst( | ||
getParser(contentTypes.INSIGHT).parseSync(`--- | ||
author: enki | ||
--- | ||
# This is an \`example\` | ||
`) | ||
), | ||
null, | ||
2 | ||
) | ||
) | ||
``` | ||
Logs | ||
```json | ||
{ | ||
"type": "root", | ||
"children": [ | ||
{ | ||
"type": "yaml", | ||
"value": "author: enki", | ||
"data": { | ||
"parsedValue": { | ||
"author": "enki" | ||
} | ||
} | ||
}, | ||
{ | ||
"type": "headline", | ||
"children": [ | ||
{ | ||
"type": "text", | ||
"value": "This is an " | ||
}, | ||
{ | ||
"type": "inlineCode", | ||
"value": "example" | ||
} | ||
] | ||
} | ||
] | ||
} | ||
``` |
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
Trivial Package
Supply chain riskPackages less than 10 lines of code are easily copied into your own project and may not warrant the additional supply chain risk of an external dependency.
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
Trivial Package
Supply chain riskPackages less than 10 lines of code are easily copied into your own project and may not warrant the additional supply chain risk of an external dependency.
Found 1 instance in 1 package
1875
58
2
1
4
+ Addedunist-util-assert@^1.0.1
+ Addedunist-util-map@^1.0.3
+ Addedobject-assign@4.1.1(transitive)
+ Addedunist-util-assert@1.0.4(transitive)
+ Addedunist-util-map@1.0.5(transitive)
+ Addedx-is-array@0.1.0(transitive)
+ Addedx-is-object@0.1.0(transitive)