data-structure-typed 1.36.4 → 1.36.6
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/.github/workflows/ci.yml +2 -20
- package/.travis.yml +3 -4
- package/CHANGELOG.md +5 -1
- package/CONTRIBUTING.md +13 -0
- package/README.md +1 -0
- package/dist/data-structures/binary-tree/binary-tree.d.ts +3 -2
- package/dist/data-structures/binary-tree/binary-tree.js +10 -4
- package/dist/data-structures/binary-tree/binary-tree.js.map +1 -1
- package/dist/data-structures/tree/tree.js +3 -5
- package/dist/data-structures/tree/tree.js.map +1 -1
- package/dist/data-structures/trie/trie.d.ts +40 -21
- package/dist/data-structures/trie/trie.js +49 -30
- package/dist/data-structures/trie/trie.js.map +1 -1
- package/lib/data-structures/binary-tree/binary-tree.d.ts +3 -2
- package/lib/data-structures/binary-tree/binary-tree.js +10 -4
- package/lib/data-structures/tree/tree.js +3 -5
- package/lib/data-structures/trie/trie.d.ts +40 -21
- package/lib/data-structures/trie/trie.js +47 -28
- package/package.json +5 -5
- package/src/data-structures/binary-tree/binary-tree.ts +9 -5
- package/src/data-structures/tree/tree.ts +3 -5
- package/src/data-structures/trie/trie.ts +54 -29
- package/test/unit/data-structures/binary-tree/binary-tree.test.ts +13 -0
- package/test/unit/data-structures/heap/heap.test.ts +0 -1
- package/test/unit/data-structures/tree/tree.test.ts +2 -2
- package/test/unit/data-structures/trie/trie.test.ts +77 -7
- package/umd/bundle.min.js +1 -1
- package/umd/bundle.min.js.map +1 -1
- package/scripts/rename_clear_files.sh +0 -29
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
#!/bin/bash
|
|
2
|
-
|
|
3
|
-
# iterate the directory to rename and clear content of files
|
|
4
|
-
rename_and_clear_files() {
|
|
5
|
-
local directory="$1"
|
|
6
|
-
local extension="$2"
|
|
7
|
-
local new_prefix="$3"
|
|
8
|
-
|
|
9
|
-
for file in "$directory"/*; do
|
|
10
|
-
if [ -d "$file" ]; then
|
|
11
|
-
rename_and_clear_files "$file" "$extension" "$new_prefix"
|
|
12
|
-
elif [ -f "$file" ] && [[ "$file" == *"$extension" ]]; then
|
|
13
|
-
filename=$(basename "$file" "$extension")
|
|
14
|
-
new_name="$directory/${filename}${new_prefix}${extension}"
|
|
15
|
-
mv "$file" "$new_name"
|
|
16
|
-
echo "Renamed $file to $new_name"
|
|
17
|
-
> "$new_name" # clear content of file
|
|
18
|
-
fi
|
|
19
|
-
done
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
# check if directory, extension and prefix were provided
|
|
23
|
-
if [ -z "$1" ] || [ -z "$2" ] || [ -z "$3" ]; then
|
|
24
|
-
echo "Usage: $0 <directory> <extension> <new_prefix>"
|
|
25
|
-
exit 1
|
|
26
|
-
fi
|
|
27
|
-
|
|
28
|
-
# evoke the recursive function to rename and clear files
|
|
29
|
-
rename_and_clear_files "$1" "$2" "$3"
|