@naturalcycles/nodejs-lib 15.92.1 → 15.94.0
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/jwt/jwt.service.d.ts +4 -4
- package/dist/validation/ajv/from-data/generateJsonSchemaFromData.d.ts +1 -1
- package/dist/validation/ajv/getAjv.d.ts +1 -1
- package/dist/validation/ajv/index.d.ts +1 -1
- package/dist/validation/ajv/index.js +1 -1
- package/dist/validation/ajv/{ajvSchema.d.ts → jSchema.d.ts} +232 -271
- package/dist/validation/ajv/{ajvSchema.js → jSchema.js} +453 -460
- package/dist/validation/ajv/jsonSchemaBuilder.util.d.ts +1 -1
- package/dist/zip/zip.util.d.ts +3 -0
- package/dist/zip/zip.util.js +10 -0
- package/package.json +2 -2
- package/src/jwt/jwt.service.ts +8 -4
- package/src/validation/ajv/from-data/generateJsonSchemaFromData.ts +2 -2
- package/src/validation/ajv/getAjv.ts +5 -5
- package/src/validation/ajv/index.ts +1 -1
- package/src/validation/ajv/{ajvSchema.ts → jSchema.ts} +1447 -1471
- package/src/validation/ajv/jsonSchemaBuilder.util.ts +1 -1
- package/src/zip/zip.util.ts +16 -0
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { _uniq } from '@naturalcycles/js-lib/array'
|
|
2
2
|
import { _filterNullishValues } from '@naturalcycles/js-lib/object'
|
|
3
3
|
import type { AnyObject } from '@naturalcycles/js-lib/types'
|
|
4
|
-
import type { JsonSchema } from './
|
|
4
|
+
import type { JsonSchema } from './jSchema.js'
|
|
5
5
|
|
|
6
6
|
export const JSON_SCHEMA_ORDER = [
|
|
7
7
|
'$schema',
|
package/src/zip/zip.util.ts
CHANGED
|
@@ -96,6 +96,14 @@ export async function zstdCompress(
|
|
|
96
96
|
return await zstdCompressAsync(input, zstdLevelToOptions(level, options))
|
|
97
97
|
}
|
|
98
98
|
|
|
99
|
+
export function zstdCompressSync(
|
|
100
|
+
input: Buffer | string,
|
|
101
|
+
level?: Integer, // defaults to 3
|
|
102
|
+
options: ZstdOptions = {},
|
|
103
|
+
): Buffer<ArrayBuffer> {
|
|
104
|
+
return zlib.zstdCompressSync(input, zstdLevelToOptions(level, options))
|
|
105
|
+
}
|
|
106
|
+
|
|
99
107
|
export function zstdLevelToOptions(level: Integer | undefined, opt: ZstdOptions = {}): ZstdOptions {
|
|
100
108
|
if (!level) return opt
|
|
101
109
|
|
|
@@ -122,6 +130,14 @@ export async function zstdDecompress(
|
|
|
122
130
|
return await zstdDecompressAsync(input, options)
|
|
123
131
|
}
|
|
124
132
|
|
|
133
|
+
export function zstdDecompressToStringSync(input: Buffer, options: ZstdOptions = {}): string {
|
|
134
|
+
return zlib.zstdDecompressSync(input, options).toString()
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
export function zstdDecompressSync(input: Buffer, options: ZstdOptions = {}): Buffer<ArrayBuffer> {
|
|
138
|
+
return zlib.zstdDecompressSync(input, options)
|
|
139
|
+
}
|
|
140
|
+
|
|
125
141
|
const ZSTD_MAGIC_NUMBER = 0xfd2fb528
|
|
126
142
|
|
|
127
143
|
export function isZstdBuffer(input: Buffer): boolean {
|