dependency-check-core/src/main/java/org/owasp/dependencycheck/data/nsp/SanitizePackage.java
/**
     * The NSP API only accepts a subset of objects typically found in
     * package.json. This method accepts a JsonObject of a raw package.json file
     * and returns a new 'sanitized' version based on a pre-defined whitelist of
     * allowable object NSP accepts.
     *
     * @param rawPackage a raw package.json file
     * @return a sanitized version of the package.json file
     */
The NSP API only accepts a subset of objects typically found in
package.json. This method accepts a JsonObject of a raw package.json file
and returns a new 'sanitized' version based on a pre-defined whitelist of
allowable object NSP accepts.

@param rawPackage a raw package.json file
@return a sanitized version of the package.json file
The NSP API only accepts a subset of objects typically found in package . json . This method accepts a JsonObject of a raw package . json file and returns a new ' sanitized ' version based on a pre - defined whitelist of allowable object NSP accepts . @param rawPackage a raw package . json file @return a sanitized version of the package . json file
public static JsonObject sanitize(JsonObject rawPackage) {
        final JsonObjectBuilder builder = Json.createObjectBuilder();
        for (Map.Entry<String, JsonValue> entry : rawPackage.entrySet()) {
            if (WHITELIST.contains(entry.getKey())) {
                builder.add(entry.getKey(), entry.getValue());
            }
        }
        return builder.build();
    }
public static JsonObject sanitize ( JsonObject rawPackage ) { final JsonObjectBuilder builder = Json . createObjectBuilder ( ) ; for ( Map . Entry < String , JsonValue > entry : rawPackage . entrySet ( ) ) { if ( WHITELIST . contains ( entry . getKey ( ) ) ) { builder . add ( entry . getKey ( ) , entry . getValue ( ) ) ; } } return builder . build ( ) ; }
The NSP API only accepts a subset of objects typically found in
 package.json.
The NSP API only accepts a subset of objects typically found in package . json .