Skip to content

Commit

Permalink
create directory.
Browse files Browse the repository at this point in the history
  • Loading branch information
dojyorin committed Jan 24, 2024
1 parent fe7c313 commit aa00f4b
Show file tree
Hide file tree
Showing 43 changed files with 100 additions and 99 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,12 @@ The actual binary structure looks like this:
This structure is repeats for the number of files.

# Browser
Collected only parts of this module that not use the `Deno` namespace and prepared as browser-compatible code to [`mod.universal.ts`](./mod.universal.ts).
Collected only parts of this module that not use the `Deno` namespace and prepared as browser-compatible pure JavaScript to [`mod.pure.ts`](./mod.pure.ts).

You can use script from [esm.sh](https://esm.sh).

```ts
import {fetchExtend} from "https://esm.sh/gh/dojyorin/deno_simple_utility@version/mod.universal.ts?bundle&target=esnext";
import {fetchExtend} from "https://esm.sh/gh/dojyorin/deno_simple_utility@version/mod.pure.ts?bundle&target=esnext";
```

# API
Expand Down
13 changes: 13 additions & 0 deletions mod.pure.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
export * from "./src/pure/base64.ts";
export * from "./src/pure/byte.ts";
export * from "./src/pure/crypto.ts";
export * from "./src/pure/deep.ts";
export * from "./src/pure/deflate.ts";
export * from "./src/pure/fetch.ts";
export * from "./src/pure/import.ts";
export * from "./src/pure/minipack.ts";
export * from "./src/pure/primitive.ts";
export * from "./src/pure/stream.ts";
export * from "./src/pure/text.ts";
export * from "./src/pure/time.ts";
export * from "./src/pure/worker.ts";
39 changes: 20 additions & 19 deletions mod.test.ts
Original file line number Diff line number Diff line change
@@ -1,19 +1,20 @@
import "./test/base64.test.ts";
import "./test/byte.test.ts";
import "./test/crypto.test.ts";
import "./test/csv.deno.test.ts";
import "./test/deep.test.ts";
import "./test/deflate.test.ts";
import "./test/fetch.test.ts";
import "./test/import.test.ts";
import "./test/json.deno.test.ts";
import "./test/log.deno.test.ts";
import "./test/minipack.test.ts";
import "./test/path.deno.test.ts";
import "./test/platform.deno.test.ts";
import "./test/primitive.test.ts";
import "./test/process.deno.test.ts";
import "./test/stream.test.ts";
import "./test/text.test.ts";
import "./test/time.test.ts";
import "./test/worker.test.ts";
import "./test/pure/base64.test.ts";
import "./test/pure/byte.test.ts";
import "./test/pure/crypto.test.ts";
import "./test/pure/deep.test.ts";
import "./test/pure/deflate.test.ts";
import "./test/pure/fetch.test.ts";
import "./test/pure/import.test.ts";
import "./test/pure/primitive.test.ts";
import "./test/pure/minipack.test.ts";
import "./test/pure/stream.test.ts";
import "./test/pure/text.test.ts";
import "./test/pure/time.test.ts";
import "./test/pure/worker.test.ts";

import "./test/deno/csv.test.ts";
import "./test/deno/json.test.ts";
import "./test/deno/log.test.ts";
import "./test/deno/path.test.ts";
import "./test/deno/platform.test.ts";
import "./test/deno/process.test.ts";
38 changes: 19 additions & 19 deletions mod.ts
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
export * from "./src/base64.ts";
export * from "./src/byte.ts";
export * from "./src/crypto.ts";
export * from "./src/deep.ts";
export * from "./src/deflate.ts";
export * from "./src/fetch.ts";
export * from "./src/import.ts";
export * from "./src/minipack.ts";
export * from "./src/primitive.ts";
export * from "./src/stream.ts";
export * from "./src/text.ts";
export * from "./src/time.ts";
export * from "./src/worker.ts";
export * from "./src/pure/base64.ts";
export * from "./src/pure/byte.ts";
export * from "./src/pure/crypto.ts";
export * from "./src/pure/deep.ts";
export * from "./src/pure/deflate.ts";
export * from "./src/pure/fetch.ts";
export * from "./src/pure/import.ts";
export * from "./src/pure/minipack.ts";
export * from "./src/pure/primitive.ts";
export * from "./src/pure/stream.ts";
export * from "./src/pure/text.ts";
export * from "./src/pure/time.ts";
export * from "./src/pure/worker.ts";

export * from "./src/csv.deno.ts";
export * from "./src/json.deno.ts";
export * from "./src/log.deno.ts";
export * from "./src/path.deno.ts";
export * from "./src/platform.deno.ts";
export * from "./src/process.deno.ts";
export * from "./src/deno/csv.ts";
export * from "./src/deno/json.ts";
export * from "./src/deno/log.ts";
export * from "./src/deno/path.ts";
export * from "./src/deno/platform.ts";
export * from "./src/deno/process.ts";
13 changes: 0 additions & 13 deletions mod.universal.ts

This file was deleted.

6 changes: 3 additions & 3 deletions src/csv.deno.ts → src/deno/csv.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import {parse, stringify} from "../deps.ts";
import {deepClone} from "./deep.ts";
import {primitiveParseX} from "./primitive.ts";
import {parse, stringify} from "../../deps.ts";
import {deepClone} from "../pure/deep.ts";
import {primitiveParseX} from "../pure/primitive.ts";

/**
* Object containing string, number, or boolean.
Expand Down
2 changes: 1 addition & 1 deletion src/json.deno.ts → src/deno/json.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import {type Opt} from "./deep.ts";
import {type Opt} from "../pure/deep.ts";

/**
* Read JSON file and convert to object.
Expand Down
4 changes: 2 additions & 2 deletions src/log.deno.ts → src/deno/log.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import {Logger, ConsoleHandler, FileHandler, format} from "../deps.ts";
import {mainPath} from "./path.deno.ts";
import {Logger, ConsoleHandler, FileHandler, format} from "../../deps.ts";
import {mainPath} from "./path.ts";

function logRecord(date:Date, level:string, message:string){
return `${format(date, "yyyy-MM-ddTHH:mm:ss")} [${level}] ${message}`;
Expand Down
4 changes: 2 additions & 2 deletions src/path.deno.ts → src/deno/path.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import {dirname, fromFileUrl} from "../deps.ts";
import {isWin} from "./platform.deno.ts";
import {dirname, fromFileUrl} from "../../deps.ts";
import {isWin} from "./platform.ts";

/**
* Convert from backslash to slash.
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
4 changes: 2 additions & 2 deletions test/csv.deno.test.ts → test/deno/csv.test.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import {assertEquals} from "../deps.test.ts";
import {csvEncode, csvDecode} from "../src/csv.deno.ts";
import {assertEquals} from "../../deps.test.ts";
import {csvEncode, csvDecode} from "../../src/deno/csv.ts";

const sample = [{
foo: 123,
Expand Down
4 changes: 2 additions & 2 deletions test/json.deno.test.ts → test/deno/json.test.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import {assertEquals} from "../deps.test.ts";
import {jsonRead, jsonWrite, jsonLoad} from "../src/json.deno.ts";
import {assertEquals} from "../../deps.test.ts";
import {jsonRead, jsonWrite, jsonLoad} from "../../src/deno/json.ts";

const object = <const>{
id: "22d8b040-8a63-46a0-8df6-0f508a778689",
Expand Down
4 changes: 2 additions & 2 deletions test/log.deno.test.ts → test/deno/log.test.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import {assertEquals, exists} from "../deps.test.ts";
import {logEntry} from "../src/log.deno.ts";
import {assertEquals, exists} from "../../deps.test.ts";
import {logEntry} from "../../src/deno/log.ts";

const name = "operation";

Expand Down
4 changes: 2 additions & 2 deletions test/path.deno.test.ts → test/deno/path.test.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import {assertEquals, dirname, fromFileUrl} from "../deps.test.ts";
import {slashU, slashW, tmpPath, dataPath, homePath, mainPath} from "../src/path.deno.ts";
import {assertEquals, dirname, fromFileUrl} from "../../deps.test.ts";
import {slashU, slashW, tmpPath, dataPath, homePath, mainPath} from "../../src/deno/path.ts";

Deno.test({
name: "Path: Separator",
Expand Down
4 changes: 2 additions & 2 deletions test/platform.deno.test.ts → test/deno/platform.test.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import {assertEquals} from "../deps.test.ts";
import {isWin} from "../src/platform.deno.ts";
import {assertEquals} from "../../deps.test.ts";
import {isWin} from "../../src/deno/platform.ts";

Deno.test({
ignore: Deno.build.os !== "windows",
Expand Down
4 changes: 2 additions & 2 deletions test/process.deno.test.ts → test/deno/process.test.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import {assertEquals} from "../deps.test.ts";
import {runCommand} from "../src/process.deno.ts";
import {assertEquals} from "../../deps.test.ts";
import {runCommand} from "../../src/deno/process.ts";

Deno.test({
name: "Process: Run (no args)",
Expand Down
4 changes: 2 additions & 2 deletions test/base64.test.ts → test/pure/base64.test.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import {assertEquals} from "../deps.test.ts";
import {b64Encode, b64Decode, b64DataURL} from "../src/base64.ts";
import {assertEquals} from "../../deps.test.ts";
import {b64Encode, b64Decode, b64DataURL} from "../../src/pure/base64.ts";

const sample1 = new Uint8Array([
0x58, 0x0D, 0xC7, 0x64, 0x21, 0x42, 0x27, 0x76,
Expand Down
4 changes: 2 additions & 2 deletions test/byte.test.ts → test/pure/byte.test.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import {assertEquals} from "../deps.test.ts";
import {blobConvert, byteConcat} from "../src/byte.ts";
import {assertEquals} from "../../deps.test.ts";
import {blobConvert, byteConcat} from "../../src/pure/byte.ts";

const sample = "hello!";

Expand Down
4 changes: 2 additions & 2 deletions test/crypto.test.ts → test/pure/crypto.test.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import {assertEquals} from "../deps.test.ts";
import {generateRandom, deriveHash, pkGenerateECDH, pkGenerateECDSA, pkEncrypt, pkDecrypt, pkSign, pkVerify} from "../src/crypto.ts";
import {assertEquals} from "../../deps.test.ts";
import {generateRandom, deriveHash, pkGenerateECDH, pkGenerateECDSA, pkEncrypt, pkDecrypt, pkSign, pkVerify} from "../../src/pure/crypto.ts";

const sample = new Uint8Array([0x02, 0xF2, 0x5D, 0x1F, 0x1C, 0x34, 0xB9, 0x2F]);

Expand Down
4 changes: 2 additions & 2 deletions test/deep.test.ts → test/pure/deep.test.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import {assertEquals} from "../deps.test.ts";
import {deepClone, deepFreeze, deepSeal} from "../src/deep.ts";
import {assertEquals} from "../../deps.test.ts";
import {deepClone, deepFreeze, deepSeal} from "../../src/pure/deep.ts";

const sample = {
aaa: {
Expand Down
4 changes: 2 additions & 2 deletions test/deflate.test.ts → test/pure/deflate.test.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import {assertEquals} from "../deps.test.ts";
import {deflateEncode, deflateDecode} from "../src/deflate.ts";
import {assertEquals} from "../../deps.test.ts";
import {deflateEncode, deflateDecode} from "../../src/pure/deflate.ts";

const sample = new Uint8Array([
0x71, 0xD6, 0xFB, 0x3D, 0xF9, 0xD9, 0x41, 0x07,
Expand Down
4 changes: 2 additions & 2 deletions test/fetch.test.ts → test/pure/fetch.test.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import {assertEquals} from "../deps.test.ts";
import {fetchExtend} from "../src/fetch.ts";
import {assertEquals} from "../../deps.test.ts";
import {fetchExtend} from "../../src/pure/fetch.ts";

const sample = new Uint8Array([
0x71, 0xD6, 0xFB, 0x3D, 0xF9, 0xD9, 0x41, 0x07,
Expand Down
4 changes: 2 additions & 2 deletions test/import.test.ts → test/pure/import.test.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import {assertEquals} from "../deps.test.ts";
import {importAssert} from "../src/import.ts";
import {assertEquals} from "../../deps.test.ts";
import {importAssert} from "../../src/pure/import.ts";

const expect = <const>{
assert: {
Expand Down
4 changes: 2 additions & 2 deletions test/minipack.test.ts → test/pure/minipack.test.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import {assertEquals} from "../deps.test.ts";
import {mpEncode, mpDecode} from "../src/minipack.ts";
import {assertEquals} from "../../deps.test.ts";
import {mpEncode, mpDecode} from "../../src/pure/minipack.ts";

const sampleBin = new Uint8Array([0x02, 0xF2, 0x5D, 0x1F, 0x1C, 0x34, 0xB9, 0x2F]);
const sampleName = "random.bin";
Expand Down
4 changes: 2 additions & 2 deletions test/primitive.test.ts → test/pure/primitive.test.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import {assertEquals} from "../deps.test.ts";
import {primitiveParse, primitiveParseX} from "../src/primitive.ts";
import {assertEquals} from "../../deps.test.ts";
import {primitiveParse, primitiveParseX} from "../../src/pure/primitive.ts";

Deno.test({
name: "Primitive: Parse",
Expand Down
4 changes: 2 additions & 2 deletions test/stream.test.ts → test/pure/stream.test.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import {assertEquals} from "../deps.test.ts";
import {streamEncode, streamDecode} from "../src/stream.ts";
import {assertEquals} from "../../deps.test.ts";
import {streamEncode, streamDecode} from "../../src/pure/stream.ts";

const sample = new Uint8Array([
0x71, 0xD6, 0xFB, 0x3D, 0xF9, 0xD9, 0x41, 0x07,
Expand Down
4 changes: 2 additions & 2 deletions test/text.test.ts → test/pure/text.test.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import {assertEquals} from "../deps.test.ts";
import {u8Encode, u8Decode, sjisDecode, hexEncode, hexDecode, trimExtend, fixWidth, cleanText, accurateSegment, pad0} from "../src/text.ts";
import {assertEquals} from "../../deps.test.ts";
import {u8Encode, u8Decode, sjisDecode, hexEncode, hexDecode, trimExtend, fixWidth, cleanText, accurateSegment, pad0} from "../../src/pure/text.ts";

const sampleText = " Lorem ipsum\r dolor sit \r\r amet. ";
const sampleBin = new Uint8Array([
Expand Down
4 changes: 2 additions & 2 deletions test/time.test.ts → test/pure/time.test.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import {assertEquals} from "../deps.test.ts";
import {utEncode, utDecode, utParse, delay, dtSerial} from "../src/time.ts";
import {assertEquals} from "../../deps.test.ts";
import {utEncode, utDecode, utParse, delay, dtSerial} from "../../src/pure/time.ts";

const sample = new Date(2000, 0, 1, 0, 0, 0, 0);

Expand Down
4 changes: 2 additions & 2 deletions test/worker.test.ts → test/pure/worker.test.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import {assertEquals} from "../deps.test.ts";
import {createTask} from "../src/worker.ts";
import {assertEquals} from "../../deps.test.ts";
import {createTask} from "../../src/pure/worker.ts";

const sample1 = new Uint8Array([1, 2, 3, 4]);
const sample2 = new Uint8Array([2, 4, 6, 8]);
Expand Down

0 comments on commit aa00f4b

Please sign in to comment.