Compare commits

..

8 Commits

Author SHA1 Message Date
a640ab3d7b 10.0.5 2022-09-05 00:21:43 +02:00
37d6d56287 fix(core): update 2022-09-05 00:21:42 +02:00
443a026502 10.0.4 2022-07-24 23:11:41 +02:00
9644c5b7e3 fix(core): update 2022-07-24 23:11:41 +02:00
25faa8c697 10.0.3 2022-07-24 23:04:52 +02:00
982387aaa3 fix(core): update 2022-07-24 23:04:51 +02:00
4a11f50efe 10.0.2 2022-06-09 19:27:00 +02:00
0ddec29392 fix(core): update 2022-06-09 19:26:59 +02:00
8 changed files with 4925 additions and 1666 deletions

View File

@ -18,17 +18,6 @@ before_script:
# ==================== # ====================
# security stage # security stage
# ==================== # ====================
mirror:
stage: security
script:
- npmci git mirror
only:
- tags
tags:
- lossless
- docker
- notpriv
auditProductionDependencies: auditProductionDependencies:
image: registry.gitlab.com/hosttoday/ht-docker-node:npmci image: registry.gitlab.com/hosttoday/ht-docker-node:npmci
stage: security stage: security
@ -100,10 +89,9 @@ codequality:
only: only:
- tags - tags
script: script:
- npmci command npm install -g tslint typescript - npmci command npm install -g typescript
- npmci npm prepare - npmci npm prepare
- npmci npm install - npmci npm install
- npmci command "tslint -c tslint.json ./ts/**/*.ts"
tags: tags:
- lossless - lossless
- docker - docker
@ -123,11 +111,10 @@ trigger:
pages: pages:
stage: metadata stage: metadata
script: script:
- npmci node install lts - npmci node install stable
- npmci command npm install -g @gitzone/tsdoc
- npmci npm prepare - npmci npm prepare
- npmci npm install - npmci npm install
- npmci command tsdoc - npmci command npm run buildDocs
tags: tags:
- lossless - lossless
- docker - docker

