blob_id
stringlengths
40
40
language
stringclasses
1 value
repo_name
stringlengths
5
132
path
stringlengths
3
236
src_encoding
stringclasses
29 values
length_bytes
int64
8
7.94M
score
float64
2.52
5.72
int_score
int64
3
5
detected_licenses
listlengths
0
142
license_type
stringclasses
2 values
text
stringlengths
8
7.94M
download_success
bool
1 class
11a499642f27faee0aec4150092825afc3dba5d9
JavaScript
jscheinhorn/IoTStackathon
/server/api/chart.js
UTF-8
1,646
2.734375
3
[ "MIT" ]
permissive
const router = require('express').Router() const {Graph, Data} = require('../db/models') module.exports = router router.get('/', async (req, res, next) => { try { const graphs = await Graph.findAll() res.json(graphs) } catch (err) { next(err) } }) router.get('/:id', async (req, res, next) => { con...
true
0422c9a6c233dcec1adb818a09904b5ae35f09a8
JavaScript
bbossgroups/bboss-gencode
/commonstyle/WebRoot/include/js/common.js
UTF-8
5,979
3.046875
3
[ "Apache-2.0" ]
permissive
/** * @fileoverview 基础函数库 * @author xs | creator */ /** * debug box */ function trace(txt) { return; if(!$('debugbox')) { var debug = $C('textarea'); debug.id = 'debugbox'; debug.rows = '20'; debug.cols = '150'; document.body.appendChild(debug); }else{ var debug = $('debugbox'); ...
true
692b0c8d7d6b1f55f1102ac3a4b39612af0a15fa
JavaScript
bthj/rotatengine.js
/js/rotatengine/items/letters.js
UTF-8
1,964
3.046875
3
[ "Apache-2.0" ]
permissive
/* * bangsi@bthj.is * * Module creating letters within container elements, * to be arranged by world modules (spherical, cylindrical). */ define(["jquery"], function( $ ) { var itemContainers = []; var letterContainerClass; var letterClass; function getOneItemContainer( containerClass ) { ...
true
71a7770ccbf9f1d123898429854e4518d33d83e4
JavaScript
LucasPrf/NodeJs
/Aulas/tern.js
UTF-8
69
2.515625
3
[]
no_license
const id = nota => nota>5 ? 'aproado':'reprovadp' console.log(id(5))
true
0dd342a892507e786505dd9f26fb21a42e05505f
JavaScript
khaledosama999/coligo
/middleware/validation.js
UTF-8
3,640
2.640625
3
[]
no_license
const { body, param, validationResult, } = require('express-validator'); const goToErrorMiddleware = async (req, res, next) => { const errors = validationResult(req); if (!errors.isEmpty()) { next(errors.array()); } else next(); } const getQuizValidator = [ body("name").exists().wi...
true
bd613f3dff154227c95a2d13f8352d8ba8781af7
JavaScript
givebest/givebest.github.io
/utils/index.js
UTF-8
808
2.828125
3
[]
no_license
const fs = require("fs"); const path = require("path"); let list = []; async function findFileLoop(params = {}, callback) { const dirPath = params.dirPath; if (!dirPath) { return; } const files = fs.readdirSync(dirPath); for (let index = 0; index < files.length; index++) { const filena...
true
3d336d6425a031c6ecf81f96001bb6d0ddfd07e3
JavaScript
altafshaikh/todo-app-backend-file-based
/controllers/taskController.js
UTF-8
1,276
2.546875
3
[]
no_license
const fs = require("fs"); const path = require("path"); const Task = require("../models/Task"); const AppError = require("../helpers/appErroClass"); const sendErrorMessage = require("../helpers/sendError"); let fileName = path.join(__dirname, "../data", "tasks.json"); let tasks = JSON.parse(fs.readFileSync(fileName, ...
true
4fa12a15fee36a98b138fd018048f1941d056deb
JavaScript
sdfcbs91/fourboxsResizeDrag2.0
/drag.js
GB18030
6,730
2.6875
3
[]
no_license
/** **:[{drag:{control:"",type:"s"},control:"",location:"left_top"}] **/ var girdResize = function (o) { this.configs = o; this.options = { position: { left: 0.5, top: 0.5} }; this.getWidth = function () { this.width = parseInt($(window).width() + $(window.document).scrollLeft()), this.paddingW = parseInt(t...
true
f01a94c3e238ed72c0749d280509e4c51dacdda7
JavaScript
ankit1250/weather-web-application
/src/utils/forecast.js
UTF-8
615
2.828125
3
[]
no_license
const request = require('request') const forecast = (latitude,longitude,callback)=>{ const url = `http://api.weatherstack.com/current?access_key=ab9d09a7ff631e3194fcba6fdf01b677&query=${latitude},${longitude}` request({url,json:true},(error,{body})=>{ if(error){ callback('Unable to connec...
true
bea891cfd5defdb3161647f9a1e746727e5d5955
JavaScript
jsthatcher/phase-0
/week9/review.js
UTF-8
2,072
4.53125
5
[]
no_license
/*User stories: - As a user I want to create a new shopping list - As a user I want to add a new item and its' quantity to the list - As a user I want to remove an item from the list - As a user I want to update the quantity of an item in the list - As a user I want to print the entire list*/ /* Pseudocode: - defin...
true
be41a3e6d9702f6f28bdf67db811e442eb97e5d3
JavaScript
domgalop/DinoApp
/src/factories/creatureFactory.js
UTF-8
2,169
3.453125
3
[]
no_license
// generate unique Id for each creature function generateId() { return (Date.now().toString(36) + Math.random().toString(36).substr(2, 5)).toUpperCase(); } // constructor function to generate creatures (dino and human) function CreatureFactory({ diet = '', fact = '', hasName = false, height = 0, name = ''...
true
b81c92da6a98b42fe332d69227009617fe71fc06
JavaScript
DrFair/fair-twitch
/examples/authexample.js
UTF-8
1,542
2.890625
3
[]
no_license
// This is an example of the Twitch OAuth Authorization Code Flow using express. // We expect our Twitch redirect URL to be http://localhost:3000/auth // First we require our .env file containing our Twitch dev application details using the dotenv module require('dotenv').config({ path: './.env' }); // Create our Twi...
true
ab5201e0565a1a6c190525fd15879835461f429a
JavaScript
Munykin/comeback.pro
/server/methods/team.js
UTF-8
7,038
2.5625
3
[]
no_license
Meteor.methods({ 'createTeam': function(teamName) { if (!teamName) throw new Meteor.Error(403, 'Нет аргументов'); check(teamName, String); if (Teams.findOne({name: teamName})) throw new Meteor.Error(403, 'Команда ' + teamName + ' уже существует.'); if (Meteor.users.findOne({_id: this.userId}).profile.team) thr...
true
a18c7b074c844abda145722a0b55c38964939691
JavaScript
ripexz/dungeon-treasure-hunt
/js/display.canvas.js
UTF-8
5,885
2.625
3
[ "MIT" ]
permissive
hunt.display = (function(){ var dom = hunt.dom, $ = dom.$, animations = [], previousCycle, canvas, ctx, cols, rows, gridSize, squares, bombTime = hunt.settings.bombTime, firstRun = true; function addAnimation(runTime, fncs) { var anim = { runTime: runTime, startTime: Date.now(), pos: 0, ...
true
72cbb0cba5ae7a7d26e9bd4aa81c8cc840437748
JavaScript
haiyuegit/JS201806-zhufeng
/11.正式课第十一周/day2/src/source/7.属性改变视图变.js
UTF-8
855
3.03125
3
[]
no_license
import React from "react"; import ReactDOM from "react-dom"; /*function Welcome(props){ return <div> {props.time.toLocaleString()} </div> } // 属性可以影响视图; setInterval(function () { ReactDOM.render(<Welcome time={new Date()}/>,document.getElementById("root")); },1000);*/ function Welcome(props){ ...
true
6464ef79251a1d5af27e7e6ab6a08a4e82431d95
JavaScript
AmaliePauli/SuperFairML
/src/diagrams/criteria_box/criteria.js
UTF-8
14,051
2.609375
3
[ "CC-BY-4.0" ]
permissive
export const criteriaData = [ { title: "Statistical Measures", description: `<p> A lot of focus in the literature has been on statistical measures where metrics for a predictor can be calculated by comparing the predicted classes and the actual classes (see <d-cite key="verma2018fairness, mi...
true
d130ecce6cda3080ad131e3aa22aaa92f3de2abb
JavaScript
jmiralles/games-app
/src/gamesListView.js
UTF-8
1,842
2.65625
3
[]
no_license
import { qs, $on } from "./helpers"; import gameList from "./components/gameList"; import titleHtml from "./components/title"; import searchHtml from "./components/searchInput"; const homePage = async ({ store, filterBy, title }) => { let $appList, $formInput; const $htmlContent = qs("#appContent"); const search...
true
e1bd17d62e7200f031d7479dde92bec8853e4aba
JavaScript
adenhumbert/virtual-stick
/src/TouchHandler.js
UTF-8
4,870
3.1875
3
[ "ISC" ]
permissive
export default class TouchHandler { constructor(options) { let defaults = { 'element': document.body, 'start': (ev) => {}, 'move': (ev) => {}, 'end': (ev) => {}, 'width': 100, 'height': 100, 'left': 0, 'top':0, ...
true
d7830aef5b5f5ea338c5fc565929264de1910573
JavaScript
amittovim/Taki-React
/src/logic/main.js
UTF-8
11,655
2.515625
3
[]
no_license
import {GameState} from "./state"; import {PlayerEnum} from "../app/enums/player.enum"; import {CardActionEnum} from "../app/enums/card-action-enum"; import {handleCardMove} from "./dealer/dealer"; import * as GameUtils from "./utils/game.utils"; import {GameStatusEnum} from "./game-status.enum"; import * as dealer fro...
true
7904668423560192342640570b34158ad7843003
JavaScript
gustavofds/trybe-exercises
/FUNDAMENTALS/BLOCO_4/DIA_1/exercise_10.js
UTF-8
584
3.984375
4
[]
no_license
// Exercicio 10 - Escreva um programa que se inicie com dois valores em duas variáveis diferentes: o custo de um produto e seu valor de venda. A partir dos valores, calcule quanto de lucro (valor de venda descontado o custo do produto) a empresa terá ao vender mil desses produtos. let custoDoProduto = 33; let valorDeVe...
true
35a84692d7128947f1b9da09439ecbb51cd64fda
JavaScript
GurmehrBindra/Project28
/paperball.js
UTF-8
424
2.5625
3
[]
no_license
class Paperball{ constructor(x,y,radius){ //var options={ //} this.body=Bodies.circle(x,y,radius); this.radius=radius; this.image=loadImage("paper.png"); World.add(world,this.body); } display(){ var pos=this.body.position; console.log(this.body); ...
true
1f8dc8fa99e07aee12c178658b362216d5777617
JavaScript
tkim90/algorithms_practice
/arraysStrings/findPeak.js
UTF-8
1,210
4.15625
4
[]
no_license
// https://leetcode.com/problems/find-peak-element/submissions/ // O(n) time var findPeakElement = function(nums) { if (nums.length === 0) return -1; if (nums.length === 1) return 0; for (let i = 0; i < nums.length; i++) { if (i === 0 && nums[i] > nums[i + 1]) { return i; } else if (i === nums.l...
true
74ba81323c0a5b5cee73cab15f5c79bb14121937
JavaScript
rjamesak/lcSolutions
/addBinary.js
UTF-8
2,232
4.25
4
[]
no_license
// https://leetcode.com/problems/add-binary/ // Given two binary strings a and b, return their sum as a binary string. /** * @param {string} a * @param {string} b * @return {string} */ var addBinary = function (a, b) { // carry variable let carry = 0 let answer = "" // compare the strings from the...
true
465ec05b698e1600b5b521a6dea69cb99c73b6d7
JavaScript
zhangrenyi666/apih5-2
/zj-web-doc/04_zj-quality/quality/draw/js/js.js
UTF-8
6,467
2.765625
3
[]
no_license
var wxx = { personArr : [],//随机转动的人数 clickState : false,// 点击状态 transformTimer : null,//转动特效定时器 $str:'',//中奖人dom totalNumber:0,//抽奖总人数 lotteryNum:0,//剩余抽奖次数 transform:function(cb){// 点击按钮时的转动特效 wxx.transformTimer = setInterval(function(){ var unitNum=parseInt(Math.ran...
true
3f4ece0273982a73c465f622d3c9b668cd01716b
JavaScript
Anil1111/JavaScript-1
/httpRequests/axios/chaining/apps.js
UTF-8
987
2.859375
3
[]
no_license
axios.get("https://swapi.dev/api/planets/") .then(({ data }) => { console.log(data) for(let planet of data.results){ console.log(planet.name) } // another request axios.get(data.next) .then(({ data }) =>{ console.log('SENDING ANOTHER REQUEST') console.log(da...
true
49a7d3670b3c04d6daa9fe9b5ecd29b2903c6e6e
JavaScript
beepsboops/lotide
/test/tailTest.js
UTF-8
615
3.46875
3
[]
no_license
// test/tailTest.js const assertEqual = require('chai').assert; //changed assertEqual -> assert.deepEqual; not sure if this is what instructions meant const tail = require('../tail'); const assert = require('chai').assert; //TEST CODE FROM tail.js const words = ["Yo Yo", "Lighthouse", "Labs"]; console.log(assertEqual...
true
35f8f2b5e91f272d47897e2d8a0193f1d249a5c8
JavaScript
arynsh/starbucks
/js/scripts.js
UTF-8
1,564
3.515625
4
[]
no_license
function Customer (name,balance){ this.name = name; this.balance = balance; } Customer.prototype.name = function(){ return this.name; } // Customer.prototype.balance = function(){ // return this.balance; // } Customer.prototype.addToBalance = function(amount) { this.balance += amount; } Customer.prototype...
true
3d42184f9cb49927432fe650d953ba541ba6940d
JavaScript
bobbydolan/Adobe-illustrator
/_Dev/public_illustrator_scripts-master/stack_two_text_frames.js
UTF-8
848
3.109375
3
[]
no_license
/* Fuction name: stack_two_text_frames Function description: given two textFrames, align the second textFrame to the left edge of first textFrame, then place the second textFrame some value of points below the first textFrame. this is determined by the SPACING constant. Set this value to whatever you want. Re...
true
2a0833f982fa6629c99283ce4b51be30cf2840bf
JavaScript
DDChiang/script-prac
/ajax-basics-jquery/script.js
UTF-8
3,117
3.140625
3
[]
no_license
$(function () { //simple loading data $("div.1 button#1").click(function () { $("div.1 span.1").load("data.txt"); }); $("div.1 button#2").click(function () { $("div.1 span.2").load("data.txt p"); }); //basic ajax call: $(selector).load(url, data, callback); //where da...
true
02e42c61c59680909e462909976658cd934a4b08
JavaScript
clonalejandro/chat
/src/utils/mysqlmanager.js
UTF-8
1,428
2.71875
3
[ "MIT" ]
permissive
/** IMPORTS **/ const mysql = require("mysql"); module.exports = class MysqlManager { /** CONSTRUCTORS **/ constructor(App, config){ this.App = App; this.prefix = "MYSQL"; this.config = config; this.startConnection() } /** * This function cr...
true
08aac9b894c4bda090fee64ccd2aa210448e1d21
JavaScript
zhengguoguan/Fxpt
/WebRoot/theme/js/jsp/base/.svn/text-base/default_tr.js.svn-base
UTF-8
981
2.625
3
[]
no_license
$(function(){ // 为tr绑定onmouseover与onmouseout事件 $("tr").hover( function(){ // onmouseover $(this).css({"background-color" : "#FFFFBF", "cursor" : "pointer"}); }, function(){ // onmouseout $(this).css("background-color","#FFFFFF"); } ); }); //合并时间列相同的 function tdCombine(id){ var tds =...
true
058d16ae18b5af6882d0a5604abd80eafe02b6d2
JavaScript
lampofaladdin/Algorithm
/question_easy/array/杨辉三角.js
UTF-8
1,001
3.75
4
[]
no_license
// 给定一个非负整数 numRows,生成杨辉三角的前 numRows 行。 // 在杨辉三角中,每个数是它左上方和右上方的数的和。 // 示例: // 输入: 5 // 输出: // [ // [1], // [1, 1], // [1, 2, 1], // [1, 3, 3, 1], // [1, 4, 6, 4, 1] // ] // 来源:力扣(LeetCode) // 链接:https://leetcode-cn.com/problems/pascals-triangle // 著作权归领扣网络所有。商业转载请联系官方授权,非商业...
true
5bf37bc171828ee25053dbb3ca2474fc67a9aff0
JavaScript
YasinSayyed-2508/Holographic-Audio-Visualizer
/spectrum-visualizer.js
UTF-8
4,794
2.859375
3
[]
no_license
// spectrum-visualizer.js function AudioVisualizer(element) { //constants this.numberOfBars = 40; //Rendering this.scene; this.camera; this.renderer; this.animationId = 0; this.element = element; this.activeColorIdx = 0; this.colorSelections = [ 0x82b1ff, 0xff2b60, ...
true
810e157db3fd868cb8ff3ea6ca23376291a1854f
JavaScript
sydnycutler/sydnycutler.github.io
/lesson11/js/summary-fh.js
UTF-8
569
3.015625
3
[]
no_license
const apiURL = "https://api.openweathermap.org/data/2.5/weather?lat=42.0380399&lon=-111.4048681&units=imperial&appid=6f653c2cd15523df9a5166654b1b0b55"; fetch(apiURL) .then((response) => response.json()) .then((jsObject) => { console.log(jsObject); document.getElementById('curtemp').textContent = jsObject....
true
cd9c88bde5b3dfde6b544722666257b9142ee9aa
JavaScript
287/code.js
/toNumberValue.js
UTF-8
473
3.015625
3
[]
no_license
/** * @include isString, isNumberLike, isPureNumber * @param {any} value * @param {number} pValue * @return {number} */ function toNumberValue(value, pValue){ if(isString(value)){ if(value === ''){ value = 0; }else if(value === 'center'){ value = pValue * .5; }else if(isNumberLike(value)){ value *=...
true
706b25cf3ffa43213a69f8e40c5627a4d0cf4bac
JavaScript
nebvlar/todolist
/src/tasks.js
UTF-8
1,032
2.9375
3
[]
no_license
import createTask from './tasks' export default myTask = ['Boob']; export default class Task { constructor(task, desc, date, priority, project) { this.taskName = taskName; this.desc = desc; this.date = date; this.priority = priority; this.project = project; } } function addTask() { newTask =...
true
38d11fa78d52a76b47930184436372af7972138c
JavaScript
manuelmhtr/countries-and-timezones
/test/unit/get-all-countries.js
UTF-8
1,465
2.65625
3
[ "MIT" ]
permissive
import * as ct from '../../src'; import data from '../../src/data.json'; import { getDeprecatedTimezones } from '../utils'; const DEPRECATED_TIMEZONES = getDeprecatedTimezones(data.timezones); describe('.getAllCountries', () => { it('returns an object containing full countries data', () => { const expectedLengt...
true
393abf7ce0a0a3c059550a6e165d1ce3ed96cf4e
JavaScript
JohnKeating1997/BlogServer-built-on-Nodejs
/blog-1/scr/controller/blog.js
UTF-8
3,658
3.046875
3
[]
no_license
const { exec } = require('../db/mysql') const getList = (author, keyword) => { // //先返回假数据,格式正确 // return [ // { // id: 1, // title: "标题1", // content: "内容1", // createTime: 1601796418837, // author: 'John' // }, // ...
true
1e1dfc874b60a5a97ef7e5562a45b9fb826b2405
JavaScript
mk29142/e-polling
/src/main/resources/front-end/public/src/graph.js
UTF-8
3,674
2.65625
3
[ "MIT" ]
permissive
(function() { let pollId = window.location.href.substring( window.location.href.lastIndexOf('/') + 1); $.get('/graph/' + pollId, function(stringData) { let data = JSON.parse(stringData); let text = []; let sigmaScores = []; let tauScores = []; for (let i = 0; i < data.length; i++) { t...
true
9e646e0c85d2903448266cfea218345234df1e5b
JavaScript
crolson/Kanakatana2014
/Assets/Resources/Scripts/Stone.js
UTF-8
1,828
2.671875
3
[]
no_license
/* * This class handles the magic stones that give you new powers. */ #pragma strict //what power to give, as a kana. set in editor var power : String; //a refrence to the ability handler. set in editor. var abilities: HUDAbilities; //a refrence to the text Trigger to play (gameobject) var triggerObj : GameObjec...
true
5c8902e05095a34f3c6689acec8d705b5d699617
JavaScript
juhnowski/src_m
/1/WebcamSwiper-master/db.js
UTF-8
10,293
2.515625
3
[]
no_license
var phreebie={}; phreebie.init = function() { /** * customerDb - URL по которому запрашиваются файлы базы данных в формате json */ phreebie.customerDb = "http://interactivefishing.tv"; /** * custom...
true
467eee06a4a10763b0b2003ecda92d56a734c34a
JavaScript
saurabhmathur96/game-dev-with-js
/AtariBreakout/brickWall.js
UTF-8
497
3.75
4
[]
no_license
//Brick Wall var canvas = document.getElementById('canvas'); var cxt = canvas.getContext('2d'); var bricks = [] function drawBrick(x,y){ bricks.push({'x':x,'y':y}); cxt.beginPath(); cxt.rect(x, y, 30,20); cxt.fill(); } function brickWall(){ var m = 3, n=parseInt(canvas.width/40); console.log(n);...
true
56c7427052089aa75e1ecd990d47dab7d50e8971
JavaScript
IgnOry/HoracioStudios
/ServerMatchmaking/pruebaServerMatchmaking.js
UTF-8
992
2.890625
3
[]
no_license
//import express from 'express'; var express = require('express'); const server = express(); server.use(express.json()) const port = 25565; var cont = 0; // Rest C# // /start empieza a buscar emparejamiento // log in // crear cuenta // server.get('/start', (req, res) => { cont+=1; return res.send(cont.toString...
true
945627fd6089053bdf63d40d7333fc8b917d15ca
JavaScript
charan2628/Learning-React-Example-Code
/reactCompiledJSX.js
UTF-8
3,289
2.625
3
[]
no_license
"use strict"; var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; var data = [{ name: "Baked Salmon", in...
true
feed9678f9c97ce3333e247d12b41edc08b4cc72
JavaScript
NyanoNyan/CV-Project
/src/App1.js
UTF-8
7,684
2.75
3
[]
no_license
import React from "react"; import PersonalInfo from "../src/componenets/PersonalInfo" import Education1 from "../src/componenets/Education1" import Experience from "../src/componenets/Experience" import uniqid from "uniqid"; import "../src/styles/App.css" import {Helmet} from "react-helmet"; class App extends React.C...
true
32be36283e87243a78eabf43dbcc59952406ac95
JavaScript
CheekyBunny/HOPE
/phrases.js
UTF-8
4,141
2.546875
3
[]
no_license
const helloMessage = `Привет! Вы можете сыграть со мной в викторину по моделированию, либо угадать пропущенные слова в определениях. Нужно правильно отвечать и набирать очки. Для завершения игр+ы скажите "конец игр+ы". Введ+ите пож+алуйста свое имя.`; const selectGroupMessage = `Введ+ите пож+алуйста свою гр+уппу.`; c...
true
dd9ecfbb1058bbc1446c92314e2d5a26c65cd44a
JavaScript
JahangeerAnsari/task-app-mern
/client/src/redux/actions/auth.actions.js
UTF-8
1,181
2.5625
3
[]
no_license
import AxiosInstance from "../Axios"; import { authActionTypes } from "./action-types"; export const registerUserAction = (user) => { return async (dispatch) => { //each dispatch() handled by the corresponding reducers dispatch({ type: authActionTypes.REGISTER_REQUEST, }); const res = await Axio...
true
ae397ed4437328a0c1debdbf1b4b3d6dce5954e2
JavaScript
christian7gonzalez/Desarrollos
/En curso/01 Desarrollo Web Javascript desde 0 2020/Seccion 3/04 Sintaxis/JS/Script.js
UTF-8
157
2.703125
3
[]
no_license
let numero = -4; let palabra = 'hola mundo'; let respuesta = false; const PI = 3.14; numero = 54; palabra = 'Adios'; console.log(numero);
true
c31fbf8fd83978d0a5584349106f3340b1ae9c77
JavaScript
yuhuihui2011/microExon
/public/js/main.js
UTF-8
795
2.546875
3
[]
no_license
$(document).ready(function(){ $('#limitSelector').on('change', function(){ var limit = $(this).val(); var phase; if ($('#phaseCheck').is(":checked")) { phase = "phaseOn"; }else{ phase = "phaseOff"; } var src = $("#msaImage").attr('src').substring(...
true
3aa3b3ef1636b2cf8da1aed5e411641e2e2dfadb
JavaScript
nikmck22/100daysofcode
/day11.js
UTF-8
4,029
4.5
4
[]
no_license
// Create an if statement inside the function to return "Yes, that was true" if the parameter wasThatTrue is true and return "No, that was false" otherwise. function trueOrFalse(wasThatTrue) { if (wasThatTrue) { return "Yes, that was true"; } return "No, that was false"; } // Add the equality operator to th...
true
b7462fc1fdae956f72f4a913bd6367a5033eae7b
JavaScript
kimyounsoo/java_ee
/guestBookServlet/WebContent/js/guestbook.js
UTF-8
450
2.578125
3
[]
no_license
function checkWrite(){ document.getElementById("subjectDiv").innerText =""; document.getElementById("contentDiv").innerText =""; if(document.getElementById("subject").value=="") document.getElementById("subjectDiv").innerText="제목을 입력하세요"; else if(document.getElementById("content").value=="") document.getEle...
true
72ead5787bf25774f3c124427cf968fcb320f5eb
JavaScript
acmASCIS-Tecnical-Committee/Event-Committee-System
/routes/api/store.js
UTF-8
7,864
2.703125
3
[]
no_license
// to use Router const express = require("express"); // to use get/post requests from it const router = express.Router(); // to authenticate the private routes const passport = require("passport"); // load store schema const Store = require("../../models/store"); // validation functions const validateStore = require(...
true
844e8a7c5e77e137e0f4a0621a36e97e81e659bb
JavaScript
statebox/purescript-studio
/halogen-kdmoncat/src/View/KDMonCat/EditDomHelpers.js
UTF-8
383
2.78125
3
[]
no_license
"use strict"; exports.copyToClipboard = function (text) { var textArea = document.createElement("textarea"); textArea.value = text; document.body.appendChild(textArea); textArea.focus(); textArea.select(); document.execCommand('copy'); document.body.removeChild(textArea); } exports.insertText = function...
true
a038ca0cb4175497da1ba987f002164d0544fac4
JavaScript
danielsaad/TC2-IFB-CC
/Fundamentos de Node JS/testCurrency2.js
UTF-8
309
2.53125
3
[]
no_license
var Currency = require('./currency2'); var convert = new Currency(0.91); console.log('50 dólares canadenses equivalem a esta quantidade de dólares americanos: ',convert.canadianToUs(50)); console.log('30 dólares americanos equivalem a esta quantidade de dólares canadenses: ',convert.UsToCanadian(30));
true
d27ed59f58fefb5cfd350f7f9451ad5496192213
JavaScript
IvanCherepica/biusness-festival
/src/main/webapp/userNotification.js
UTF-8
3,084
2.9375
3
[]
no_license
var userName; var userID; var isInFestival; var festival; var user; // get request for user name and id $.ajax({ url: "/rest/userdata", method: "get", async: true, error: function(message) { console.log(message); }, success: function(data) { userName = data.name; userID...
true
c0a6897ff84acee88a2aa2d2ebefe9c330250659
JavaScript
MaksymPryhorko/goit-js-hw-11-color-switch
/index.js
UTF-8
959
3
3
[]
no_license
const colors = [ '#FFFFFF', '#2196F3', '#4CAF50', '#FF9800', '#009688', '#795548', ]; let timerId = null; const bodyRef = document.querySelector('body'); const startBtnRef = document.querySelector('button[data-action="start"]'); const stopBtnRef = document.querySelector('button[data-action="stop"]'); con...
true
759fcefd10def33f0bfc3d879f21f32618bebaa0
JavaScript
padma67/CRUD
/day2task/index.js
UTF-8
1,877
2.890625
3
[]
no_license
const http = require("http"); const express = require("express"); const app = express(); const bodyparser = require("body-parser"); const port = 4000; app.use(bodyparser.json()); let studentDetails = []; let staffDetails = []; app.post("/studentCreation", (req, res) => { studentDetails.push(req.body); res.json({ m...
true
b2483ba2e66d28475f4adc174f368553cc9ba55b
JavaScript
9manta87/ddaycounter
/weather_toronto.js
UTF-8
2,000
3.296875
3
[]
no_license
const COORDS = 'coords'; const API_KEY = 'e17eea4bafe784200662194cb7514749'; const toronto = document.querySelector('.toronto_temp'); function getIcon(json){ const info = json.weather[0].main const icon = document.querySelector('.tor_icon'); console.log(info); if (info === 'Clouds'){ i...
true
e691d47768a3f878306842d3c689fee1b8b71ac8
JavaScript
gitiklar/front-end-course
/my-front-end/7 ממשקי פיתוח של הדפדפן עדכון/56 localStorage/demo1.js
UTF-8
532
3.28125
3
[]
no_license
const btn =document.querySelector('.btn1'); const btn2 = document.querySelector('.btn2'); const results = document.querySelector('#value'); val=Number (localStorage.getItem('count')); results.textContent = val; function inc() { results.textContent = ++val; localStorage.setItem('count',val); } function reset(...
true
be0e0fa3df2de74b205781b5c408fcc200854799
JavaScript
alessioraggioli/tsac-asdjs
/homework_03.js
UTF-8
752
3.765625
4
[]
no_license
function Stack() { this.array = []; } Stack.prototype.push = function (insert) { this.array.push(insert); } Stack.prototype.pop = function () { return this.array.pop(); } Stack.prototype.peek = function () { return this.array[this.array.length - ...
true
bfd923efb5f9ade51168b58c7c88963fb1678e1f
JavaScript
taikonauten/postcss-function-rem
/index.js
UTF-8
191
2.546875
3
[]
no_license
module.exports = function (pxParams = '', baseFontSize = 16) { const values = pxParams.split(' '); return values.map(px => { return `${px / baseFontSize}rem`; }).join(' '); };
true
f52c9e6050de96c62b7f96a11d118b901d81f1a4
JavaScript
aaronbryan12/fsw-120
/week4/project-2/project-2/src/components/FormBadge.js
UTF-8
3,962
2.671875
3
[]
no_license
import React from "react" import BadgeList from "./BadgeList" class FormBadge extends React.Component { constructor(){ super() this.state={ firstName: "", lastName: "", email: "", placeOfBirth: "", phone: "", favoriteFood: "", ...
true
0d7bab2ed341733485e1909b19196389f52d74f7
JavaScript
Prosen-Ghosh/Learn-JavaScript-and-Node.js
/nodejs/object_2/app.js
UTF-8
305
3.875
4
[]
no_license
//object properties var obj = { firstname : 'Prosen', lastname : 'Ghosh' }; // this variable is holding the key name of the object "obj" var name_of_the_property = 'lastname'; // here we can dynamically called the property console.log(obj['firstname']); console.log(obj[name_of_the_property]);
true
dc378b11292ef4bf284fcdd12c7ccba1e6c8e3e0
JavaScript
1198734032/xin-guan4
/text3/third.js
UTF-8
240
3.09375
3
[]
no_license
let get=document.getElementsByTagName("li"); let listArr = ['list1','list2','list3','list4','list5']; for(let i=0;i<get.length;i++){ get[i].addEventListener("click",function(){ get[i].innerHTML=(listArr)[i]; },false) }
true
f889ea603d82f9220e7f814d847bfc22499ab5b8
JavaScript
muthuvijay/traceof
/src/map.js
UTF-8
3,426
2.515625
3
[ "Apache-2.0" ]
permissive
/** * Map tracker */ import React, { Component } from 'react'; import { StyleSheet, Text, Dimensions, View } from 'react-native'; import MapView from 'react-native-maps'; import flagImg from '../assets/flag-blue.png'; // import Geolocation, { getState } from './Geolocation'; const { width, height } = Dimen...
true
ca8133511af699a1a3e8ecc4e2b872637607dc57
JavaScript
Lemeshevskaya/my_progect
/js/media-duck__remove.js
UTF-8
847
2.953125
3
[]
no_license
var table = document.querySelector('.media-duck__content'); var foto = document.querySelector('.media-duck__carousel-foto'); var video = document.querySelector('.media-duck__carousel-video'); var selected; table.onclick = function(event) { var target = event.target; while (target != this) { if (target...
true
da5a45d41f93549be667d29141633ee3cb108c47
JavaScript
CuAnnan/Downlink
/src/Computers/Tasks/ICEBreaker.js
UTF-8
4,307
3.125
3
[]
no_license
const Task = require('./Task'), helper = require('../../Helpers'); class IcePoint { constructor(heightRange) { this.heightRange = heightRange; this.height = helper.getRandomIntegerBetween(-this.heightRange, this.heightRange); } } class IceBreakerPoint { /** * @param {Ic...
true
c0264374b4c4aca4dfe03e223969be8225ccee06
JavaScript
yantsishko/leetcode
/all-elements-in-two-binary-search-trees/all-elements-in-two-binary-search-trees.js
UTF-8
627
3.40625
3
[]
no_license
/** * Definition for a binary tree node. * function TreeNode(val, left, right) { * this.val = (val===undefined ? 0 : val) * this.left = (left===undefined ? null : left) * this.right = (right===undefined ? null : right) * } */ /** * @param {TreeNode} root1 * @param {TreeNode} root2 * @return {numbe...
true
57415fbaf8868e88c098b8a648bc95df91459690
JavaScript
ngocchinh3618/Instagram-reactjs
/src/reducers/users.js
UTF-8
1,187
2.53125
3
[]
no_license
import * as actionTypes from "../store/actiontypes"; import DataUser from "../data/users.json"; const initialState = localStorage.getItem("user") != null ? {username: localStorage.getItem("user")} : {}; const reducer = (state = initialState, action) => { switch (action.type) { case actionTypes.LOGIN: const...
true
d16de5813a4a806b8748e842a666266f87389dcb
JavaScript
hellozepp/learn-go
/src/truffle/VotingDapp/src/App.js
UTF-8
4,779
2.6875
3
[]
no_license
import React, { Component } from 'react' import VotingContract from '../build/contracts/Voting.json' import getWeb3 from './utils/getWeb3' import './css/oswald.css' import './css/open-sans.css' import './css/pure-min.css' import './App.css' const contractAddress = "0x160555aaa125581fd6765ac57184db6a921dd12e"; var vo...
true
7c4563e8fbf070392c1e0021173a28983f9246b0
JavaScript
terrancecorley/secret-message
/main.js
UTF-8
417
2.953125
3
[]
no_license
const button = document.querySelector('button'); const msg = document.querySelectorAll('.msg'); // Adding styles to quote on btn click button.addEventListener('click', () => { button.textContent = ':)'; for ( let i = 0; i < msg.length; i +=1 ) { msg[i].style.color = 'turquoise'; msg[i].style.textTransform ...
true
5329ed717355bfab39dd0bd99a9cf9aa27760b82
JavaScript
cauldyclark15/all-about-js-1
/gallery.js
UTF-8
347
3
3
[]
no_license
(function () { if (typeof window !== "undefined") { var btn1 = document.createElement("button"); btn1.id = "btn1"; btn1.innerText = "Fire"; btn1.addEventListener("click", function () { console.log("IS THIS GONNA WORK?"); }); var body = document.body; if (body) { body.appendCh...
true
9a67baf680f63478fa70d06ea71467f03a2b4616
JavaScript
DanielLazarov/TelebidStuff
/Tests/krugche/krugche.js
UTF-8
639
3.25
3
[]
no_license
function draw(){ var i=0; var r = parseInt(document.getElementById("r").value); var x = parseInt(document.getElementById("x").value); var y = parseInt(document.getElementById("y").value); var c = document.getElementById("canvas"); var ctx=c.getContext("2d"); console.log(x+(Math.cos(i)/r)); console.log(y+(Math.s...
true
7195369e330fa8009937d5bd199451011ee7a1b8
JavaScript
mark0322/xCharts
/util/array/flatten.js
UTF-8
258
3.140625
3
[]
no_license
/** * 扁平化一层子数组 * @param {Array} arr 二维数组 * @return {Array} 一维数组 * eg flatten([1, 2, 3, [4, 5, 6]]) -> [1, 2, 3, 4, 5, 6] */ function flatten(arr) { return arr.reduce((a, b) => a.concat(b), []) } export default flatten
true
24e593c4fc3759cbd0e470e4cdce0f379d01c99e
JavaScript
Visco01/esse3API
/index.js
UTF-8
930
2.84375
3
[ "BSD-3-Clause" ]
permissive
const Esse3API = require('./api/Esse3API.js'); /** * Creates a new Esse3API object * @param position (int) The endpoint's position in JSON data. See README.md for details. By default is set to * 30: it referres to Ca'Foscari University in Venice. * @param username (string) Username * @param passwo...
true
8fe60bbbd975969cdf2d1e0d9c9e69ea0a6b9939
JavaScript
SchneiderBert/MERN
/Algo_Generator/client/src/components/AlgorithmGenerator.jsx
UTF-8
1,208
2.578125
3
[]
no_license
import React from 'react'; const AlgorithmGenerator = props => { const algos = props.algos return ( <ul className="generatorArea"> { algos.map((algo, index) => ( (parseInt(index) % 2 === 0) ? <li className="algoSelection bg-warning" key={index} id={...
true
658cbc247d61c540a898fc5f493d80ddd11d54e8
JavaScript
jeffsu/js2
/src/core/js2-parser.js
UTF-8
12,482
2.921875
3
[ "MIT" ]
permissive
(function (undefined, JS2) { JS2.Parser = { parse: function(str) { var lexer = new JS2.Lexer(str); var tokens = lexer.tokenize(true); var root = new Content(tokens); return root; }, parseFile: function(file) { return this.parse(js2.fs.read(file, 'utf8')); } }; ...
true
8a665a22abe85f8ca496f7d76826daee92549b72
JavaScript
titarenko/test8
/index.js
UTF-8
2,636
2.640625
3
[ "MIT" ]
permissive
var _ = require('lodash'); var Q = require('q'); var request = require('request'); function Test(options) { this.options = _.defaults(options || {}, { url: '' }); this.result = Q(); this.data = { req: {}, res: {} }; this.jar = request.jar(); } Test.prototype.resolve = function(instance) { var self = t...
true
7d1ed49977cb713b28bbfd770c1bb3faedb818cc
JavaScript
napastyuk/currency-converter
/js/index.js
UTF-8
8,296
2.921875
3
[]
no_license
(function init(){ const CBRF_COURSEAPI_URL = "https://www.cbr-xml-daily.ru/daily_json.js"; let newRates = {}; //Объект со всем курсами const rootId = "currencyCalc"; let currencyCount = "1"; let defaultCurrencyCode = "RUB"; let defaultСalculatedCurrency = "USD"; checkStorage(); function checkStorage() { ...
true
657f23db31daed0753a222e3e07cef7c76c97811
JavaScript
yarallira/API-Rest-em-Node
/serie-node/src/app/controllers/ProductController.js
UTF-8
1,754
2.703125
3
[]
no_license
const express = require('express'); const Product = require('../models/product') const router = express.Router(); router.get('/', async (req, res) => { const id = req.params.id; try{ const product = await Product.find(); console.log(product); return res.send(product); } catch (err...
true
1b8e71520c0ba4e50d3f06d66c3619d06a7b1a51
JavaScript
jerseyschorr/jerseyschorr.github.io
/lib/navigation.es6
UTF-8
1,317
3.0625
3
[]
no_license
// function scrollit(start, end, time) { // console.log(start, end, time); // const startTime = new Date().getTime(); // const timer = setInterval(() => { // const step = Math.min(1, (new Date().getTime() - startTime) / time); // const adjustment = start + step * (end - start); // ...
true
f7e64acdf4f21bcb465e8270314f1c684768ad59
JavaScript
lightandluck/react-lumines
/server/src/utils.js
UTF-8
4,928
2.859375
3
[ "MIT" ]
permissive
import { dimensions } from './constants'; export const range = n => { const arr = []; for (let i = 0; i < n; i++) { arr.push(i); } return arr; } export const generateRandomPiece = () => { const n = Math.floor(Math.random() * 16); return [!!(n & 8), !!(n & 4), !!(n & 2), !!(n & 1)]; }; export const xT...
true
2c49c38c3b42f0d1fc54b1fd319380df172f2a77
JavaScript
the-mausoleum/pomodoro
/pomodoro.js
UTF-8
4,746
2.859375
3
[ "MIT" ]
permissive
$(document).ready(function() { var id; var pondoriCount = 0; $('#start').click(function() { console.log('start'); //$('#controls').html('<button type="button" class="btn btn-lg btn-danger" id="stop"><span class="button-text" id="stop-text">结束</span></button>'); $('#start').css('display', 'none'); $...
true
ac76cb7f2da931931c6f773869e6d59508071f59
JavaScript
LiuL0703/algorithm
/LeetCode/JavaScript/#448 Find All Numbers Disappeared in an Array.js
UTF-8
281
3.359375
3
[]
no_license
/** * @param {number[]} nums * @return {number[]} */ var findDisappearedNumbers = function(nums) { var res = []; var stop = nums.length; var i; for(i=1;i<=stop;i++){ if(nums.indexOf(i)===-1){ res.push(i); } } return res; };
true
45ebc8929dd1cc6ed522939aba99174c7e8195bf
JavaScript
wangtao0101/leetcode-problem-types
/template/143.js
UTF-8
441
3.28125
3
[ "MIT" ]
permissive
/* * @lc app=leetcode.cn id=143 lang=javascript * * [143] 重排链表 */ // @lc code=start /** * Definition for singly-linked list. * function ListNode(val) { * this.val = val; * this.next = null; * } */ /** * @param {ListNode} head * @return {void} Do not return anything, modify head in-p...
true
95c6d2fa2783937776908b63d7dc7e6d64e1c846
JavaScript
omerfrough786/Data
/React/changebackgorund/src/Body/body.js
UTF-8
1,782
2.90625
3
[]
no_license
import React, { Component } from "react"; import "./body.css"; export class body extends Component { state = { red: "0", green: "0", blue: "0", str: "rgba()" }; ChangeRed(e) { this.setState({ red: e.target.value, str: "rgba(" + this.state.red + "," + ...
true
be3d098e3c59aa0e11406097437df7f065c325b0
JavaScript
nebez/floppybird
/js/main.js
UTF-8
12,184
2.734375
3
[ "Apache-2.0" ]
permissive
var debugmode = false; var states = Object.freeze({ SplashScreen: 0, GameScreen: 1, ScoreScreen: 2 }); var currentstate; var gravity = 0.25; var velocity = 0; var position = 180; var rotation = 0; var jump = -4.6; var flyArea = $("#flyarea").height(); var score = 0; var highscore = 0; var pipeheight = 90;...
true
0fd497deb1100069b57410c720c5660d46567b6f
JavaScript
wainola/duoc_examen_client
/src/reducers/authReducer.js
UTF-8
1,782
2.515625
3
[]
no_license
import { SUCCESS_LOCAL_LOGIN, FAIL_LOCAL_LOGIN, LOGOUT, REFRESH_AUTH, CHANGE_LOGIN_STATUS, SUCCESS_GOOGLE_LOGIN } from '../actions/types' const initialState = { isAuthenticated: false } export default function(state = initialState, action){ switch(action.type){ case SUCCESS_LOCAL_LOGIN: loca...
true
2f6ea861674c99d039b49b222fa82464b67106f2
JavaScript
rodriguezj7/taskGamble
/src/components/IndecisionApp.js
UTF-8
2,452
2.75
3
[]
no_license
import React from 'react'; import AddOption from './AddOption'; import Options from './Options'; import Action from './Action'; import Header from './Header'; import OptionModal from './OptionModal'; class IndecisionApp extends React.Component { state = { options: [], selectedOption: undefined }; //Remov...
true
f19fb5de435803770c6f44fa492f009bdeb3ba71
JavaScript
mrakib007/Basic-js
/date.js
UTF-8
311
3.375
3
[]
no_license
var date = new Date(); console.log(date); var year = date.getUTCFullYear(); console.log(year); var month = date.getMonth(); console.log(month); var currentDate = date.getDate(); console.log(currentDate); var currentDay = date.getDay(); console.log(currentDay); var hour = date.getHours(); console.log(hour);
true
9f8b51f8269c8e6f0510eee67e3c36714deb6f91
JavaScript
Awexxus/awexxus.github.io
/crud-ui-master/src/AddItem.js
UTF-8
1,923
2.65625
3
[]
no_license
import React, { Component } from 'react'; class AddItem extends Component { AddOneItem(author, isbn, caption) { fetch('http://server.noorsoft.ru:9022/api/records', { method: 'PUT', headers: { 'Accept': 'application/json', 'Content-...
true
8c4d64741724b5aa564c0dcb50865d3556f74448
JavaScript
amida-tech/api-boilerplate
/server/controllers/auth.controller.js
UTF-8
1,350
2.578125
3
[ "Apache-2.0" ]
permissive
import jwt from 'jsonwebtoken'; import httpStatus from 'http-status'; import APIError from '../helpers/APIError'; import config from '../../config/config'; // sample user, used for authentication const user = { username: 'react', // deepcode ignore NoHardcodedPasswords: for demostration purposes password: 'expre...
true
91847603fd3d8f4679b71603414eaee46fbc916b
JavaScript
HaoruiPeng/InfoCom
/webserver/static/js/login.js
UTF-8
586
2.765625
3
[]
no_license
function login() { var username = document.getElementById('login-serialnumber').value; var password = document.getElementById('login-password').value; var data = { "login-serialnumber": username, "login-password": password, } var xhttp = new XMLHttpRequest(); xhttp.onreadystatechan...
true
1801a66f37965bd6876c983064b592405fb1798e
JavaScript
ErikKimsey/Node-Blog
/config/middleware.js
UTF-8
410
2.59375
3
[]
no_license
const nameCheckNLimit = (req, res, next) => { let { name } = req.body; if (name) { if (name.length < 128 && name.length > 0) { next(); } this.errorHandler(404, 'No name, no game...whatever that means.;') } }; const errorHandler = (res, code, msg) => { res.status(co...
true
441cf436e34a719fb629dae1e856b68789b2a770
JavaScript
jahmezz/full-stack-interview
/PatientScorer.js
UTF-8
3,598
2.703125
3
[ "MIT" ]
permissive
import getDistance from 'geolib/es/getDistance'; //TODO: Make these values easily adjustable via configuration file. const AGE_CUTOFF = 45; //new patient is below this number of attempts const NEW_PATIENT_OFFER_CUTOFF = 20; const NEW_PATIENT_ACCEPT_RATE = 0.2; //offers affect the score up to this number const MAX_ACCE...
true
7ae645237a5e0a3d58204a362fe6967be4a5243a
JavaScript
jcsullivan/MSDProjects
/MBPINetwork/MBPIDriver.js
UTF-8
9,314
3.203125
3
[]
no_license
let xhr = new XMLHttpRequest(); xhr.addEventListener('load', loadData); xhr.open('GET', "FillerData.json"); xhr.send(); let team = {}; function loadData(){ let peopleSet = new Set(); for(let line of this.responseText.split("\n")){ if(line){ let parse = JSON.parse(line); le...
true
518c773dd9e277d05fb59ae7d211c2bf01cfba6b
JavaScript
kapilrathore/Landing-Page-Jinnz-Events-
/js/init.js
UTF-8
23,376
2.703125
3
[ "MIT" ]
permissive
(function($) { var jWindow = $(window); var elements = []; var elementsInView = []; var isSpying = false; var ticks = 0; var unique_id = 1; var offset = { top : 0, right : 0, bottom : 0, left : 0, } /** * Find elements that are within the boundary * @param {number} top * @param {number} right ...
true
457a028b9a194f9d1d50f0991077ad64ff7943e8
JavaScript
jlliu/tissulabs
/script.js
UTF-8
1,185
2.578125
3
[ "MIT" ]
permissive
$(document).ready(function(){ $("w-div input").attr("style", "height:52px !important"); $("#learn-more").click(function() { $([document.documentElement, document.body]).animate({ scrollTop: "740px" }, 800); }); var currentScrollPosition=0; window.addEventListener("scroll", function (event) { ...
true
3d20010dfdf3bd70c2b8a10adcbe606530688992
JavaScript
skalnik/print-queue
/lib/queueItem.js
UTF-8
5,765
2.71875
3
[]
no_license
var validator = require('validator'), request = require('request'), redis = require('./redis'), watch = require('watchjs').watch; // All possible statuses for a QueueItem to have. First is default var VALID_STATUSES = ['submitted', 'queued', 'rejected', 'printed']; // Redis key for our sorted set & counter var K...
true
d1867348638dc44e0bacf38322967e800c30b5af
JavaScript
pa-monteiro/app-node-with-tests
/src/app/controllers/VehicleController.js
UTF-8
2,408
2.5625
3
[]
no_license
import * as Yup from 'yup'; import Vehicle from '../models/Vehicle'; import Models from '../models/Models'; import Brand from '../models/Brand'; class VehicleController { async store(req, res) { const schema = Yup.object().shape({ brand_id: Yup.number().required(), model_id: Yup.number().required(), ...
true