Skip to content

Commit

Permalink
Fix license headers
Browse files Browse the repository at this point in the history
Closes #188
  • Loading branch information
Rycochet committed Jan 21, 2024
1 parent effc4ce commit ebf9465
Show file tree
Hide file tree
Showing 34 changed files with 201 additions and 29 deletions.
2 changes: 1 addition & 1 deletion LICENSE → LICENSE.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
MIT License

Copyright (c) 2013 pieroxy
Copyright (c) 2013 Pieroxy <pieroxy@pieroxy.net>

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
6 changes: 6 additions & 0 deletions src/UTF16/UTF16.test.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
/*
* SPDX-FileCopyrightText: 2013 Pieroxy <[email protected]>
*
* SPDX-License-Identifier: MIT
*/

import { describe } from "vitest";
import { compressToUTF16, decompressFromUTF16 } from ".";
import { runTestSet } from "../__tests__/testFunctions";
Expand Down
6 changes: 6 additions & 0 deletions src/UTF16/compressToUTF16.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
/*
* SPDX-FileCopyrightText: 2013 Pieroxy <[email protected]>
*
* SPDX-License-Identifier: MIT
*/

import { _compress } from "../_compress";

export function compressToUTF16(input: string | null) {
Expand Down
6 changes: 6 additions & 0 deletions src/UTF16/decompressFromUTF16.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
/*
* SPDX-FileCopyrightText: 2013 Pieroxy <[email protected]>
*
* SPDX-License-Identifier: MIT
*/

import { _decompress } from "../_decompress";

export function decompressFromUTF16(compressed: string | null) {
Expand Down
6 changes: 6 additions & 0 deletions src/UTF16/index.ts
Original file line number Diff line number Diff line change
@@ -1,2 +1,8 @@
/*
* SPDX-FileCopyrightText: 2013 Pieroxy <[email protected]>
*
* SPDX-License-Identifier: MIT
*/

export { compressToUTF16 } from "./compressToUTF16";
export { decompressFromUTF16 } from "./decompressFromUTF16";
6 changes: 6 additions & 0 deletions src/Uint8Array/Uint8Array.test.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
/*
* SPDX-FileCopyrightText: 2013 Pieroxy <[email protected]>
*
* SPDX-License-Identifier: MIT
*/

import { describe } from "vitest";
import { compressToUint8Array, decompressFromUint8Array } from ".";
import { runTestSet } from "../__tests__/testFunctions";
Expand Down
6 changes: 6 additions & 0 deletions src/Uint8Array/compressToUint8Array.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
/*
* SPDX-FileCopyrightText: 2013 Pieroxy <[email protected]>
*
* SPDX-License-Identifier: MIT
*/

import { compress } from "../stock/compress";

export function compressToUint8Array(uncompressed: string | null): Uint8Array {
Expand Down
6 changes: 6 additions & 0 deletions src/Uint8Array/decompressFromUint8Array.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
/*
* SPDX-FileCopyrightText: 2013 Pieroxy <[email protected]>
*
* SPDX-License-Identifier: MIT
*/

import { decompress } from "../stock/decompress";

export function decompressFromUint8Array(compressed: Uint8Array | null): string | null {
Expand Down
6 changes: 6 additions & 0 deletions src/Uint8Array/index.ts
Original file line number Diff line number Diff line change
@@ -1,2 +1,8 @@
/*
* SPDX-FileCopyrightText: 2013 Pieroxy <[email protected]>
*
* SPDX-License-Identifier: MIT
*/

export { compressToUint8Array } from "./compressToUint8Array";
export { decompressFromUint8Array } from "./decompressFromUint8Array";
6 changes: 6 additions & 0 deletions src/__tests__/testFunctions.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
/*
* SPDX-FileCopyrightText: 2013 Pieroxy <[email protected]>
*
* SPDX-License-Identifier: MIT
*/

/* eslint-disable @typescript-eslint/ban-ts-comment */
import { test, expect } from "vitest";

Expand Down
6 changes: 6 additions & 0 deletions src/_compress.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
/*
* SPDX-FileCopyrightText: 2013 Pieroxy <[email protected]>
*
* SPDX-License-Identifier: MIT
*/

export type Dictionary = Record<string, number>;
export type PendingDictionary = Record<string, true>;

Expand Down
6 changes: 6 additions & 0 deletions src/_decompress.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
/*
* SPDX-FileCopyrightText: 2013 Pieroxy <[email protected]>
*
* SPDX-License-Identifier: MIT
*/

export interface DecompressionTracker {
val: number;
position: number;
Expand Down
15 changes: 6 additions & 9 deletions src/base64/base64-string.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,9 @@
// Copyright (c) 2013 Pieroxy <[email protected]>
// This work is free. You can redistribute it and/or modify it
// under the terms of the WTFPL, Version 2
// For more information see LICENSE.txt or http://www.wtfpl.net/
//
// This lib is part of the lz-string project.
// For more information, the home page:
// http://pieroxy.net/blog/pages/lz-string/index.html
//
/*
* SPDX-FileCopyrightText: 2013 Pieroxy <[email protected]>
*
* SPDX-License-Identifier: MIT
*/

// Base64 compression / decompression for already compressed content (gif, png, jpg, mp3, ...)
// version 1.4.1

Expand Down
6 changes: 6 additions & 0 deletions src/base64/base64.test.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
/*
* SPDX-FileCopyrightText: 2013 Pieroxy <[email protected]>
*
* SPDX-License-Identifier: MIT
*/

import { describe } from "vitest";
import { compressToBase64, decompressFromBase64 } from ".";
import { runTestSet } from "../__tests__/testFunctions";
Expand Down
6 changes: 6 additions & 0 deletions src/base64/compressToBase64.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
/*
* SPDX-FileCopyrightText: 2013 Pieroxy <[email protected]>
*
* SPDX-License-Identifier: MIT
*/

import { _compress } from "../_compress";
import keyStrBase64 from "./keyStrBase64";

Expand Down
6 changes: 6 additions & 0 deletions src/base64/decompressFromBase64.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
/*
* SPDX-FileCopyrightText: 2013 Pieroxy <[email protected]>
*
* SPDX-License-Identifier: MIT
*/

import { _decompress } from "../_decompress";
import { getBaseValue } from "../getBaseValue";
import keyStrBase64 from "./keyStrBase64";
Expand Down
6 changes: 6 additions & 0 deletions src/base64/index.ts
Original file line number Diff line number Diff line change
@@ -1,2 +1,8 @@
/*
* SPDX-FileCopyrightText: 2013 Pieroxy <[email protected]>
*
* SPDX-License-Identifier: MIT
*/

export { compressToBase64 } from "./compressToBase64";
export { decompressFromBase64 } from "./decompressFromBase64";
6 changes: 6 additions & 0 deletions src/base64/keyStrBase64.ts
Original file line number Diff line number Diff line change
@@ -1 +1,7 @@
/*
* SPDX-FileCopyrightText: 2013 Pieroxy <[email protected]>
*
* SPDX-License-Identifier: MIT
*/

export default "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";
6 changes: 6 additions & 0 deletions src/encodedURI/compressToEncodedURI.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
/*
* SPDX-FileCopyrightText: 2013 Pieroxy <[email protected]>
*
* SPDX-License-Identifier: MIT
*/

import { _compress } from "../_compress";
import keyStrUriSafe from "./keyStrUriSafe";

Expand Down
6 changes: 6 additions & 0 deletions src/encodedURI/decompressFromEncodedURI.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
/*
* SPDX-FileCopyrightText: 2013 Pieroxy <[email protected]>
*
* SPDX-License-Identifier: MIT
*/

import keyStrUriSafe from "./keyStrUriSafe";
import { _decompress } from "../_decompress";
import { getBaseValue } from "../getBaseValue";
Expand Down
6 changes: 6 additions & 0 deletions src/encodedURI/encodedURI.test.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
/*
* SPDX-FileCopyrightText: 2013 Pieroxy <[email protected]>
*
* SPDX-License-Identifier: MIT
*/

import { describe, expect, test } from "vitest";
import { compressToEncodedURIComponent, decompressFromEncodedURIComponent } from ".";
import { runTestSet, test_longString_fn, test_tattooSource } from "../__tests__/testFunctions";
Expand Down
6 changes: 6 additions & 0 deletions src/encodedURI/index.ts
Original file line number Diff line number Diff line change
@@ -1,2 +1,8 @@
/*
* SPDX-FileCopyrightText: 2013 Pieroxy <[email protected]>
*
* SPDX-License-Identifier: MIT
*/

export { compressToEncodedURIComponent } from "./compressToEncodedURI";
export { decompressFromEncodedURIComponent } from "./decompressFromEncodedURI";
6 changes: 6 additions & 0 deletions src/encodedURI/keyStrUriSafe.ts
Original file line number Diff line number Diff line change
@@ -1 +1,7 @@
/*
* SPDX-FileCopyrightText: 2013 Pieroxy <[email protected]>
*
* SPDX-License-Identifier: MIT
*/

export default "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+-$";
6 changes: 6 additions & 0 deletions src/getBaseValue.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
/*
* SPDX-FileCopyrightText: 2013 Pieroxy <[email protected]>
*
* SPDX-License-Identifier: MIT
*/

export type Dictionary = Record<string, number>;
export type DictionaryCollection = Record<string, Dictionary>;

Expand Down
14 changes: 5 additions & 9 deletions src/index.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,8 @@
// Copyright (c) 2013 Pieroxy <[email protected]>
// This work is free. You can redistribute it and/or modify it
// under the terms of the WTFPL, Version 2
// For more information see LICENSE.txt or http://www.wtfpl.net/
//
// For more information, the home page:
// http://pieroxy.net/blog/pages/lz-string/testing.html
//
// LZ-based compression algorithm, version 1.4.5
/*
* SPDX-FileCopyrightText: 2013 Pieroxy <[email protected]>
*
* SPDX-License-Identifier: MIT
*/

import { _compress } from "./_compress";
import { _decompress } from "./_decompress";
Expand Down
6 changes: 6 additions & 0 deletions src/stock/compress.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
/*
* SPDX-FileCopyrightText: 2013 Pieroxy <[email protected]>
*
* SPDX-License-Identifier: MIT
*/

import { _compress } from "../_compress";

export function compress(input: string | null) {
Expand Down
6 changes: 6 additions & 0 deletions src/stock/decompress.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
/*
* SPDX-FileCopyrightText: 2013 Pieroxy <[email protected]>
*
* SPDX-License-Identifier: MIT
*/

import { _decompress } from "../_decompress";

export function decompress(compressed: string | null) {
Expand Down
6 changes: 6 additions & 0 deletions src/stock/index.ts
Original file line number Diff line number Diff line change
@@ -1,2 +1,8 @@
/*
* SPDX-FileCopyrightText: 2013 Pieroxy <[email protected]>
*
* SPDX-License-Identifier: MIT
*/

export { compress } from "./compress";
export { decompress } from "./decompress";
6 changes: 6 additions & 0 deletions src/stock/stock.test.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
/*
* SPDX-FileCopyrightText: 2013 Pieroxy <[email protected]>
*
* SPDX-License-Identifier: MIT
*/

import { describe } from "vitest";
import { compress, decompress } from ".";
import { runTestSet } from "../__tests__/testFunctions";
Expand Down
6 changes: 6 additions & 0 deletions tests/dist.cjs.main.test.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
/*
* SPDX-FileCopyrightText: 2013 Pieroxy <[email protected]>
*
* SPDX-License-Identifier: MIT
*/

import { describe } from "vitest";
import LZString from "../dist/index.cjs";
import { runAllTests } from "./testFunctions";
Expand Down
6 changes: 6 additions & 0 deletions tests/dist.es.main.test.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
/*
* SPDX-FileCopyrightText: 2013 Pieroxy <[email protected]>
*
* SPDX-License-Identifier: MIT
*/

import { describe } from "vitest";
import LZString from "../dist/index.js";
import { runAllTests } from "./testFunctions";
Expand Down
6 changes: 6 additions & 0 deletions tests/testFunctions.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
/*
* SPDX-FileCopyrightText: 2013 Pieroxy <[email protected]>
*
* SPDX-License-Identifier: MIT
*/

import { test, expect, describe } from "vitest";
import {
test_allUtf16,
Expand Down
6 changes: 6 additions & 0 deletions tests/testValues.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
/*
* SPDX-FileCopyrightText: 2013 Pieroxy <[email protected]>
*
* SPDX-License-Identifier: MIT
*/

/** Simple value */
export const test_hw = "Hello world!";

Expand Down
19 changes: 9 additions & 10 deletions vite.config.ts → vite.config.mts
Original file line number Diff line number Diff line change
@@ -1,12 +1,16 @@
/*
* SPDX-FileCopyrightText: 2013 Pieroxy <[email protected]>
*
* SPDX-License-Identifier: MIT
*/

/// <reference types="vitest" />
import { parse, relative, resolve } from "path";
import { resolve } from "path";
import { defineConfig } from "vite";
import dts from "vite-plugin-dts";
import eslint from "vite-plugin-eslint";
import tsconfigPaths from "vite-tsconfig-paths";

const root = resolve(__dirname, "src");

export default defineConfig({
plugins: [tsconfigPaths(), dts({ rollupTypes: true }), eslint()],
build: {
Expand All @@ -26,13 +30,8 @@ export default defineConfig({
},
{
format: "es",
chunkFileNames: "[name].js",
manualChunks: (id: string) => {
const { dir, name } = parse(relative(root, id));

// If it's in node_modules then don't export
return dir.startsWith(".") ? null : name || "common";
},
preserveModules: true,
entryFileNames: "[name].js",
},
{
format: "umd",
Expand Down

0 comments on commit ebf9465

Please sign in to comment.