Skip to content

Commit

Permalink
fix: dist
Browse files Browse the repository at this point in the history
  • Loading branch information
Fureev Eugene committed Jul 27, 2023
1 parent 82eb325 commit 3bea6d7
Show file tree
Hide file tree
Showing 12 changed files with 147 additions and 0 deletions.
20 changes: 20 additions & 0 deletions dist/cjs/is/isUrl.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions dist/cjs/is/isUrl.js.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

45 changes: 45 additions & 0 deletions dist/cjs/structures/CollectionArray.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions dist/cjs/structures/CollectionArray.js.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

17 changes: 17 additions & 0 deletions dist/esm/is/isUrl.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
/**
* Checks if string can parse as URL
*
* @param {any} str
* @returns {boolean}
*/
export default function isUrl(str) {
let url;
try {
url = new URL(str);
}
catch (_) {
return false;
}
return url.protocol === 'http:' || url.protocol === 'https:';
}
//# sourceMappingURL=isUrl.mjs.map
1 change: 1 addition & 0 deletions dist/esm/is/isUrl.mjs.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

38 changes: 38 additions & 0 deletions dist/esm/structures/CollectionArray.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
import isFunction from '../is/isFunction.mjs';
import toString from '../to/toString.mjs';
export class CollectionArray {
constructor() {
this.items = [];
}
push(item) {
this.items.push(item);
}
pull() {
return !this.isEmpty() ? this.items.pop() : undefined;
}
size() {
return this.items.length;
}
isEmpty() {
return this.size() === 0;
}
toArray() {
return [...this.items];
}
toString(callback) {
const data = this.toArray();
if (callback && isFunction(callback)) {
return data.map(item => callback(item)).toString();
}
return data.toString();
}
map(callback) {
const data = this.toArray();
if (!isFunction(callback)) {
throw Error('Invalid map-function: ' + toString(callback));
}
return data.map(item => callback(item));
}
}
export default new CollectionArray();
//# sourceMappingURL=CollectionArray.mjs.map
1 change: 1 addition & 0 deletions dist/esm/structures/CollectionArray.mjs.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 8 additions & 0 deletions dist/types/is/isUrl.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
/**
* Checks if string can parse as URL
*
* @param {any} str
* @returns {boolean}
*/
export default function isUrl(str: any): boolean;
//# sourceMappingURL=isUrl.d.ts.map
1 change: 1 addition & 0 deletions dist/types/is/isUrl.d.ts.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

13 changes: 13 additions & 0 deletions dist/types/structures/CollectionArray.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
export declare class CollectionArray<T> {
protected items: T[];
push(item: T): void;
pull(): T | undefined;
size(): number;
isEmpty(): boolean;
toArray(): T[];
toString(callback?: (i: T) => any): string;
map<R extends any>(callback: (i: T) => any): R[];
}
declare const _default: CollectionArray<unknown>;
export default _default;
//# sourceMappingURL=CollectionArray.d.ts.map
1 change: 1 addition & 0 deletions dist/types/structures/CollectionArray.d.ts.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 3bea6d7

Please sign in to comment.