New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@notable/dumper

Package Overview
Dependencies
Maintainers
2
Versions
27
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@notable/dumper - npm Package Compare versions

Comparing version 2.0.3 to 3.0.0

dist/providers/abstract/index.d.ts

4

dist/config.d.ts

@@ -1,2 +0,2 @@

import { Options as TurndownOptions } from 'turndown';
import { Options } from '@notable/html2markdown';
declare const Config: {

@@ -10,5 +10,5 @@ note: {

html2markdown: {
options: TurndownOptions;
options: Options;
};
};
export default Config;
"use strict";
/* IMPORT */
Object.defineProperty(exports, "__esModule", { value: true });
/* CONFIG */
/* MAIN */
const Config = {

@@ -27,2 +27,2 @@ note: {

exports.default = Config;
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiY29uZmlnLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vc3JjL2NvbmZpZy50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiO0FBQ0EsWUFBWTs7QUFJWixZQUFZO0FBRVosTUFBTSxNQUFNLEdBQUc7SUFDYixJQUFJLEVBQUU7UUFDSixZQUFZLEVBQUUsVUFBVTtLQUN6QjtJQUNELFVBQVUsRUFBRTtRQUNWLFdBQVcsRUFBRSxVQUFVO0tBQ3hCO0lBQ0QsYUFBYSxFQUFFO1FBQ2IsT0FBTyxFQUFFO1lBQ1AsZ0JBQWdCLEVBQUUsR0FBRztZQUNyQixjQUFjLEVBQUUsUUFBUTtZQUN4QixXQUFXLEVBQUUsR0FBRztZQUNoQixLQUFLLEVBQUUsS0FBSztZQUNaLFlBQVksRUFBRSxLQUFLO1lBQ25CLEVBQUUsRUFBRSxLQUFLO1lBQ1QsU0FBUyxFQUFFLFNBQVM7WUFDcEIsZUFBZSxFQUFFLElBQUk7U0FDSDtLQUNyQjtDQUNGLENBQUM7QUFFRixZQUFZO0FBRVosa0JBQWUsTUFBTSxDQUFDIn0=
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiY29uZmlnLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vc3JjL2NvbmZpZy50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiO0FBQ0EsWUFBWTs7QUFJWixVQUFVO0FBRVYsTUFBTSxNQUFNLEdBQUc7SUFDYixJQUFJLEVBQUU7UUFDSixZQUFZLEVBQUUsVUFBVTtLQUN6QjtJQUNELFVBQVUsRUFBRTtRQUNWLFdBQVcsRUFBRSxVQUFVO0tBQ3hCO0lBQ0QsYUFBYSxFQUFFO1FBQ2IsT0FBTyxFQUFZO1lBQ2pCLGdCQUFnQixFQUFFLEdBQUc7WUFDckIsY0FBYyxFQUFFLFFBQVE7WUFDeEIsV0FBVyxFQUFFLEdBQUc7WUFDaEIsS0FBSyxFQUFFLEtBQUs7WUFDWixZQUFZLEVBQUUsS0FBSztZQUNuQixFQUFFLEVBQUUsS0FBSztZQUNULFNBQVMsRUFBRSxTQUFTO1lBQ3BCLGVBQWUsRUFBRSxJQUFJO1NBQ3RCO0tBQ0Y7Q0FDRixDQUFDO0FBRUYsWUFBWTtBQUVaLGtCQUFlLE1BQU0sQ0FBQyJ9
import { Source, Options } from './types';
declare const Dumper: {
providers: (import("./providers/boostnote").BoostnoteProvider | import("./providers/enex").EnexProvider | import("./providers/html").HTMLProvider | import("./providers/markdown").MarkdownProvider)[];
isSupported(source: Source): boolean;
dump(options: Options): Promise<void>;
isSupported: (source: Source) => boolean;
dump: (options: Options) => Promise<void>;
};

@@ -7,0 +7,0 @@ declare const _default: typeof Dumper & {

@@ -6,4 +6,5 @@ "use strict";

const utils_1 = require("./utils");
/* DUMPER */
/* MAIN */
const Dumper = {
/* VARIABLES */
providers: [

@@ -15,9 +16,11 @@ providers_1.Boostnote,

],
isSupported(source) {
/* API */
isSupported: (source) => {
return !!Dumper.providers.find(provider => provider.isSupported(source));
},
async dump(options) {
dump: async (options) => {
if (options.DOMParser)
config_1.default.html2markdown.options['parser'] = options.DOMParser;
const sources = utils_1.default.lang.castArray(options.source), sourcesUnsupported = sources.filter(source => !Dumper.isSupported(source));
const sources = utils_1.default.lang.castArray(options.source);
const sourcesUnsupported = sources.filter(source => !Dumper.isSupported(source));
if (sourcesUnsupported.length)

@@ -37,2 +40,2 @@ throw new Error(`These sources are not supported: ${sourcesUnsupported.join(', ')}`);

Object.defineProperty(module.exports, "__esModule", { value: true });
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi9zcmMvaW5kZXgudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IjtBQUNBLFlBQVk7O0FBR1oscUNBQThCO0FBQzlCLDJDQUE0RDtBQUM1RCxtQ0FBNEI7QUFFNUIsWUFBWTtBQUVaLE1BQU0sTUFBTSxHQUFHO0lBRWIsU0FBUyxFQUFFO1FBQ1QscUJBQVM7UUFDVCxnQkFBSTtRQUNKLGdCQUFJO1FBQ0osb0JBQVE7S0FDVDtJQUVELFdBQVcsQ0FBRyxNQUFjO1FBRTFCLE9BQU8sQ0FBQyxDQUFDLE1BQU0sQ0FBQyxTQUFTLENBQUMsSUFBSSxDQUFHLFFBQVEsQ0FBQyxFQUFFLENBQUMsUUFBUSxDQUFDLFdBQVcsQ0FBRyxNQUFNLENBQUUsQ0FBRSxDQUFDO0lBRWpGLENBQUM7SUFFRCxLQUFLLENBQUMsSUFBSSxDQUFHLE9BQWdCO1FBRTNCLElBQUssT0FBTyxDQUFDLFNBQVM7WUFBRyxnQkFBTSxDQUFDLGFBQWEsQ0FBQyxPQUFPLENBQUMsUUFBUSxDQUFDLEdBQUcsT0FBTyxDQUFDLFNBQVMsQ0FBQztRQUVwRixNQUFNLE9BQU8sR0FBRyxlQUFLLENBQUMsSUFBSSxD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FBQyxRQUFRLENBQUMsV0FBVyxDQUFHLE1BQU0sQ0FBRSxDQUFFLENBQUM7WUFFdkYsSUFBSyxDQUFDLFFBQVE7Z0JBQUcsTUFBTSxJQUFJLEtBQUssQ0FBRyxpQ0FBaUMsTUFBTSxFQUFFLENBQUUsQ0FBQztZQUUvRSxNQUFNLFFBQVEsQ0FBQyxJQUFJLENBQUcsTUFBTSxFQUFFLE9BQU8sQ0FBQyxJQUFJLENBQUUsQ0FBQztTQUU5QztJQUVILENBQUM7Q0FFRixDQUFDO0FBRUYsWUFBWTtBQUVaLGtCQUFlLE1BQU0sQ0FBQyJ9
/// <reference types="node" />
import { Stats } from 'fs';
import { Class, Promisable } from 'type-fest';
declare type DOMParser = Class<{
declare type Constructor<T> = {
new (): T;
};
declare type ConstructorWith<T, Arguments extends unknown[]> = {
new (...args: Arguments): T;
};
declare type Promisable<T> = Promise<T> | T;
declare type DOMParser = Constructor<{
parseFromString(str: string, mimeType: string): Document;

@@ -33,3 +39,3 @@ }>;

declare type Dump = (note: Note) => Promisable<void>;
declare type Source = string | Buffer;
declare type Source = string | Uint8Array;
declare type SourceDetails = {

@@ -39,3 +45,3 @@ stats?: Stats;

};
declare type Content = Buffer;
declare type Content = Uint8Array;
declare type Options = {

@@ -46,2 +52,3 @@ DOMParser?: DOMParser;

};
export { DOMParser, Attachment, AttachmentMetadata, Note, NoteMetadata, Dump, Source, SourceDetails, Class, Content, Stats, Options };
export { Constructor, ConstructorWith, Promisable };
export { DOMParser, Attachment, AttachmentMetadata, Note, NoteMetadata, Dump, Source, SourceDetails, Content, Stats, Options };

@@ -7,2 +7,2 @@ "use strict";

Object.defineProperty(exports, "Stats", { enumerable: true, get: function () { return fs_1.Stats; } });
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidHlwZXMuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi9zcmMvdHlwZXMudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IjtBQUNBLFlBQVk7OztBQUVaLDJCQUF5QjtBQXlEMkYsc0ZBekQ1RyxVQUFLLE9BeUQ0RyJ9
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidHlwZXMuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi9zcmMvdHlwZXMudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IjtBQUNBLFlBQVk7OztBQUVaLDJCQUF5QjtBQWlFb0Ysc0ZBakVyRyxVQUFLLE9BaUVxRyJ9

@@ -1,17 +0,21 @@

/// <reference types="node" />
import { Stats } from './types';
declare const Utils: {
buffer: {
fromBase64: (string: string) => Uint8Array;
fromUtf8: (string: string) => Uint8Array;
toUtf8: (buffer: Uint8Array) => string;
};
lang: {
isArray(x: any): x is any[];
isBoolean(x: any): x is boolean;
isString(x: any): x is string;
isBuffer(x: any): x is Buffer;
isDateValid(x: any): x is Date;
castArray<T>(x: T | T[]): T[];
flatten<T_1>(x: T_1[][]): T_1[];
isArray: (value: unknown) => value is unknown[];
isBoolean: (value: unknown) => value is boolean;
isString: (value: unknown) => value is string;
isBuffer: (value: unknown) => value is Uint8Array;
isDateValid: (value: unknown) => value is Date;
castArray: <T>(value: T | T[]) => T[];
flatten: <T_1>(value: T_1[][]) => T_1[];
matchAll: (str: string, re: RegExp) => RegExpMatchArray[];
};
mime: {
inferExtension(type: string): string;
isImage(type: string): boolean;
inferExtension: (type: string) => string;
isImage: (type: string) => boolean;
};

@@ -22,20 +26,20 @@ system: {

file: {
checkSize(filePath: string): Promise<void>;
read(filePath: string): Promise<Buffer>;
stats(filePath: string): Promise<Stats>;
checkSize: (filePath: string) => Promise<void>;
read: (filePath: string) => Promise<Uint8Array>;
stats: (filePath: string) => Promise<Stats>;
};
path: {
name(filePath: string): string;
name: (filePath: string) => string;
};
format: {
txt: {
inferTitle(content: string): string | undefined;
inferTitle: (content: string) => string | undefined;
};
markdown: {
inferTitle(content: string): string | undefined;
inferTitle: (content: string) => string | undefined;
};
html: {
inferTitle(content: string): string | undefined;
ensureTitle(content: string, title: string): string;
convert(content: string, title?: string | undefined): string;
inferTitle: (content: string) => string | undefined;
ensureTitle: (content: string, title: string) => string;
convert: (content: string, title?: string | undefined) => string;
};

@@ -42,0 +46,0 @@ };

"use strict";
/* IMPORT */
Object.defineProperty(exports, "__esModule", { value: true });
const html2markdown_1 = require("@notable/html2markdown");
const decode_base64_1 = require("decode-base64");
const fs = require("fs");
const mime2ext_1 = require("mime2ext");
const path = require("path");
const uint8_encoding_1 = require("uint8-encoding");
const config_1 = require("./config");
const html2markdown_1 = require("./html2markdown");
/* UTILS */
/* MAIN */
const Utils = {
/* API */
buffer: {
fromBase64: (string) => {
string = string.replace(/\r?\n|\r/g, ''); // Sanitization for stupid inputs like Evernote's
return (0, decode_base64_1.default)(string);
},
fromUtf8: (string) => {
return uint8_encoding_1.default.encode(string);
},
toUtf8: (buffer) => {
return uint8_encoding_1.default.decode(buffer);
}
},
lang: {
isArray(x) {
return x instanceof Array;
isArray: (value) => {
return value instanceof Array;
},
isBoolean(x) {
return typeof x === 'boolean';
isBoolean: (value) => {
return typeof value === 'boolean';
},
isString(x) {
return typeof x === 'string';
isString: (value) => {
return typeof value === 'string';
},
isBuffer(x) {
return x instanceof Buffer;
isBuffer: (value) => {
return value instanceof Uint8Array;
},
isDateValid(x) {
return x instanceof Date && !isNaN(x.getTime());
isDateValid: (value) => {
return value instanceof Date && !isNaN(value.getTime());
},
castArray(x) {
return Utils.lang.isArray(x) ? x : [x];
castArray: (value) => {
return Utils.lang.isArray(value) ? value : [value];
},
flatten(x) {
return [].concat.apply([], x);
flatten: (value) => {
return [].concat.apply([], value);
},

@@ -38,7 +53,7 @@ matchAll: (str, re) => {

mime: {
inferExtension(type) {
inferExtension: (type) => {
const ext = (0, mime2ext_1.default)(type);
return ext ? `.${ext}` : '';
},
isImage(type) {
isImage: (type) => {
return type.includes('image');

@@ -58,3 +73,3 @@ }

file: {
checkSize(filePath) {
checkSize: (filePath) => {
return Utils.file.stats(filePath).then(stats => {

@@ -66,3 +81,3 @@ if (stats.size < (Utils.system.getMaxHeapSize() * .75))

},
async read(filePath) {
read: async (filePath) => {
await Utils.file.checkSize(filePath);

@@ -73,7 +88,7 @@ return new Promise((resolve, reject) => {

return reject(err);
resolve(data);
return resolve(data);
});
});
},
stats(filePath) {
stats: (filePath) => {
return new Promise((resolve, reject) => {

@@ -83,3 +98,3 @@ fs.stat(filePath, (err, stats) => {

return reject(err);
resolve(stats);
return resolve(stats);
});

@@ -90,3 +105,3 @@ });

path: {
name(filePath) {
name: (filePath) => {
return path.basename(filePath, path.extname(filePath));

@@ -97,3 +112,3 @@ }

txt: {
inferTitle(content) {
inferTitle: (content) => {
const firstUnemptyLine = content.match(/^.*?\S.*$/m);

@@ -105,3 +120,3 @@ if (firstUnemptyLine)

markdown: {
inferTitle(content) {
inferTitle: (content) => {
const headingMatch = content.match(/^\s{0,3}#+\s(.*)(\s#+\s*$)?/m);

@@ -113,3 +128,3 @@ if (headingMatch)

html: {
inferTitle(content) {
inferTitle: (content) => {
const headingMatch = content.match(/<h1(?:\s[^>]*)?>(.*?)<\/h1>/i);

@@ -122,7 +137,8 @@ if (headingMatch)

},
ensureTitle(content, title) {
ensureTitle: (content, title) => {
const headingMatch = content.match(/<h1(?:\s[^>]*)?>(.*?)<\/h1>/i);
if (headingMatch)
return content;
const titleTag = `<h1>${title}</h1>`, bodyIndex = content.indexOf('<body>');
const titleTag = `<h1>${title}</h1>`;
const bodyIndex = content.indexOf('<body>');
if (bodyIndex >= 0) {

@@ -135,3 +151,3 @@ return `${content.substring(0, bodyIndex)}${titleTag}${content.substring(bodyIndex)}`;

},
convert(content, title) {
convert: (content, title) => {
title = title || Utils.format.html.inferTitle(content);

@@ -147,2 +163,2 @@ if (title)

exports.default = Utils;
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidXRpbHMuanMiLCJzb3VyY2V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FFLENBQUM7Z0JBRS9DLElBQUssU0FBUyxJQUFJLENBQUMsRUFBRztvQkFFcEIsT0FBTyxHQUFHLE9BQU8sQ0FBQyxTQUFTLENBQUcsQ0FBQyxFQUFFLFNBQVMsQ0FBRSxHQUFHLFFBQVEsR0FBRyxPQUFPLENBQUMsU0FBUyxDQUFHLFNBQVMsQ0FBRSxFQUFFLENBQUM7aUJBRTdGO3FCQUFNO29CQUVMLE9BQU8sR0FBRyxRQUFRLEdBQUcsT0FBTyxFQUFFLENBQUM7aUJBRWhDO1lBRUgsQ0FBQztZQUVELE9BQU8sRUFBRSxDQUFFLE9BQWUsRUFBRSxLQUFjLEVBQVcsRUFBRTtnQkFFckQsS0FBSyxHQUFHLEtBQUssSUFBSSxLQUFLLENBQUMsTUFBTSxDQUFDLElBQUksQ0FBQyxVQUFVLENBQUcsT0FBTyxDQUFFLENBQUM7Z0JBRTFELElBQUssS0FBSztvQkFBRyxPQUFPLEdBQUcsS0FBSyxDQUFDLE1BQU0sQ0FBQyxJQUFJLENBQUMsV0FBVyxDQUFHLE9BQU8sRUFBRSxLQUFLLENBQUUsQ0FBQztnQkFFeEUsT0FBTyxJQUFBLHVCQUFhLEVBQUcsT0FBTyxFQUFFLGdCQUFNLENBQUMsYUFBYSxDQUFDLE9BQU8sQ0FBRSxDQUFDO1lBRWpFLENBQUM7U0FFRjtLQUVGO0NBRUYsQ0FBQztBQUVGLFlBQVk7QUFFWixrQkFBZSxLQUFLLENBQUMifQ==
{
"name": "@notable/dumper",
"description": "Library for extracting attachments, notes and metadata out of formats used by popular note-taking apps.",
"version": "2.0.3",
"version": "3.0.0",
"main": "dist/index.js",

@@ -39,23 +39,22 @@ "files": [

"dependencies": {
"@notable/html2markdown": "^1.0.1",
"cson2json": "^1.0.0",
"decode-base64": "^2.0.0",
"entities-decode": "^1.0.0",
"fast-xml-parser": "3.17.4",
"mime2ext": "^1.0.0",
"mime2ext": "^1.0.1",
"sanitize-basename": "^1.0.0",
"type-fest": "^0.17.0"
"uint8-encoding": "^1.0.0"
},
"peerDependencies": {
"minidom": "1.0.0"
},
"devDependencies": {
"@types/node": "^14.14.22",
"@types/turndown": "^5.0.0",
"@types/node": "^17.0.23",
"@types/turndown": "^5.0.1",
"minidom": "^1.0.0",
"minimist": "^1.2.5",
"minimist": "^1.2.6",
"mkdirp": "^1.0.4",
"rimraf": "^3.0.2",
"test-diff": "^1.1.0",
"typescript": "^4.1.3",
"typescript-transform-export-interop": "^1.0.2"
"typescript": "^4.6.3",
"typescript-transform-export-interop": "^1.0.4"
}
}

@@ -56,3 +56,3 @@ # Dumper

},
content: Buffer
content: Uint8Array
}[],

@@ -65,3 +65,3 @@ deleted: boolean,

},
content: Buffer
content: Uint8Array
}

@@ -68,0 +68,0 @@ ```

/* IMPORT */
import {Options as TurndownOptions} from 'turndown';
import {Options} from '@notable/html2markdown';
/* CONFIG */
/* MAIN */

@@ -16,3 +16,3 @@ const Config = {

html2markdown: {
options: {
options: <Options> {
bulletListMarker: '-',

@@ -26,3 +26,3 @@ codeBlockStyle: 'fenced',

strongDelimiter: '**'
} as TurndownOptions
}
}

@@ -29,0 +29,0 @@ };

@@ -9,6 +9,8 @@

/* DUMPER */
/* MAIN */
const Dumper = {
/* VARIABLES */
providers: [

@@ -21,4 +23,6 @@ Boostnote,

isSupported ( source: Source ): boolean {
/* API */
isSupported: ( source: Source ): boolean => {
return !!Dumper.providers.find ( provider => provider.isSupported ( source ) );

@@ -28,8 +32,8 @@

async dump ( options: Options ): Promise<void> {
dump: async ( options: Options ): Promise<void> => {
if ( options.DOMParser ) Config.html2markdown.options['parser'] = options.DOMParser;
const sources = Utils.lang.castArray ( options.source ),
sourcesUnsupported = sources.filter ( source => !Dumper.isSupported ( source ) );
const sources = Utils.lang.castArray ( options.source );
const sourcesUnsupported = sources.filter ( source => !Dumper.isSupported ( source ) );

@@ -36,0 +40,0 @@ if ( sourcesUnsupported.length ) throw new Error ( `These sources are not supported: ${sourcesUnsupported.join ( ', ' )}` );

@@ -5,7 +5,14 @@

import {Stats} from 'fs';
import {Class, Promisable} from 'type-fest';
/* TYPES */
/* HELPERS */
type DOMParser = Class<{
type Constructor<T> = { new (): T };
type ConstructorWith<T, Arguments extends unknown[]> = { new ( ...args: Arguments ): T };
type Promisable<T> = Promise<T> | T;
/* MAIN */
type DOMParser = Constructor<{
parseFromString ( str: string, mimeType: string ): Document

@@ -45,3 +52,3 @@ }>;

type Source = string | Buffer;
type Source = string | Uint8Array;

@@ -53,3 +60,3 @@ type SourceDetails = {

type Content = Buffer;
type Content = Uint8Array;

@@ -64,2 +71,3 @@ type Options = {

export {DOMParser, Attachment, AttachmentMetadata, Note, NoteMetadata, Dump, Source, SourceDetails, Class, Content, Stats, Options};
export {Constructor, ConstructorWith, Promisable};
export {DOMParser, Attachment, AttachmentMetadata, Note, NoteMetadata, Dump, Source, SourceDetails, Content, Stats, Options};
/* IMPORT */
import html2markdown from '@notable/html2markdown';
import decodeBase64 from 'decode-base64';
import * as fs from 'fs';
import mime2ext from 'mime2ext';
import * as path from 'path';
import U8 from 'uint8-encoding';
import {Stats} from './types';
import Config from './config';
import html2markdown from './html2markdown';
/* UTILS */
/* MAIN */
const Utils = {
/* API */
buffer: {
fromBase64: ( string: string ): Uint8Array => {
string = string.replace ( /\r?\n|\r/g, '' ); // Sanitization for stupid inputs like Evernote's
return decodeBase64 ( string );
},
fromUtf8: ( string: string ): Uint8Array => {
return U8.encode ( string );
},
toUtf8: ( buffer: Uint8Array ): string => {
return U8.decode ( buffer );
}
},
lang: {
isArray ( x ): x is any[] {
isArray: ( value: unknown ): value is unknown[] => {
return x instanceof Array;
return value instanceof Array;
},
isBoolean ( x ): x is boolean {
isBoolean: ( value: unknown ): value is boolean => {
return typeof x === 'boolean';
return typeof value === 'boolean';
},
isString ( x ): x is string {
isString: ( value: unknown ): value is string => {
return typeof x === 'string';
return typeof value === 'string';
},
isBuffer ( x ): x is Buffer {
isBuffer: ( value: unknown ): value is Uint8Array => {
return x instanceof Buffer;
return value instanceof Uint8Array;
},
isDateValid ( x ): x is Date {
isDateValid: ( value: unknown ): value is Date => {
return x instanceof Date && !isNaN ( x.getTime () );
return value instanceof Date && !isNaN ( value.getTime () );
},
castArray<T> ( x: T | T[] ): T[] {
castArray: <T> ( value: T | T[] ): T[] => {
return Utils.lang.isArray ( x ) ? x : [x];
return Utils.lang.isArray ( value ) ? value : [value];
},
flatten<T> ( x: T[][] ): T[] {
flatten: <T> ( value: T[][] ): T[] => {
return [].concat.apply ( [], x );
return [].concat.apply ( [], value );

@@ -69,3 +97,3 @@ },

inferExtension ( type: string ): string {
inferExtension: ( type: string ): string => {

@@ -78,3 +106,3 @@ const ext = mime2ext ( type );

isImage ( type: string ): boolean {
isImage: ( type: string ): boolean => {

@@ -107,3 +135,3 @@ return type.includes ( 'image' );

checkSize ( filePath: string ): Promise<void> {
checkSize: ( filePath: string ): Promise<void> => {

@@ -120,3 +148,3 @@ return Utils.file.stats ( filePath ).then ( stats => {

async read ( filePath: string ): Promise<Buffer> {
read: async ( filePath: string ): Promise<Uint8Array> => {

@@ -131,3 +159,3 @@ await Utils.file.checkSize ( filePath );

resolve ( data );
return resolve ( data );

@@ -140,3 +168,3 @@ });

stats ( filePath: string ): Promise<Stats> {
stats: ( filePath: string ): Promise<Stats> => {

@@ -149,3 +177,3 @@ return new Promise ( ( resolve, reject ) => {

resolve ( stats );
return resolve ( stats );

@@ -162,3 +190,3 @@ });

name ( filePath: string ): string {
name: ( filePath: string ): string => {

@@ -175,3 +203,3 @@ return path.basename ( filePath, path.extname ( filePath ) );

inferTitle ( content: string ): string | undefined {
inferTitle: ( content: string ): string | undefined => {

@@ -188,3 +216,3 @@ const firstUnemptyLine = content.match ( /^.*?\S.*$/m );

inferTitle ( content: string ): string | undefined {
inferTitle: ( content: string ): string | undefined => {

@@ -201,3 +229,3 @@ const headingMatch = content.match ( /^\s{0,3}#+\s(.*)(\s#+\s*$)?/m );

inferTitle ( content: string ): string | undefined {
inferTitle: ( content: string ): string | undefined => {

@@ -214,3 +242,3 @@ const headingMatch = content.match ( /<h1(?:\s[^>]*)?>(.*?)<\/h1>/i );

ensureTitle ( content: string, title: string ): string {
ensureTitle: ( content: string, title: string ): string => {

@@ -221,4 +249,4 @@ const headingMatch = content.match ( /<h1(?:\s[^>]*)?>(.*?)<\/h1>/i );

const titleTag = `<h1>${title}</h1>`,
bodyIndex = content.indexOf ( '<body>' );
const titleTag = `<h1>${title}</h1>`;
const bodyIndex = content.indexOf ( '<body>' );

@@ -237,3 +265,3 @@ if ( bodyIndex >= 0 ) {

convert ( content: string, title?: string ): string {
convert: ( content: string, title?: string ): string => {

@@ -240,0 +268,0 @@ title = title || Utils.format.html.inferTitle ( content );

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