6525
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@ -1,14 +1,15 @@
{ {
"name": "@pushrocks/smartfile", "name": "@pushrocks/smartfile",
"private": false, "private": false,
"version": "10.0.1", "version": "10.0.5",
"description": "offers smart ways to work with files in nodejs", "description": "offers smart ways to work with files in nodejs",
"main": "dist_ts/index.js", "main": "dist_ts/index.js",
"typings": "dist_ts/index.d.ts", "typings": "dist_ts/index.d.ts",
"type": "module", "type": "module",
"scripts": { "scripts": {
"test": "(tstest test/)", "test": "(tstest test/)",
"build": "(tsbuild --web --allowimplicitany)" "build": "(tsbuild --web --allowimplicitany)",
"buildDocs": "tsdoc"
}, },
"repository": { "repository": {
"type": "git", "type": "git",
@ -28,27 +29,27 @@
"@pushrocks/lik": "^6.0.0", "@pushrocks/lik": "^6.0.0",
"@pushrocks/smartdelay": "^2.0.13", "@pushrocks/smartdelay": "^2.0.13",
"@pushrocks/smartfile-interfaces": "^1.0.7", "@pushrocks/smartfile-interfaces": "^1.0.7",
"@pushrocks/smarthash": "^2.1.10", "@pushrocks/smarthash": "^3.0.1",
"@pushrocks/smartjson": "^4.0.6", "@pushrocks/smartjson": "^5.0.1",
"@pushrocks/smartmime": "^1.0.5", "@pushrocks/smartmime": "^1.0.5",
"@pushrocks/smartpath": "^5.0.5", "@pushrocks/smartpath": "^5.0.5",
"@pushrocks/smartpromise": "^3.1.6", "@pushrocks/smartpromise": "^3.1.6",
"@pushrocks/smartrequest": "^1.1.56", "@pushrocks/smartrequest": "^2.0.11",
"@pushrocks/smartstream": "^2.0.1", "@pushrocks/smartstream": "^2.0.3",
"@pushrocks/streamfunction": "^4.0.4", "@pushrocks/streamfunction": "^4.0.4",
"@types/fs-extra": "^9.0.13", "@types/fs-extra": "^9.0.13",
"@types/glob": "^7.2.0", "@types/glob": "^8.0.0",
"@types/js-yaml": "^4.0.5", "@types/js-yaml": "^4.0.5",
"fs-extra": "^10.1.0", "fs-extra": "^10.1.0",
"glob": "^8.0.3", "glob": "^8.0.3",
"js-yaml": "^4.1.0" "js-yaml": "^4.1.0"
}, },
"devDependencies": { "devDependencies": {
"@gitzone/tsbuild": "^2.1.63", "@gitzone/tsbuild": "^2.1.65",
"@gitzone/tsrun": "^1.2.35", "@gitzone/tsrun": "^1.2.37",
"@gitzone/tstest": "^1.0.71", "@gitzone/tstest": "^1.0.73",
"@pushrocks/tapbundle": "^5.0.3", "@pushrocks/tapbundle": "^5.0.4",
"@types/node": "^17.0.40", "@types/node": "^18.7.14",
"gulp-function": "^2.2.14" "gulp-function": "^2.2.14"
}, },
"files": [ "files": [

View File

@ -38,9 +38,7 @@ tap.test('.fs.listFolders() -> should get the file type from a string', async ()
tap.test('.fs.listFilesSync() -> should get the file type from a string', async () => { tap.test('.fs.listFilesSync() -> should get the file type from a string', async () => {
expect(smartfile.fs.listFilesSync('./test/testassets/')).toContain('mytest.json'); expect(smartfile.fs.listFilesSync('./test/testassets/')).toContain('mytest.json');
expect(smartfile.fs.listFilesSync('./test/testassets/')).not.toContain('notExistentFile'); expect(smartfile.fs.listFilesSync('./test/testassets/')).not.toContain('notExistentFile');
expect(smartfile.fs.listFilesSync('./test/testassets/', /mytest\.json/)).toContain( expect(smartfile.fs.listFilesSync('./test/testassets/', /mytest\.json/)).toContain('mytest.json');
'mytest.json'
);
expect(smartfile.fs.listFilesSync('./test/testassets/', /mytests.json/)).not.toContain( expect(smartfile.fs.listFilesSync('./test/testassets/', /mytests.json/)).not.toContain(
'mytest.json' 'mytest.json'
); );
@ -133,9 +131,7 @@ tap.test('.fs.toObjectSync() -> should read an .json file to an object', async (
}); });
tap.test('.fs.toStringSync() -> should read a file to a string', async () => { tap.test('.fs.toStringSync() -> should read a file to a string', async () => {
expect(smartfile.fs.toStringSync('./test/testassets/mytest.txt')).toEqual( expect(smartfile.fs.toStringSync('./test/testassets/mytest.txt')).toEqual('Some TestString &&%$');
'Some TestString &&%$'
);
}); });
// --------------------------- // ---------------------------

View File

@ -3,6 +3,6 @@
*/ */
export const commitinfo = { export const commitinfo = {
name: '@pushrocks/smartfile', name: '@pushrocks/smartfile',
version: '10.0.1', version: '10.0.5',
description: 'offers smart ways to work with files in nodejs' description: 'offers smart ways to work with files in nodejs'
} }

View File

@ -242,4 +242,9 @@ export class Smartfile extends plugins.smartjson.Smartjson {
const oldFileName = this.parsedPath.base; const oldFileName = this.parsedPath.base;
this.path = this.path.replace(new RegExp(oldFileName + '$'), fileNameArg); this.path = this.path.replace(new RegExp(oldFileName + '$'), fileNameArg);
} }
public async editContentAsString(editFuncArg: (fileStringArg: string) => Promise<string>) {
const newFileString = await editFuncArg(this.contentBuffer.toString());
this.contentBuffer = Buffer.from(newFileString);
}
} }

View File

@ -11,7 +11,4 @@ export const createWriteStream = (pathArg: string) => {
return plugins.fs.createWriteStream(pathArg); return plugins.fs.createWriteStream(pathArg);
}; };
export const streamDirectory = async (dirPathArg: string) => {};
export const streamDirectory = async (dirPathArg: string) => {
}

View File

@ -26,7 +26,7 @@ export {
smartpath, smartpath,
smartpromise, smartpromise,
smartrequest, smartrequest,
smartstream smartstream,
}; };
// third party scope // third party scope