@naturalcycles/nodejs-lib 13.30.0 → 13.30.2

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/dist/index.d.ts CHANGED
@@ -1,20 +1,29 @@
1
1
  import Ajv from 'ajv';
2
- import fastGlob from 'fast-glob';
3
2
  import type { Options as FastGlobOptions } from 'fast-glob';
4
- import globby from 'globby';
3
+ import fastGlob from 'fast-glob';
5
4
  import type { GlobbyOptions } from 'globby';
6
- import type { AnySchema, ValidationErrorItem, AlternativesSchema, ArraySchema, BinarySchema, BooleanSchema, DateSchema, FunctionSchema, ObjectSchema } from 'joi';
5
+ import globby from 'globby';
6
+ import type { AlternativesSchema, AnySchema, ArraySchema, BinarySchema, BooleanSchema, DateSchema, FunctionSchema, ObjectSchema, ValidationErrorItem } from 'joi';
7
7
  export * from './buffer/buffer.util';
8
+ export * from './colors/colors';
9
+ export * from './csv/csvReader';
10
+ export * from './csv/csvWriter';
11
+ export * from './csv/transformToCSV';
8
12
  export * from './diff/tableDiff';
13
+ export * from './fs/del';
14
+ export * from './fs/fs2';
15
+ export * from './fs/json2env';
16
+ export * from './fs/kpy';
9
17
  export * from './infra/process.util';
18
+ export * from './jwt/jwt.service';
10
19
  export * from './log/debug';
11
- export * from './security/hash.util';
20
+ export * from './log/log.util';
21
+ export * from './script/runScript';
12
22
  export * from './security/crypto.util';
23
+ export * from './security/hash.util';
13
24
  export * from './security/id.util';
14
25
  export * from './security/nanoid';
15
26
  export * from './security/secret.util';
16
- export * from './colors/colors';
17
- export * from './log/log.util';
18
27
  export * from './slack/slack.service';
19
28
  export * from './slack/slack.service.model';
20
29
  export * from './stream/ndjson/ndjson.model';
@@ -23,26 +32,26 @@ export * from './stream/ndjson/ndjsonStreamForEach';
23
32
  export * from './stream/ndjson/transformJsonParse';
24
33
  export * from './stream/ndjson/transformToNDJson';
25
34
  export * from './stream/pipeline/pipeline';
35
+ export * from './stream/progressLogger';
26
36
  export * from './stream/readable/readableCreate';
27
37
  export * from './stream/readable/readableForEach';
28
38
  export * from './stream/readable/readableFromArray';
29
39
  export * from './stream/readable/readableToArray';
30
40
  export * from './stream/stream.model';
31
- export * from './stream/progressLogger';
32
41
  export * from './stream/transform/transformChunk';
33
42
  export * from './stream/transform/transformFilter';
34
43
  export * from './stream/transform/transformLimit';
35
- export * from './stream/transform/transformOffset';
36
44
  export * from './stream/transform/transformLogProgress';
37
45
  export * from './stream/transform/transformMap';
38
46
  export * from './stream/transform/transformMapSimple';
39
- export * from './stream/transform/transformNoOp';
40
47
  export * from './stream/transform/transformMapSync';
48
+ export * from './stream/transform/transformNoOp';
49
+ export * from './stream/transform/transformOffset';
41
50
  export * from './stream/transform/transformSplit';
42
51
  export * from './stream/transform/transformTap';
43
- export * from './stream/transform/transformToArray';
44
52
  export * from './stream/transform/transformTee';
45
53
  export * from './stream/transform/transformThrottle';
54
+ export * from './stream/transform/transformToArray';
46
55
  export * from './stream/transform/worker/baseWorkerClass';
47
56
  export * from './stream/transform/worker/transformMultiThreaded';
48
57
  export * from './stream/transform/worker/transformMultiThreaded.model';
@@ -50,16 +59,13 @@ export * from './stream/writable/writableForEach';
50
59
  export * from './stream/writable/writableFork';
51
60
  export * from './stream/writable/writablePushToArray';
52
61
  export * from './stream/writable/writableVoid';
53
- export * from './csv/csvWriter';
54
- export * from './csv/csvReader';
55
- export * from './csv/transformToCSV';
56
62
  export * from './string/inspect';
63
+ export * from './util/buildInfo.util';
57
64
  export * from './util/env.util';
