This repository has been archived by the owner on Jun 20, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge remote-tracking branch 'origin/#120' into refactor-endpoint-format
- Loading branch information
Showing
5 changed files
with
272 additions
and
202 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
class DataTypeIdHelper { | ||
/** | ||
* @param {string[]} params | ||
*/ | ||
static build(params) { | ||
return params.join('.'); | ||
} | ||
/** @param {string} dataTypeId */ | ||
static parse(dataTypeId) { | ||
return dataTypeId.split('.'); | ||
} | ||
/** | ||
* @param {string} dataTypeId | ||
* @param {string[]} partialParams | ||
*/ | ||
static contain(dataTypeId, partialParams) { | ||
const params = DataTypeIdHelper.parse(dataTypeId); | ||
if (partialParams > params) { | ||
return false; | ||
} | ||
for (let i = 0; i < partialParams.length; i++) { | ||
if (partialParams[i] != params[i]) { | ||
return false; | ||
} | ||
} | ||
return true; | ||
} | ||
} | ||
module.exports = DataTypeIdHelper; |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.