@gjsify/zlib 0.0.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/README.md +8 -0
- package/lib/cjs/index.js +36 -0
- package/lib/esm/index.js +6 -0
- package/lib/types/index.d.ts +3 -0
- package/package.json +48 -0
- package/src/index.spec.ts +43 -0
- package/src/index.ts +4 -0
- package/src/test.mts +6 -0
- package/test.gjs.js +35635 -0
- package/test.gjs.js.map +7 -0
- package/test.gjs.mjs +40899 -0
- package/test.node.js +1252 -0
- package/test.node.js.map +7 -0
- package/test.node.mjs +333 -0
- package/tsconfig.json +19 -0
- package/tsconfig.types.json +8 -0
- package/tsconfig.types.tsbuildinfo +1 -0
package/README.md
ADDED
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
# @gjsify/zlib
|
|
2
|
+
|
|
3
|
+
Node.js zlib module for Gjs
|
|
4
|
+
## Inspirations and credits
|
|
5
|
+
- https://nodejs.org/api/zlib.html
|
|
6
|
+
- https://github.com/geut/brode/blob/main/packages/browser-node-core/src/zlib.js
|
|
7
|
+
- https://github.com/browserify/browserify-zlib
|
|
8
|
+
- https://github.com/denoland/deno_std/blob/main/node/zlib.ts
|
package/lib/cjs/index.js
ADDED
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
var __create = Object.create;
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
6
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
+
var __export = (target, all) => {
|
|
8
|
+
for (var name in all)
|
|
9
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
10
|
+
};
|
|
11
|
+
var __copyProps = (to, from, except, desc) => {
|
|
12
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
13
|
+
for (let key of __getOwnPropNames(from))
|
|
14
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
15
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
16
|
+
}
|
|
17
|
+
return to;
|
|
18
|
+
};
|
|
19
|
+
var __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default"));
|
|
20
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
22
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
23
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
24
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
25
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
26
|
+
mod
|
|
27
|
+
));
|
|
28
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
|
+
var src_exports = {};
|
|
30
|
+
__export(src_exports, {
|
|
31
|
+
default: () => src_default
|
|
32
|
+
});
|
|
33
|
+
module.exports = __toCommonJS(src_exports);
|
|
34
|
+
__reExport(src_exports, require("@gjsify/deno_std/node/zlib"), module.exports);
|
|
35
|
+
var import_zlib = __toESM(require("@gjsify/deno_std/node/zlib"), 1);
|
|
36
|
+
var src_default = import_zlib.default;
|
package/lib/esm/index.js
ADDED
package/package.json
ADDED
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@gjsify/zlib",
|
|
3
|
+
"version": "0.0.2",
|
|
4
|
+
"description": "Node.js zlib module for Gjs",
|
|
5
|
+
"main": "lib/cjs/index.js",
|
|
6
|
+
"module": "lib/esm/index.js",
|
|
7
|
+
"types": "lib/types/index.d.ts",
|
|
8
|
+
"type": "module",
|
|
9
|
+
"exports": {
|
|
10
|
+
".": {
|
|
11
|
+
"import": {
|
|
12
|
+
"types": "./lib/types/index.d.ts",
|
|
13
|
+
"default": "./lib/esm/index.js"
|
|
14
|
+
},
|
|
15
|
+
"require": {
|
|
16
|
+
"types": "./lib/types/index.d.ts",
|
|
17
|
+
"default": "./lib/cjs/index.js"
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
},
|
|
21
|
+
"scripts": {
|
|
22
|
+
"clear": "rm -rf lib tsconfig.tsbuildinfo tsconfig.types.tsbuildinfo || exit 0",
|
|
23
|
+
"print:name": "echo '@gjsify/zlib'",
|
|
24
|
+
"build": "yarn print:name && yarn build:gjsify && yarn build:types",
|
|
25
|
+
"build:gjsify": "gjsify build --library 'src/**/*.{ts,js}' --exclude 'src/**/*.spec.{mts,ts}' 'src/test.{mts,ts}'",
|
|
26
|
+
"build:types": "tsc --project tsconfig.types.json || exit 0",
|
|
27
|
+
"build:test": "yarn build:test:gjs && yarn build:test:node",
|
|
28
|
+
"build:test:gjs": "gjsify build src/test.mts --app gjs --outfile test.gjs.mjs",
|
|
29
|
+
"build:test:node": "gjsify build src/test.mts --app node --outfile test.node.mjs",
|
|
30
|
+
"test": "yarn print:name && yarn build:gjsify && yarn build:test && yarn test:node && yarn test:gjs",
|
|
31
|
+
"test:gjs": "gjs -m test.gjs.mjs",
|
|
32
|
+
"test:node": "node test.node.mjs"
|
|
33
|
+
},
|
|
34
|
+
"keywords": [
|
|
35
|
+
"gjs",
|
|
36
|
+
"node",
|
|
37
|
+
"zlib"
|
|
38
|
+
],
|
|
39
|
+
"devDependencies": {
|
|
40
|
+
"@gjsify/cli": "^0.0.2",
|
|
41
|
+
"@gjsify/unit": "^0.0.2",
|
|
42
|
+
"@types/node": "^20.3.1",
|
|
43
|
+
"typescript": "^5.1.3"
|
|
44
|
+
},
|
|
45
|
+
"dependencies": {
|
|
46
|
+
"@gjsify/deno_std": "^0.0.2"
|
|
47
|
+
}
|
|
48
|
+
}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { describe, it, expect } from '@gjsify/unit';
|
|
2
|
+
|
|
3
|
+
import { deflateRaw, inflateRaw, deflate, inflate, gzip, gunzip } from 'zlib';
|
|
4
|
+
|
|
5
|
+
export default async () => {
|
|
6
|
+
|
|
7
|
+
await describe('zlib.deflateRaw', async () => {
|
|
8
|
+
await it('should be a function', async () => {
|
|
9
|
+
expect(typeof deflateRaw).toBe("function");
|
|
10
|
+
});
|
|
11
|
+
});
|
|
12
|
+
|
|
13
|
+
await describe('zlib.inflateRaw', async () => {
|
|
14
|
+
await it('should be a function', async () => {
|
|
15
|
+
expect(typeof inflateRaw).toBe("function");
|
|
16
|
+
});
|
|
17
|
+
});
|
|
18
|
+
|
|
19
|
+
await describe('zlib.deflate', async () => {
|
|
20
|
+
await it('should be a function', async () => {
|
|
21
|
+
expect(typeof deflate).toBe("function");
|
|
22
|
+
});
|
|
23
|
+
});
|
|
24
|
+
|
|
25
|
+
await describe('zlib.inflate', async () => {
|
|
26
|
+
await it('should be a function', async () => {
|
|
27
|
+
expect(typeof inflate).toBe("function");
|
|
28
|
+
});
|
|
29
|
+
});
|
|
30
|
+
|
|
31
|
+
await describe('zlib.gzip', async () => {
|
|
32
|
+
await it('should be a function', async () => {
|
|
33
|
+
expect(typeof gzip).toBe("function");
|
|
34
|
+
});
|
|
35
|
+
});
|
|
36
|
+
|
|
37
|
+
await describe('zlib.gunzip', async () => {
|
|
38
|
+
await it('should be a function', async () => {
|
|
39
|
+
expect(typeof gunzip).toBe("function");
|
|
40
|
+
});
|
|
41
|
+
});
|
|
42
|
+
|
|
43
|
+
}
|
package/src/index.ts
ADDED