58
- export * from './util/lruMemoCache';
59
- export * from './util/zip.util';
60
65
  export * from './util/exec.util';
61
66
  export * from './util/git.util';
62
- export * from './util/buildInfo.util';
67
+ export * from './util/lruMemoCache';
68
+ export * from './util/zip.util';
63
69
  export * from './validation/ajv/ajv.util';
64
70
  export * from './validation/ajv/ajvSchema';
65
71
  export * from './validation/ajv/ajvValidationError';
@@ -69,11 +75,5 @@ export * from './validation/joi/joi.model';
69
75
  export * from './validation/joi/joi.shared.schemas';
70
76
  export * from './validation/joi/joi.validation.error';
71
77
  export * from './validation/joi/joi.validation.util';
72
- export * from './script/runScript';
73
- export * from './jwt/jwt.service';
74
- export * from './fs/fs2';
75
- export * from './fs/del';
76
- export * from './fs/json2env';
77
- export * from './fs/kpy';
78
- export type { GlobbyOptions, FastGlobOptions, ValidationErrorItem, AlternativesSchema, AnySchema, ArraySchema, BinarySchema, BooleanSchema, DateSchema, FunctionSchema, ObjectSchema, };
79
- export { globby, fastGlob, Ajv };
78
+ export type { AlternativesSchema, AnySchema, ArraySchema, BinarySchema, BooleanSchema, DateSchema, FastGlobOptions, FunctionSchema, GlobbyOptions, ObjectSchema, ValidationErrorItem, };
79
+ export { Ajv, fastGlob, globby };
package/dist/index.js CHANGED
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.Ajv = exports.fastGlob = exports.globby = void 0;
3
+ exports.globby = exports.fastGlob = exports.Ajv = void 0;
4
4
  const tslib_1 = require("tslib");
5
5
  const ajv_1 = tslib_1.__importDefault(require("ajv"));
6
6
  exports.Ajv = ajv_1.default;
@@ -9,16 +9,25 @@ exports.fastGlob = fast_glob_1.default;
9
9
  const globby_1 = tslib_1.__importDefault(require("globby"));
10
10
  exports.globby = globby_1.default;
11
11
  tslib_1.__exportStar(require("./buffer/buffer.util"), exports);
12
+ tslib_1.__exportStar(require("./colors/colors"), exports);
13
+ tslib_1.__exportStar(require("./csv/csvReader"), exports);
14
+ tslib_1.__exportStar(require("./csv/csvWriter"), exports);
15
+ tslib_1.__exportStar(require("./csv/transformToCSV"), exports);
12
16
  tslib_1.__exportStar(require("./diff/tableDiff"), exports);
17
+ tslib_1.__exportStar(require("./fs/del"), exports);
18
+ tslib_1.__exportStar(require("./fs/fs2"), exports);
19
+ tslib_1.__exportStar(require("./fs/json2env"), exports);
20
+ tslib_1.__exportStar(require("./fs/kpy"), exports);
13
21
  tslib_1.__exportStar(require("./infra/process.util"), exports);
22
+ tslib_1.__exportStar(require("./jwt/jwt.service"), exports);
14
23
  tslib_1.__exportStar(require("./log/debug"), exports);
15
- tslib_1.__exportStar(require("./security/hash.util"), exports);
24
+ tslib_1.__exportStar(require("./log/log.util"), exports);
25
+ tslib_1.__exportStar(require("./script/runScript"), exports);
16
26
  tslib_1.__exportStar(require("./security/crypto.util"), exports);
27
+ tslib_1.__exportStar(require("./security/hash.util"), exports);
17
28
  tslib_1.__exportStar(require("./security/id.util"), exports);
18
29
  tslib_1.__exportStar(require("./security/nanoid"), exports);
19
30
  tslib_1.__exportStar(require("./security/secret.util"), exports);
20
- tslib_1.__exportStar(require("./colors/colors"), exports);
21
- tslib_1.__exportStar(require("./log/log.util"), exports);
22
31
  tslib_1.__exportStar(require("./slack/slack.service"), exports);
23
32
  tslib_1.__exportStar(require("./slack/slack.service.model"), exports);
24
33
  tslib_1.__exportStar(require("./stream/ndjson/ndjson.model"), exports);
@@ -27,26 +36,26 @@ tslib_1.__exportStar(require("./stream/ndjson/ndjsonStreamForEach"), exports);
27
36
  tslib_1.__exportStar(require("./stream/ndjson/transformJsonParse"), exports);
