The method checks whether the primitive value of the specified object is wrapped by the opening and closing chars of an instance or given opening and closing chars.
Optional opening chars of a string type to check if the primitive value contains them at the beginning. The default value is picked from the private #opening property of an instance.
closing: string = this.#closing
Optional closing chars of a string type to check if the primitive value contains them at the end. The default value is picked from the private #closing property of an instance.
// Example usage.import { Wrap } from'@angular-package/wrapper';// Returns true. Checks `[]`.newWrap(`[`,`]`,'quote').isWrapped();// Returns false.// It's not wrapped cause of opening chars are an empty string.newWrap(``,`]`,'quote').isWrapped();// Returns false.// It's not wrapped cause of closing chars are an empty string.newWrap(`[`,``,'quote').isWrapped();// Returns false.newWrap(``,``,'quote').isWrapped();
Given opening
// Example usage.import { Wrap } from'@angular-package/wrapper';// Returns true. Checks `[]`.newWrap(`[`,`]`,'quote').isWrapped('[');// Returns false.newWrap(`[`,`]`,'quote').isWrapped('[','');// Returns false. Checks `<]`.newWrap(`[`,`]`,'quote').isWrapped('<');// Returns false.// It's not wrapped cause of opening chars are an empty string.newWrap(``,`]`,'quote').isWrapped('<');// Returns false.// It's not wrapped cause of closing chars are an empty string.newWrap(`[`,``,'quote').isWrapped('[');// Returns false.// It's not wrapped cause of closing chars are an empty string.newWrap(`[`,``,'quote').isWrapped('[',''),
Given closing
// Example usage.import { Wrap } from'@angular-package/wrapper';// Returns true. Checks `[]`.newWrap(`[`,`]`,'quote').isWrapped(undefined,']');// Returns false. Checks `[>`.newWrap(`[`,`]`,'quote').isWrapped(undefined,'>');// Returns false.// It's not wrapped cause of opening chars are an empty string.newWrap(``,`]`,'quote').isWrapped(undefined,']');// Returns false.// It's not wrapped cause of opening chars are an empty string.newWrap(``,`]`,'quote').isWrapped(``,']');