sptc 0.0.13 → 0.0.15

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/engine/index.js CHANGED
@@ -42,7 +42,7 @@ function executeSptcFileEx(...x) {
42
42
  if(!is_str && typeof x==='string') x=Buffer.concat(x)
43
43
  xbuf.push(x)
44
44
  }
45
- resolve(xbuf)
45
+ resolve(is_str? xbuf.join(''): Buffer.concat(xbuf))
46
46
  }
47
47
  x[2].onError=e=>{
48
48
  onError && onError(e)
@@ -2,7 +2,8 @@ const _module=require('module')
2
2
  const vm=require('vm')
3
3
  const path=require('path')
4
4
  const Compiler=require('./compiler')
5
- const {generate_uuid, PromiseWithResolvers}=require('../utils')
5
+ const Utils=require('../utils')
6
+ const {generate_uuid, PromiseWithResolvers}=Utils
6
7
 
7
8
  /*
8
9
  const tt={x: 2, b: [2, 5], c: _=>2, d: /xx/ig}
@@ -125,6 +126,7 @@ function securityPatch() {
125
126
  }
126
127
 
127
128
  const NOOP=_=>null
129
+ const Application={}
128
130
  function buildContext(ctx0, option) {
129
131
 
130
132
  const {
@@ -155,6 +157,10 @@ function buildContext(ctx0, option) {
155
157
  isMaster: !masterPriv,
156
158
  })
157
159
 
160
+ ctx.Application=Application
161
+
162
+ ctx.Utils=Utils
163
+
158
164
  // Dynamically set the cache configuration.
159
165
  ctx.configSptcFileCache=(cacheVersion, cacheSeconds)=>{
160
166
  if(!isEntry) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "sptc",
3
- "version": "0.0.13",
3
+ "version": "0.0.15",
4
4
  "description": "Simple Pretreat Toolkit CLI",
5
5
  "main": "index.js",
6
6
  "engines": {