28
37
  tslib_1.__exportStar(require("./stream/ndjson/transformToNDJson"), exports);
29
38
  tslib_1.__exportStar(require("./stream/pipeline/pipeline"), exports);
39
+ tslib_1.__exportStar(require("./stream/progressLogger"), exports);
30
40
  tslib_1.__exportStar(require("./stream/readable/readableCreate"), exports);
31
41
  tslib_1.__exportStar(require("./stream/readable/readableForEach"), exports);
32
42
  tslib_1.__exportStar(require("./stream/readable/readableFromArray"), exports);
33
43
  tslib_1.__exportStar(require("./stream/readable/readableToArray"), exports);
34
44
  tslib_1.__exportStar(require("./stream/stream.model"), exports);
35
- tslib_1.__exportStar(require("./stream/progressLogger"), exports);
36
45
  tslib_1.__exportStar(require("./stream/transform/transformChunk"), exports);
37
46
  tslib_1.__exportStar(require("./stream/transform/transformFilter"), exports);
38
47
  tslib_1.__exportStar(require("./stream/transform/transformLimit"), exports);
39
- tslib_1.__exportStar(require("./stream/transform/transformOffset"), exports);
40
48
  tslib_1.__exportStar(require("./stream/transform/transformLogProgress"), exports);
41
49
  tslib_1.__exportStar(require("./stream/transform/transformMap"), exports);
42
50
  tslib_1.__exportStar(require("./stream/transform/transformMapSimple"), exports);
43
- tslib_1.__exportStar(require("./stream/transform/transformNoOp"), exports);
44
51
  tslib_1.__exportStar(require("./stream/transform/transformMapSync"), exports);
52
+ tslib_1.__exportStar(require("./stream/transform/transformNoOp"), exports);
53
+ tslib_1.__exportStar(require("./stream/transform/transformOffset"), exports);
45
54
  tslib_1.__exportStar(require("./stream/transform/transformSplit"), exports);
46
55
  tslib_1.__exportStar(require("./stream/transform/transformTap"), exports);
47
- tslib_1.__exportStar(require("./stream/transform/transformToArray"), exports);
48
56
  tslib_1.__exportStar(require("./stream/transform/transformTee"), exports);
49
57
  tslib_1.__exportStar(require("./stream/transform/transformThrottle"), exports);
58
+ tslib_1.__exportStar(require("./stream/transform/transformToArray"), exports);
50
59
  tslib_1.__exportStar(require("./stream/transform/worker/baseWorkerClass"), exports);
51
60
  tslib_1.__exportStar(require("./stream/transform/worker/transformMultiThreaded"), exports);
52
61
  tslib_1.__exportStar(require("./stream/transform/worker/transformMultiThreaded.model"), exports);
@@ -54,16 +63,13 @@ tslib_1.__exportStar(require("./stream/writable/writableForEach"), exports);
54
63
  tslib_1.__exportStar(require("./stream/writable/writableFork"), exports);
55
64
  tslib_1.__exportStar(require("./stream/writable/writablePushToArray"), exports);
56
65
  tslib_1.__exportStar(require("./stream/writable/writableVoid"), exports);
57
- tslib_1.__exportStar(require("./csv/csvWriter"), exports);
58
- tslib_1.__exportStar(require("./csv/csvReader"), exports);
59
- tslib_1.__exportStar(require("./csv/transformToCSV"), exports);
60
66
  tslib_1.__exportStar(require("./string/inspect"), exports);
67
+ tslib_1.__exportStar(require("./util/buildInfo.util"), exports);
61
68
  tslib_1.__exportStar(require("./util/env.util"), exports);
62
- tslib_1.__exportStar(require("./util/lruMemoCache"), exports);
63
- tslib_1.__exportStar(require("./util/zip.util"), exports);
64
69
  tslib_1.__exportStar(require("./util/exec.util"), exports);
65
70
  tslib_1.__exportStar(require("./util/git.util"), exports);
66
- tslib_1.__exportStar(require("./util/buildInfo.util"), exports);
71
+ tslib_1.__exportStar(require("./util/lruMemoCache"), exports);
72
+ tslib_1.__exportStar(require("./util/zip.util"), exports);
67
73
  tslib_1.__exportStar(require("./validation/ajv/ajv.util"), exports);
