BREAKING CHANGE(core): switch to esm

This commit is contained in:
2022-06-26 11:34:09 +02:00
parent bb7bee3b42
commit 143eef8781
14 changed files with 8721 additions and 9082 deletions

8
ts/00_commitinfo_data.ts Normal file
View File

@ -0,0 +1,8 @@
/**
* autocreated commitinfo by @pushrocks/commitinfo
*/
export const commitinfo = {
name: '@pushrocks/smarthash',
version: '3.0.0',
description: 'simplified access to node hash functions'
}

View File

@ -1,4 +1,4 @@
import * as plugins from './nodehash.plugins';
import * as plugins from './nodehash.plugins.js';
export * from './nodehash.sha256';
export * from './nodehash.md5';
export * from './nodehash.sha256.js';
export * from './nodehash.md5.js';

View File

@ -1,4 +1,4 @@
import * as plugins from './nodehash.plugins';
import * as plugins from './nodehash.plugins.js';
export const hashStreamPipeStop = (resolveFuntion) => {
const forEach = (chunk: Buffer, enc, cb) => {

View File

@ -1,4 +1,4 @@
import * as plugins from './nodehash.plugins';
import * as plugins from './nodehash.plugins.js';
export const md5FromString = async (stringToHash: string) => {
return plugins.crypto.createHash('md5').update(stringToHash).digest('hex');

View File

@ -1,5 +1,5 @@
import * as plugins from './nodehash.plugins';
import * as helpers from './nodehash.helpers';
import * as plugins from './nodehash.plugins.js';
import * as helpers from './nodehash.helpers.js';
/**
* creates sha256 Hash from Stream
@ -56,7 +56,7 @@ export const sha256FromBuffer = async (bufferArg: Buffer): Promise<string> => {
* computes sha265 Hash from Object
*/
export const sha265FromObject = async (objectArg: any): Promise<string> => {
const stringifiedObject = plugins.smartjson.stringify(objectArg, {});
const stringifiedObject = plugins.smartjson.stringify(objectArg);
const hashResult = await sha256FromString(stringifiedObject);
return hashResult;
};