4 Commits

Author SHA1 Message Date
0ab254e4ed 3.0.2 2023-06-25 00:29:03 +02:00
185b7a38d5 fix(core): update 2023-06-25 00:29:02 +02:00
7ab6922eed 3.0.1 2023-03-06 18:45:20 +01:00
31bf5f7486 fix(core): update 2023-03-06 18:45:20 +01:00
7 changed files with 4414 additions and 14193 deletions

14180
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@ -1,6 +1,6 @@
{
"name": "@pushrocks/smarthbs",
"version": "3.0.0",
"version": "3.0.2",
"private": false,
"description": "handlebars with better fs support",
"main": "dist_ts/index.js",
@ -27,9 +27,7 @@
"@pushrocks/smartfile": "^10.0.2",
"@pushrocks/smartpath": "^5.0.5",
"@pushrocks/smartpromise": "^3.1.7",
"@types/lodash.uniq": "^4.5.7",
"handlebars": "^4.7.7",
"lodash.uniq": "^4.5.0"
"handlebars": "^4.7.7"
},
"devDependencies": {
"@gitzone/tsbuild": "^2.1.63",

4393
pnpm-lock.yaml generated Normal file

File diff suppressed because it is too large Load Diff

View File

@ -6,8 +6,8 @@ import * as path from 'path';
const dirname = smartpath.get.dirnameFromImportMetaUrl(import.meta.url);
let testHbsDir = path.join(dirname, 'hbs_testfiles');
let testPartialDir = path.join(testHbsDir, 'partials');
let hbs_testfilesDir = path.join(dirname, 'hbs_testfiles');
let testPartialDir = path.join(hbs_testfilesDir, 'partials');
let testResultDir = path.join(dirname, 'testresult');
tap.test('smarthbs -> should create partials', async () => {
@ -15,7 +15,7 @@ tap.test('smarthbs -> should create partials', async () => {
});
tap.test('smarthbs -> should compile a directory', async () => {
smarthbs.compileDirectory(testHbsDir, testResultDir, 'data.json');
smarthbs.compileDirectory(hbs_testfilesDir, testResultDir, 'data.json');
});
tap.test('', async () => {

View File

@ -3,6 +3,6 @@
*/
export const commitinfo = {
name: '@pushrocks/smarthbs',
version: '3.0.0',
version: '3.0.2',
description: 'handlebars with better fs support'
}

View File

@ -1,8 +1,15 @@
import handlebars from 'handlebars';
import lodashUniq from 'lodash.uniq';
import * as smartpath from '@pushrocks/smartpath';
// node native
import * as path from 'path';
export { path };
import * as smartpath from '@pushrocks/smartpath';
import * as smartfile from '@pushrocks/smartfile';
import * as smartpromise from '@pushrocks/smartpromise';
export { handlebars, lodashUniq, path, smartfile, smartpromise };
export { smartpath, smartfile, smartpromise };
// third party
import handlebars from 'handlebars';
export { handlebars };

View File

@ -31,7 +31,10 @@ export let findVarsInHbsString = async (hbsStringArg: string) => {
});
// make sure are uniq
varNameArray = plugins.lodashUniq(varNameArray);
function uniqueArray(input: string[]): string[] {
return Array.from(new Set(input));
}
varNameArray = uniqueArray(varNameArray);
return varNameArray;
};