68
74
  tslib_1.__exportStar(require("./validation/ajv/ajvSchema"), exports);
69
75
  tslib_1.__exportStar(require("./validation/ajv/ajvValidationError"), exports);
@@ -73,9 +79,3 @@ tslib_1.__exportStar(require("./validation/joi/joi.model"), exports);
73
79
  tslib_1.__exportStar(require("./validation/joi/joi.shared.schemas"), exports);
74
80
  tslib_1.__exportStar(require("./validation/joi/joi.validation.error"), exports);
75
81
  tslib_1.__exportStar(require("./validation/joi/joi.validation.util"), exports);
76
- tslib_1.__exportStar(require("./script/runScript"), exports);
77
- tslib_1.__exportStar(require("./jwt/jwt.service"), exports);
78
- tslib_1.__exportStar(require("./fs/fs2"), exports);
79
- tslib_1.__exportStar(require("./fs/del"), exports);
80
- tslib_1.__exportStar(require("./fs/json2env"), exports);
81
- tslib_1.__exportStar(require("./fs/kpy"), exports);
@@ -1,9 +1,9 @@
1
1
  import { AnyObject, ErrorData, JWTString } from '@naturalcycles/js-lib';
2
2
  import { AnySchema } from 'joi';
3
- import type { Algorithm, VerifyOptions, JwtHeader, SignOptions } from 'jsonwebtoken';
3
+ import type { Algorithm, JwtHeader, SignOptions, VerifyOptions } from 'jsonwebtoken';
4
4
  import jsonwebtoken from 'jsonwebtoken';
5
5
  export { jsonwebtoken };
