@cenk1cenk2/oclif-common 2.0.0 → 2.0.1
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/dist/index.d.ts +7 -6
- package/dist/index.js +5 -2
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -116,12 +116,12 @@ declare enum MergeStrategy {
|
|
|
116
116
|
declare function merge<T extends Record<PropertyKey, any> | any[]>(strategy: MergeStrategy, target: T, ...source: Partial<T>[]): T;
|
|
117
117
|
|
|
118
118
|
interface CommonLockerData {
|
|
119
|
-
path: string;
|
|
119
|
+
path: string | string[];
|
|
120
120
|
enabled?: boolean;
|
|
121
121
|
root?: boolean;
|
|
122
122
|
}
|
|
123
123
|
declare type LockableData = any;
|
|
124
|
-
interface LockData<T extends LockableData = LockableData> extends CommonLockerData {
|
|
124
|
+
interface LockData<T extends LockableData = LockableData> extends Partial<CommonLockerData> {
|
|
125
125
|
data: T;
|
|
126
126
|
merge?: MergeStrategy;
|
|
127
127
|
}
|
|
@@ -143,7 +143,7 @@ declare class YamlParser implements GenericParser {
|
|
|
143
143
|
stringify<T = any>(data: T): string;
|
|
144
144
|
}
|
|
145
145
|
|
|
146
|
-
declare class LockerService {
|
|
146
|
+
declare class LockerService<LockFile extends LockableData = LockableData> {
|
|
147
147
|
private file;
|
|
148
148
|
private parser;
|
|
149
149
|
private root?;
|
|
@@ -158,11 +158,12 @@ declare class LockerService {
|
|
|
158
158
|
addUnlock(data?: UnlockData | UnlockData[]): void;
|
|
159
159
|
lockAll(): Promise<void>;
|
|
160
160
|
unlockAll(): Promise<void>;
|
|
161
|
-
lock<T extends LockableData>(data: LockData<T> | LockData<T>[]): Promise<void>;
|
|
161
|
+
lock<T extends LockableData = LockableData>(data: LockData<T> | LockData<T>[]): Promise<void>;
|
|
162
162
|
unlock(data?: UnlockData | UnlockData[]): Promise<void>;
|
|
163
|
-
read
|
|
164
|
-
write
|
|
163
|
+
read(): Promise<LockFile>;
|
|
164
|
+
write(data: LockFile): Promise<void>;
|
|
165
165
|
private buildPath;
|
|
166
|
+
private normalizePath;
|
|
166
167
|
}
|
|
167
168
|
|
|
168
169
|
declare class ParserService {
|
package/dist/index.js
CHANGED
|
@@ -816,9 +816,12 @@ var LockerService = class {
|
|
|
816
816
|
}
|
|
817
817
|
buildPath(d) {
|
|
818
818
|
if (d?.root !== true && this.root) {
|
|
819
|
-
return
|
|
819
|
+
return [this.root, ...this.normalizePath(d.path)];
|
|
820
820
|
}
|
|
821
|
-
return d.path;
|
|
821
|
+
return this.normalizePath(d.path);
|
|
822
|
+
}
|
|
823
|
+
normalizePath(path) {
|
|
824
|
+
return Array.isArray(path) ? path : path.split(".");
|
|
822
825
|
}
|
|
823
826
|
};
|
|
824
827
|
__name(LockerService, "LockerService");
|