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

@iannisz/node-cms

Package Overview
Dependencies
Maintainers
1
Versions
95
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@iannisz/node-cms - npm Package Compare versions

Comparing version 0.0.1 to 0.0.2

20

compiler.ts
import * as fs from 'fs'
import * as chalk from 'chalk'
import { Table } from 'node-json-database'
type HTMLString = string
type Path = string
type PageCompiler = (pageContent: any, pages: any) => { html: string, path: string }
type PageCompiler = (pageContent: any, pages: any) => { html: HTMLString, path: Path }
export const compile = (pages: any, compilePage: any, root: string) => {
export const compile = (pagesTable: Table, pageTypesTable: Table, compilePage: any, root: string) => {
// Store start time

@@ -16,7 +14,9 @@

for (let pageType in pages) {
for (let i = 0; i < pages[pageType].pages.length; i++) {
const pageCompiler = compilePage[pageType] as PageCompiler
const page = pageCompiler(pages[pageType].pages[i], pages)
for (let pageType of pageTypesTable.rows) {
const pages = pagesTable.where(row => row.pageType == pageType.name).rows
for (let i = 0; i < pages.length; i++) {
const pageCompiler = compilePage[pageType.name] as PageCompiler
const page = pageCompiler(pages[i], pages)
// Create directory, if needed

@@ -41,3 +41,3 @@

const getDirectory = (path: Path) => {
const getDirectory = (path: string) => {
let currentChar = path.charAt(path.length - 1)

@@ -44,0 +44,0 @@

{
"name": "@iannisz/node-cms",
"version": "0.0.1",
"version": "0.0.2",
"description": "",

@@ -16,4 +16,5 @@ "main": "index.js",

"chalk": "^4.0.0",
"ncp": "^2.0.0"
"ncp": "^2.0.0",
"node-json-database": "0.0.9"
}
}
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