summaryrefslogtreecommitdiff
path: root/node_modules/locutus/php/var/strval.js
diff options
context:
space:
mode:
Diffstat (limited to 'node_modules/locutus/php/var/strval.js')
-rw-r--r--node_modules/locutus/php/var/strval.js36
1 files changed, 0 insertions, 36 deletions
diff --git a/node_modules/locutus/php/var/strval.js b/node_modules/locutus/php/var/strval.js
deleted file mode 100644
index a9d9b08..0000000
--- a/node_modules/locutus/php/var/strval.js
+++ /dev/null
@@ -1,36 +0,0 @@
-'use strict';
-
-module.exports = function strval(str) {
- // discuss at: http://locutus.io/php/strval/
- // original by: Brett Zamir (http://brett-zamir.me)
- // improved by: Kevin van Zonneveld (http://kvz.io)
- // bugfixed by: Brett Zamir (http://brett-zamir.me)
- // example 1: strval({red: 1, green: 2, blue: 3, white: 4})
- // returns 1: 'Object'
-
- var gettype = require('../var/gettype');
- var type = '';
-
- if (str === null) {
- return '';
- }
-
- type = gettype(str);
-
- // Comment out the entire switch if you want JS-like
- // behavior instead of PHP behavior
- switch (type) {
- case 'boolean':
- if (str === true) {
- return '1';
- }
- return '';
- case 'array':
- return 'Array';
- case 'object':
- return 'Object';
- }
-
- return str;
-};
-//# sourceMappingURL=strval.js.map \ No newline at end of file