New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details
Socket
Book a DemoSign in
Socket

@ultraq/string-utils

Package Overview
Dependencies
Maintainers
1
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@ultraq/string-utils - npm Package Compare versions

Comparing version
1.2.0
to
2.0.0
+11
-8
package.json
{
"name": "@ultraq/string-utils",
"version": "1.2.0",
"version": "2.0.0",
"description": "A collection of utilities for JavaScript strings",

@@ -21,3 +21,3 @@ "author": "Emanuel Rabina <emanuelrabina@gmail.com> (http://www.ultraq.net.nz/)",

"scripts": {
"lint": "eslint '*.js'",
"lint": "eslint \"*.js\"",
"test": "npm run lint && jest",

@@ -31,9 +31,12 @@ "coverage": "cat ./coverage/lcov.info | coveralls",

"devDependencies": {
"babel-cli": "^6.26.0",
"babel-preset-env": "^1.6.1",
"coveralls": "^2.13.1",
"eslint": "^4.8.0",
"eslint-config-ultraq": "^2.0.0",
"jest": "^21.2.1"
"@babel/cli": "^7.8.4",
"@babel/preset-env": "^7.9.6",
"coveralls": "^3.1.0",
"eslint": "^7.0.0",
"eslint-config-ultraq": "^2.3.2",
"jest": "^26.0.1"
},
"engines": {
"node": ">=10"
}
}

@@ -5,6 +5,5 @@

[![Build Status](https://travis-ci.org/ultraq/string-utils.svg?branch=master)](https://travis-ci.org/ultraq/string-utils)
[![Build Status](https://travis-ci.com/ultraq/string-utils.svg?branch=master)](https://travis-ci.com/ultraq/string-utils)
[![Coverage Status](https://coveralls.io/repos/github/ultraq/string-utils/badge.svg?branch=master)](https://coveralls.io/github/ultraq/string-utils?branch=master)
[![npm](https://img.shields.io/npm/v/@ultraq/string-utils.svg?maxAge=3600)](https://www.npmjs.com/package/@ultraq/string-utils)
[![License](https://img.shields.io/github/license/ultraq/string-utils.svg?maxAge=2592000)](https://github.com/ultraq/string-utils/blob/master/LICENSE.txt)

@@ -23,9 +22,3 @@ A collection of utilities for JavaScript strings.

Via bower:
```
bower install https://github.com/ultraq/string-utils.git --save
```
API

@@ -32,0 +25,0 @@ ---

@@ -1,2 +0,2 @@

'use strict';
"use strict";

@@ -8,2 +8,3 @@ Object.defineProperty(exports, "__esModule", {

exports.format = format;
/*

@@ -34,6 +35,4 @@ * Copyright 2017, Emanuel Rabina (http://www.ultraq.net.nz/)

function escapeHtml(string) {
return typeof string !== 'string' ? string : string.replace(/&/g, '&amp;').replace(/</g, '&lt;').replace(/>/g, '&gt;').replace(/"/g, '&quot;').replace(/'/g, '&#039;');
}
/**

@@ -49,4 +48,6 @@ * Returns the replacement of each placeholder in a template string with a

*/
function format(template) {
for (var _len = arguments.length, values = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
for (var _len = arguments.length, values = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
values[_key - 1] = arguments[_key];

@@ -53,0 +54,0 @@ }

@@ -1,1 +0,1 @@

{"version":3,"sources":["string-utils.js"],"names":[],"mappings":";;;;;QAwBgB,U,GAAA,U;QAoBA,M,GAAA,M;AA5ChB;;;;;;;;;;;;;;;;AAgBA;;;;;;;;AAQO,SAAS,UAAT,CAAoB,MAApB,EAA4B;;AAElC,SAAO,OAAO,MAAP,KAAkB,QAAlB,GAA6B,MAA7B,GAAsC,OAC3C,OAD2C,CACnC,IADmC,EAC7B,OAD6B,EAE3C,OAF2C,CAEnC,IAFmC,EAE7B,MAF6B,EAG3C,OAH2C,CAGnC,IAHmC,EAG7B,MAH6B,EAI3C,OAJ2C,CAInC,IAJmC,EAI7B,QAJ6B,EAK3C,OAL2C,CAKnC,IALmC,EAK7B,QAL6B,CAA7C;AAMA;;AAED;;;;;;;;;;AAUO,SAAS,MAAT,CAAgB,QAAhB,EAAqC;AAAA,oCAAR,MAAQ;AAAR,UAAQ;AAAA;;AAE3C,SAAO,SAAS,OAAT,CAAiB,YAAjB,EAA+B,UAAC,KAAD,EAAQ,KAAR;AAAA,WAAkB,OAAO,CAAC,KAAR,IAAiB,EAAnC;AAAA,GAA/B,CAAP;AACA","file":"string-utils.cjs.js","sourcesContent":["/* \n * Copyright 2017, Emanuel Rabina (http://www.ultraq.net.nz/)\n * \n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n * \n * http://www.apache.org/licenses/LICENSE-2.0\n * \n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n/**\n * Escapes special HTML characters in a string with their entity code\n * equivalents.\n * \n * @param {String} string\n * @return {String}\n * HTML escaped string, safe for use in HTML.\n */\nexport function escapeHtml(string) {\n\n\treturn typeof string !== 'string' ? string : string\n\t\t.replace(/&/g, '&amp;')\n\t\t.replace(/</g, '&lt;')\n\t\t.replace(/>/g, '&gt;')\n\t\t.replace(/\"/g, '&quot;')\n\t\t.replace(/'/g, '&#039;');\n}\n\n/**\n * Returns the replacement of each placeholder in a template string with a\n * corresponding replacement value.\n * \n * @param {String} template\n * @param {...String} values\n * Argument list of values or a single array of values.\n * @return {String}\n * Replaced template string.\n */\nexport function format(template, ...values) {\n\n\treturn template.replace(/\\{(\\d+)\\}/g, (match, index) => values[+index] + '');\n}\n"]}
{"version":3,"sources":["string-utils.js"],"names":[],"mappings":";;;;;;;;AAAA;;;;;;;;;;;;;;;;AAgBA;;;;;;;;AAQO,SAAS,UAAT,CAAoB,MAApB,EAA4B;AAElC,SAAO,OAAO,MAAP,KAAkB,QAAlB,GAA6B,MAA7B,GAAsC,MAAM,CACjD,OAD2C,CACnC,IADmC,EAC7B,OAD6B,EAE3C,OAF2C,CAEnC,IAFmC,EAE7B,MAF6B,EAG3C,OAH2C,CAGnC,IAHmC,EAG7B,MAH6B,EAI3C,OAJ2C,CAInC,IAJmC,EAI7B,QAJ6B,EAK3C,OAL2C,CAKnC,IALmC,EAK7B,QAL6B,CAA7C;AAMA;AAED;;;;;;;;;;;;AAUO,SAAS,MAAT,CAAgB,QAAhB,EAAqC;AAAA,oCAAR,MAAQ;AAAR,IAAA,MAAQ;AAAA;;AAE3C,SAAO,QAAQ,CAAC,OAAT,CAAiB,YAAjB,EAA+B,UAAC,KAAD,EAAQ,KAAR;AAAA,WAAkB,MAAM,CAAC,CAAC,KAAF,CAAN,GAAiB,EAAnC;AAAA,GAA/B,CAAP;AACA","file":"string-utils.cjs.js","sourcesContent":["/* \n * Copyright 2017, Emanuel Rabina (http://www.ultraq.net.nz/)\n * \n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n * \n * http://www.apache.org/licenses/LICENSE-2.0\n * \n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n/**\n * Escapes special HTML characters in a string with their entity code\n * equivalents.\n * \n * @param {String} string\n * @return {String}\n * HTML escaped string, safe for use in HTML.\n */\nexport function escapeHtml(string) {\n\n\treturn typeof string !== 'string' ? string : string\n\t\t.replace(/&/g, '&amp;')\n\t\t.replace(/</g, '&lt;')\n\t\t.replace(/>/g, '&gt;')\n\t\t.replace(/\"/g, '&quot;')\n\t\t.replace(/'/g, '&#039;');\n}\n\n/**\n * Returns the replacement of each placeholder in a template string with a\n * corresponding replacement value.\n * \n * @param {String} template\n * @param {...String} values\n * Argument list of values or a single array of values.\n * @return {String}\n * Replaced template string.\n */\nexport function format(template, ...values) {\n\n\treturn template.replace(/\\{(\\d+)\\}/g, (match, index) => values[+index] + '');\n}\n"]}

@@ -26,6 +26,4 @@ /*

export function escapeHtml(string) {
return typeof string !== 'string' ? string : string.replace(/&/g, '&amp;').replace(/</g, '&lt;').replace(/>/g, '&gt;').replace(/"/g, '&quot;').replace(/'/g, '&#039;');
}
/**

@@ -41,4 +39,5 @@ * Returns the replacement of each placeholder in a template string with a

*/
export function format(template) {
for (var _len = arguments.length, values = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
for (var _len = arguments.length, values = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
values[_key - 1] = arguments[_key];

@@ -45,0 +44,0 @@ }

@@ -1,1 +0,1 @@

{"version":3,"sources":["string-utils.js"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;AAgBA;;;;;;;;AAQA,OAAO,SAAS,UAAT,CAAoB,MAApB,EAA4B;;AAElC,SAAO,OAAO,MAAP,KAAkB,QAAlB,GAA6B,MAA7B,GAAsC,OAC3C,OAD2C,CACnC,IADmC,EAC7B,OAD6B,EAE3C,OAF2C,CAEnC,IAFmC,EAE7B,MAF6B,EAG3C,OAH2C,CAGnC,IAHmC,EAG7B,MAH6B,EAI3C,OAJ2C,CAInC,IAJmC,EAI7B,QAJ6B,EAK3C,OAL2C,CAKnC,IALmC,EAK7B,QAL6B,CAA7C;AAMA;;AAED;;;;;;;;;;AAUA,OAAO,SAAS,MAAT,CAAgB,QAAhB,EAAqC;AAAA,oCAAR,MAAQ;AAAR,UAAQ;AAAA;;AAE3C,SAAO,SAAS,OAAT,CAAiB,YAAjB,EAA+B,UAAC,KAAD,EAAQ,KAAR;AAAA,WAAkB,OAAO,CAAC,KAAR,IAAiB,EAAnC;AAAA,GAA/B,CAAP;AACA","file":"string-utils.es.js","sourcesContent":["/* \n * Copyright 2017, Emanuel Rabina (http://www.ultraq.net.nz/)\n * \n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n * \n * http://www.apache.org/licenses/LICENSE-2.0\n * \n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n/**\n * Escapes special HTML characters in a string with their entity code\n * equivalents.\n * \n * @param {String} string\n * @return {String}\n * HTML escaped string, safe for use in HTML.\n */\nexport function escapeHtml(string) {\n\n\treturn typeof string !== 'string' ? string : string\n\t\t.replace(/&/g, '&amp;')\n\t\t.replace(/</g, '&lt;')\n\t\t.replace(/>/g, '&gt;')\n\t\t.replace(/\"/g, '&quot;')\n\t\t.replace(/'/g, '&#039;');\n}\n\n/**\n * Returns the replacement of each placeholder in a template string with a\n * corresponding replacement value.\n * \n * @param {String} template\n * @param {...String} values\n * Argument list of values or a single array of values.\n * @return {String}\n * Replaced template string.\n */\nexport function format(template, ...values) {\n\n\treturn template.replace(/\\{(\\d+)\\}/g, (match, index) => values[+index] + '');\n}\n"]}
{"version":3,"sources":["string-utils.js"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;AAgBA;;;;;;;;AAQA,OAAO,SAAS,UAAT,CAAoB,MAApB,EAA4B;AAElC,SAAO,OAAO,MAAP,KAAkB,QAAlB,GAA6B,MAA7B,GAAsC,MAAM,CACjD,OAD2C,CACnC,IADmC,EAC7B,OAD6B,EAE3C,OAF2C,CAEnC,IAFmC,EAE7B,MAF6B,EAG3C,OAH2C,CAGnC,IAHmC,EAG7B,MAH6B,EAI3C,OAJ2C,CAInC,IAJmC,EAI7B,QAJ6B,EAK3C,OAL2C,CAKnC,IALmC,EAK7B,QAL6B,CAA7C;AAMA;AAED;;;;;;;;;;;AAUA,OAAO,SAAS,MAAT,CAAgB,QAAhB,EAAqC;AAAA,oCAAR,MAAQ;AAAR,IAAA,MAAQ;AAAA;;AAE3C,SAAO,QAAQ,CAAC,OAAT,CAAiB,YAAjB,EAA+B,UAAC,KAAD,EAAQ,KAAR;AAAA,WAAkB,MAAM,CAAC,CAAC,KAAF,CAAN,GAAiB,EAAnC;AAAA,GAA/B,CAAP;AACA","file":"string-utils.es.js","sourcesContent":["/* \n * Copyright 2017, Emanuel Rabina (http://www.ultraq.net.nz/)\n * \n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n * \n * http://www.apache.org/licenses/LICENSE-2.0\n * \n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n/**\n * Escapes special HTML characters in a string with their entity code\n * equivalents.\n * \n * @param {String} string\n * @return {String}\n * HTML escaped string, safe for use in HTML.\n */\nexport function escapeHtml(string) {\n\n\treturn typeof string !== 'string' ? string : string\n\t\t.replace(/&/g, '&amp;')\n\t\t.replace(/</g, '&lt;')\n\t\t.replace(/>/g, '&gt;')\n\t\t.replace(/\"/g, '&quot;')\n\t\t.replace(/'/g, '&#039;');\n}\n\n/**\n * Returns the replacement of each placeholder in a template string with a\n * corresponding replacement value.\n * \n * @param {String} template\n * @param {...String} values\n * Argument list of values or a single array of values.\n * @return {String}\n * Replaced template string.\n */\nexport function format(template, ...values) {\n\n\treturn template.replace(/\\{(\\d+)\\}/g, (match, index) => values[+index] + '');\n}\n"]}