6
- export type { Algorithm, VerifyOptions, SignOptions, JwtHeader };
6
+ export type { Algorithm, JwtHeader, SignOptions, VerifyOptions };
7
7
  export interface JWTServiceCfg {
8
8
  /**
9
9
  * Public key is required to Verify incoming tokens.
@@ -1,5 +1,5 @@
1
1
  import { AbortableAsyncMapper } from '@naturalcycles/js-lib';
2
- import { TransformMapOptions, TransformLogProgressOptions } from '../..';
2
+ import { TransformLogProgressOptions, TransformMapOptions } from '../..';
3
3
  export interface NDJSONMapOptions<IN = any, OUT = IN> extends TransformMapOptions<IN, OUT>, TransformLogProgressOptions<IN> {
4
4
  inputFilePath: string;
5
5
  outputFilePath: string;
@@ -6,7 +6,7 @@ exports._pipelineToArray = _pipelineToArray;
6
6
  const node_stream_1 = require("node:stream");
7
7
  const promises_1 = require("node:stream/promises");
8
8
  const js_lib_1 = require("@naturalcycles/js-lib");
9
- const index_1 = require("../../index");
9
+ const writablePushToArray_1 = require("../writable/writablePushToArray");
10
10
  /**
11
11
  * Promisified `stream.pipeline`.
12
12
  *
@@ -77,7 +77,7 @@ async function _pipeline(streams, opt = {}) {
77
77
  */
78
78
  async function _pipelineToArray(streams, opt = {}) {
79
79
  const a = [];
80
- await _pipeline([...streams, (0, index_1.writablePushToArray)(a)], opt);
80
+ await _pipeline([...streams, (0, writablePushToArray_1.writablePushToArray)(a)], opt);
81
81
  return a;
82
82
  }
83
83
  class AbortableTransform extends node_stream_1.Transform {
@@ -1,4 +1,4 @@
1
- import { Mapper, AbortableAsyncMapper } from '@naturalcycles/js-lib';
1
+ import { AbortableAsyncMapper, Mapper } from '@naturalcycles/js-lib';
2
2
  import { ReadableTyped } from '../../index';
3
3
  import { TransformMapOptions } from '../transform/transformMap';
4
4
  /**
@@ -1,5 +1,5 @@
1
1
  import { InspectOptions } from 'node:util';
2
- import { StringifyOptions, JsonStringifyFunction } from '@naturalcycles/js-lib';
2
+ import { JsonStringifyFunction, StringifyOptions } from '@naturalcycles/js-lib';
3
3
  export interface InspectAnyOptions extends StringifyOptions, InspectOptions {
4
4
  }
5
5
  /**
@@ -1,5 +1,5 @@
1
- import type { ValuesOf } from '@naturalcycles/js-lib';
2
1
  import 'dotenv/config';
2
+ import type { ValuesOf } from '@naturalcycles/js-lib';
3
3
  /**
4
4
  * @example
5
5
  *
@@ -3,8 +3,8 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.requireEnvKeys = requireEnvKeys;
4
4
  exports.requireFileToExist = requireFileToExist;
5
5
  const tslib_1 = require("tslib");
6
- const node_fs_1 = tslib_1.__importDefault(require("node:fs"));
7
6
  require("dotenv/config"); // ensure .env is read before requiring keys
7
+ const node_fs_1 = tslib_1.__importDefault(require("node:fs"));
8
8
  /**
9
9
  * @example
10
10
  *
@@ -1,4 +1,4 @@
1
- import { JsonSchema, JsonSchemaBuilder, CommonLogger } from '@naturalcycles/js-lib';
1
+ import { CommonLogger, JsonSchema, JsonSchemaBuilder } from '@naturalcycles/js-lib';
2
2
  import Ajv from 'ajv';
3
3
  import { AjvValidationError } from './ajvValidationError';
4
4
  export interface AjvValidationOptions {
@@ -1,5 +1,5 @@
1
- import Ajv from 'ajv';
2
1
  import type { Options } from 'ajv';
2
+ import Ajv from 'ajv';
3
3
  /**
4
4
  * Create Ajv with modified defaults.
5
5
  *
@@ -57,8 +57,8 @@ function oneOfSchema(...schemas) {
57
57
  exports.anySchema = joi_extensions_1.Joi.any();
58
58
  exports.anyObjectSchema = joi_extensions_1.Joi.object().options({ stripUnknown: false });
59
59
  exports.BASE62_REGEX = /^[a-zA-Z0-9]+$/;
60
- exports.BASE64_REGEX = /^[A-Za-z0-9+/]+={0,2}$/;
61
- exports.BASE64URL_REGEX = /^[\w-/]+$/;
60
+ exports.BASE64_REGEX = /^[a-zA-Z0-9+/]+={0,2}$/;
61
+ exports.BASE64URL_REGEX = /^[a-zA-Z0-9_-]+$/;
62
62
  exports.base62Schema = exports.stringSchema.regex(exports.BASE62_REGEX);
63
63
  exports.base64Schema = exports.stringSchema.regex(exports.BASE64_REGEX);
64
64
  exports.base64UrlSchema = exports.stringSchema.regex(exports.BASE64URL_REGEX);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@naturalcycles/nodejs-lib",
3
- "version": "13.30.0",
3
+ "version": "13.30.2",
4
4
  "scripts": {
5
5
  "prepare": "husky",
6
6
  "docs-serve": "vuepress dev docs",
package/src/fs/del.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { pFilter, pMap, _since } from '@naturalcycles/js-lib'
1
+ import { _since, pFilter, pMap } from '@naturalcycles/js-lib'
2
2
  import { dimGrey, yellow } from '../colors/colors'
3
3
  import { fs2, globby } from '../index'
4
4
 
package/src/index.ts CHANGED
@@ -1,30 +1,39 @@
1
1
  import Ajv from 'ajv'
2
- import fastGlob from 'fast-glob'
3
2
  import type { Options as FastGlobOptions } from 'fast-glob'
4
- import globby from 'globby'
3
+ import fastGlob from 'fast-glob'
5
4
  import type { GlobbyOptions } from 'globby'
5
+ import globby from 'globby'
6
6
  import type {
7
- AnySchema,
8
- ValidationErrorItem,
9
7
  AlternativesSchema,
8
+ AnySchema,
10
9
  ArraySchema,
11
10
  BinarySchema,
12
11
  BooleanSchema,
13
12
  DateSchema,
14
13
  FunctionSchema,
15
14
  ObjectSchema,
15
+ ValidationErrorItem,
16
16
  } from 'joi'
17
17
  export * from './buffer/buffer.util'
18
+ export * from './colors/colors'
19
+ export * from './csv/csvReader'
20
+ export * from './csv/csvWriter'
21
+ export * from './csv/transformToCSV'
18
22
  export * from './diff/tableDiff'
23
+ export * from './fs/del'
24
+ export * from './fs/fs2'
25
+ export * from './fs/json2env'
26
+ export * from './fs/kpy'
19
27
  export * from './infra/process.util'
28
+ export * from './jwt/jwt.service'
20
29
  export * from './log/debug'
21
- export * from './security/hash.util'
30
+ export * from './log/log.util'
31
+ export * from './script/runScript'
22
32
  export * from './security/crypto.util'
33
+ export * from './security/hash.util'
23
34
  export * from './security/id.util'
24
35
  export * from './security/nanoid'
25
36
  export * from './security/secret.util'
26
- export * from './colors/colors'
27
- export * from './log/log.util'
28
37
  export * from './slack/slack.service'
29
38
  export * from './slack/slack.service.model'
30
39
  export * from './stream/ndjson/ndjson.model'
@@ -33,26 +42,26 @@ export * from './stream/ndjson/ndjsonStreamForEach'
33
42
  export * from './stream/ndjson/transformJsonParse'
34
43
  export * from './stream/ndjson/transformToNDJson'
35
44
  export * from './stream/pipeline/pipeline'
45
+ export * from './stream/progressLogger'
36
46
  export * from './stream/readable/readableCreate'
37
47
  export * from './stream/readable/readableForEach'
38
48
  export * from './stream/readable/readableFromArray'
39
49
  export * from './stream/readable/readableToArray'
40
50
  export * from './stream/stream.model'
41
- export * from './stream/progressLogger'
42
51
  export * from './stream/transform/transformChunk'
43
52
  export * from './stream/transform/transformFilter'
44
53
  export * from './stream/transform/transformLimit'
45
- export * from './stream/transform/transformOffset'
46
54
  export * from './stream/transform/transformLogProgress'
47
55
  export * from './stream/transform/transformMap'
48
56
  export * from './stream/transform/transformMapSimple'
49
- export * from './stream/transform/transformNoOp'
50
57
  export * from './stream/transform/transformMapSync'
58
+ export * from './stream/transform/transformNoOp'
59
+ export * from './stream/transform/transformOffset'
51
60
  export * from './stream/transform/transformSplit'
52
61
  export * from './stream/transform/transformTap'
53
- export * from './stream/transform/transformToArray'
54
62
  export * from './stream/transform/transformTee'
55
63
  export * from './stream/transform/transformThrottle'
64
+ export * from './stream/transform/transformToArray'
56
65
  export * from './stream/transform/worker/baseWorkerClass'
57
66
  export * from './stream/transform/worker/transformMultiThreaded'
58
67
  export * from './stream/transform/worker/transformMultiThreaded.model'
@@ -60,16 +69,13 @@ export * from './stream/writable/writableForEach'
60
69
  export * from './stream/writable/writableFork'
61
70
  export * from './stream/writable/writablePushToArray'
62
71
  export * from './stream/writable/writableVoid'
63
- export * from './csv/csvWriter'
64
- export * from './csv/csvReader'
65
- export * from './csv/transformToCSV'
66
72
  export * from './string/inspect'
73
+ export * from './util/buildInfo.util'
67
74
  export * from './util/env.util'
68
- export * from './util/lruMemoCache'
69
- export * from './util/zip.util'
70
75
  export * from './util/exec.util'
71
76
  export * from './util/git.util'
72
- export * from './util/buildInfo.util'
77
+ export * from './util/lruMemoCache'
78
+ export * from './util/zip.util'
73
79
  export * from './validation/ajv/ajv.util'
74
80
  export * from './validation/ajv/ajvSchema'
75
81
  export * from './validation/ajv/ajvValidationError'
@@ -79,28 +85,22 @@ export * from './validation/joi/joi.model'
79
85
  export * from './validation/joi/joi.shared.schemas'
80
86
  export * from './validation/joi/joi.validation.error'
81
87
  export * from './validation/joi/joi.validation.util'
82
- export * from './script/runScript'
83
- export * from './jwt/jwt.service'
84
- export * from './fs/fs2'
85
- export * from './fs/del'
86
- export * from './fs/json2env'
87
- export * from './fs/kpy'
88
88
 
89
89
  export type {
90
- GlobbyOptions,
91
- FastGlobOptions,
92
- ValidationErrorItem,
93
90
  AlternativesSchema,
94
91
  AnySchema,
95
92
  ArraySchema,
96
93
  BinarySchema,
97
94
  BooleanSchema,
98
95
  DateSchema,
96
+ FastGlobOptions,
99
97
  FunctionSchema,
98
+ GlobbyOptions,
100
99
  ObjectSchema,
100
+ ValidationErrorItem,
101
101
  // extended
102
102
  // NumberSchema,
103
103
  // StringSchema,
104
104
  }
105
105
 
106
- export { globby, fastGlob, Ajv }
106
+ export { Ajv, fastGlob, globby }
@@ -1,11 +1,11 @@
1
1
  import { _assert, _errorDataAppend, AnyObject, ErrorData, JWTString } from '@naturalcycles/js-lib'
2
2
  import { AnySchema } from 'joi'
3
- import type { Algorithm, VerifyOptions, JwtHeader, SignOptions } from 'jsonwebtoken'
3
+ import type { Algorithm, JwtHeader, SignOptions, VerifyOptions } from 'jsonwebtoken'
4
4
  import jsonwebtoken from 'jsonwebtoken'
5
5
  import { anyObjectSchema } from '../validation/joi/joi.shared.schemas'
6
6
  import { validate } from '../validation/joi/joi.validation.util'
7
7
  export { jsonwebtoken }
8
- export type { Algorithm, VerifyOptions, SignOptions, JwtHeader }
8
+ export type { Algorithm, JwtHeader, SignOptions, VerifyOptions }
9
9
 
10
10
  export interface JWTServiceCfg {
11
11
  /**
@@ -1,5 +1,5 @@
1
- import { pDelay, setGlobalStringifyFunction } from '@naturalcycles/js-lib'
2
1
  import type { CommonLogger } from '@naturalcycles/js-lib'
2
+ import { pDelay, setGlobalStringifyFunction } from '@naturalcycles/js-lib'
3
3
  import { inspectStringifyFn } from '../string/inspect'
4
4
 
5
5
  export interface RunScriptOptions {
@@ -1,12 +1,12 @@
1
1
  import { AbortableAsyncMapper, ErrorMode } from '@naturalcycles/js-lib'
2
2
  import {
3
+ _pipeline,
4
+ fs2,
3
5
  transformLimit,
4
6
  transformLogProgress,
7
+ TransformLogProgressOptions,
5
8
  transformMap,
6
9
  TransformMapOptions,
7
- _pipeline,
8
- TransformLogProgressOptions,
9
- fs2,
10
10
  } from '../..'
11
11
 
12
12
  export interface NDJSONMapOptions<IN = any, OUT = IN>
@@ -1,12 +1,12 @@
1
1
  import { AbortableAsyncMapper, ErrorMode } from '@naturalcycles/js-lib'
2
2
  import {
3
+ _pipeline,
4
+ fs2,
3
5
  transformLogProgress,
4
6
  TransformLogProgressOptions,
5
7
  transformMap,
6
8
  TransformMapOptions,
7
9
  writableVoid,
8
- _pipeline,
9
- fs2,
10
10
  } from '../..'
11
11
 
12
12
  export interface NDJSONStreamForEachOptions<IN = any>
@@ -1,7 +1,7 @@
1
1
  import { Readable, Transform, Writable } from 'node:stream'
2
2
  import { pipeline } from 'node:stream/promises'
3
3
  import { _last, AnyFunction, DeferredPromise, pDefer } from '@naturalcycles/js-lib'
4
- import { writablePushToArray } from '../../index'
4
+ import { writablePushToArray } from '../writable/writablePushToArray'
5
5
 
6
6
  type AnyStream = NodeJS.ReadableStream | NodeJS.WritableStream | NodeJS.ReadWriteStream
7
7
 
@@ -1,5 +1,5 @@
1
- import { Mapper, _passNothingPredicate, AbortableAsyncMapper } from '@naturalcycles/js-lib'
2
- import { ReadableTyped, _pipeline } from '../../index'
1
+ import { _passNothingPredicate, AbortableAsyncMapper, Mapper } from '@naturalcycles/js-lib'
2
+ import { _pipeline, ReadableTyped } from '../../index'
3
3
  import { transformMap, TransformMapOptions } from '../transform/transformMap'
4
4
 
5
5
  /**
@@ -1,5 +1,5 @@
1
1
  import { Worker } from 'node:worker_threads'
2
- import { DeferredPromise, pDefer, _range, AnyObject } from '@naturalcycles/js-lib'
2
+ import { _range, AnyObject, DeferredPromise, pDefer } from '@naturalcycles/js-lib'
3
3
  import through2Concurrent = require('through2-concurrent')
4
4
  import { TransformTyped } from '../../stream.model'
5
5
  import { WorkerInput, WorkerOutput } from './transformMultiThreaded.model'
@@ -1,4 +1,4 @@
1
- import { AsyncMapper, _passNothingPredicate, Mapper } from '@naturalcycles/js-lib'
1
+ import { _passNothingPredicate, AsyncMapper, Mapper } from '@naturalcycles/js-lib'
2
2
  import { transformMap, TransformMapOptions, transformMapSync } from '../..'
3
3
  import { WritableTyped } from '../stream.model'
4
4
 
@@ -1,5 +1,5 @@
1
1
  import { Writable } from 'node:stream'
2
- import { readableCreate, ReadableTyped, _pipeline } from '../..'
2
+ import { _pipeline, readableCreate, ReadableTyped } from '../..'
3
3
  import { TransformOptions, WritableTyped } from '../stream.model'
4
4
 
5
5
  /**
@@ -1,5 +1,5 @@
1
1
  import { inspect, InspectOptions } from 'node:util'
2
- import { StringifyOptions, _stringify, JsonStringifyFunction } from '@naturalcycles/js-lib'
2
+ import { _stringify, JsonStringifyFunction, StringifyOptions } from '@naturalcycles/js-lib'
3
3
 
4
4
  export interface InspectAnyOptions extends StringifyOptions, InspectOptions {}
5
5
 
@@ -1,6 +1,6 @@
1
+ import 'dotenv/config' // ensure .env is read before requiring keys
1
2
  import fs from 'node:fs'
2
3
  import type { ValuesOf } from '@naturalcycles/js-lib'
3
- import 'dotenv/config' // ensure .env is read before requiring keys
4
4
 
5
5
  /**
6
6
  * @example
@@ -1,6 +1,6 @@
1
1
  import { JsonSchema } from '@naturalcycles/js-lib'
2
- import { fastGlob, fs2 } from '../..'
3
2
  import type { FastGlobOptions } from '../..'
3
+ import { fastGlob, fs2 } from '../..'
4
4
  import { AjvSchema, AjvSchemaCfg } from './ajvSchema'
5
5
 
6
6
  /**
@@ -1,11 +1,11 @@
1
1
  import {
2
- JsonSchema,
3
- JsonSchemaAnyBuilder,
4
- JsonSchemaBuilder,
5
2
  _filterNullishValues,
6
3
  _isObject,
7
4
  _substringBefore,
8
5
  CommonLogger,
6
+ JsonSchema,
7
+ JsonSchemaAnyBuilder,
8
+ JsonSchemaBuilder,
9
9
  } from '@naturalcycles/js-lib'
10
10
  import Ajv, { ValidateFunction } from 'ajv'
11
11
  import { _inspect, fs2, requireFileToExist } from '../../index'
@@ -1,5 +1,5 @@
1
- import Ajv from 'ajv'
2
1
  import type { Options } from 'ajv'
2
+ import Ajv from 'ajv'
3
3
 
4
4
  const AJV_OPTIONS: Options = {
5
5
  removeAdditional: true,
@@ -1,6 +1,6 @@
1
1
  import JoiLib from 'joi'
2
- import { NumberSchema, numberExtensions } from './number.extensions'
3
- import { StringSchema, stringExtensions } from './string.extensions'
2
+ import { numberExtensions, NumberSchema } from './number.extensions'
3
+ import { stringExtensions, StringSchema } from './string.extensions'
4
4
 
5
5
  export interface ExtendedJoi extends JoiLib.Root {
6
6
  // eslint-disable-next-line id-blacklist
@@ -76,8 +76,8 @@ export const anySchema = Joi.any()
76
76
  export const anyObjectSchema: ObjectSchema = Joi.object().options({ stripUnknown: false })
77
77
 
78
78
  export const BASE62_REGEX = /^[a-zA-Z0-9]+$/
79
- export const BASE64_REGEX = /^[A-Za-z0-9+/]+={0,2}$/
80
- export const BASE64URL_REGEX = /^[\w-/]+$/
79
+ export const BASE64_REGEX = /^[a-zA-Z0-9+/]+={0,2}$/
80
+ export const BASE64URL_REGEX = /^[a-zA-Z0-9_-]+$/
81
81
  export const base62Schema = stringSchema.regex(BASE62_REGEX)
82
82
  export const base64Schema = stringSchema.regex(BASE64_REGEX)
83
83
  export const base64UrlSchema = stringSchema.regex(BASE64URL_REGEX)