@dereekb/util 8.13.9 → 8.14.0
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/CHANGELOG.md +9 -0
- package/package.json +1 -1
- package/src/lib/array/array.index.d.ts +6 -1
- package/src/lib/array/array.index.js +7 -1
- package/src/lib/array/array.index.js.map +1 -1
- package/src/lib/contact/domain.d.ts +2 -1
- package/src/lib/contact/domain.js +7 -5
- package/src/lib/contact/domain.js.map +1 -1
- package/src/lib/model/model.d.ts +18 -2
- package/src/lib/model/model.js +13 -1
- package/src/lib/model/model.js.map +1 -1
- package/src/lib/path/path.d.ts +37 -1
- package/src/lib/path/path.js +39 -2
- package/src/lib/path/path.js.map +1 -1
- package/src/lib/string/char.d.ts +33 -0
- package/src/lib/string/char.js +45 -1
- package/src/lib/string/char.js.map +1 -1
- package/src/lib/string/index.d.ts +1 -0
- package/src/lib/string/index.js +1 -0
- package/src/lib/string/index.js.map +1 -1
- package/src/lib/string/string.d.ts +6 -0
- package/src/lib/string/string.js +25 -1
- package/src/lib/string/string.js.map +1 -1
- package/src/lib/string/transform.d.ts +14 -0
- package/src/lib/string/transform.js +19 -1
- package/src/lib/string/transform.js.map +1 -1
- package/src/lib/string/url.d.ts +138 -0
- package/src/lib/string/url.js +134 -0
- package/src/lib/string/url.js.map +1 -0
- package/src/lib/value/indexed.d.ts +11 -0
- package/src/lib/value/indexed.js +16 -1
- package/src/lib/value/indexed.js.map +1 -1
- package/test/CHANGELOG.md +4 -0
- package/test/package.json +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,15 @@
|
|
|
2
2
|
|
|
3
3
|
This file was generated using [@jscutlery/semver](https://github.com/jscutlery/semver).
|
|
4
4
|
|
|
5
|
+
# [8.14.0](https://github.com/dereekb/dbx-components/compare/v8.13.9-dev...v8.14.0) (2022-08-08)
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
### Features
|
|
9
|
+
|
|
10
|
+
* added WebsiteUrl and functions ([ed3430f](https://github.com/dereekb/dbx-components/commit/ed3430f7caba109fbcb9fc02764c22d3ee686fc4))
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
|
|
5
14
|
## [8.13.9](https://github.com/dereekb/dbx-components/compare/v8.13.8-dev...v8.13.9) (2022-08-05)
|
|
6
15
|
|
|
7
16
|
|
package/package.json
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { IndexNumber, IndexRef } from '../value/indexed';
|
|
1
|
+
import { IndexNumber, IndexRef, IndexRangeInput } from '../value/indexed';
|
|
2
2
|
import { Maybe } from '../value/maybe.type';
|
|
3
3
|
/**
|
|
4
4
|
* A set of number corresponding to items in an array.
|
|
@@ -34,3 +34,8 @@ export declare function findBest<T>(input: T[], compare: (a: T, b: T) => number)
|
|
|
34
34
|
* @returns
|
|
35
35
|
*/
|
|
36
36
|
export declare function findBestIndexSetPair<T>(input: IndexSetPairSet<T>, compare: (a: T, b: T) => number): IndexSetPair<T>;
|
|
37
|
+
/**
|
|
38
|
+
* Slices a configured index range from the input array.
|
|
39
|
+
*/
|
|
40
|
+
export declare type SliceIndexRangeFunction<T> = (input: T[]) => T[];
|
|
41
|
+
export declare function sliceIndexRangeFunction<T>(inputRange: IndexRangeInput): SliceIndexRangeFunction<T>;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.findBestIndexSetPair = exports.findBest = exports.expandIndexSet = exports.findToIndexSet = void 0;
|
|
3
|
+
exports.sliceIndexRangeFunction = exports.findBestIndexSetPair = exports.findBest = exports.expandIndexSet = exports.findToIndexSet = void 0;
|
|
4
|
+
const indexed_1 = require("../value/indexed");
|
|
4
5
|
/**
|
|
5
6
|
* Runs a filter on an array and returns an IndexSet for values that match.
|
|
6
7
|
*
|
|
@@ -62,4 +63,9 @@ function findBestIndexSetPair(input, compare) {
|
|
|
62
63
|
return best;
|
|
63
64
|
}
|
|
64
65
|
exports.findBestIndexSetPair = findBestIndexSetPair;
|
|
66
|
+
function sliceIndexRangeFunction(inputRange) {
|
|
67
|
+
const range = (0, indexed_1.indexRange)(inputRange);
|
|
68
|
+
return (input) => input.slice(range.minIndex, range.maxIndex);
|
|
69
|
+
}
|
|
70
|
+
exports.sliceIndexRangeFunction = sliceIndexRangeFunction;
|
|
65
71
|
//# sourceMappingURL=array.index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"array.index.js","sourceRoot":"","sources":["../../../../../../packages/util/src/lib/array/array.index.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"array.index.js","sourceRoot":"","sources":["../../../../../../packages/util/src/lib/array/array.index.ts"],"names":[],"mappings":";;;AAAA,8CAAkG;AAgBlG;;;;;;GAMG;AACH,SAAgB,cAAc,CAAI,KAAU,EAAE,MAA6B;IACzE,MAAM,aAAa,GAAkB,EAAE,CAAC;IAExC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE;QACrB,IAAI,MAAM,CAAC,CAAC,CAAC,EAAE;YACb,aAAa,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;SACvB;IACH,CAAC,CAAC,CAAC;IAEH,OAAO,aAAa,CAAC;AACvB,CAAC;AAVD,wCAUC;AAED,SAAgB,cAAc,CAAI,KAAU,EAAE,QAAkB;IAC9D,OAAO,QAAQ,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,EAAE,CAAC,EAAE,IAAI,EAAE,KAAK,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;AACtD,CAAC;AAFD,wCAEC;AAED;;;;;GAKG;AACH,SAAgB,QAAQ,CAAI,KAAU,EAAE,OAA+B;IACrE,IAAI,SAAS,GAAG,CAAC,CAAC;IAClB,IAAI,IAAI,GAAG,KAAK,CAAC,CAAC,CAAC,CAAC;IAEpB,KAAK,IAAI,CAAC,GAAG,CAAC,EAA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* @param urlLikeInput
|
|
14
14
|
* @returns The domain
|
|
15
15
|
*/
|
|
16
|
-
export declare function
|
|
16
|
+
export declare function readEmailDomainFromUrlOrEmailAddress(urlLikeInput: string | EmailAddress | EmailAddressDomain): EmailAddressDomain;
|
|
17
|
+
export declare const readDomainFromUrlOrEmailAddress: typeof readEmailDomainFromUrlOrEmailAddress;
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.readDomainFromUrlOrEmailAddress = exports.readDomainFromEmailAddress = exports.readDomainsFromEmailAddresses = void 0;
|
|
3
|
+
exports.readDomainFromUrlOrEmailAddress = exports.readEmailDomainFromUrlOrEmailAddress = exports.readDomainFromEmailAddress = exports.readDomainsFromEmailAddresses = void 0;
|
|
4
4
|
const array_1 = require("../array");
|
|
5
|
+
const url_1 = require("../string/url");
|
|
5
6
|
function readDomainsFromEmailAddresses(addresses) {
|
|
6
7
|
return (0, array_1.uniqueCaseInsensitiveStrings)(addresses.map(readDomainFromEmailAddress));
|
|
7
8
|
}
|
|
@@ -23,7 +24,7 @@ exports.readDomainFromEmailAddress = readDomainFromEmailAddress;
|
|
|
23
24
|
* @param urlLikeInput
|
|
24
25
|
* @returns The domain
|
|
25
26
|
*/
|
|
26
|
-
function
|
|
27
|
+
function readEmailDomainFromUrlOrEmailAddress(urlLikeInput) {
|
|
27
28
|
const emailSplit = urlLikeInput.split('@');
|
|
28
29
|
const url = emailSplit[emailSplit.length - 1];
|
|
29
30
|
let domain;
|
|
@@ -31,8 +32,7 @@ function readDomainFromUrlOrEmailAddress(urlLikeInput) {
|
|
|
31
32
|
domain = url;
|
|
32
33
|
}
|
|
33
34
|
else {
|
|
34
|
-
|
|
35
|
-
domain = httpSplit[httpSplit.length - 1];
|
|
35
|
+
domain = (0, url_1.websiteDomainAndPathPairFromWebsiteUrl)(url).domain;
|
|
36
36
|
// strip out www. if it is provided, as it is a 'special' domain type,
|
|
37
37
|
// and emails probably don't come from there.
|
|
38
38
|
if (domain.startsWith('www')) {
|
|
@@ -41,5 +41,7 @@ function readDomainFromUrlOrEmailAddress(urlLikeInput) {
|
|
|
41
41
|
}
|
|
42
42
|
return domain;
|
|
43
43
|
}
|
|
44
|
-
exports.
|
|
44
|
+
exports.readEmailDomainFromUrlOrEmailAddress = readEmailDomainFromUrlOrEmailAddress;
|
|
45
|
+
// MARK: Compat
|
|
46
|
+
exports.readDomainFromUrlOrEmailAddress = readEmailDomainFromUrlOrEmailAddress;
|
|
45
47
|
//# sourceMappingURL=domain.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"domain.js","sourceRoot":"","sources":["../../../../../../packages/util/src/lib/contact/domain.ts"],"names":[],"mappings":";;;AAAA,oCAAwD;
|
|
1
|
+
{"version":3,"file":"domain.js","sourceRoot":"","sources":["../../../../../../packages/util/src/lib/contact/domain.ts"],"names":[],"mappings":";;;AAAA,oCAAwD;AACxD,uCAAuE;AAKvE,SAAgB,6BAA6B,CAAC,SAAyB;IACrE,OAAO,IAAA,oCAA4B,EAAC,SAAS,CAAC,GAAG,CAAC,0BAA0B,CAAC,CAAC,CAAC;AACjF,CAAC;AAFD,sEAEC;AAED,SAAgB,0BAA0B,CAAC,OAAqB;IAC9D,MAAM,KAAK,GAAG,OAAO,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;IACjC,MAAM,MAAM,GAAG,KAAK,CAAC,CAAC,CAAC,CAAC;IACxB,OAAO,MAAM,CAAC,WAAW,EAAE,CAAC;AAC9B,CAAC;AAJD,gEAIC;AAED;;;;;;;;;;GAUG;AACH,SAAgB,oCAAoC,CAAC,YAAwD;IAC3G,MAAM,UAAU,GAAG,YAAY,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;IAC3C,MAAM,GAAG,GAAG,UAAU,CAAC,UAAU,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC;IAE9C,IAAI,MAAM,CAAC;IAEX,IAAI,UAAU,CAAC,MAAM,GAAG,CAAC,EAAE;QACzB,MAAM,GAAG,GAAG,CAAC;KACd;SAAM;QACL,MAAM,GAAG,IAAA,4CAAsC,EAAC,GAAG,CAAC,CAAC,MAAM,CAAC;QAE5D,sEAAsE;QACtE,6CAA6C;QAC7C,IAAI,MAAM,CAAC,UAAU,CAAC,KAAK,CAAC,EAAE;YAC5B,MAAM,GAAG,MAAM,CAAC,KAAK,CAAC,MAAM,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;SACrC;KACF;IAED,OAAO,MAAM,CAAC;AAChB,CAAC;AAnBD,oFAmBC;AAED,eAAe;AACF,QAAA,+BAA+B,GAAG,oCAAoC,CAAC"}
|
package/src/lib/model/model.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { ReadKeyFunction, ReadKeysFunction } from '../key';
|
|
2
2
|
import { Maybe } from '../value/maybe.type';
|
|
3
|
+
import { MapFunction } from '../value/map';
|
|
3
4
|
/**
|
|
4
5
|
* A string model key
|
|
5
6
|
*/
|
|
@@ -8,19 +9,22 @@ export declare type ModelKey = string;
|
|
|
8
9
|
* Arbitrary model type.
|
|
9
10
|
*/
|
|
10
11
|
export declare type ModelTypeString = string;
|
|
12
|
+
export declare const DEFAULT_UNKNOWN_MODEL_TYPE_STRING: ModelTypeString;
|
|
11
13
|
/**
|
|
12
14
|
* A model with an identifier on the "id" key.
|
|
13
15
|
*/
|
|
14
16
|
export interface UniqueModel {
|
|
15
17
|
id?: ModelKey;
|
|
16
18
|
}
|
|
19
|
+
export interface TypedModel {
|
|
20
|
+
type: ModelTypeString;
|
|
21
|
+
}
|
|
17
22
|
export interface NamedUniqueModel extends UniqueModel {
|
|
18
23
|
name?: string;
|
|
19
24
|
}
|
|
20
25
|
export declare type ModelOrKey<T extends UniqueModel> = T | ModelKey;
|
|
21
|
-
export interface ModelKeyTypePair {
|
|
26
|
+
export interface ModelKeyTypePair extends TypedModel {
|
|
22
27
|
key: ModelKey;
|
|
23
|
-
type: ModelTypeString;
|
|
24
28
|
}
|
|
25
29
|
/**
|
|
26
30
|
* An encoded ModelKeyTypePair.
|
|
@@ -36,6 +40,7 @@ export interface ReadModelKeyParams<T> {
|
|
|
36
40
|
read: ReadModelKeyFunction<T>;
|
|
37
41
|
}
|
|
38
42
|
export declare type ReadModelKeyFunction<T> = ReadKeyFunction<T, ModelKey>;
|
|
43
|
+
export declare type ReadModelTypeFunction<T> = ReadKeyFunction<T, ModelTypeString>;
|
|
39
44
|
export declare type ReadRelationKeysFunction<T> = ReadKeysFunction<T, ModelKey>;
|
|
40
45
|
export declare type MultiModelKeyMap<T> = Map<string, T>;
|
|
41
46
|
export declare const readUniqueModelKey: (model: UniqueModel) => string | undefined;
|
|
@@ -72,3 +77,14 @@ export declare function isModelKey<T extends UniqueModel>(input: ModelOrKey<T>):
|
|
|
72
77
|
export declare function throwKeyIsRequired(): void;
|
|
73
78
|
export declare function encodeModelKeyTypePair(pair: ModelKeyTypePair): ModelKey;
|
|
74
79
|
export declare function decodeModelKeyTypePair(linkKey: ModelKey): ModelKeyTypePair;
|
|
80
|
+
/**
|
|
81
|
+
* A type and data pair.
|
|
82
|
+
*/
|
|
83
|
+
export interface ModelTypeDataPair<T = unknown> extends TypedModel {
|
|
84
|
+
data: T;
|
|
85
|
+
}
|
|
86
|
+
/**
|
|
87
|
+
* Used for converting the input data into a ModelTypeDataPair value.
|
|
88
|
+
*/
|
|
89
|
+
export declare type ModelTypeDataPairFactory<T> = MapFunction<T, ModelTypeDataPair<T>>;
|
|
90
|
+
export declare function modelTypeDataPairFactory<T>(typeReader: ReadModelTypeFunction<T>, defaultType?: string): ModelTypeDataPairFactory<T>;
|
package/src/lib/model/model.js
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.decodeModelKeyTypePair = exports.encodeModelKeyTypePair = exports.throwKeyIsRequired = exports.isModelKey = exports.readModelKeyFromObject = exports.readModelKey = exports.requireModelKey = exports.readModelKeys = exports.useModelOrKey = exports.makeMultiModelKeyMap = exports.makeModelMap = exports.removeModelsWithKey = exports.removeModelsWithSameKey = exports.symmetricDifferenceWithModels = exports.readModelKeysFromObjects = exports.uniqueModels = exports.uniqueKeys = exports.AbstractUniqueModel = exports.readUniqueModelKey = void 0;
|
|
3
|
+
exports.modelTypeDataPairFactory = exports.decodeModelKeyTypePair = exports.encodeModelKeyTypePair = exports.throwKeyIsRequired = exports.isModelKey = exports.readModelKeyFromObject = exports.readModelKey = exports.requireModelKey = exports.readModelKeys = exports.useModelOrKey = exports.makeMultiModelKeyMap = exports.makeModelMap = exports.removeModelsWithKey = exports.removeModelsWithSameKey = exports.symmetricDifferenceWithModels = exports.readModelKeysFromObjects = exports.uniqueModels = exports.uniqueKeys = exports.AbstractUniqueModel = exports.readUniqueModelKey = exports.DEFAULT_UNKNOWN_MODEL_TYPE_STRING = void 0;
|
|
4
4
|
const set_1 = require("../set/set");
|
|
5
5
|
const array_unique_1 = require("../array/array.unique");
|
|
6
|
+
exports.DEFAULT_UNKNOWN_MODEL_TYPE_STRING = 'unknown';
|
|
6
7
|
const readUniqueModelKey = (model) => model.id;
|
|
7
8
|
exports.readUniqueModelKey = readUniqueModelKey;
|
|
8
9
|
class AbstractUniqueModel {
|
|
@@ -135,4 +136,15 @@ function decodeModelKeyTypePair(linkKey) {
|
|
|
135
136
|
};
|
|
136
137
|
}
|
|
137
138
|
exports.decodeModelKeyTypePair = decodeModelKeyTypePair;
|
|
139
|
+
function modelTypeDataPairFactory(typeReader, defaultType = exports.DEFAULT_UNKNOWN_MODEL_TYPE_STRING) {
|
|
140
|
+
return (data) => {
|
|
141
|
+
var _a;
|
|
142
|
+
const type = (_a = typeReader(data)) !== null && _a !== void 0 ? _a : defaultType;
|
|
143
|
+
return {
|
|
144
|
+
type,
|
|
145
|
+
data
|
|
146
|
+
};
|
|
147
|
+
};
|
|
148
|
+
}
|
|
149
|
+
exports.modelTypeDataPairFactory = modelTypeDataPairFactory;
|
|
138
150
|
//# sourceMappingURL=model.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"model.js","sourceRoot":"","sources":["../../../../../../packages/util/src/lib/model/model.ts"],"names":[],"mappings":";;;AAAA,oCAAqD;AACrD,wDAAmD;
|
|
1
|
+
{"version":3,"file":"model.js","sourceRoot":"","sources":["../../../../../../packages/util/src/lib/model/model.ts"],"names":[],"mappings":";;;AAAA,oCAAqD;AACrD,wDAAmD;AAetC,QAAA,iCAAiC,GAAoB,SAAS,CAAC;AA6CrE,MAAM,kBAAkB,GAAG,CAAC,KAAkB,EAAE,EAAE,CAAC,KAAK,CAAC,EAAE,CAAC;AAAtD,QAAA,kBAAkB,sBAAoC;AAEnE,MAAsB,mBAAmB;IAGvC,YAAY,QAAsC;QAChD,IAAI,QAAQ,EAAE;YACZ,IAAI,CAAC,EAAE,GAAG,QAAQ,CAAC,EAAE,CAAC;SACvB;IACH,CAAC;CACF;AARD,kDAQC;AAED,SAAgB,UAAU,CAAC,IAAgB;IACzC,OAAO,KAAK,CAAC,IAAI,CAAC,IAAI,GAAG,CAAC,IAAI,CAAC,CAAC,CAAC;AACnC,CAAC;AAFD,gCAEC;AAID,SAAgB,YAAY,CAAI,MAAW,EAAE,UAAmC,0BAAkB;IAChG,OAAO,IAAA,yBAAU,EAAC,MAAM,EAAE,OAAO,CAAC,CAAC;AACrC,CAAC;AAFD,oCAEC;AAID,SAAgB,wBAAwB,CAAwB,KAAU,EAAE,QAAkB,EAAE,IAA8B;IAC5H,OAAO,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,sBAAsB,CAAC,CAAC,EAAE,QAAQ,EAAE,IAAI,CAAC,CAAC,CAAC;AACrE,CAAC;AAFD,4DAEC;AAED,SAAgB,6BAA6B,CAAwB,CAAkB,EAAE,CAAkB,EAAE,QAAkB,EAAE,IAA8B;IAC7J,OAAO,IAAA,6BAAuB,EAA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AO,EAAE,EAAE;;QACjB,MAAM,IAAI,GAAoB,MAAA,UAAU,CAAC,IAAI,CAAC,mCAAI,WAAW,CAAC;QAC9D,OAAO;YACL,IAAI;YACJ,IAAI;SACL,CAAC;IACJ,CAAC,CAAC;AACJ,CAAC;AARD,4DAQC"}
|
package/src/lib/path/path.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { MapSameFunction } from '../value/map';
|
|
2
2
|
import { ArrayOrValue } from '../array/array';
|
|
3
|
-
import { Maybe } from '../value';
|
|
3
|
+
import { IndexRangeInput, Maybe } from '../value';
|
|
4
4
|
import { FactoryWithRequiredInput } from '../getter/getter';
|
|
5
5
|
export declare const SLASH_PATH_SEPARATOR = "/";
|
|
6
6
|
export declare const SLASH_PATH_FILE_TYPE_SEPARATOR = ".";
|
|
@@ -157,3 +157,39 @@ export interface SlashPathFactoryConfig {
|
|
|
157
157
|
export declare function slashPathFactory(config?: SlashPathFactoryConfig): SlashPathFactory;
|
|
158
158
|
export declare function mergeSlashPaths(paths: Maybe<SlashPath>[]): SlashPath;
|
|
159
159
|
export declare function slashPathInvalidError(): Error;
|
|
160
|
+
/**
|
|
161
|
+
* Splits the path and returns the items at the given ranges.
|
|
162
|
+
*
|
|
163
|
+
* @param path
|
|
164
|
+
*/
|
|
165
|
+
export declare function isolateSlashPath(path: SlashPath, range: IndexRangeInput): SlashPath;
|
|
166
|
+
/**
|
|
167
|
+
* isolateSlashPathFunction() config.
|
|
168
|
+
*/
|
|
169
|
+
export interface IsolateSlashPathFunctionConfig {
|
|
170
|
+
/**
|
|
171
|
+
* Range to isolate
|
|
172
|
+
*/
|
|
173
|
+
range: IndexRangeInput;
|
|
174
|
+
/**
|
|
175
|
+
* Start type to force the result to be.
|
|
176
|
+
*/
|
|
177
|
+
startType?: SlashPathStartType;
|
|
178
|
+
/**
|
|
179
|
+
* Whether or not to isolate the path to a file path. If true, the result string will not end with a slash.
|
|
180
|
+
*/
|
|
181
|
+
asFile?: boolean;
|
|
182
|
+
}
|
|
183
|
+
/**
|
|
184
|
+
* Isolates a configured index range of path elements.
|
|
185
|
+
*
|
|
186
|
+
* Path start type is retained. I.E. If a relative path is input, a relative path will be returned.
|
|
187
|
+
*/
|
|
188
|
+
export declare type IsolateSlashPathFunction = (path: SlashPath) => SlashPath;
|
|
189
|
+
/**
|
|
190
|
+
* Creates an IsolateSlashPathFunction.
|
|
191
|
+
*
|
|
192
|
+
* @param config
|
|
193
|
+
* @returns
|
|
194
|
+
*/
|
|
195
|
+
export declare function isolateSlashPathFunction(config: IsolateSlashPathFunctionConfig): IsolateSlashPathFunction;
|
package/src/lib/path/path.js
CHANGED
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.slashPathInvalidError = exports.mergeSlashPaths = exports.slashPathFactory = exports.slashPathValidationFactory = exports.replaceInvalidFilePathTypeSeparatorsInSlashPathFunction = exports.replaceInvalidFilePathTypeSeparatorsInSlashPath = exports.removeTrailingFileTypeSeparators = exports.replaceMultipleFilePathsInSlashPath = exports.fixMultiSlashesInSlashPath = exports.toAbsoluteSlashPathStartType = exports.toRelativeSlashPathStartType = exports.ALL_SLASH_PATH_FILE_TYPE_SEPARATORS_REGEX = exports.ALL_DOUBLE_SLASHES_REGEX = exports.ALL_SLASHES_REGEX = exports.TRAILING_FILE_TYPE_SEPARATORS_REGEX = exports.TRAILING_SLASHES_REGEX = exports.LEADING_SLASHES_REGEX = exports.slashPathStartTypeFactory = exports.slashPathParts = exports.slashPathName = exports.isValidSlashPath = exports.isSlashPathFolder = exports.isSlashPathTypedFile = exports.isSlashPathFile = exports.slashPathType = exports.DEFAULT_SLASH_PATH_ILLEGAL_CHARACTER_REPLACEMENT = exports.DEFAULT_SLASH_PATH_ILLEGAL_CHARACTERS = exports.SLASH_PATH_FILE_TYPE_SEPARATOR = exports.SLASH_PATH_SEPARATOR = void 0;
|
|
3
|
+
exports.isolateSlashPathFunction = exports.isolateSlashPath = exports.slashPathInvalidError = exports.mergeSlashPaths = exports.slashPathFactory = exports.slashPathValidationFactory = exports.replaceInvalidFilePathTypeSeparatorsInSlashPathFunction = exports.replaceInvalidFilePathTypeSeparatorsInSlashPath = exports.removeTrailingFileTypeSeparators = exports.replaceMultipleFilePathsInSlashPath = exports.fixMultiSlashesInSlashPath = exports.toAbsoluteSlashPathStartType = exports.toRelativeSlashPathStartType = exports.ALL_SLASH_PATH_FILE_TYPE_SEPARATORS_REGEX = exports.ALL_DOUBLE_SLASHES_REGEX = exports.ALL_SLASHES_REGEX = exports.TRAILING_FILE_TYPE_SEPARATORS_REGEX = exports.TRAILING_SLASHES_REGEX = exports.LEADING_SLASHES_REGEX = exports.slashPathStartTypeFactory = exports.slashPathParts = exports.slashPathName = exports.isValidSlashPath = exports.isSlashPathFolder = exports.isSlashPathTypedFile = exports.isSlashPathFile = exports.slashPathType = exports.DEFAULT_SLASH_PATH_ILLEGAL_CHARACTER_REPLACEMENT = exports.DEFAULT_SLASH_PATH_ILLEGAL_CHARACTERS = exports.SLASH_PATH_FILE_TYPE_SEPARATOR = exports.SLASH_PATH_SEPARATOR = void 0;
|
|
4
4
|
const map_1 = require("../value/map");
|
|
5
5
|
const array_1 = require("../array/array");
|
|
6
6
|
const string_1 = require("../string");
|
|
7
7
|
const value_1 = require("../value");
|
|
8
|
+
const array_index_1 = require("../array/array.index");
|
|
8
9
|
exports.SLASH_PATH_SEPARATOR = '/';
|
|
9
10
|
exports.SLASH_PATH_FILE_TYPE_SEPARATOR = '.';
|
|
10
11
|
exports.DEFAULT_SLASH_PATH_ILLEGAL_CHARACTERS = ['#', '[', ']', '*', '?'];
|
|
@@ -19,7 +20,7 @@ exports.DEFAULT_SLASH_PATH_ILLEGAL_CHARACTER_REPLACEMENT = '_';
|
|
|
19
20
|
* @returns
|
|
20
21
|
*/
|
|
21
22
|
function slashPathType(input) {
|
|
22
|
-
const dotCount = input.split(exports.SLASH_PATH_FILE_TYPE_SEPARATOR,
|
|
23
|
+
const dotCount = input.split(exports.SLASH_PATH_FILE_TYPE_SEPARATOR, 3).length - 1;
|
|
23
24
|
let type;
|
|
24
25
|
switch (dotCount) {
|
|
25
26
|
case 0:
|
|
@@ -228,4 +229,40 @@ function slashPathInvalidError() {
|
|
|
228
229
|
return new Error('The slashPath is invalid.');
|
|
229
230
|
}
|
|
230
231
|
exports.slashPathInvalidError = slashPathInvalidError;
|
|
232
|
+
/**
|
|
233
|
+
* Splits the path and returns the items at the given ranges.
|
|
234
|
+
*
|
|
235
|
+
* @param path
|
|
236
|
+
*/
|
|
237
|
+
function isolateSlashPath(path, range) {
|
|
238
|
+
return isolateSlashPathFunction({ range })(path);
|
|
239
|
+
}
|
|
240
|
+
exports.isolateSlashPath = isolateSlashPath;
|
|
241
|
+
/**
|
|
242
|
+
* Creates an IsolateSlashPathFunction.
|
|
243
|
+
*
|
|
244
|
+
* @param config
|
|
245
|
+
* @returns
|
|
246
|
+
*/
|
|
247
|
+
function isolateSlashPathFunction(config) {
|
|
248
|
+
const { startType, asFile } = config;
|
|
249
|
+
const range = (0, value_1.indexRange)(config.range);
|
|
250
|
+
const sliceRange = (0, array_index_1.sliceIndexRangeFunction)(range);
|
|
251
|
+
return (path) => {
|
|
252
|
+
const split = toRelativeSlashPathStartType(path).split(exports.SLASH_PATH_SEPARATOR);
|
|
253
|
+
const splitRange = sliceRange(split);
|
|
254
|
+
let joined = splitRange.join(exports.SLASH_PATH_SEPARATOR);
|
|
255
|
+
const isFolder = asFile !== true && split.length > range.maxIndex;
|
|
256
|
+
if (isFolder) {
|
|
257
|
+
joined = joined + exports.SLASH_PATH_SEPARATOR; // end with a slash.
|
|
258
|
+
}
|
|
259
|
+
if (startType === 'absolute' || path.startsWith(exports.SLASH_PATH_SEPARATOR)) {
|
|
260
|
+
return toAbsoluteSlashPathStartType(joined);
|
|
261
|
+
}
|
|
262
|
+
else {
|
|
263
|
+
return joined;
|
|
264
|
+
}
|
|
265
|
+
};
|
|
266
|
+
}
|
|
267
|
+
exports.isolateSlashPathFunction = isolateSlashPathFunction;
|
|
231
268
|
//# sourceMappingURL=path.js.map
|
package/src/lib/path/path.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"path.js","sourceRoot":"","sources":["../../../../../../packages/util/src/lib/path/path.ts"],"names":[],"mappings":";;;AAAA,sCAAsE;AACtE,0CAAmF;AACnF,sCAAqI;AACrI,
|
|
1
|
+
{"version":3,"file":"path.js","sourceRoot":"","sources":["../../../../../../packages/util/src/lib/path/path.ts"],"names":[],"mappings":";;;AAAA,sCAAsE;AACtE,0CAAmF;AACnF,sCAAqI;AACrI,oCAA8H;AAE9H,sDAA+D;AAElD,QAAA,oBAAoB,GAAG,GAAG,CAAC;AAC3B,QAAA,8BAA8B,GAAG,GAAG,CAAC;AAKrC,QAAA,qCAAqC,GAAG,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,CAAC,CAAC;AAE/E;;GAEG;AACU,QAAA,gDAAgD,GAAG,GAAG,CAAC;AAoCpE;;;;;GAKG;AACH,SAAgB,aAAa,CAAC,KAAgB;IAC5C,MAAM,QAAQ,GAAG,KAAK,CAAC,KAAK,CAAC,sCAA8B,EAAE,CAAC,CAAC,CAAC,MAAM,GAAG,CAAC,CAAC;IAC3E,IAAI,IAAmB,CAAC;IAExB,QAAQ,QAAQ,EAAE;QAChB,KAAK,CAAC;YACJ,IAAI,KAAK,CAAC,MAAM,KAAK,CAAC,EAAE;gBACtB,IAAI,GAAG,SAAS,CAAC;aAClB;iBAAM;gBACL,MAAM,SAAS,GAAG,KAAK,CAAC,KAAK,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC;gBAE1C,IAAI,SAAS,KAAK,4BAAoB,EAAE;oBACtC,IAAI,GAAG,QAAQ,CAAC;iBACjB;qBAAM;oBACL,IAAI,GAAG,MAAM,CAAC;iBACf;aACF;YACD,MAAM;QACR,KAAK,CAAC;Y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D,CAAC;AAFD,sDAEC;AAED;;;;GAIG;AACH,SAAgB,gBAAgB,CAAC,IAAe,EAAE,KAAsB;IACtE,OAAO,wBAAwB,CAAC,EAAE,KAAK,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC;AACnD,CAAC;AAFD,4CAEC;AA2BD;;;;;GAKG;AACH,SAAgB,wBAAwB,CAAC,MAAsC;IAC7E,MAAM,EAAE,SAAS,EAAE,MAAM,EAAE,GAAG,MAAM,CAAC;IACrC,MAAM,KAAK,GAAG,IAAA,kBAAU,EAAC,MAAM,CAAC,KAAK,CAAC,CAAC;IACvC,MAAM,UAAU,GAAG,IAAA,qCAAuB,EAAC,KAAK,CAAC,CAAC;IAElD,OAAO,CAAC,IAAe,EAAE,EAAE;QACzB,MAAM,KAAK,GAAG,4BAA4B,CAAC,IAAI,CAAC,CAAC,KAAK,CAAC,4BAAoB,CAAC,CAAC;QAC7E,MAAM,UAAU,GAAG,UAAU,CAAC,KAAK,CAAC,CAAC;QACrC,IAAI,MAAM,GAAG,UAAU,CAAC,IAAI,CAAC,4BAAoB,CAAC,CAAC;QACnD,MAAM,QAAQ,GAAG,MAAM,KAAK,IAAI,IAAI,KAAK,CAAC,MAAM,GAAG,KAAK,CAAC,QAAQ,CAAC;QAElE,IAAI,QAAQ,EAAE;YACZ,MAAM,GAAG,MAAM,GAAG,4BAAoB,CAAC,CAAC,oBAAoB;SAC7D;QAED,IAAI,SAAS,KAAK,UAAU,IAAI,IAAI,CAAC,UAAU,CAAC,4BAAoB,CAAC,EAAE;YACrE,OAAO,4BAA4B,CAAC,MAAM,CAAC,CAAC;SAC7C;aAAM;YACL,OAAO,MAAM,CAAC;SACf;IACH,CAAC,CAAC;AACJ,CAAC;AArBD,4DAqBC"}
|
package/src/lib/string/char.d.ts
CHANGED
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import { ArrayOrValue } from '../array/array';
|
|
2
|
+
import { DecisionFunction } from '../value/decision';
|
|
1
3
|
export interface FirstAndLastCharacterOccurrence {
|
|
2
4
|
readonly first: number | -1;
|
|
3
5
|
readonly last: number | -1;
|
|
@@ -14,6 +16,37 @@ export interface FirstAndLastCharacterOccurrence {
|
|
|
14
16
|
* @returns
|
|
15
17
|
*/
|
|
16
18
|
export declare function firstAndLastCharacterOccurrence(input: string, find: string): FirstAndLastCharacterOccurrence;
|
|
19
|
+
/**
|
|
20
|
+
* Function that replaces the last character with the configured replacement string if it is any of the configured values.
|
|
21
|
+
*/
|
|
22
|
+
export declare type ReplaceLastCharacterIfIsFunction = (input: string) => string;
|
|
23
|
+
/**
|
|
24
|
+
* Replaces the last character with the replacement string if it is any of the input values.
|
|
25
|
+
*
|
|
26
|
+
* @param input
|
|
27
|
+
* @param replacement
|
|
28
|
+
* @param is
|
|
29
|
+
* @returns
|
|
30
|
+
*/
|
|
31
|
+
export declare function replaceLastCharacterIfIsFunction(replacement: string, is: ArrayOrValue<string>): ReplaceLastCharacterIfIsFunction;
|
|
32
|
+
/**
|
|
33
|
+
* Replaces the last character with the replacement string if the decision is true.
|
|
34
|
+
*
|
|
35
|
+
* @param input
|
|
36
|
+
* @param index
|
|
37
|
+
* @param replacement
|
|
38
|
+
* @returns
|
|
39
|
+
*/
|
|
40
|
+
export declare function replaceLastCharacterIf(input: string, replacement: string, decision: DecisionFunction<string>): string;
|
|
41
|
+
/**
|
|
42
|
+
* Replaces the character at the given index with the replacement string if the decision is true.
|
|
43
|
+
*
|
|
44
|
+
* @param input
|
|
45
|
+
* @param index
|
|
46
|
+
* @param replacement
|
|
47
|
+
* @returns
|
|
48
|
+
*/
|
|
49
|
+
export declare function replaceCharacterAtIndexIf(input: string, index: number, replacement: string, decision: DecisionFunction<string>): string;
|
|
17
50
|
/**
|
|
18
51
|
* Replaces the character at the given index with the replacement string.
|
|
19
52
|
*
|
package/src/lib/string/char.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.UTF_PRIVATE_USAGE_AREA_START = exports.UTF_8_START_CHARACTER = exports.splitStringAtIndex = exports.replaceCharacterAtIndexWith = exports.firstAndLastCharacterOccurrence = void 0;
|
|
3
|
+
exports.UTF_PRIVATE_USAGE_AREA_START = exports.UTF_8_START_CHARACTER = exports.splitStringAtIndex = exports.replaceCharacterAtIndexWith = exports.replaceCharacterAtIndexIf = exports.replaceLastCharacterIf = exports.replaceLastCharacterIfIsFunction = exports.firstAndLastCharacterOccurrence = void 0;
|
|
4
4
|
/**
|
|
5
5
|
* Find the first and last occurence of the input character in the input string.
|
|
6
6
|
*
|
|
@@ -36,6 +36,50 @@ function firstAndLastCharacterOccurrence(input, find) {
|
|
|
36
36
|
};
|
|
37
37
|
}
|
|
38
38
|
exports.firstAndLastCharacterOccurrence = firstAndLastCharacterOccurrence;
|
|
39
|
+
/**
|
|
40
|
+
* Replaces the last character with the replacement string if it is any of the input values.
|
|
41
|
+
*
|
|
42
|
+
* @param input
|
|
43
|
+
* @param replacement
|
|
44
|
+
* @param is
|
|
45
|
+
* @returns
|
|
46
|
+
*/
|
|
47
|
+
function replaceLastCharacterIfIsFunction(replacement, is) {
|
|
48
|
+
const matches = new Set(is);
|
|
49
|
+
return (input) => {
|
|
50
|
+
return replaceLastCharacterIf(input, replacement, (x) => matches.has(x));
|
|
51
|
+
};
|
|
52
|
+
}
|
|
53
|
+
exports.replaceLastCharacterIfIsFunction = replaceLastCharacterIfIsFunction;
|
|
54
|
+
/**
|
|
55
|
+
* Replaces the last character with the replacement string if the decision is true.
|
|
56
|
+
*
|
|
57
|
+
* @param input
|
|
58
|
+
* @param index
|
|
59
|
+
* @param replacement
|
|
60
|
+
* @returns
|
|
61
|
+
*/
|
|
62
|
+
function replaceLastCharacterIf(input, replacement, decision) {
|
|
63
|
+
return input.length > 0 ? replaceCharacterAtIndexIf(input, input.length - 1, replacement, decision) : input;
|
|
64
|
+
}
|
|
65
|
+
exports.replaceLastCharacterIf = replaceLastCharacterIf;
|
|
66
|
+
/**
|
|
67
|
+
* Replaces the character at the given index with the replacement string if the decision is true.
|
|
68
|
+
*
|
|
69
|
+
* @param input
|
|
70
|
+
* @param index
|
|
71
|
+
* @param replacement
|
|
72
|
+
* @returns
|
|
73
|
+
*/
|
|
74
|
+
function replaceCharacterAtIndexIf(input, index, replacement, decision) {
|
|
75
|
+
if (decision(input[index])) {
|
|
76
|
+
return replaceCharacterAtIndexWith(input, index, replacement);
|
|
77
|
+
}
|
|
78
|
+
else {
|
|
79
|
+
return input;
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
exports.replaceCharacterAtIndexIf = replaceCharacterAtIndexIf;
|
|
39
83
|
/**
|
|
40
84
|
* Replaces the character at the given index with the replacement string.
|
|
41
85
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"char.js","sourceRoot":"","sources":["../../../../../../packages/util/src/lib/string/char.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"char.js","sourceRoot":"","sources":["../../../../../../packages/util/src/lib/string/char.ts"],"names":[],"mappings":";;;AAYA;;;;;;GAMG;AACH,SAAgB,+BAA+B,CAAC,KAAa,EAAE,IAAY;IACzE,IAAI,KAAK,GAAW,CAAC,CAAC,CAAC;IACvB,IAAI,IAAI,GAAW,CAAC,CAAC,CAAC;IACtB,IAAI,UAAU,GAAG,CAAC,CAAC;IAEnB,IAAI,IAAI,CAAC,MAAM,KAAK,CAAC,EAAE;QACrB,MAAM,IAAI,KAAK,CAAC,6EAA6E,CAAC,CAAC;KAChG;IAED,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,KAAK,CAAC,MAAM,EAAE,CAAC,IAAI,CAAC,EAAE;QACxC,IAAI,KAAK,CAAC,CAAC,CAAC,KAAK,IAAI,EAAE;YACrB,IAAI,KAAK,KAAK,CAAC,CAAC,EAAE;gBAChB,KAAK,GAAG,CAAC,CAAC;aACX;iBAAM;gBACL,IAAI,GAAG,CAAC,CAAC;aACV;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AI,EAAE,IAAI,CAAC,GAAG,kBAAkB,CAAC,KAAK,EAAE,KAAK,EAAE,KAAK,CAAC,CAAC;IAC7D,OAAO,IAAI,GAAG,WAAW,GAAG,IAAI,CAAC;AACnC,CAAC;AAHD,kEAGC;AAED;;;;;;;GAOG;AACH,SAAgB,kBAAkB,CAAC,KAAa,EAAE,KAAa,EAAE,SAAS,GAAG,KAAK;IAChF,MAAM,IAAI,GAAG,KAAK,CAAC,SAAS,CAAC,CAAC,EAAE,KAAK,CAAC,CAAC;IACvC,MAAM,IAAI,GAAG,KAAK,CAAC,SAAS,CAAC,KAAK,GAAG,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;IAC1D,OAAO,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC;AACtB,CAAC;AAJD,gDAIC;AAED;;;;GAIG;AACU,QAAA,qBAAqB,GAAG,QAAQ,CAAC;AAE9C;;;;;;GAMG;AACU,QAAA,4BAA4B,GAAG,QAAQ,CAAC"}
|
package/src/lib/string/index.js
CHANGED
|
@@ -5,4 +5,5 @@ tslib_1.__exportStar(require("./char"), exports);
|
|
|
5
5
|
tslib_1.__exportStar(require("./string"), exports);
|
|
6
6
|
tslib_1.__exportStar(require("./replace"), exports);
|
|
7
7
|
tslib_1.__exportStar(require("./transform"), exports);
|
|
8
|
+
tslib_1.__exportStar(require("./url"), exports);
|
|
8
9
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../packages/util/src/lib/string/index.ts"],"names":[],"mappings":";;;AAAA,iDAAuB;AACvB,mDAAyB;AACzB,oDAA0B;AAC1B,sDAA4B"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../packages/util/src/lib/string/index.ts"],"names":[],"mappings":";;;AAAA,iDAAuB;AACvB,mDAAyB;AACzB,oDAA0B;AAC1B,sDAA4B;AAC5B,gDAAsB"}
|
|
@@ -35,3 +35,9 @@ export declare function capitalizeFirstLetter(value: string): string;
|
|
|
35
35
|
* @returns
|
|
36
36
|
*/
|
|
37
37
|
export declare function lowercaseFirstLetter(value: string): string;
|
|
38
|
+
/**
|
|
39
|
+
* Performs split, but joins the remainder instead of discarding them.
|
|
40
|
+
*
|
|
41
|
+
* @param input
|
|
42
|
+
*/
|
|
43
|
+
export declare function splitJoinRemainder(input: string, separator: string, limit: number): string[];
|
package/src/lib/string/string.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.lowercaseFirstLetter = exports.capitalizeFirstLetter = exports.addPlusPrefixToNumber = exports.splitCommaSeparatedStringToSet = exports.splitCommaSeparatedString = exports.caseInsensitiveString = void 0;
|
|
3
|
+
exports.splitJoinRemainder = exports.lowercaseFirstLetter = exports.capitalizeFirstLetter = exports.addPlusPrefixToNumber = exports.splitCommaSeparatedStringToSet = exports.splitCommaSeparatedString = exports.caseInsensitiveString = void 0;
|
|
4
4
|
function caseInsensitiveString(input) {
|
|
5
5
|
return input === null || input === void 0 ? void 0 : input.toLocaleLowerCase();
|
|
6
6
|
}
|
|
@@ -48,4 +48,28 @@ function lowercaseFirstLetter(value) {
|
|
|
48
48
|
return value.charAt(0).toLowerCase() + value.slice(1);
|
|
49
49
|
}
|
|
50
50
|
exports.lowercaseFirstLetter = lowercaseFirstLetter;
|
|
51
|
+
/**
|
|
52
|
+
* Performs split, but joins the remainder instead of discarding them.
|
|
53
|
+
*
|
|
54
|
+
* @param input
|
|
55
|
+
*/
|
|
56
|
+
function splitJoinRemainder(input, separator, limit) {
|
|
57
|
+
const split = input.split(separator);
|
|
58
|
+
const components = [];
|
|
59
|
+
if (split.length > 1) {
|
|
60
|
+
const hasItemsToMerge = split.length > limit;
|
|
61
|
+
const stopIndex = hasItemsToMerge ? limit - 1 : split.length;
|
|
62
|
+
for (let i = 0; i < stopIndex; i += 1) {
|
|
63
|
+
components.push(split[i]);
|
|
64
|
+
}
|
|
65
|
+
if (hasItemsToMerge) {
|
|
66
|
+
components.push(split.slice(stopIndex).join(separator));
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
else {
|
|
70
|
+
components.push(split[0]);
|
|
71
|
+
}
|
|
72
|
+
return components;
|
|
73
|
+
}
|
|
74
|
+
exports.splitJoinRemainder = splitJoinRemainder;
|
|
51
75
|
//# sourceMappingURL=string.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"string.js","sourceRoot":"","sources":["../../../../../../packages/util/src/lib/string/string.ts"],"names":[],"mappings":";;;AAkBA,SAAgB,qBAAqB,CAAC,KAAoB;IACxD,OAAO,KAAK,aAAL,KAAK,uBAAL,KAAK,CAAE,iBAAiB,EAAE,CAAC;AACpC,CAAC;AAFD,sDAEC;AAID,SAAgB,yBAAyB,CAAc,KAA8B,EAAE,QAA8B,CAAC,CAAC,EAAE,EAAE,CAAC,CAAiB;IAC3I,MAAM,MAAM,GAAG,KAAK,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;IAChC,OAAO,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,KAAK,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC;AAC5C,CAAC;AAHD,8DAGC;AAED,SAAgB,8BAA8B,CAAC,KAAkC;IAC/E,OAAO,IAAI,GAAG,CAAC,KAAK,IAAI,IAAI,CAAC,CAAC,CAAC,yBAAyB,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC;AACxE,CAAC;AAFD,wEAEC;AAED;;;;GAIG;AACH,SAAgB,qBAAqB,CAAC,KAAqB,EAAE,MAAM,GAAG,GAAG;IACvE,IAAI,KAAK,IAAI,IAAI,EAAE;QACjB,OAAO,KAAK,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,MAAM,GAAG,KAAK,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IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,SAAS,CAAC,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC,CAAC;SACzD;KACF;SAAM;QACL,UAAU,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC;KAC3B;IAED,OAAO,UAAU,CAAC;AACpB,CAAC;AApBD,gDAoBC"}
|
|
@@ -22,3 +22,17 @@ export declare type TransformStringFunctionConfig<S extends string = string> = {
|
|
|
22
22
|
};
|
|
23
23
|
export declare type TransformStringFunction<S extends string = string> = MapFunction<S, S>;
|
|
24
24
|
export declare function transformStringFunction<S extends string = string>(config: TransformStringFunctionConfig): TransformStringFunction<S>;
|
|
25
|
+
export declare function addPrefix(prefix: string, input: string): string;
|
|
26
|
+
/**
|
|
27
|
+
* Function that adds a configured prefix to the input string if it does not exist on that string.
|
|
28
|
+
*/
|
|
29
|
+
export declare type AddPrefixFunction = (input: string) => string;
|
|
30
|
+
/**
|
|
31
|
+
* Creates an AddPrefixFunction
|
|
32
|
+
*
|
|
33
|
+
* @param input
|
|
34
|
+
* @param replacement
|
|
35
|
+
* @param is
|
|
36
|
+
* @returns
|
|
37
|
+
*/
|
|
38
|
+
export declare function addPrefixFunction(prefix: string): AddPrefixFunction;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.transformStringFunction = exports.stringToLowercaseFunction = exports.stringToUppercaseFunction = exports.stringTrimFunction = void 0;
|
|
3
|
+
exports.addPrefixFunction = exports.addPrefix = exports.transformStringFunction = exports.stringToLowercaseFunction = exports.stringToUppercaseFunction = exports.stringTrimFunction = void 0;
|
|
4
4
|
const map_1 = require("../value/map");
|
|
5
5
|
function stringTrimFunction(input) {
|
|
6
6
|
return input.trim();
|
|
@@ -40,4 +40,22 @@ function transformStringFunction(config) {
|
|
|
40
40
|
return transform;
|
|
41
41
|
}
|
|
42
42
|
exports.transformStringFunction = transformStringFunction;
|
|
43
|
+
function addPrefix(prefix, input) {
|
|
44
|
+
return addPrefixFunction(prefix)(input);
|
|
45
|
+
}
|
|
46
|
+
exports.addPrefix = addPrefix;
|
|
47
|
+
/**
|
|
48
|
+
* Creates an AddPrefixFunction
|
|
49
|
+
*
|
|
50
|
+
* @param input
|
|
51
|
+
* @param replacement
|
|
52
|
+
* @param is
|
|
53
|
+
* @returns
|
|
54
|
+
*/
|
|
55
|
+
function addPrefixFunction(prefix) {
|
|
56
|
+
return (input) => {
|
|
57
|
+
return input.startsWith(prefix) ? input : prefix + input;
|
|
58
|
+
};
|
|
59
|
+
}
|
|
60
|
+
exports.addPrefixFunction = addPrefixFunction;
|
|
43
61
|
//# sourceMappingURL=transform.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"transform.js","sourceRoot":"","sources":["../../../../../../packages/util/src/lib/string/transform.ts"],"names":[],"mappings":";;;AAAA,sCAAyD;AAGzD,SAAgB,kBAAkB,CAAC,KAAa;IAC9C,OAAO,KAAK,CAAC,IAAI,EAAE,CAAC;AACtB,CAAC;AAFD,gDAEC;AAED,SAAgB,yBAAyB,CAAC,KAAa;IACrD,OAAO,KAAK,CAAC,WAAW,EAAE,CAAC;AAC7B,CAAC;AAFD,8DAEC;AAED,SAAgB,yBAAyB,CAAC,KAAa;IACrD,OAAO,KAAK,CAAC,WAAW,EAAE,CAAC;AAC7B,CAAC;AAFD,8DAEC;AAuBD,SAAgB,uBAAuB,CAA4B,MAAqC;IACtG,IAAI,aAA6C,CAAC;IAElD,IAAI,MAAM,CAAC,SAAS,EAAE;QACpB,aAAa,GAAG,MAAM,CAAC,SAAS,CAAC;KAClC;SAAM,IAAI,MAAM,CAAC,WAAW,EAAE;QAC7B,aAAa,GAAG,yBAAyB,CAAC;KAC3C;SAAM,IAAI,MAAM,CAAC,WAAW,EAAE;QAC7B,aAAa,GAAG,yBAAyB,CAAC;KAC3C;IAED,IAAI,SAAS,GAAmC,aAAa,CAAC;IAE9D,IAAI,MAAM,CAAC,IAAI,EAAE;QACf,IAAI,aAAa,IAAI,IAAI,EAAE;YACzB,SAAS,GAAG,CAAC,CAAC,EAAE,EAAE,CAAE,aAAyC,CAAC,kBAAkB,CAAC,CAAC,CAAC,CAAC,CAAC;SACtF;aAAM;YACL,SAAS,GAAG,kBAAkB,CAAC;SAChC;KACF;IAED,IAAI,SAAS,IAAI,IAAI,EAAE;QACrB,SAAS,GAAG,kBAAuC,CAAC;KACrD;IAED,OAAO,SAAkD,CAAC;AAC5D,CAAC;AA1BD,0DA0BC"}
|
|
1
|
+
{"version":3,"file":"transform.js","sourceRoot":"","sources":["../../../../../../packages/util/src/lib/string/transform.ts"],"names":[],"mappings":";;;AAAA,sCAAyD;AAGzD,SAAgB,kBAAkB,CAAC,KAAa;IAC9C,OAAO,KAAK,CAAC,IAAI,EAAE,CAAC;AACtB,CAAC;AAFD,gDAEC;AAED,SAAgB,yBAAyB,CAAC,KAAa;IACrD,OAAO,KAAK,CAAC,WAAW,EAAE,CAAC;AAC7B,CAAC;AAFD,8DAEC;AAED,SAAgB,yBAAyB,CAAC,KAAa;IACrD,OAAO,KAAK,CAAC,WAAW,EAAE,CAAC;AAC7B,CAAC;AAFD,8DAEC;AAuBD,SAAgB,uBAAuB,CAA4B,MAAqC;IACtG,IAAI,aAA6C,CAAC;IAElD,IAAI,MAAM,CAAC,SAAS,EAAE;QACpB,aAAa,GAAG,MAAM,CAAC,SAAS,CAAC;KAClC;SAAM,IAAI,MAAM,CAAC,WAAW,EAAE;QAC7B,aAAa,GAAG,yBAAyB,CAAC;KAC3C;SAAM,IAAI,MAAM,CAAC,WAAW,EAAE;QAC7B,aAAa,GAAG,yBAAyB,CAAC;KAC3C;IAED,IAAI,SAAS,GAAmC,aAAa,CAAC;IAE9D,IAAI,MAAM,CAAC,IAAI,EAAE;QACf,IAAI,aAAa,IAAI,IAAI,EAAE;YACzB,SAAS,GAAG,CAAC,CAAC,EAAE,EAAE,CAAE,aAAyC,CAAC,kBAAkB,CAAC,CAAC,CAAC,CAAC,CAAC;SACtF;aAAM;YACL,SAAS,GAAG,kBAAkB,CAAC;SAChC;KACF;IAED,IAAI,SAAS,IAAI,IAAI,EAAE;QACrB,SAAS,GAAG,kBAAuC,CAAC;KACrD;IAED,OAAO,SAAkD,CAAC;AAC5D,CAAC;AA1BD,0DA0BC;AAED,SAAgB,SAAS,CAAC,MAAc,EAAE,KAAa;IACrD,OAAO,iBAAiB,CAAC,MAAM,CAAC,CAAC,KAAK,CAAC,CAAC;AAC1C,CAAC;AAFD,8BAEC;AAOD;;;;;;;GAOG;AACH,SAAgB,iBAAiB,CAAC,MAAc;IAC9C,OAAO,CAAC,KAAa,EAAE,EAAE;QACvB,OAAO,KAAK,CAAC,UAAU,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,MAAM,GAAG,KAAK,CAAC;IAC3D,CAAC,CAAC;AACJ,CAAC;AAJD,8CAIC"}
|
|
@@ -0,0 +1,138 @@
|
|
|
1
|
+
import { IndexRangeInput } from './../value/indexed';
|
|
2
|
+
import { MapFunction } from '../value/map';
|
|
3
|
+
import { Maybe } from '../value/maybe.type';
|
|
4
|
+
/**
|
|
5
|
+
* A website domain.
|
|
6
|
+
*
|
|
7
|
+
* Examples:
|
|
8
|
+
* - dereekb.com
|
|
9
|
+
* - components.dereekb.com
|
|
10
|
+
*/
|
|
11
|
+
export declare type WebsiteDomain = string;
|
|
12
|
+
/**
|
|
13
|
+
* Simple website domain regex that looks for a period between the domain and the tld
|
|
14
|
+
*/
|
|
15
|
+
export declare const WEBSITE_DOMAIN_NAME_REGEX: RegExp;
|
|
16
|
+
/**
|
|
17
|
+
* Returns true if the input probably has a website domain in it.
|
|
18
|
+
*
|
|
19
|
+
* Examples where it will return true:
|
|
20
|
+
* - dereekb.com
|
|
21
|
+
* - https://components.dereekb.com
|
|
22
|
+
* - https://components.dereekb.com/
|
|
23
|
+
* - https://components.dereekb.com/doc/home
|
|
24
|
+
*
|
|
25
|
+
* @param input
|
|
26
|
+
* @returns
|
|
27
|
+
*/
|
|
28
|
+
export declare function hasWebsiteDomain(input: string): input is WebsiteDomain;
|
|
29
|
+
/**
|
|
30
|
+
* A website url that starts with http:// or https://
|
|
31
|
+
*/
|
|
32
|
+
export declare type BaseWebsiteUrl<D extends WebsiteDomain = WebsiteDomain> = `http://${D}` | `https://${D}`;
|
|
33
|
+
/**
|
|
34
|
+
* A website url. Is at minimum a domain.
|
|
35
|
+
*
|
|
36
|
+
* Examples:
|
|
37
|
+
* - dereekb.com
|
|
38
|
+
* - https://components.dereekb.com
|
|
39
|
+
* - https://components.dereekb.com/
|
|
40
|
+
* - https://components.dereekb.com/doc/home
|
|
41
|
+
*/
|
|
42
|
+
export declare type WebsiteUrl = string;
|
|
43
|
+
/**
|
|
44
|
+
* A website's domain and path combined, without the BaseWebsiteUrl
|
|
45
|
+
*
|
|
46
|
+
* Examples:
|
|
47
|
+
* - dereekb.com
|
|
48
|
+
* - components.dereekb.com/
|
|
49
|
+
* - components.dereekb.com/doc/home
|
|
50
|
+
*/
|
|
51
|
+
export declare type WebsiteDomainAndPath = string;
|
|
52
|
+
/**
|
|
53
|
+
* A website's path component.
|
|
54
|
+
*
|
|
55
|
+
* Examples:
|
|
56
|
+
* - /
|
|
57
|
+
* - /doc/home
|
|
58
|
+
* - /doc/home?test=true
|
|
59
|
+
*/
|
|
60
|
+
export declare type WebsitePath = `/${string}`;
|
|
61
|
+
/**
|
|
62
|
+
* Any query parameters that follow the path.
|
|
63
|
+
*/
|
|
64
|
+
export declare type WebsiteQueryString = `?${string}`;
|
|
65
|
+
/**
|
|
66
|
+
* Maps the input WebsitePath to remove the configured base path.
|
|
67
|
+
*/
|
|
68
|
+
export declare type IsolateWebsitePathFunction = MapFunction<WebsitePath | WebsiteDomainAndPath | WebsiteUrl, WebsitePath>;
|
|
69
|
+
export interface IsolateWebsitePathFunctionConfig {
|
|
70
|
+
/**
|
|
71
|
+
* Optional range of paths to isolate.
|
|
72
|
+
*/
|
|
73
|
+
isolatePathComponents?: IndexRangeInput;
|
|
74
|
+
/**
|
|
75
|
+
* Base path to remove/ignore when isolating a path from the input.
|
|
76
|
+
*
|
|
77
|
+
* For example:
|
|
78
|
+
* - For Reddit it could ignore /u or /u
|
|
79
|
+
*/
|
|
80
|
+
ignoredBasePath?: string;
|
|
81
|
+
/**
|
|
82
|
+
* Whether or not to remove any query parameters if they exist.
|
|
83
|
+
*
|
|
84
|
+
* False by default.
|
|
85
|
+
*/
|
|
86
|
+
removeQueryParameters?: boolean;
|
|
87
|
+
/**
|
|
88
|
+
* Whether or not to remove any trailing slash from the path.
|
|
89
|
+
*
|
|
90
|
+
* False by default.
|
|
91
|
+
*/
|
|
92
|
+
removeTrailingSlash?: boolean;
|
|
93
|
+
}
|
|
94
|
+
/**
|
|
95
|
+
* Creates a new ExcludeBaseWebsitePathFunction that excludes the base path from the input website path if it exists.
|
|
96
|
+
*
|
|
97
|
+
* @param basePath
|
|
98
|
+
*/
|
|
99
|
+
export declare function isolateWebsitePathFunction(config?: IsolateWebsitePathFunctionConfig): IsolateWebsitePathFunction;
|
|
100
|
+
export interface WebsitePathAndQueryPair {
|
|
101
|
+
path: WebsitePath;
|
|
102
|
+
query?: Maybe<WebsiteQueryString>;
|
|
103
|
+
}
|
|
104
|
+
export declare function websitePathAndQueryPair(inputPath: string | WebsitePath): WebsitePathAndQueryPair;
|
|
105
|
+
/**
|
|
106
|
+
* Reads the website path from the input.
|
|
107
|
+
*
|
|
108
|
+
* @param input
|
|
109
|
+
* @returns
|
|
110
|
+
*/
|
|
111
|
+
export declare function websitePathFromWebsiteUrl(inputUrl: WebsiteUrl | WebsiteDomainAndPath): WebsitePath;
|
|
112
|
+
export declare function websiteDomainAndPathPairFromWebsiteUrl(inputUrl: WebsiteUrl | WebsiteDomainAndPath): WebsiteDomainAndPathPair;
|
|
113
|
+
/**
|
|
114
|
+
* Reads the website path from the input WebsiteDomainAndPath.
|
|
115
|
+
*
|
|
116
|
+
* @param input
|
|
117
|
+
* @returns
|
|
118
|
+
*/
|
|
119
|
+
export declare function websitePathFromWebsiteDomainAndPath(input: WebsiteDomainAndPath): WebsitePath;
|
|
120
|
+
export interface WebsiteDomainAndPathPair {
|
|
121
|
+
domain: WebsiteDomain;
|
|
122
|
+
path: WebsitePath;
|
|
123
|
+
}
|
|
124
|
+
export declare function websiteDomainAndPathPair(input: WebsiteDomainAndPath): WebsiteDomainAndPathPair;
|
|
125
|
+
export declare const HTTP_OR_HTTPS_REGEX: RegExp;
|
|
126
|
+
/**
|
|
127
|
+
* Removes both http:// and https:// from the url.
|
|
128
|
+
*
|
|
129
|
+
* @param url
|
|
130
|
+
* @returns
|
|
131
|
+
*/
|
|
132
|
+
export declare function removeHttpFromUrl(url: BaseWebsiteUrl | string): WebsiteDomainAndPath;
|
|
133
|
+
/**
|
|
134
|
+
* Returns true if the input string starts with http/https
|
|
135
|
+
*
|
|
136
|
+
* @param input
|
|
137
|
+
*/
|
|
138
|
+
export declare function hasHttpPrefix(input: string): input is BaseWebsiteUrl;
|
|
@@ -0,0 +1,134 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.hasHttpPrefix = exports.removeHttpFromUrl = exports.HTTP_OR_HTTPS_REGEX = exports.websiteDomainAndPathPair = exports.websitePathFromWebsiteDomainAndPath = exports.websiteDomainAndPathPairFromWebsiteUrl = exports.websitePathFromWebsiteUrl = exports.websitePathAndQueryPair = exports.isolateWebsitePathFunction = exports.hasWebsiteDomain = exports.WEBSITE_DOMAIN_NAME_REGEX = void 0;
|
|
4
|
+
const path_1 = require("../path/path");
|
|
5
|
+
const map_1 = require("../value/map");
|
|
6
|
+
const replace_1 = require("./replace");
|
|
7
|
+
const string_1 = require("./string");
|
|
8
|
+
const char_1 = require("./char");
|
|
9
|
+
/**
|
|
10
|
+
* Simple website domain regex that looks for a period between the domain and the tld
|
|
11
|
+
*/
|
|
12
|
+
exports.WEBSITE_DOMAIN_NAME_REGEX = /(.+)\.(.+)/;
|
|
13
|
+
/**
|
|
14
|
+
* Returns true if the input probably has a website domain in it.
|
|
15
|
+
*
|
|
16
|
+
* Examples where it will return true:
|
|
17
|
+
* - dereekb.com
|
|
18
|
+
* - https://components.dereekb.com
|
|
19
|
+
* - https://components.dereekb.com/
|
|
20
|
+
* - https://components.dereekb.com/doc/home
|
|
21
|
+
*
|
|
22
|
+
* @param input
|
|
23
|
+
* @returns
|
|
24
|
+
*/
|
|
25
|
+
function hasWebsiteDomain(input) {
|
|
26
|
+
return exports.WEBSITE_DOMAIN_NAME_REGEX.test(input);
|
|
27
|
+
}
|
|
28
|
+
exports.hasWebsiteDomain = hasWebsiteDomain;
|
|
29
|
+
/**
|
|
30
|
+
* Creates a new ExcludeBaseWebsitePathFunction that excludes the base path from the input website path if it exists.
|
|
31
|
+
*
|
|
32
|
+
* @param basePath
|
|
33
|
+
*/
|
|
34
|
+
function isolateWebsitePathFunction(config = {}) {
|
|
35
|
+
const { removeQueryParameters, ignoredBasePath, isolatePathComponents, removeTrailingSlash } = config;
|
|
36
|
+
const basePathRegex = ignoredBasePath ? new RegExp('^' + (0, replace_1.escapeStringForRegex)((0, path_1.toAbsoluteSlashPathStartType)(ignoredBasePath))) : undefined;
|
|
37
|
+
const isolateRange = isolatePathComponents != null ? (0, path_1.isolateSlashPathFunction)({ range: isolatePathComponents, startType: 'absolute' }) : undefined;
|
|
38
|
+
const replaceTrailingSlash = removeTrailingSlash === true ? (0, char_1.replaceLastCharacterIfIsFunction)('', path_1.SLASH_PATH_SEPARATOR) : undefined;
|
|
39
|
+
const pathTransform = (0, map_1.chainMapSameFunctions)([
|
|
40
|
+
// remove any base path
|
|
41
|
+
basePathRegex != null ? (inputPath) => inputPath.replace(basePathRegex, '') : undefined,
|
|
42
|
+
// remove the query parameters
|
|
43
|
+
removeQueryParameters != null ? (inputPath) => websitePathAndQueryPair(inputPath).path : undefined,
|
|
44
|
+
// isolate range
|
|
45
|
+
isolateRange != null
|
|
46
|
+
? (inputPath) => {
|
|
47
|
+
let result = isolateRange(inputPath);
|
|
48
|
+
// retain the query if one is available.
|
|
49
|
+
if (removeQueryParameters !== true) {
|
|
50
|
+
const { query } = websitePathAndQueryPair(inputPath);
|
|
51
|
+
if (query) {
|
|
52
|
+
result = result + query;
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
return result;
|
|
56
|
+
}
|
|
57
|
+
: undefined,
|
|
58
|
+
// remove trailing slash from path
|
|
59
|
+
replaceTrailingSlash != null
|
|
60
|
+
? ((inputPath) => {
|
|
61
|
+
const { path, query } = websitePathAndQueryPair(inputPath);
|
|
62
|
+
return replaceTrailingSlash(path) + (query !== null && query !== void 0 ? query : '');
|
|
63
|
+
})
|
|
64
|
+
: undefined
|
|
65
|
+
]);
|
|
66
|
+
return (input) => {
|
|
67
|
+
const path = pathTransform(websitePathFromWebsiteUrl(input));
|
|
68
|
+
return path;
|
|
69
|
+
};
|
|
70
|
+
}
|
|
71
|
+
exports.isolateWebsitePathFunction = isolateWebsitePathFunction;
|
|
72
|
+
function websitePathAndQueryPair(inputPath) {
|
|
73
|
+
const [path, query] = inputPath.split('?', 2);
|
|
74
|
+
return {
|
|
75
|
+
path: path,
|
|
76
|
+
query: query ? `?${query}` : undefined
|
|
77
|
+
};
|
|
78
|
+
}
|
|
79
|
+
exports.websitePathAndQueryPair = websitePathAndQueryPair;
|
|
80
|
+
/**
|
|
81
|
+
* Reads the website path from the input.
|
|
82
|
+
*
|
|
83
|
+
* @param input
|
|
84
|
+
* @returns
|
|
85
|
+
*/
|
|
86
|
+
function websitePathFromWebsiteUrl(inputUrl) {
|
|
87
|
+
const websiteDomainAndPath = removeHttpFromUrl(inputUrl);
|
|
88
|
+
return websitePathFromWebsiteDomainAndPath(websiteDomainAndPath);
|
|
89
|
+
}
|
|
90
|
+
exports.websitePathFromWebsiteUrl = websitePathFromWebsiteUrl;
|
|
91
|
+
function websiteDomainAndPathPairFromWebsiteUrl(inputUrl) {
|
|
92
|
+
const websiteDomainAndPath = removeHttpFromUrl(inputUrl);
|
|
93
|
+
return websiteDomainAndPathPair(websiteDomainAndPath);
|
|
94
|
+
}
|
|
95
|
+
exports.websiteDomainAndPathPairFromWebsiteUrl = websiteDomainAndPathPairFromWebsiteUrl;
|
|
96
|
+
/**
|
|
97
|
+
* Reads the website path from the input WebsiteDomainAndPath.
|
|
98
|
+
*
|
|
99
|
+
* @param input
|
|
100
|
+
* @returns
|
|
101
|
+
*/
|
|
102
|
+
function websitePathFromWebsiteDomainAndPath(input) {
|
|
103
|
+
return websiteDomainAndPathPair(input).path;
|
|
104
|
+
}
|
|
105
|
+
exports.websitePathFromWebsiteDomainAndPath = websitePathFromWebsiteDomainAndPath;
|
|
106
|
+
function websiteDomainAndPathPair(input) {
|
|
107
|
+
const [domain, path] = (0, string_1.splitJoinRemainder)(input, '/', 2);
|
|
108
|
+
return {
|
|
109
|
+
domain,
|
|
110
|
+
path: (0, path_1.toAbsoluteSlashPathStartType)(path !== null && path !== void 0 ? path : '/')
|
|
111
|
+
};
|
|
112
|
+
}
|
|
113
|
+
exports.websiteDomainAndPathPair = websiteDomainAndPathPair;
|
|
114
|
+
exports.HTTP_OR_HTTPS_REGEX = /^https:\/\/|http:\/\//;
|
|
115
|
+
/**
|
|
116
|
+
* Removes both http:// and https:// from the url.
|
|
117
|
+
*
|
|
118
|
+
* @param url
|
|
119
|
+
* @returns
|
|
120
|
+
*/
|
|
121
|
+
function removeHttpFromUrl(url) {
|
|
122
|
+
return url.replace(exports.HTTP_OR_HTTPS_REGEX, '');
|
|
123
|
+
}
|
|
124
|
+
exports.removeHttpFromUrl = removeHttpFromUrl;
|
|
125
|
+
/**
|
|
126
|
+
* Returns true if the input string starts with http/https
|
|
127
|
+
*
|
|
128
|
+
* @param input
|
|
129
|
+
*/
|
|
130
|
+
function hasHttpPrefix(input) {
|
|
131
|
+
return exports.HTTP_OR_HTTPS_REGEX.test(input);
|
|
132
|
+
}
|
|
133
|
+
exports.hasHttpPrefix = hasHttpPrefix;
|
|
134
|
+
//# sourceMappingURL=url.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"url.js","sourceRoot":"","sources":["../../../../../../packages/util/src/lib/string/url.ts"],"names":[],"mappings":";;;AACA,uCAA4G;AAC5G,sCAAkE;AAElE,uCAAiD;AACjD,qCAA8C;AAE9C,iCAA0D;AAW1D;;GAEG;AACU,QAAA,yBAAyB,GAAG,YAAY,CAAC;AAEtD;;;;;;;;;;;GAWG;AACH,SAAgB,gBAAgB,CAAC,KAAa;IAC5C,OAAO,iCAAyB,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;AAC/C,CAAC;AAFD,4CAEC;AA0ED;;;;GAIG;AACH,SAAgB,0BAA0B,CAAC,SAA2C,EAAE;IACtF,MAAM,EAAE,qBAAqB,EAAE,eAAe,EAAE,qBAAqB,EAAE,mBAAmB,EAAE,GAAG,MAAM,CAAC;IACtG,MAAM,aAAa,GAAkB,eAAe,CAAC,CAAC,CAAC,IAAI,MAAM,CAAC,GAAG,GAAG,IAAA,8BAAoB,EAAC,IAAA,mCAA4B,EAAC,eAAe,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC;IACzJ,MAAM,YAAY,GAAG,qBAAqB,IAAI,IAAI,CAAC,CAAC,CAAC,IAAA,+BAAwB,EAAC,EAAE,KAAK,EAAE,qBAAqB,EAAE,SAAS,EAAE,UAAU,EAAE,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC;IACnJ,MAAM,oBAAoB,GAAG,mBAAmB,KAAK,IAAI,CAAC,CAAC,CAAC,IAAA,uCAAgC,EAAC,EAAE,EAAE,2BAAoB,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC;IAEnI,MAAM,aAAa,GAAyC,IAAA,2BAAqB,EAAC;QAChF,uBAAuB;QACvB,aAAa,IAAI,IAAI,CAAC,CAAC,CAAC,CAAC,SAAS,EAAE,EAAE,C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ACzC,OAAO,2BAAmB,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;AACzC,CAAC;AAFD,sCAEC"}
|
|
@@ -43,6 +43,17 @@ export interface IndexRange {
|
|
|
43
43
|
*/
|
|
44
44
|
maxIndex: IndexNumber;
|
|
45
45
|
}
|
|
46
|
+
/**
|
|
47
|
+
* An IndexNumber that represenst a range of a single index, or an IndexRange.
|
|
48
|
+
*/
|
|
49
|
+
export declare type IndexRangeInput = IndexNumber | IndexRange;
|
|
50
|
+
/**
|
|
51
|
+
* Creates an IndexRange from the input.
|
|
52
|
+
*
|
|
53
|
+
* @param input
|
|
54
|
+
* @returns
|
|
55
|
+
*/
|
|
56
|
+
export declare function indexRange(input: IndexRangeInput): IndexRange;
|
|
46
57
|
/**
|
|
47
58
|
* Checks whether or not the input number is in the range.
|
|
48
59
|
*/
|
package/src/lib/value/indexed.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.indexRangeOverlapsIndexRangeFunction = exports.indexRangeOverlapsIndexRange = exports.isIndexRangeInIndexRangeFunction = exports.isIndexRangeInIndexRange = exports.isIndexNumberInIndexRangeFunction = exports.isIndexNumberInIndexRange = exports.indexRangeCheckFunction = exports.asIndexRangeCheckFunctionConfig = exports.indexRangeCheckReaderFunction = exports.sortByIndexAscendingCompareFunction = exports.sortAscendingIndexNumberRefFunction = void 0;
|
|
3
|
+
exports.indexRangeOverlapsIndexRangeFunction = exports.indexRangeOverlapsIndexRange = exports.isIndexRangeInIndexRangeFunction = exports.isIndexRangeInIndexRange = exports.isIndexNumberInIndexRangeFunction = exports.isIndexNumberInIndexRange = exports.indexRangeCheckFunction = exports.asIndexRangeCheckFunctionConfig = exports.indexRangeCheckReaderFunction = exports.indexRange = exports.sortByIndexAscendingCompareFunction = exports.sortAscendingIndexNumberRefFunction = void 0;
|
|
4
4
|
const object_1 = require("../object/object");
|
|
5
5
|
/**
|
|
6
6
|
* Creates a SortCompareFunction<T> that sorts by index on IndexRef values.
|
|
@@ -22,6 +22,21 @@ function sortByIndexAscendingCompareFunction(readIndex) {
|
|
|
22
22
|
return (a, b) => readIndex(a) - readIndex(b);
|
|
23
23
|
}
|
|
24
24
|
exports.sortByIndexAscendingCompareFunction = sortByIndexAscendingCompareFunction;
|
|
25
|
+
/**
|
|
26
|
+
* Creates an IndexRange from the input.
|
|
27
|
+
*
|
|
28
|
+
* @param input
|
|
29
|
+
* @returns
|
|
30
|
+
*/
|
|
31
|
+
function indexRange(input) {
|
|
32
|
+
if (typeof input === 'number') {
|
|
33
|
+
return { minIndex: input, maxIndex: input + 1 };
|
|
34
|
+
}
|
|
35
|
+
else {
|
|
36
|
+
return input;
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
exports.indexRange = indexRange;
|
|
25
40
|
function indexRangeCheckReaderFunction(input, read = (x) => x.i) {
|
|
26
41
|
const rangeCheck = indexRangeCheckFunction(input);
|
|
27
42
|
return (value) => rangeCheck(read(value));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"indexed.js","sourceRoot":"","sources":["../../../../../../packages/util/src/lib/value/indexed.ts"],"names":[],"mappings":";;;AAAA,6CAAgD;AAkBhD;;;;;GAKG;AACH,SAAgB,mCAAmC;IACjD,OAAO,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;AAC7B,CAAC;AAFD,kFAEC;AAOD;;;;;GAKG;AACH,SAAgB,mCAAmC,CAAI,SAA+B;IACpF,OAAO,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,SAAS,CAAC,CAAC,CAAC,GAAG,SAAS,CAAC,CAAC,CAAC,CAAC;AAC/C,CAAC;AAFD,kFAEC;
|
|
1
|
+
{"version":3,"file":"indexed.js","sourceRoot":"","sources":["../../../../../../packages/util/src/lib/value/indexed.ts"],"names":[],"mappings":";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AE,QAAQ,EAAE,GAAG,yCAAyC,CAAC,+BAA+B,CAAC,KAAK,CAAC,CAAC,CAAC;IACjH,OAAO,CAAC,KAAiB,EAAE,EAAE;QAC3B,OAAO,KAAK,CAAC,QAAQ,IAAI,QAAQ,IAAI,KAAK,CAAC,QAAQ,IAAI,QAAQ,CAAC;IAClE,CAAC,CAAC;AACJ,CAAC;AALD,4EAKC;AAOD,SAAgB,4BAA4B,CAAC,iBAA6B,EAAE,UAAsB;IAChG,OAAO,oCAAoC,CAAC,UAAU,CAAC,CAAC,iBAAiB,CAAC,CAAC;AAC7E,CAAC;AAFD,oEAEC;AAED;;;;;GAKG;AACH,SAAgB,oCAAoC,CAAC,KAA8B;IACjF,MAAM,EAAE,QAAQ,EAAE,QAAQ,EAAE,GAAG,yCAAyC,CAAC,+BAA+B,CAAC,KAAK,CAAC,CAAC,CAAC;IACjH,OAAO,CAAC,KAAiB,EAAE,EAAE;QAC3B,OAAO,KAAK,CAAC,QAAQ,IAAI,QAAQ,IAAI,KAAK,CAAC,QAAQ,IAAI,QAAQ,CAAC;IAClE,CAAC,CAAC;AACJ,CAAC;AALD,oFAKC"}
|
package/test/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,10 @@
|
|
|
2
2
|
|
|
3
3
|
This file was generated using [@jscutlery/semver](https://github.com/jscutlery/semver).
|
|
4
4
|
|
|
5
|
+
# [8.14.0](https://github.com/dereekb/dbx-components/compare/v8.13.9-dev...v8.14.0) (2022-08-08)
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
|
|
5
9
|
## [8.13.9](https://github.com/dereekb/dbx-components/compare/v8.13.8-dev...v8.13.9) (2022-08-05)
|
|
6
10
|
|
|
7
11
|
|
package/test/package.json
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dereekb/util/test",
|
|
3
|
-
"version": "8.
|
|
3
|
+
"version": "8.14.0",
|
|
4
4
|
"type": "commonjs",
|
|
5
5
|
"main": "./src/index.js",
|
|
6
6
|
"typings": "./src/index.d.ts",
|
|
7
7
|
"dependencies": {},
|
|
8
8
|
"peerDependencies": {
|
|
9
|
-
"@dereekb/util": "8.
|
|
9
|
+
"@dereekb/util": "8.14.0",
|
|
10
10
|
"make-error": "^1.3.0",
|
|
11
11
|
"ts-essentials": "^9.1.2",
|
|
12
12
|
"extra-set": "^2.2.11",
|