From d0bf49472b8e02ea40eab48e2e861b603450233e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kry=C5=A1tof=20Wold=C5=99ich?= <31292499+krystofwoldrich@users.noreply.github.com> Date: Thu, 6 Apr 2023 15:00:16 +0200 Subject: [PATCH] chore(vendor): Update license and attribution style (#2949) --- src/js/vendor/buffer/LICENSE | 23 ------------------- src/js/vendor/buffer/utf8ToBytes.ts | 29 +++++++++++++++++++----- test/vendor/buffer/utf8ToBytes.test.ts | 31 ++++++++++++++++++++------ 3 files changed, 48 insertions(+), 35 deletions(-) delete mode 100644 src/js/vendor/buffer/LICENSE diff --git a/src/js/vendor/buffer/LICENSE b/src/js/vendor/buffer/LICENSE deleted file mode 100644 index 1cd6eec5f..000000000 --- a/src/js/vendor/buffer/LICENSE +++ /dev/null @@ -1,23 +0,0 @@ -# From: https://github.com/feross/buffer/blob/795bbb5bda1b39f1370ebd784bea6107b087e3a7/LICENSE - -The MIT License (MIT) - -Copyright (c) Feross Aboukhadijeh, and other contributors. - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. diff --git a/src/js/vendor/buffer/utf8ToBytes.ts b/src/js/vendor/buffer/utf8ToBytes.ts index e7d77bc53..a8a743f48 100644 --- a/src/js/vendor/buffer/utf8ToBytes.ts +++ b/src/js/vendor/buffer/utf8ToBytes.ts @@ -1,12 +1,31 @@ +// Adapted from https://github.com/feross/buffer/blob/795bbb5bda1b39f1370ebd784bea6107b087e3a7/index.js#L1956 + +// The MIT License (MIT) + +// Copyright (c) Feross Aboukhadijeh, and other contributors. + +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: + +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. + +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. + /* eslint-disable */ /** * Convert a string to a byte array - * - * This is a utf8ToBytes function from the buffer module (with added types) - * https://github.com/feross/buffer/blob/795bbb5bda1b39f1370ebd784bea6107b087e3a7/index.js#L1956 - * - * License: MIT (https://github.com/feross/buffer) */ export function utf8ToBytes(string: string, units?: number): number[] { units = units || Infinity; diff --git a/test/vendor/buffer/utf8ToBytes.test.ts b/test/vendor/buffer/utf8ToBytes.test.ts index 0589ceb0d..ff7b82f0a 100644 --- a/test/vendor/buffer/utf8ToBytes.test.ts +++ b/test/vendor/buffer/utf8ToBytes.test.ts @@ -1,12 +1,29 @@ +// Adapted from https://github.com/feross/buffer/blob/795bbb5bda1b39f1370ebd784bea6107b087e3a7/index.js#L1956 + +// The MIT License (MIT) + +// Copyright (c) Feross Aboukhadijeh, and other contributors. + +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: + +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. + +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. + import { utf8ToBytes } from '../../../src/js/vendor'; -/** - * These test are taken over from encode-utf8 library to test the utf8ToBytes function - * - * https://github.com/LinusU/encode-utf8/blob/9c112ab99827e07667f9a349ca5498157479f68e/test.js - * - * License: MIT (https://github.com/LinusU/encode-utf8) - */ describe('Buffer utf8 tests', () => { const testCases = [ '゚・✿ヾ╲(。◕‿◕。)╱✿・゚',