Skip to content

Commit

Permalink
v4.2.0
Browse files Browse the repository at this point in the history
### 更新点
- 変数の型名を取得する `System.typeOf` を追加
- `SFile.prototype.searchFile` について引数に正規表現を入れるなどの改善、及び複数ファイルを探すような機能を追加
- `SFile.prototype.move` のエラー処理を強化、詳細な動作仕様をメソッドの説明に記載
- `SFile.prototype.renameTo` のエラー処理を強化、詳細な動作仕様をメソッドの説明に記載
  • Loading branch information
natade-jp committed May 5, 2021
1 parent 958b214 commit 7b16a57
Show file tree
Hide file tree
Showing 14 changed files with 681 additions and 283 deletions.
7 changes: 7 additions & 0 deletions HISTORY.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
# History

## SenkoWSH v4.2.0
### 更新点
- 変数の型名を取得する `System.typeOf` を追加
- `SFile.prototype.searchFile` について引数に正規表現を入れるなどの改善、及び複数ファイルを探すような機能を追加
- `SFile.prototype.move` のエラー処理を強化、詳細な動作仕様をメソッドの説明に記載
- `SFile.prototype.renameTo` のエラー処理を強化、詳細な動作仕様をメソッドの説明に記載

## SenkoWSH v4.1.1
### 更新点
- `SFile` の入力引数に `SFile` 型を入力するとエラーが発生する場合があったのを回避
Expand Down
34 changes: 27 additions & 7 deletions build/SenkoWSH.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1180,13 +1180,21 @@ declare class SFile {
copy(file_obj: string | SFile): boolean;
/**
* ファイルの移動
* @param {string|SFile} file_obj
* - 移動後の `this` は、移動後のファイルを指す
* - `this` がファイルの場合、ディレクトリを選択すると、ディレクトリ内へファイルを移動させます
* - `this` がファイルの場合、ファイルを選択すると、ディレクトリの移動かつファイル名を変更します
* - `this` がディレクトリの場合、指定したディレクトリへファイルを移動させるため、ディレクトリ名の変更は行えません
*
* @param {string|SFile} file_obj - 移動先のファイル名及びディレクトリ
* @returns {boolean}
*/
move(file_obj: string | SFile): boolean;
/**
* ファイル名を変更
* @param {string|SFile} file_obj
* - 変更後の `this` は、変更後のファイルを指す
* - 引数はフルパスを渡した場合でもファイル名のみ使用する
*
* @param {string|SFile} file_obj 変更後のファイル名
* @returns {boolean}
*/
renameTo(file_obj: string | SFile): boolean;
Expand All @@ -1202,7 +1210,9 @@ declare class SFile {
getName(): string;
/**
* 親フォルダの絶対パス
* URLなら最後にスラッシュをつけて返す
* - 通常のフォルダの場合は、最後の「`/`」は除去される
* - URLなら最後にスラッシュをつけて返す
*
* @returns {string}
*/
getParent(): string;
Expand Down Expand Up @@ -1393,11 +1403,13 @@ declare class SFile {
getAllFiles(): SFile[];
/**
* 指定した条件にあうファイルを探す
* 関数を指定する場合は、ファイル名とフルパスが引数に渡されます
* @param {string|SFile|function(string, string): boolean} file_obj
* @returns {SFile|null}
* - 関数を指定する場合は、ファイル名とフルパスが引数に渡されます
*
* @param {string|SFile|RegExp|function(SFile): boolean} file_obj
* @param {boolean} [is_all_file=false] trueで指定した場合は条件に合うファイルを複数見つけて配列で返す
* @returns {SFile|SFile[]|null}
*/
searchFile(file_obj: string | SFile | ((...params: any[]) => any)): SFile | null;
searchFile(file_obj: string | SFile | RegExp | ((...params: any[]) => any), is_all_file?: boolean): SFile | SFile[] | null;
/**
* 圧縮する
* - 圧縮後のファイル名の拡張子で圧縮したい形式を指定する
Expand Down Expand Up @@ -1634,6 +1646,14 @@ declare class System {
* @returns {any}
*/
static createByteArrayFromNumberArray(number_array: number[], offset?: number): any;
/**
* データの型を小文字の英字で返す
* - 配列であれば `array`、正規表現であれば `regexp` などを返します
*
* @param {any} x
* @returns {string}
*/
static typeOf(x: any): string;
}

/**
Expand Down
Binary file modified build/SenkoWSH.js
Binary file not shown.
150 changes: 95 additions & 55 deletions docs/class/src/senko/SFile.js~SFile.html

Large diffs are not rendered by default.

107 changes: 107 additions & 0 deletions docs/class/src/senko/System.js~System.html
Original file line number Diff line number Diff line change
Expand Up @@ -963,6 +963,38 @@ <h1 data-ice="name">System</h1>
<td>


</td>
</tr>
<tr data-ice="target">
<td>
<span class="access" data-ice="access">public</span>
<span data-ice="static">static</span>


<span class="override" data-ice="override"></span>
</td>
<td>
<div>
<p>



<span class="code" data-ice="name"><span><a href="class/src/senko/System.js~System.html#static-method-typeOf">typeOf</a></span></span><span class="code" data-ice="signature">(x: <span>any</span>): <span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String">string</a></span></span>
</p>
</div>
<div>


<div data-ice="description"><p>&#x30C7;&#x30FC;&#x30BF;&#x306E;&#x578B;&#x3092;&#x5C0F;&#x6587;&#x5B57;&#x306E;&#x82F1;&#x5B57;&#x3067;&#x8FD4;&#x3059;</p>
<ul>
<li>&#x914D;&#x5217;&#x3067;&#x3042;&#x308C;&#x3070; <code>array</code>&#x3001;&#x6B63;&#x898F;&#x8868;&#x73FE;&#x3067;&#x3042;&#x308C;&#x3070; <code>regexp</code> &#x306A;&#x3069;&#x3092;&#x8FD4;&#x3057;&#x307E;&#x3059;</li>
</ul>
</div>
</div>
</td>
<td>


</td>
</tr>
</tbody>
Expand Down Expand Up @@ -2829,6 +2861,81 @@ <h3 data-ice="anchor" id="static-method-stop">



</div>
<div class="detail" data-ice="detail">
<h3 data-ice="anchor" id="static-method-typeOf">
<span class="access" data-ice="access">public</span>
<span data-ice="static">static</span>




<span class="code" data-ice="name">typeOf</span><span class="code" data-ice="signature">(x: <span>any</span>): <span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String">string</a></span></span>
<span class="right-info">


<span data-ice="source"><span><a href="file/src/senko/System.js.html#lineNumber610">source</a></span></span>
</span>
</h3>




<div data-ice="description"><p>&#x30C7;&#x30FC;&#x30BF;&#x306E;&#x578B;&#x3092;&#x5C0F;&#x6587;&#x5B57;&#x306E;&#x82F1;&#x5B57;&#x3067;&#x8FD4;&#x3059;</p>
<ul>
<li>&#x914D;&#x5217;&#x3067;&#x3042;&#x308C;&#x3070; <code>array</code>&#x3001;&#x6B63;&#x898F;&#x8868;&#x73FE;&#x3067;&#x3042;&#x308C;&#x3070; <code>regexp</code> &#x306A;&#x3069;&#x3092;&#x8FD4;&#x3057;&#x307E;&#x3059;</li>
</ul>
</div>



<div data-ice="properties"><div data-ice="properties">
<h4 data-ice="title">Params:</h4>
<table class="params">
<thead>
<tr><td>Name</td><td>Type</td><td>Attribute</td><td>Description</td></tr>
</thead>
<tbody>

<tr data-ice="property" data-depth="0">
<td data-ice="name" class="code" data-depth="0">x</td>
<td data-ice="type" class="code"><span>any</span></td>
<td data-ice="appendix"></td>
<td data-ice="description"></td>
</tr>
</tbody>
</table>
</div>
</div>

<div class="return-params" data-ice="returnParams">
<h4>Return:</h4>
<table>
<tbody>
<tr>
<td class="return-type code" data-ice="returnType"><span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String">string</a></span></td>

</tr>
</tbody>
</table>
<div data-ice="returnProperties">
</div>
</div>















</div>
</div>

Expand Down
8 changes: 4 additions & 4 deletions docs/coverage.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"coverage": "100%",
"expectCount": 187,
"actualCount": 187,
"expectCount": 188,
"actualCount": 188,
"files": {
"src/konpeito/Random.js": {
"expectCount": 20,
Expand Down Expand Up @@ -69,8 +69,8 @@
"undocumentLines": []
},
"src/senko/System.js": {
"expectCount": 33,
"actualCount": 33,
"expectCount": 34,
"actualCount": 34,
"undocumentLines": []
},
"src/SenkoWSH.js": {
Expand Down
Loading

0 comments on commit 7b16a57

Please sign in to comment.