Skip to content

Commit cb8c394

Browse files
committed
chore: change comments of example
chore: let to const
1 parent 6f3239a commit cb8c394

File tree

23 files changed

+134
-58
lines changed

23 files changed

+134
-58
lines changed

ajax/index.mjs

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -353,9 +353,14 @@ function send(xhr, options) {
353353
* @param {string} [options.mimeType] - Override the MIME type returned by the server. This options can be used on IE11+
354354
* @returns {?Promise} - If the browser supports Promise, return the Promise object. If not, return null.
355355
* @example
356-
* import ajax from 'tui-code-snippet/ajax'; // import ES6 module (written in ES6)
357-
* // import ajax from 'tui-code-snippet/ajax/index.js'; // import transfiled file (IE8+)
358-
* // const ajax = require('tui-code-snippet/ajax/index.js'); // CommonJS
356+
* // ES6
357+
* import ajax from 'tui-code-snippet/ajax';
358+
*
359+
* // import transfiled file (IE8+)
360+
* import ajax from 'tui-code-snippet/ajax/index.js';
361+
*
362+
* // CommonJS
363+
* const ajax = require('tui-code-snippet/ajax/index.js');
359364
*
360365
* // If the browser supports Promise, return the Promise object
361366
* ajax({

array/inArray.js

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,11 @@ var isArray = require('../type/isArray');
2323
* @returns {number} the First index at which a given element, or -1 if it is not present
2424
* @memberof module:array
2525
* @example
26-
* import inArray from 'tui-code-snippet/array/inArray'; // ES6
27-
* // const inArray = require('tui-code-snippet/array/inArray'); // CommonJS
26+
* // ES6
27+
* import inArray from 'tui-code-snippet/array/inArray';
28+
*
29+
* // CommonJS
30+
* const inArray = require('tui-code-snippet/array/inArray');
2831
*
2932
* const arr = ['one', 'two', 'three', 'four'];
3033
* const idx1 = inArray('one', arr, 3); // -1

array/range.js

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,11 @@ var isUndefined = require('../type/isUndefined');
1515
* @returns {Array}
1616
* @memberof module:array
1717
* @example
18-
* import range from 'tui-code-snippet/array/range'; // ES6
19-
* // const range = require('tui-code-snippet/array/range'); // CommonJS
18+
* // ES6
19+
* import range from 'tui-code-snippet/array/range';
20+
*
21+
* // CommonJS
22+
* const range = require('tui-code-snippet/array/range');
2023
*
2124
* range(5); // [0, 1, 2, 3, 4]
2225
* range(1, 5); // [1,2,3,4]

array/zip.js

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,13 @@ var forEach = require('../collection/forEach');
1313
* @returns {Array}
1414
* @memberof module:array
1515
* @example
16-
* import zip from 'tui-code-snippet/array/zip'; // ES6
17-
* // const zip = require('tui-code-snippet/array/zip'); // CommonJS
16+
* // ES6
17+
* import zip from 'tui-code-snippet/array/zip';
18+
*
19+
* // CommonJS
20+
* const zip = require('tui-code-snippet/array/zip');
1821
*
19-
* const result = zip([1, 2, 3], ['a', 'b','c'], [true, false, true]);
22+
* const result = zip([1, 2, 3], ['a', 'b', 'c'], [true, false, true]);
2023
* console.log(result[0]); // [1, 'a', true]
2124
* console.log(result[1]); // [2, 'b', false]
2225
* console.log(result[2]); // [3, 'c', true]

browser/browser.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,11 @@
1414
* This object has an information that indicate the kind of browser. It can detect IE8 ~ IE11, Chrome, Firefox, Safari, and Edge.
1515
* @memberof module:browser
1616
* @example
17+
* // ES6
1718
* import browser from 'tui-code-snippet/browser/browser';
18-
* // const browser = require('tui-code-snippet/browser/browser'); // CommonJS
19+
*
20+
* // CommonJS
21+
* const browser = require('tui-code-snippet/browser/browser');
1922
*
2023
* browser.chrome === true; // chrome
2124
* browser.firefox === true; // firefox

collection/forEach.js

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,11 @@ var forEachOwnProperties = require('../collection/forEachOwnProperties');
2626
* @param {Object} [context] Context(this) of callback function
2727
* @memberof module:collection
2828
* @example
29-
* import forEach from 'tui-code-snippet/collection/forEach'; // ES6
30-
* // const forEach = require('tui-code-snippet/collection/forEach'); // CommonJS
29+
* // ES6
30+
* import forEach from 'tui-code-snippet/collection/forEach';
31+
*
32+
* // CommonJS
33+
* const forEach = require('tui-code-snippet/collection/forEach');
3134
*
3235
* let sum = 0;
3336
*

collection/forEachArray.js

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,11 @@
1818
* @param {Object} [context] Context(this) of callback function
1919
* @memberof module:collection
2020
* @example
21-
* import forEachArray from 'tui-code-snippet/collection/forEachArray'; // ES6
22-
* // const forEachArray = require('tui-code-snippet/collection/forEachArray'); // CommonJS
21+
* // ES6
22+
* import forEachArray from 'tui-code-snippet/collection/forEachArray';
23+
*
24+
* // CommonJS
25+
* const forEachArray = require('tui-code-snippet/collection/forEachArray');
2326
*
2427
* let sum = 0;
2528
*

collection/forEachOwnProperties.js

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,11 @@
1717
* @param {Object} [context] Context(this) of callback function
1818
* @memberof module:collection
1919
* @example
20-
* import forEachOwnProperties from 'tui-code-snippet/collection/forEachOwnProperties'; // ES6
21-
* // const forEachOwnProperties = require('tui-code-snippet/collection/forEachOwnProperties'); // CommonJS
20+
* // ES6
21+
* import forEachOwnProperties from 'tui-code-snippet/collection/forEachOwnProperties';
22+
*
23+
* // CommonJS
24+
* const forEachOwnProperties = require('tui-code-snippet/collection/forEachOwnProperties');
2225
*
2326
* let sum = 0;
2427
*

collection/pluck.js

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,11 @@ var forEach = require('./forEach');
1414
* @returns {Array}
1515
* @memberof module:collection
1616
* @example
17-
* import pluck from 'tui-code-snippet/collection/pluck'; // ES6
18-
* // const pluck = require('tui-code-snippet/collection/pluck'); // CommonJS
17+
* // ES6
18+
* import pluck from 'tui-code-snippet/collection/pluck';
19+
*
20+
* // CommonJS
21+
* const pluck = require('tui-code-snippet/collection/pluck');
1922
*
2023
* const objArr = [
2124
* {'abc': 1, 'def': 2, 'ghi': 3},

collection/toArray.js

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,11 @@ var forEachArray = require('./forEachArray');
1414
* @returns {Array} Array
1515
* @memberof module:collection
1616
* @example
17-
* import toArray from 'tui-code-snippet/collection/toArray'; // ES6
18-
* // const toArray = require('tui-code-snippet/collection/toArray'); // CommonJS
17+
* // ES6
18+
* import toArray from 'tui-code-snippet/collection/toArray';
19+
*
20+
* // CommonJS
21+
* const toArray = require('tui-code-snippet/collection/toArray');
1922
*
2023
* const arrayLike = {
2124
* 0: 'one',

0 commit comments

Comments
 (0)