MCPcopy
hub / github.com/strongloop/loopback / splitPrincipal

Function splitPrincipal

common/models/user.js:132–143  ·  view source on GitHub ↗
(name, realmDelimiter)

Source from the content-addressed store, hash-verified

130 };
131
132 function splitPrincipal(name, realmDelimiter) {
133 const parts = [null, name];
134 if (!realmDelimiter) {
135 return parts;
136 }
137 const index = name.indexOf(realmDelimiter);
138 if (index !== -1) {
139 parts[0] = name.substring(0, index);
140 parts[1] = name.substring(index + realmDelimiter.length);
141 }
142 return parts;
143 }
144
145 /**
146 * Normalize the credentials

Callers 1

user.jsFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…